Hello all,
I would like to calculate the unemployment rate by demographic characteristics.
In the interests of brevity, let's just look at the unemployment rate by educational attainment:
Recall that the unemployment rate is the number of unemployed individuals/labour force (where labour force = employed + unemployed).
So I created the following variables:
Now how I can get a command (one or two lines) that will provide with unemployment rates by educational group? Obviously I can just get the number of individuals who are unemployed by educational attainment divided by the number of those individuals (by educational attainment) in the labour force, but I am sure there is a more efficient way of doing this?
I would like to calculate the unemployment rate by demographic characteristics.
In the interests of brevity, let's just look at the unemployment rate by educational attainment:
Code:
gen educat = 0 if education == 0 replace educat = 1 if education >= 1 & education <= 8 replace educat = 2 if education == 9 | education == 10 | education == 11 | education == 12 | education == 14 | education == 15 replace educat = 3 if education == 13 | education == 16 replace educat = 4 if education >= 17 & education <= 20 replace educat = 5 if education >= 21 & education <= 24 replace educat = 6 if education >= 25 & education <= 26 label define EDUCAT 0 "none" 1 "primary" 2 "incomplete secondary" 3 "matric" 4 "cert/dip" 5 "degree" 6 "other/unspecified" label values educat EDUCAT
So I created the following variables:
Code:
*** recode and create variables * working-age population category gen workingage = (age >= 15 & age <=65) label define WORKINGAGE 1 "working age" 0 "not working age" label values workingage WORKINGAGE * employed dummy (15-65 years only) gen employed = (status == 1 & workingage == 1) label define EMPLOYED 1 "employed" 0 "other" label values employed EMPLOYED * narrowed unemployed (15-65 years only) gen unemp_nar = (status == 2 & workingage == 1) label define UNEMP 1 "unemployed" label values unemp_nar UNEMP * narrow employed/unemployed dummy (15-65 years only) gen lbmk_nar = . replace lbmk_nar = 1 if unemp_nar==1 replace lbmk_nar = 0 if employed==1 label define LBMK 0 "employed" 1 "unemployed" label values lbmk_nar LBMK * narrow labour force dummy (15-65 years only) gen narmark = (lbmk_nar >= 0 & lbmk_nar <= 1) label define LBMKMARK 0 "Not" 1 "In Labour Force" label values narmark LBMKMARK
Comment