Hi,
I am trying to calculate adjusted predicted prevalence by age and sex after a survey weighted logistic regression as follows:
I figured one option is to do predict, and then calculate the survey weighted means of the predicted probabilities for each sex/age group category
However it generally seems recommended to use margins to do this as follows:
However my understanding that the prediction for each age/sex group is calculating the probability if everyone in the sample had that level of age/sex and not just among those that truly have that level of age/sex (I want the latter). Am I misunderstanding margins, or is there a way to specify so that I get only the predicted probabilities at each level of sex/age for those who truly have the level of sex/age
I am trying to calculate adjusted predicted prevalence by age and sex after a survey weighted logistic regression as follows:
Code:
svy,subpop(if include==1): glm vaccine_type i.age_cat1 i.sex i.race i.age_cat1#i.sex i.smoking i.marital, family(binomial)
However it generally seems recommended to use margins to do this as follows:
Code:
margins i.age_cat1#i.sex if include==1, post