Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LCFS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Anderson
LCFS
Commits
191aacca
Commit
191aacca
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
added code to create a generic birth decade cohort variable
parent
ef960dde
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ONS-UK-EFS-time-series-extract.do
+13
-3
13 additions, 3 deletions
ONS-UK-EFS-time-series-extract.do
with
13 additions
and
3 deletions
ONS-UK-EFS-time-series-extract.do
+
13
−
3
View file @
191aacca
...
...
@@ -68,14 +68,14 @@ local years "2001-2012" // just a label
local
all_years
"2001-2002 2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009 2010 2011 2012"
// years to process local do_years = "2001-2002 2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009 2010 2011 2012"
* set to 1 to refresh each yearly extract you listed in do_years
local
do_extracts
0
local
do_extracts
1
* drop the first survey for the merge as it is loaded first
local
mergeyears
=
"2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009 2010 2011 2012"
* be sure to keep only these from the dv hh file - these will be 'kept' (along with case and ba_* or c_* after the var names have been reduced to lower case
* basic weighting & consumption expenditure codes
local
dvhh_keepvars
=
"weight* p60*t p61*t p630
tp
"
local
dvhh_keepvars
=
"weight* p60*t p61*t p630
* p396*
"
* needed for income equivalisation later
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon a055 g018 g019 p116* p344* p389*"
* DEMAND 2.3 (older people mobile lives)
...
...
@@ -361,10 +361,11 @@ if `do_extracts' {
/* 1st adult = .67 spouse = .33 other 2nd adult = .33 3rd adult = .33 subsequent adults = .33 children aged < 14 = .2 children aged 14+ = .33 */
*
catch
hh
with
no
children
replace
ba_under14
=
0
if
ba_under14
==
.
replace
ba_over14
=
0
if
ba_over14
==
.
gen
oecd_equivbhcwt
=
0.67
if
ba_adults
>=
1
replace
oecd_equivbhcwt
=
oecd_equivbhcwt
+
((
ba_adults
-1
)
*
0.33
)
+
(
ba_under14
*
0.2
)
+
(
ba_over14
*
0.33
)
di
"Calculating equiv income (OECD) and quartiles/deciles"
* p344 & p3
8
9 changed to *p after 2006 and top coded (!)
* p344
, p389
& p39
6
changed to *p after 2006 and top coded (!)
if
`y'
>
2005
{
rename
p344p
p344
rename
p389p
p389
rename
p396p
p396
}
gen
equiv_p344
=
p344
/
oecd_equivbhcwt
...
...
@@ -397,6 +398,15 @@ if `do_extracts' {
gen
ba_month
=
a055
* create a birth cohort variable
* remember that after 2005 age is top coded to 80
* year of birth
gen
ba_birthyear
=
ba_sampyear
-
p396
* create a birth cohort variable
recode
ba_birth
(
1910
/
1919
=
1
)
(
1920
/
1929
=
2
)
(
1930
/
1939
=
3
)
(
1940
/
1949
=
4
)
(
1950
/
1959
=
5
)
(
1960
/
1969
=
6
)
(
1970
/
1979
=
7
)
(
1980
/
1989
=
8
)
(
1990
/
1999
=
9
)
(
2000
/
2009
=
10
),
gen
(
ba_birth_cohort
)
lab
def
ba_birth_cohort
1
"1910-1919"
2
"1920-1929"
3
"1930-1939"
4
"1940-1949"
5
"1950-1959"
6
"1960-1969"
7
"1970-1979"
8
"1980-1989"
9
"1990-1999"
10
"2000-2009"
lab
val
ba_birth_cohort
ba_birth_cohort
* tab ba_birth_cohort c_age, mi
***********************
* End of per-year processing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment