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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Anderson
LCFS
Commits
ef960dde
Commit
ef960dde
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
added additional core variables
parent
ff07a0b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ONS-UK-EFS-time-series-extract.do
+22
-20
22 additions, 20 deletions
ONS-UK-EFS-time-series-extract.do
with
22 additions
and
20 deletions
ONS-UK-EFS-time-series-extract.do
+
22
−
20
View file @
ef960dde
...
...
@@ -68,16 +68,18 @@ 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
1
local
do_extracts
0
* 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' after the var names have been reduced to lower case
*
DEMAND 2.3 (older people mobile liv
es
)
local
dvhh_keepvars
=
"
b480 b481 b485 c96111* c96112* cc5413* c73311* c73312*
"
* 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 cod
es
local
dvhh_keepvars
=
"
weight* p60*t p61*t p630tp
"
* needed for income equivalisation later
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon weight* a055 g018 g019 p116* p344* p389*"
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon a055 g018 g019 p116* p344* p389*"
* DEMAND 2.3 (older people mobile lives)
local
dvhh_keepvars
=
"`dvhh_keepvars' b480 b481 b485 c96111* c96112* cc5413* c73311* c73312*"
* keep these from rawhh file
* DEMAND 2.3 (older people mobile lives)
...
...
@@ -359,11 +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"
local
incanonl
"anonymised hhold inc + allowances"
* p344 & p389 changed to *p after 2006 and top coded (!)
capture
nosily
:
renpfix
p344p
p344
capture
nosily
:
renpfix
p389
p389
if
`y'
>
2005
{
rename
p344p
p344
rename
p389p
p389
}
gen
equiv_p344
=
p344
/
oecd_equivbhcwt
gen
equiv_p389bhc
=
p389
/
oecd_equivbhcwt
...
...
@@ -457,19 +459,10 @@ tab ba_calyear ba_month
gen
caseno
=
case
if
`do_extracts'
{
di
"do_extracts = `do_extracts', all years (`years') extracted and refreshed"
}
else
{
di
"do_extracts = `do_extracts', years not extracted so individual files not refreshed"
}
* to test
tabstat
c_ncars
c_nchild
c_npersons
c_nearners
c_nrooms
,
by
(
ba_sampyear
)
drop
_merge
*
a055
g
*
p
*
drop
_merge
*
a055
g
*
p
116t
di
"*-> Compressing"
qui
:
compress
...
...
@@ -479,6 +472,15 @@ aorder
order
case
*
survey
*
save
"`outd'/EFS-`years'-extract-reduced-BA.dta"
,
replace
di
"Job ended at $S_DATE"
di
"************************************************************************"
if
`do_extracts'
{
di
"*-> do_extracts = `do_extracts', all years (`years') extracted and refreshed"
}
else
{
di
"*-> do_extracts = `do_extracts', years not extracted so individual files not refreshed"
}
di
"*-> Job ended at $S_DATE"
log
close
...
...
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