I am looking at the differences in wages for specific occupations by marital status. Note marital status is coded as 0=married, 1=single, 2=divorced/separated/widowed. My code for the regression is:
xi: svy, subpop(if occ1==1): glm wages i.maritalstatus age agesq experience female i.race metro hrsworked familyincome, family(gamma) link(log)
After running the above (which runs successfully), I try to get the predicted mean wages for specific occupation by marital status for female. My code is as follows:
margins, dydx(maritalstatus) subpop(if occ1==1) at(female==1)
The margins command is unable to recognize maritalstatus as a categorical variable and gives me the following error:
invalid dydx() option;
'maritalstatus' not found in list of covariates
What am I doing wrong? Thank you for your help.
Related Posts with margins after svy
similar observations within one variableHi, I would like to spot the observations that are very much alike within one string variable. Let…
If statement within foreachHey! So I would like to run a regression if income is within the range of (0-10727.88). Code: l…
Principle Component Analysis: using weights and comparison of PCA between countriesHello Statalist Forum Users, We wish to summarize several dichotomous variables of individual level…
Panel data formatHi I would like to transform my panel data so that the years are grouped from 1989 to 2016, consecut…
chi2 test with probability weightsDears I would lke to run a chi2 test but using pw rather than fw. If i use fw stata of course will …
Subscribe to:
Post Comments (Atom)
0 Response to margins after svy
Post a Comment