Skip to content
Snippets Groups Projects
Commit ba1f62fe authored by Ben Anderson's avatar Ben Anderson
Browse files

added method to keep vars from raw hh file

parent 09367a99
No related branches found
No related tags found
No related merge requests found
......@@ -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_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment