(7=5)(8=6)(else=.),gen(ba_age)// codes don't know & youth group parties to missing
labvarba_age"Age group (individual)"
labeldefineba_age///
0"0-15"///
1"16-24"///
2"25-34"///
3"35-44"///
4"45-54"///
5"55-64"///
6"65+"
labvalba_ageba_age
* check
*tab age ba_age, mi
*tab age ba_age, mi
/*
/*
...
@@ -228,7 +261,7 @@ if `do_extracts' {
...
@@ -228,7 +261,7 @@ if `do_extracts' {
keep`kvars'ba_*
keep`kvars'ba_*
qui:compress
qui:compress
gensurvey_year="20`y'"
gensurvey_year="20`y'"
tabsurvey_year
tabsurvey_year
...
@@ -236,9 +269,15 @@ if `do_extracts' {
...
@@ -236,9 +269,15 @@ if `do_extracts' {
* keep all (makes life easier below as some vars are in some years and not others)
* keep all (makes life easier below as some vars are in some years and not others)
/* create a birth cohort variable
/* create a birth cohort variable
Birth year Age in 2000 Age in 2010
1900-1909 90-100
1910-1919 80-90 90-100
1920-1929 70-80 80-90
1930-1939 60-70 70-80
1940-1949 50-60 60-70
1950-1959 40-50 50-60