I have data on education attainment per year and state and I want to compute the percentage of people who are 25 or above and have at least a Bachelors degree in a given state a given year. So far I have tried the following:
Code:
gen percedu = 0 replace percedu = 1 if educ>=110 egen meanpercedu = wtmean(percedu) if age>=25, weight(asecwt) by (statefip year)
Thank you in advance.
Best regards,
Alexandros Achilleos
0 Response to Create mean variables of a subgroup for the whole group
Post a Comment