Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating unemploymenr rate by demographic characteristics

    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:

    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
    Recall that the unemployment rate is the number of unemployed individuals/labour force (where labour force = employed + unemployed).

    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
    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?

  • #2
    I'm having trouble understanding your variables. So let's say that you have three variables for each individual: your educat variable giving their education category, a 0/1 variable laborforce that is 1 if they are in the labor force, however you define that, and a 0/1 variable employed if they are employed. The something like the following should do the job.
    Code:
    generate unemp = laborforce==1 & employed==0
    collapse (sum) unemp laborforce, by(educat)
    generate unemp_rate = unemp/laborforce
    The key insight is using the collapse command to generate totals of unemployed and labor force, by educational category.
    Last edited by William Lisowski; 29 Feb 2016, 07:44.

    Comment

    Working...
    X