Hello everyone,
I have the following data set:
I would like to generate a gender power variable by counting the male managers of the company, for instant, for the above sample, the gender power should be 3 because there are 3 male managers in the company during that quarter.
I have tried the following code:
sort gvkey datacqtr
. by gvkey datacqtr: count Male=="1"
But it will not generate the variable I want.
Thank you in advance.
I have the following data set:
| Company name | Name | CEO | CFO | Year | Quater | Gender |
| Company A | John A | Yes | no | 2019 | 1 | Male |
| Company A | Bill B | no | Yes | 2019 | 1 | Male |
| Company A | Hill C | NO | YES | 2019 | 1 | Female |
| Company A | Jack D | NO | NO | 2019 | 1 | Male |
I have tried the following code:
sort gvkey datacqtr
. by gvkey datacqtr: count Male=="1"
But it will not generate the variable I want.
Thank you in advance.

Comment