My input data is:
input personid annualearnings sex $ schooling ftwe populationmunicipality;
1 55000 male 12 10 88000
2 67000 male 16 8 66000
This is working fine. But I'm trying to calculate the mean, standard deviation, and standard error of the mean for earnings, a female binary variable, schooling, experience (ftwe), and a rural binary variable (a rural area is one where fewer than 10,000 people reside); then repeat this, but by sex (for all the other variables in this list).
When I set my first binary variable (sex = female) I have no problem running it. But if I try adding a second binary variable for population municipality, I don't know how to do it as I keep receiving error messages (see below). Am I defining it the wrong way? I have tried several different methods, but I am not sure what to do next.... Help? Thanks!!!
data out.permanent(keep = annualearnings log_annualearnings female schooling ftwe populationmunicipality);
set temp(drop = personid);
where (annualearnings^=. and sex^=" " and schooling^=. and ftwe^=. and populationmunicipality^=.);
if sex="female" then female=1;
else if sex="male" then female=0;
if populationmunicipality LT 10000, then group='rural';