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
ba1f62fe
Commit
ba1f62fe
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
added method to keep vars from raw hh file
parent
09367a99
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
+8
-7
8 additions, 7 deletions
ONS-UK-EFS-time-series-extract.do
with
8 additions
and
7 deletions
ONS-UK-EFS-time-series-extract.do
+
8
−
7
View file @
ba1f62fe
...
...
@@ -76,10 +76,13 @@ local mergeyears = "2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009
* 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 lives)
local
dvhh_keepvars
=
"b480 b481 c96111* c96112* cc5413* c73311* c73312*"
* needed for income equivalisation later
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon weight* a055 g018 g019 p116* p344* p389*"
* keep these from rawhh file
* DEMAND 2.3 (older people mobile lives)
local
rawhh_keepvars
=
"flydes*"
capture
log
close
log
using
"`logd'/ONS-UK-EFS-time-series-extract-$S_DATE.smcl"
,
replace
clear
all
...
...
@@ -148,9 +151,8 @@ if `do_extracts' {
* keep only basic variables
keep
case
*
ba_
*
c_
*
region
`dvhh_keepvars'
qui
:
compress
*
save
all
vars
save
"`efsd'/`y'/stata/dvhh-temp.dta"
,
replace
******************************
di
"* raw household file for c_comp and c_accom"
* also to pick up electricity water payments periodicity etc for error analysis use "`efsd'/`y'/stata/rawhh.dta", clear
qui
:
compress
*
save
all
vars
save
"`efsd'/`y'/stata/dvhh-temp.dta"
,
replace
******************************
di
"* raw household file for c_comp and c_accom"
di
"* also to pick up `rawhh_keepvars'"
use
"`efsd'/`y'/stata/rawhh.dta"
,
clear
* 2010 onwards data = mixed/uppercase
if
"`y'"
==
"2010"
|
"`y'"
==
"2011"
|
"`y'"
==
"2012"
{
rename
*
,
lower
...
...
@@ -178,7 +180,6 @@ if `do_extracts' {
*di in red "weight does not exist"
}
}
keep
case
*
ba_
*
di
"* Done setting up sample year for `y'"
}
...
...
@@ -198,10 +199,10 @@ if `do_extracts' {
}
}
lab
var
ba_sampyear
"Sample year"
keep
case
*
ba_
*
di
"* Done setting up sample year for `y'"
}
keep
case
*
ba_
*
`rawhh_keepvars'
* Useful vars already 'kept'
* fix name
renpfix
ba_c_
c_
...
...
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