Dear members of the list,
I have a panel with observations from several countries over several years.
At the individual level, I have information on the individual's supervisory role ("Are you supervising someone": yes/no) and gender.
I want to create an aggregate-level variable for each country and wave that tells me the percentage of individuals with a supervisory role who are women for this country and year; in other words, the female representation among those with supervisory power... And repeat the operation for all the countries and years in the sample, obviously
For instance, for a given country in the sample (cntry==724) the gender distribution among those with/without supervisory roles in 1999 (S020==1999) is as it appears in the following table
I am interested in the row percentages among the ones who answered yes to the question "Are you supervising someone"; and, more especifically, in the percentage that appear marked in red in the following image, which is a reproduction of the table above. This percentage says that 21.35% of those who appeared as claiming a supervisory role in country 724 are women.

I have followed the tips provided in the following link ("How can I create variables containing percent summaries?") which is very close to what I want. I have used the command 'egen' with 'mean' (see line below). But I have not succeded in arriving to what I want; that is, to a figure like the 21.35 for each country and wave. For instance, I have tried with the following command line (where 'cntry' stands for country, S020 stands for 'wave', 'female' for gender and 'supervising' for having a supervisory role (1) or not (0)), but to no avail:
Unfortunately, the order above does not produce the row percentages that appear in the figure in blue above (and obviously not the percentage in red)
Could you, please, help me with that?
Many thanks for your attention
Luis Ortiz
I have a panel with observations from several countries over several years.
At the individual level, I have information on the individual's supervisory role ("Are you supervising someone": yes/no) and gender.
I want to create an aggregate-level variable for each country and wave that tells me the percentage of individuals with a supervisory role who are women for this country and year; in other words, the female representation among those with supervisory power... And repeat the operation for all the countries and years in the sample, obviously
For instance, for a given country in the sample (cntry==724) the gender distribution among those with/without supervisory roles in 1999 (S020==1999) is as it appears in the following table
HTML Code:
. tab supervising female if cntry==724 & S020==1999, row +----------------+ | Key | |----------------| | frequency | | row percentage | +----------------+ Are you supervising | Sex someone | Male Female | Total --------------------+----------------------+---------- No | 211 131 | 342 | 61.70 38.30 | 100.00 --------------------+----------------------+---------- Yes | 70 19 | 89 | 78.65 21.35 | 100.00 --------------------+----------------------+---------- Total | 281 150 | 431 | 65.20 34.80 | 100.00 .
I am interested in the row percentages among the ones who answered yes to the question "Are you supervising someone"; and, more especifically, in the percentage that appear marked in red in the following image, which is a reproduction of the table above. This percentage says that 21.35% of those who appeared as claiming a supervisory role in country 724 are women.
I have followed the tips provided in the following link ("How can I create variables containing percent summaries?") which is very close to what I want. I have used the command 'egen' with 'mean' (see line below). But I have not succeded in arriving to what I want; that is, to a figure like the 21.35 for each country and wave. For instance, I have tried with the following command line (where 'cntry' stands for country, S020 stands for 'wave', 'female' for gender and 'supervising' for having a supervisory role (1) or not (0)), but to no avail:
HTML Code:
bysort cntry S020 female: egen pc_superv_fem=mean(100*inlist(supervising, 1)) if supervising<.
Could you, please, help me with that?
Many thanks for your attention
Luis Ortiz
Comment