I have three variables: company, gender and wf. The variable company takes 20 values (ranging from 1 to 20, each identifying a specific company and having some frequency against each value for men and women working in each company), the variable gender takes two values (1= male, 0=female), the variable wf takes the values 1 and 2 (not in the workforce and in the workforce respectively in a given city) (in case they are in the workforce, they are working in one of these companies).
I am interested in calculating the difference between number of males in each occupation divided by a constant (57612 = total men in the workforce) and the number of women in each occupation divided by a constant (25312 = total women in the workforce).
I have tried using the following commands:
bysort gender: egen totalwp = count(wp) if wp==2
bysort gender company: egen company_gender= count(company)
gen company_gender_wp= (company_gender/totalwp)*100 /
gen company_f_wp= (company_gender/totalwpr)*100 if gender==0
gen company_m_wp= (company_gender/totalwpr)*100 if gender==1
These give me a dataset where against each value "1" in the company variable, I have the value "X" for variable company_m_wpr and value "Y" for the variable company_f_wp.
I want a variable with the values for men and women that i can tabulate against the company variable to look at the number of men/women in each company divided by number of men/women in the workforce.
Any help would be appreciated
I am interested in calculating the difference between number of males in each occupation divided by a constant (57612 = total men in the workforce) and the number of women in each occupation divided by a constant (25312 = total women in the workforce).
I have tried using the following commands:
bysort gender: egen totalwp = count(wp) if wp==2
bysort gender company: egen company_gender= count(company)
gen company_gender_wp= (company_gender/totalwp)*100 /
gen company_f_wp= (company_gender/totalwpr)*100 if gender==0
gen company_m_wp= (company_gender/totalwpr)*100 if gender==1
These give me a dataset where against each value "1" in the company variable, I have the value "X" for variable company_m_wpr and value "Y" for the variable company_f_wp.
I want a variable with the values for men and women that i can tabulate against the company variable to look at the number of men/women in each company divided by number of men/women in the workforce.
Any help would be appreciated
Comment