Hello everyone. I did some table to show top ten occupation of the gender according to their 1) absolut number and 2) percentage. The codes for women (coded as 1 and men as 0) were:
The problem is now, that I realized today that I have to weight the survey data with pweight (The variable for that is "weight" and has for each observation another value), so I don't have to calculate the weight. So I may have to change in these codes some thing, but I don't no what to do really.
I would be very thankful for some help.
Code:
egen n_female = total (gender==1), by(occupation) egen p_female = mean(gender), by(occupation) egen tag = tag(occupation) 1)gsort -tag -n_female gen order = _n su gender if gender==1, meanonly gen ppcumtotal_female = 100 * sum(n_female) / r(N) //shows the cumulative percentage of women from all women tabdisp order in 1/10, c(occupation n_female ppcumtotal_female p_female) 2) gsort -tag -p_female replace order = _n tabdisp order in 1/10, c(occupation p_female n_female)
I would be very thankful for some help.
Comment