When I use 'margins' for complex sampling data, after a logistic regression:
. svy, subpop(if suball==1): logit arthritis i.diabetes c.age i.sex i.bmi4grp
. margins diabetes, vce(unconditional) post
. margins diabetes, vce(unconditional) post
I've got an error message sometime:
"missing predicted values encountered within the estimation sample r(322)"
The answer is to include 'subpop' in the 'margins' command:
.margins diabetes, subpop(if suball==1) vce(unconditional) post
3 comments:
Thanks! This is very helpful!
Thanks for the comment. Very helpful and worked!!
What if you do not want the marginal effects for the subpop, but for the whole sample?
Post a Comment