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

added additional core variables

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