Hello
I would be very grateful if someone would be able to advise me on this. My dependent variable is 'COST' which is a binary variable. I have various independent variables as listed below. I am using logistic regression to predict COST.
1) I want to calculate both Tjurs D and the AUROC on my logistic regression models, but cannot do this after I have performed multiple imputation. I can do both of these tasks for the complete case analyses, using the below code:
Tjur's COD*
logistic COST honos age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
predict yhat_scales_SES if e(sample)
ttest yhat_scales_SES, by (COST)
*AUROC*
logistic COST honos age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
predict AUROC_honos if e(sample)
roctab COST AUROC_scales_SES, summary
2) I cannot get this code to work for the imputed datasets despite using mi estimate and cmdok. I have tried various combinations and have gotten different errors:
*example of commands I've run
mi estimate: logistic COST honos_imputed age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
mi estimate, cmdok: predict yhat_scales_SES if e(sample)
mi estimate: ttest yhat_scales_SES, by (COST)
*errors received:
mi estimate: command not supported
predict is not officially supported by mi estimate; see mi estimation for a list of Stata estimation commands
that are supported by mi estimate. You can use option cmdok to allow estimation anyway.
requested action not valid after most recent estimation command
an error occurred when mi estimate executed predict on m=1
Would any out there know the STATA commands that I could run to get these two things to work on an imputed dataset? Many thanks in advance if you can help!
All the best
Cloudy
I would be very grateful if someone would be able to advise me on this. My dependent variable is 'COST' which is a binary variable. I have various independent variables as listed below. I am using logistic regression to predict COST.
1) I want to calculate both Tjurs D and the AUROC on my logistic regression models, but cannot do this after I have performed multiple imputation. I can do both of these tasks for the complete case analyses, using the below code:
Tjur's COD*
logistic COST honos age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
predict yhat_scales_SES if e(sample)
ttest yhat_scales_SES, by (COST)
*AUROC*
logistic COST honos age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
predict AUROC_honos if e(sample)
roctab COST AUROC_scales_SES, summary
2) I cannot get this code to work for the imputed datasets despite using mi estimate and cmdok. I have tried various combinations and have gotten different errors:
*example of commands I've run
mi estimate: logistic COST honos_imputed age gender ib(frequent).marital ib(frequent).ethnicity i.imd5
mi estimate, cmdok: predict yhat_scales_SES if e(sample)
mi estimate: ttest yhat_scales_SES, by (COST)
*errors received:
mi estimate: command not supported
predict is not officially supported by mi estimate; see mi estimation for a list of Stata estimation commands
that are supported by mi estimate. You can use option cmdok to allow estimation anyway.
requested action not valid after most recent estimation command
an error occurred when mi estimate executed predict on m=1
Would any out there know the STATA commands that I could run to get these two things to work on an imputed dataset? Many thanks in advance if you can help!
All the best
Cloudy
Comment