Skip to content

Commit 5ab9cb1

Browse files
authored
Merge pull request #323 from centreformicrosimulation/bugfix/322-weights-missing-from-regression-file-estimating-median-equivalised-income
change median income calculation to use hh weights #322
2 parents c923086 + e0ef241 commit 5ab9cb1

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

input/InitialPopulations/compile/RegressionEstimates/variable_update.do

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,9 @@ summ inc_increase inc_decrease econ_incchange
149149

150150
* Task 5
151151
* Poverty transitions
152-
// ssc install egenmore
153-
* Ensure all swvs have household weight
154-
//gen weight_house = hhdenub_xw
155-
//replace weight_house=hhdenus_xw if swv==1
156-
//replace weight_house=hhdenui_xw if swv>=6 & swv<=13
157-
//replace weight_house=hhdeng2_xw if swv==14
158-
//
159-
//label var weight_house "Weight: household cross-sectional"
160152

161153
* Generate median income for sample
162-
bysort swv: egen samp_medianinc=wpctile(econ_realequivinc), p(50) // weights(weight_house)
154+
bysort swv: egen samp_medianinc=wpctile(econ_realequivinc), p(50) weights(dhhwt)
163155
label var samp_medianinc "Median household income for sample in swv"
164156
* ONS uses net income, before or after housing costs. Net income used here.
165157
gen samp_poverty =samp_medianinc*0.60

0 commit comments

Comments
 (0)