So I have a dataset with initially 9 variables (2 categorical, 4 dummy, 3 continious). Since I will be conducting multiple linear regression, I need the categorical variables to be dummy as well. So I created a new dataset in which I turned the categorical variables into dummy. So now both of my categorical variables have 3 dummy variables. As you probably know, only one of these dummy variables can be 1, and the other two needs to be 0.
I need to impute these dummy variables, but how can I ensure that mice will only code one of these dummy variables as 1 for each observation?
This is the function I used:
imp.data = mice (data = forMICE, m = 11, method = c(“”,”logreg”,”logreg”,”logreg”,”logreg”,”logreg”,”logreg”,””,”logreg”,”logreg”,””,””,””), maxit = 20)
So I tried to code all the new created dummies as logreg.
Then I need to perform multiple linear regression using the imputed variables.
I’d really appreciate your help, I am very lost.
melody is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.