Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ds.asFactor when generating dummy variables, avoid generic DV prefix #380

Open
tombisho opened this issue May 19, 2021 · 0 comments
Open

Comments

@tombisho
Copy link
Contributor

If you want to create dummy variables for multiple factor variables which both have levels 1,2,3 then both of these have the dummy variables DV2 and DV3. This makes it harder to recombine these back into a data frame as there is duplication of column names. It is not trivial to change column names

I recommend using the variable name as the default prefix and allowing the user to specify their own if they want.

For example for EDU_LEVEL and INCOME_LEVEL the dummy variables would be EDU_LEVEL_2, EDU_LEVEL_3 and INCOME_LEVEL_2 and INCOME_LEVEL_3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant