Hello folks! I am working with a dataset that looks something like the following:
So basically I have five observations (sex, sector, emp, unemp, labforce).
I want to create a table that looks something like the following:
I am not able to figure out how I calculate WPR (Worker Population Ratio) and UR (Unemployment Rate) in Stata and tabulate that on gender and sector variables.
Note:
WPR = No. of Employed (emp) / Working age population
UR = No. of Unemployed (unemp) / (No. of Employed + No. of Unemployed)
Since I am new to Stata, I will appreciate a lot if you could add brief explanatory comments to your codes. Thanks!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float sex byte sector float(emp unemp labforce) 1 1 1 0 1 1 1 1 0 1 2 1 1 0 1 2 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 2 1 1 0 1 1 1 1 0 1 1 1 0 0 0 end label values sex sex label def sex 1 "Male", modify label def sex 2 "Female", modify label values sector sector label def sector 1 "Rural", modify
I want to create a table that looks something like the following:
I am not able to figure out how I calculate WPR (Worker Population Ratio) and UR (Unemployment Rate) in Stata and tabulate that on gender and sector variables.
Note:
WPR = No. of Employed (emp) / Working age population
UR = No. of Unemployed (unemp) / (No. of Employed + No. of Unemployed)
Since I am new to Stata, I will appreciate a lot if you could add brief explanatory comments to your codes. Thanks!
Comment