I was trying to fit a hybrid model using Richard Williams's method. Hybrid model can not include factor variables; as suggested, I created the dummy variables before applying imputation using:
then, I registered my imputed variables and began the imputation. I added the "augment" option for logit regression to deal with perfect prediction like this:
where varlist1 are dummy variables with missing values, varlist2 are continuous variables with missing values, varlist3 are non-missing variables
I thought the "augment" option will suppress the perfect prediction error message, but I still got error messages saying that I have perfect prediction issues.
Generate dummy variables before imputation will make the impute model complicated and will easily cause perfect prediction issues. Although it is recommended to prepare your variables properly before imputation, sometimes it may be easier to do it after imputation. I was wondering how could I do so properly if I want to dichotomize my 0-1 variables after imputation. Thanks.
Code:
tab oldvar, gen(newvar)
Code:
mi impute chained (logit,augment) varlist1 /// (pmm,knn(5)) varlist2 = varlist3, /// add(2) rseed(19941122) dots noisily force
I thought the "augment" option will suppress the perfect prediction error message, but I still got error messages saying that I have perfect prediction issues.
Generate dummy variables before imputation will make the impute model complicated and will easily cause perfect prediction issues. Although it is recommended to prepare your variables properly before imputation, sometimes it may be easier to do it after imputation. I was wondering how could I do so properly if I want to dichotomize my 0-1 variables after imputation. Thanks.
Comment