diff --git a/input/InitialPopulations/compile/RegressionEstimates/00_master_regression_estimates.do b/input/InitialPopulations/compile/RegressionEstimates/00_master_regression_estimates.do index d9a4681cc..3db366d15 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/00_master_regression_estimates.do +++ b/input/InitialPopulations/compile/RegressionEstimates/00_master_regression_estimates.do @@ -72,7 +72,7 @@ global estimation_sample "${path}\initial_populations\data\ukhls_pooled_ipop.dta * Pooled dataset with predicted wages after Heckman global estimation_sample2 "${path}\initial_populations\data\UKHLS_pooled_ipop2.dta" -* Directory containing external data used for the estimates (e.g. fertility rates, wage growth) +* Directory containing external data used +for the estimates (e.g. fertility rates, wage growth) global dir_external_data "${dir_work}/external_data" * Directory to save data for internal validation @@ -92,7 +92,7 @@ do "${path}\00_master_conditions.do" Two additional do-files are called from each of these do-files - variable_update.do refactors variable names - programs.do contains Stata programs to process the output of regressions and create Excel files with results used by Simpaths - */ +*/ do "${dir_do}/01_reg_education.do" @@ -114,7 +114,9 @@ do "${dir_do}/09_reg_income.do" do "${dir_do}/10_reg_socialcare.do" + /*Note that the do-files below are not yet refactored */ + do "${dir_do}/11_reg_financial_distress.do" do "${dir_do}/12_reg_health_mental.do" diff --git a/input/InitialPopulations/compile/RegressionEstimates/01_reg_education.do b/input/InitialPopulations/compile/RegressionEstimates/01_reg_education.do index e90ce2676..93dc2f49e 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/01_reg_education.do +++ b/input/InitialPopulations/compile/RegressionEstimates/01_reg_education.do @@ -26,7 +26,7 @@ log using "${dir_log}/reg_education.log", replace /******************************* SET EXCEL FILE *******************************/ -putexcel set "$dir_results/reg_education", sheet("Info") replace +putexcel set "$dir_results/reg_education", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing projection of education status" putexcel A2 = "Authors:" @@ -79,34 +79,55 @@ do "${dir_do}/programs.do" /****************** E1a: PROBABILITY OF REMAINING IN EDUCATION ****************/ display "${e1a_if_condition}" - +/* +probit Dst i.Dgn Dag Dag_sq /*Dag_c Dag_c_sq Dag_post18_sq*/ li.Ded /// + li.Dehmf_c3_Medium li.Dehmf_c3_Low /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${e1a_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("education") process("E1a") sheet("E1a_orig") /// + title("Process E1a: Prob. remain in education") /// + gofrow(3) goflabel("E1a - Remain in education") /// + ifcond("${e1a_if_condition}") probit + */ probit Dst /// demMaleFlag demAge demAgeSq eduSampleFlagL1 /// eduHighestParentC3MediumL1 eduHighestParentC3LowL1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${e1a_if_condition} [pw=${weight}], vce(robust) - process_regression, domain("education") process("E1a") sheet("E1a") /// title("Process E1a: Prob. remain in education") /// gofrow(3) goflabel("E1a - Remain in education") /// ifcond("${e1a_if_condition}") probit - /****************** E1b: PROBABILITY OF RETURNING TO EDUCATION ****************/ display "${e1b_if_condition}" +/* +probit der i.Dgn Dag Dag_sq li.Dcpst_Partnered /// + li.Deh_c4_High li.Deh_c4_Low li.Dehmf_c3_Medium li.Dehmf_c3_Low /// + li.Les_c3_NotEmployed li.Les_c3_Employed l.Dnc l.Dnc02 /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${e1b_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("education") process("E1b") sheet("E1b_orig") /// + title("Process E1b: Prob. return to education") /// + gofrow(7) goflabel("E1b - Return to education") /// + ifcond("${e1b_if_condition}") probit + */ probit der /// demMaleFlag demAge demAgeSq demPartnerStatusPartneredL1 /// eduHighestC4HighL1 eduHighestC4LowL1 /// eduHighestParentC3MediumL1 eduHighestParentC3LowL1 /// - labStatusC3NotEmployedL1 /*labStatusC3EmployedL1*/ /// + labStatusC3NotEmployedL1 labStatusC3EmployedL1 /// demNChildL1 demNChild0to2L1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${e1b_if_condition} [pw=${weight}], vce(robust) - + process_regression, domain("education") process("E1b") sheet("E1b") /// title("Process E1b: Prob. return to education") /// gofrow(7) goflabel("E1b - Return to education") /// @@ -116,13 +137,24 @@ process_regression, domain("education") process("E1b") sheet("E1b") /// /****************** E2: EDUCATION ATTAINMENT WHEN LEAVE SCHOOL ****************/ display "${e2_if_condition}" +/* +gologit2 deh_c3_recoded i.Dgn Dag Dag_sq /// + i.L_Dehmf_c3_Medium i.L_Dehmf_c3_Low /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${e2_if_condition} [pw=${weight}], autofit + +process_gologit, domain("education") process("E2") sheet("E2_orig") /// + title("Process E2: Educational Attainment When Leave School") /// + gofrow(11) goflabel("E2 - Education attainment") /// + outcomes(3) /// + ifcond("${e2_if_condition}") + */ gologit2 deh_c3_recoded /// demMaleFlag demAge demAgeSq /// eduHighestParentC3MediumL1 eduHighestParentC3LowL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${e2_if_condition} [pw=${weight}] , autofit - process_gologit, domain("education") process("E2") sheet("E2") /// title("Process E2: Educational Attainment When Leave School") /// gofrow(11) goflabel("E2 - Education attainment") /// @@ -132,5 +164,5 @@ process_gologit, domain("education") process("E2") sheet("E2") /// display "Education analysis complete!" - + capture log close diff --git a/input/InitialPopulations/compile/RegressionEstimates/02_reg_leave_parental_home.do b/input/InitialPopulations/compile/RegressionEstimates/02_reg_leave_parental_home.do index 7084edb6d..1486f3ae4 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/02_reg_leave_parental_home.do +++ b/input/InitialPopulations/compile/RegressionEstimates/02_reg_leave_parental_home.do @@ -24,7 +24,7 @@ log using "${dir_log}/reg_leave_parental_home.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_leave_parental_home", sheet("Info") replace +putexcel set "$dir_results/reg_leave_parental_home", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing leaving parental home" putexcel A2 = "Authors:" @@ -65,13 +65,26 @@ do "${dir_do}/programs.do" /**************** P1: PROBABILITY OF LEAVING THE PARENTAL HOME ****************/ display "${p1_if_condition}" + +/* +probit dlftphm i.Dgn Dag Dag_sq li.Deh_c4_Na li.Deh_c4_Medium li.Deh_c4_Low /// + li.Les_c3_Student li.Les_c3_NotEmployed /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${p1_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("leave_parental_home") process("P1") sheet("P1_orig") /// + title("Process P1: Prob. leave parental home") /// + gofrow(3) goflabel("P1 - Leave parental home") /// + ifcond("${p1_if_condition}") probit + */ probit dlftphm /// demMaleFlag demAge demAgeSq /// eduHighestC4NaL1 eduHighestC4MediumL1 eduHighestC4LowL1 /// labStatusC3StudentL1 labStatusC3NotEmployedL1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${p1_if_condition} [pw=${weight}], vce(robust) diff --git a/input/InitialPopulations/compile/RegressionEstimates/03_reg_partnership.do b/input/InitialPopulations/compile/RegressionEstimates/03_reg_partnership.do index 4d45c7c05..84e40cbb5 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/03_reg_partnership.do +++ b/input/InitialPopulations/compile/RegressionEstimates/03_reg_partnership.do @@ -24,7 +24,7 @@ log using "${dir_log}/reg_partnership.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_partnership", sheet("Info") replace +putexcel set "$dir_results/reg_partnership", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters for relationship status projection" putexcel A2 = "Authors:" @@ -66,18 +66,36 @@ do "${dir_do}/programs.do" /******************** U1: PROBABILITY FORMING PARTNERSHIP *********************/ display "${u1_if_condition}" - +/* +probit dcpen /// + i.Ded Dgn Dag Dag_sq /// + lc.Dnc lc.Dnc02 /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + /*Ded_Dag Ded_Dag_sq*/ Ded_Dgn Ded_Dnc_L1 Ded_Dnc02_L1 /// + Ded_Ydses_c5_Q2_L1 Ded_Ydses_c5_Q3_L1 Ded_Ydses_c5_Q4_L1 Ded_Ydses_c5_Q5_L1 /// + i.Deh_c4_Na i.Deh_c4_High i.Deh_c4_Medium i.Deh_c4_Low /// + li.Les_c4_Student li.Les_c4_NotEmployed li.Les_c4_Retired /// + li.Les_c4_Student_Dgn li.Les_c4_NotEmployed_Dgn li.Les_c4_Retired_Dgn /// + l.Dhe_pcs l.Dhe_mcs /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${u1_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("partnership") process("U1") sheet("U1_orig") /// + title("Process U1: Prob. form partnership") /// + gofrow(3) goflabel("U1 - Form partnership") /// + ifcond("${u1_if_condition}") probit +*/ probit dcpen /// eduSampleFlag demMaleFlag demAge demAgeSq /// demNChildL1 demNChild0to2L1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// eduSampleFlag_demMaleFlag eduSampleFlag_demNChildL1 eduSampleFlag_demNChild0to2L1 /// eduSampleFlag_Q2L1 eduSampleFlag_Q3L1 eduSampleFlag_Q4L1 eduSampleFlag_Q5L1 /// - eduHighestC4NaL1 eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 /// - labStatusC4EmployedL1 labStatusC4StudentL1 labStatusC4RetiredL1 /// - labStatusC4EmployedL1_Male labStatusC4StudentL1_Male labStatusC4RetiredL1_Male /// + eduHighestC4High eduHighestC4Medium /*eduHighestC4Low*/ /// + labStatusC4StudentL1 labStatusC4NotEmployedL1 labStatusC4RetiredL1 /// + labStatusC4Student_MaleL1 labStatusC4NotEmployed_MaleL1 labStatusC4Retired_MaleL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${u1_if_condition} [pw=${weight}], vce(robust) process_regression, domain("partnership") process("U1") sheet("U1") /// @@ -88,18 +106,40 @@ process_regression, domain("partnership") process("U1") sheet("U1") /// /******************* U2: PROBABILITY TERMINATE PARTNERSHIP ********************/ display "${u2_if_condition}" - + +/* +probit dcpex /// + i.Ded Dag Dag_sq /*Ded_Dag Ded_Dag_sq*/ /// + li.Deh_c4_Na li.Deh_c4_Low li.Deh_c4_Medium li.Deh_c4_High /// + li.Dehsp_c3_Medium li.Dehsp_c3_Low /// + li.Dhe_Fair li.Dhe_Good li.Dhe_VeryGood li.Dhe_Excellent /// + l.Dhe_pcs l.Dhe_mcs /// + l.Dhe_pcssp l.Dhe_mcssp /// + l.Dcpyy l.New_rel l.Dcpagdf /// + l.Dnc l.Dnc02 /// + li.Lesdf_c4_EmpSpouseNotEmp li.Lesdf_c4_NotEmpSpouseEmp li.Lesdf_c4_BothNotEmployed /// + l.Ypnbihs_dv l.Ynbcpdf_dv /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${u2_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("partnership") process("U2") sheet("U2_orig") /// + title("Process U2: Prob. end partnership") /// + gofrow(7) goflabel("U2 - End partnership") /// + ifcond("${u2_if_condition}") probit +*/ + probit dcpex /// - eduSampleFlag demMaleFlag demAge demAgeSq /// - eduHighestC4NaL1 eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 /// + eduSampleFlag demAge demAgeSq /// + eduHighestC4NaL1 eduHighestC4LowL1 eduHighestC4MediumL1 eduHighestC4HighL1 /// eduHighestPartnerC3MediumL1 eduHighestPartnerC3LowL1 /// - healthPhysicalPcsL1 healthMentalMcsL1 /// + healthSelfRatedFairL1 healthSelfRatedGoodL1 healthSelfRatedVeryGoodL1 healthSelfRatedExcellentL1 /// + healthPhysicalPcsL1 healthMentalMcsL1 /// healthPhysicalPartnerPcsL1 healthMentalPartnerMcsL1 /// demPartnerNYearL1 demEnterPartnerFlagL1 demAgePartnerDiffL1 /// demNChildL1 demNChild0to2L1 /// labStatusPartnerAndOwnC42L1 labStatusPartnerAndOwnC43L1 labStatusPartnerAndOwnC44L1 /// yNonBenPersGrossMonthL1 yPersAndPartnerGrossDiffMonthL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${u2_if_condition} [pw=${weight}], vce(robust) process_regression, domain("partnership") process("U2") sheet("U2") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/04_reg_fertility.do b/input/InitialPopulations/compile/RegressionEstimates/04_reg_fertility.do index 2525db426..7e54d5e96 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/04_reg_fertility.do +++ b/input/InitialPopulations/compile/RegressionEstimates/04_reg_fertility.do @@ -24,7 +24,7 @@ log using "${dir_log}/reg_fertility.log", replace /******************************* SET EXCEL FILE *******************************/ -putexcel set "$dir_results/reg_fertility", sheet("Info") replace +putexcel set "$dir_results/reg_fertility", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing projection of fertility" putexcel A2 = "Authors:" @@ -69,18 +69,38 @@ do "${dir_do}/programs.do" /*********************** F1: PROBABILITY OF HAVING A CHILD ********************/ display "${f1_if_condition}" +/* +probit dchpd /// + i.Ded Dag Dag_sq /// + l.Dhe_pcs l.Dhe_mcs /// + Dcpst_Single li.Dcpst_Single /// + /*Ded_Dag Ded_Dhe_pcs Ded_Dhe_mcs*/ /// + Ded_Dcpst_Single /*Ded_Dcpst_Single_L1*/ /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + l.Dnc l.Dnc02 /// + i.Deh_c4_Low i.Deh_c4_High /// + FertilityRate /// + /*li.Les_c3_Student*/ li.Les_c3_NotEmployed /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${f1_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("fertility") process("F1") sheet("F1_orig") /// + title("Process F1: Prob. have a child") /// + gofrow(3) goflabel("F1 - Have child") /// + ifcond("${f1_if_condition}") probit +*/ probit dchpd /// - eduSampleFlag demMaleFlag demAge demAgeSq /// + eduSampleFlag demAge demAgeSq /// healthPhysicalPcsL1 healthMentalMcsL1 /// demPartnerStatusSingle demPartnerStatusSingleL1 /// eduSampleFlag_Single /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// demNChildL1 demNChild0to2L1 /// - eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 /// + eduHighestC4Low eduHighestC4High /// fertilityRate /// /*labStatusC3StudentL1*/ labStatusC3NotEmployedL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${f1_if_condition} [pw=${weight}], vce(robust) process_regression, domain("fertility") process("F1") sheet("F1") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/05_reg_health.do b/input/InitialPopulations/compile/RegressionEstimates/05_reg_health.do index c7f2686a2..d5358c6d1 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/05_reg_health.do +++ b/input/InitialPopulations/compile/RegressionEstimates/05_reg_health.do @@ -24,7 +24,7 @@ log using "${dir_log}/reg_health.log", replace /******************************* SET EXCEL FILE *******************************/ -putexcel set "$dir_results/reg_health", sheet("Info") replace +putexcel set "$dir_results/reg_health", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing projection self-reported health status" putexcel A2 = "Authors:" @@ -75,16 +75,39 @@ do "${dir_do}/programs.do" /********************** H1: SELF-REPORTED HEALTH STATUS ***********************/ display "${h1_if_condition}" +/* +gologit2 dhe /// + Ded Dgn Dag Dag_sq /// /*Ded_Dag Ded_Dag_sq Ded_Dgn /// */ + L_Dhe_pcs L_Dhe_mcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + /*L_Les_c4_Student*/ L_Les_c4_NotEmployed L_Les_c4_Retired /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dhhtp_c4_CoupleChildren L_Dhhtp_c4_SingleNoChildren L_Dhhtp_c4_SingleChildren /// + L_Dlltsd01 /// + $regions Year_transformed Y2020 Y2021 $ethnicity if /// + ${h1_if_condition} [pw=${weight}], autofit + +/* +Note: In gologit2, the coefficients show how covariates affect the log-odds of +being above a certain category vs. at or below it. +*/ + +process_gologit, domain("health") process("H1") sheet("H1_orig") /// + title("Process H1: Self Rated Health") /// + gofrow(3) goflabel("H1 - Self-rated health") /// + outcomes(5) /// + ifcond("${h1_if_condition}") +*/ gologit2 dhe /// eduSampleFlag demMaleFlag demAge demAgeSq /// healthPhysicalPcsL1 healthMentalMcsL1 /// - eduHighestC4NaL1 eduHighestC4MediumL1 eduHighestC4LowL1 /// - /*labStatusC4StudentL1*/ labStatusC4EmployedL1 labStatusC4RetiredL1 /// + eduHighestC4Medium eduHighestC4Low /*eduHighestC4Na*/ /// + /*labStatusC4StudentL1*/ labStatusC4NotEmployedL1 labStatusC4RetiredL1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// healthDsblLongtermFlagL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${h1_if_condition} [pw=${weight}], autofit /* @@ -98,16 +121,34 @@ process_gologit, domain("health") process("H1") sheet("H1") /// outcomes(5) /// ifcond("${h1_if_condition}") + /**************** H2: PROBABILITY LONG-TERM SICK OR DISABLED ******************/ display "${h2_if_condition}" +/* +probit dlltsd01 /// + i.Dgn Dag Dag_sq /// + Deh_c4_Medium Deh_c4_Low Deh_c4_Na /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dhe_pcs L_Dhe_mcs /// + L_Dlltsd01 /// + L_Dhhtp_c4_CoupleChildren L_Dhhtp_c4_SingleNoChildren L_Dhhtp_c4_SingleChildren /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${h2_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("health") process("H2") sheet("H2_orig") /// + title("Process H2: Prob.disabled or long term sick") /// + gofrow(7) goflabel("H2 - Disabled or long term sick") /// + ifcond("${h2_if_condition}") probit +*/ -probit dlltsd01 demMaleFlag demAge demAgeSq /// +probit dlltsd01 /// + demMaleFlag demAge demAgeSq /// eduHighestC4Medium eduHighestC4Low eduHighestC4Na /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// healthDsblLongtermFlagL1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${h2_if_condition} [pw=${weight}], vce(robust) process_regression, domain("health") process("H2") sheet("H2") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/06_reg_home_ownership.do b/input/InitialPopulations/compile/RegressionEstimates/06_reg_home_ownership.do index 88bc29f80..f4e435dc5 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/06_reg_home_ownership.do +++ b/input/InitialPopulations/compile/RegressionEstimates/06_reg_home_ownership.do @@ -24,7 +24,7 @@ log using "${dir_log}/reg_home_ownership.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_home_ownership", sheet("Info") replace +putexcel set "$dir_results/reg_home_ownership", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing projection of home ownership" putexcel A2 = "Authors: " @@ -51,11 +51,11 @@ putexcel A1 = "Goodness of fit", bold use "${estimation_sample}", clear * Set data -xtset idperson swv -sort idperson swv +//xtset idperson swv +//sort idperson swv * Adjust variables -do "${dir_do}/variable_update.do" +//do "${dir_do}/variable_update.do" * Create sample at benefit unit head @@ -95,8 +95,14 @@ assert `n_bu_before' == `n_bu_after' by idbenefitunit swv, sort: gen n=_N assert n==1 +* Set data +xtset idperson swv sort idperson swv +* Adjust variables +do "${dir_do}/variable_update.do" + + /********************************** ESTIMATION ********************************/ @@ -107,16 +113,35 @@ do "${dir_do}/programs.do" /********************** HO1: PROBABILITY OF OWNING HOME ***********************/ display "${ho1_if_condition}" +/* +probit dhh_owned /// + i.Dgn Dag Dag_sq /// + il.Dhhtp_c8_2 il.Dhhtp_c8_3 il.Dhhtp_c8_4 il.Dhhtp_c8_5 il.Dhhtp_c8_6 il.Dhhtp_c8_7 il.Dhhtp_c8_8 /// + il.Les_c4_Student il.Les_c4_NotEmployed il.Les_c4_Retired /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + l.Dhe_mcs l.Dhe_pcs /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + l.Yptciihs_dv /// + l.Dhh_owned /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${ho1_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("home_ownership") process("HO1") sheet("HO1_orig") /// + title("Process S2b: Prob. own home") /// + gofrow(3) goflabel("HO1 - Own home") /// + ifcond("${ho1_if_condition}") probit +*/ + probit dhh_owned /// demMaleFlag demAge demAgeSq /// demCompHhC82L1 demCompHhC83L1 demCompHhC84L1 demCompHhC85L1 demCompHhC86L1 demCompHhC87L1 demCompHhC88L1 /// labStatusC4StudentL1 labStatusC4NotEmployedL1 labStatusC4RetiredL1 /// - eduHighestC4MediumL1 eduHighestC4LowL1 eduHighestC4NaL1 /// + eduHighestC4Medium eduHighestC4Low eduHighestC4Na /// healthPhysicalPcsL1 healthMentalMcsL1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// yMiscPersGrossMonthL1 /// wealthPrptyFlagL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${ho1_if_condition} [pw=dwt], vce(cluster idperson) process_regression, domain("home_ownership") process("HO1") sheet("HO1") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/07_reg_retirement.do b/input/InitialPopulations/compile/RegressionEstimates/07_reg_retirement.do index b4c136110..6170a564b 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/07_reg_retirement.do +++ b/input/InitialPopulations/compile/RegressionEstimates/07_reg_retirement.do @@ -25,7 +25,7 @@ log using "${dir_log}/reg_retirement.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_retirement", sheet("Info") replace +putexcel set "$dir_results/reg_retirement", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters governing projection of retirement" putexcel A2 = "Authors: " @@ -70,6 +70,21 @@ do "${dir_do}/programs.do" /****************** R1a: PROBABILITY OF RETIREMENT, SINLGE ********************/ display "${r1a_if_condition}" +/* +probit drtren i.Dgn Dag Dag_sq /// + li.Deh_c4_Medium li.Deh_c4_Low li.Deh_c4_Na /// + l.Dhe_pcs l.Dhe_mcs /// + i.Reached_Retirement_Age /// + li.Les_c3_NotEmployed /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 li.Dlltsd01 /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${r1a_if_condition} [pw=${weight}], vce(robust) + +process_regression, domain("retirement") process("R1a") sheet("R1a_orig") /// + title("Process R1a: Prob. retire, singles") /// + gofrow(3) goflabel("R1a - Retire, singles") /// + ifcond("${r1a_if_condition}") probit +*/ probit drtren /// demMaleFlag demAge demAgeSq /// @@ -79,7 +94,7 @@ probit drtren /// labStatusC3NotEmployedL1 /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// healthDsblLongtermFlagL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${r1a_if_condition} [pw=${weight}], vce(robust) process_regression, domain("retirement") process("R1a") sheet("R1a") /// @@ -91,16 +106,33 @@ process_regression, domain("retirement") process("R1a") sheet("R1a") /// /***************** R1b: PROBABILITY OF RETIREMENT, PARTNERED ******************/ display "${r1b_if_condition}" + /* +probit drtren i.Dgn Dag Dag_sq /// + li.Deh_c4_Medium li.Deh_c4_Low li.Deh_c4_Na /// + l.Dhe_pcs l.Dhe_mcs /// + i.Reached_Retirement_Age i.Reached_Retirement_Age_Les /// + li.Les_c3_NotEmployed li.Lessp_c3_NotEmployed /// + i.Reached_Retirement_Age_Sp /// + li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 /// + li.Dlltsd01 /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${r1b_if_condition} [pw=${weight}], vce(robust) +process_regression, domain("retirement") process("R1b") sheet("R1b_orig") /// + title("Process R1b: Prob. retire, partnered") /// + gofrow(7) goflabel("R1a - Retire, partnered") /// + ifcond("${r1b_if_condition}") probit + */ probit drtren /// demMaleFlag demAge demAgeSq /// eduHighestC4MediumL1 eduHighestC4LowL1 eduHighestC4NaL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// demPensAgeFlag demPensAgeFlag_NotEmployed /// - labStatusC3NotEmployedL1 labStatusPartnerC3NotEmplL1 /// + labStatusC3NotEmployedL1 labStatusPartnerC3NotEmployedL1 /// demPensPartnerAgeFlag /// yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + healthDsblLongtermFlagL1 /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${r1b_if_condition} [pw=${weight}], vce(robust) process_regression, domain("retirement") process("R1b") sheet("R1b") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/08_reg_wages.do b/input/InitialPopulations/compile/RegressionEstimates/08_reg_wages.do index 1afdb6b14..be7222102 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/08_reg_wages.do +++ b/input/InitialPopulations/compile/RegressionEstimates/08_reg_wages.do @@ -4,7 +4,7 @@ * OBJECT: Heckman regressions * AUTHORS: Patryk Bronka, Daria Popova, Justin van de Ven, * Aleksandra Kolndrekaj, Ashley Burdett -* LAST UPDATE: 28 April 2026 (DP) +* LAST UPDATE: 19 May 2026 (DP) ******************************************************************************** ******************************************************************************** * NOTES: Strategy: @@ -39,12 +39,12 @@ do "${dir_do}/programs.do" ******************************************************************************** * Set Excel file * Info sheet - first stage -putexcel set "$dir_results/reg_employment_selection", sheet("Info") replace +putexcel set "$dir_results/reg_employment_selection", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "This file contains regression estimates from the first stage of the Heckman selection model used to estimates wages." putexcel A2 = "Authors:", bold putexcel B2 = "Patryk Bronka, Justin Van de Ven, Daria Popova, Aleksandra Kolndrekaj, Ashley Burdett" -putexcel A3 = "Last edit: 28 April 2026 (DP) " +putexcel A3 = "Last edit: 19 May 2026 (DP) " putexcel A5 = "Process:", bold putexcel B5 = "Description:", bold @@ -63,12 +63,12 @@ putexcel B12 = "Predicted wages used as input into union parameters and income p putexcel B13 = "Two-step Heckman command is used which does not permit weights" * Info sheet - second stage -putexcel set "$dir_results/reg_wages", sheet("Info") replace +putexcel set "$dir_results/reg_wages", sheet("Info") modify //replace putexcel A1 = "Description:" putexcel B1 = "This file contains regression estimates used to calculate potential wages for males and females in the simulation." putexcel A2 = "Authors:", bold putexcel B2 = "Patryk Bronka, Justin Van de Ven, Daria Popova, Aleksandra Kolndrekaj, Ashley Burdett" -putexcel A3 = "Last edit: 28 April 2026 (DP) " +putexcel A3 = "Last edit: 19 May 2026 (DP) " putexcel A5 = "Process:", bold putexcel B5 = "Description:", bold @@ -113,7 +113,7 @@ do "${dir_do}/variable_update.do" * Merge in real growth index merge m:1 stm using "$dir_external_data/growth_rates", keep(3) nogen /// keepusing(real_wage_growth) -rename real_wage_growth realWageGrowth +gen realWageGrowth = real_wage_growth * Set data xtset idperson swv @@ -171,50 +171,67 @@ gen pred_hourly_wage = . do "${dir_do}/programs.do" /******************** WAGES: WOMEN, NO PREV WAGE OBSERVED *********************/ +/* +global wage_eqn "lwage_hour dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 pt real_wage_growth y2020 y2021 i.dot" +global seln_eqn "i.L1les_c3 dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 mar child dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 y2020 y2021 i.dot" + +local filter = "${wages_f_no_prev_if_condition}" + +heckman $wage_eqn if `filter', select($seln_eqn) twostep mills(lambda) + +process_heckman, /// + process("W1fa_orig") /// + ifcond("`filter'") /// + savefile("Female_NPW_sample") /// + graphsubtitle("Females, No previously observed wage") /// + wordfile("$dir_raw_results/wages/Output_NWW.doc") /// + wordtitle("Heckman-corrected wage equation: women not in employment last year") /// + wordctitle("Not working women") /// + sheet2("W1fa_orig") sheet1("W1fa-sel_orig") /// + rmserow(2) +*/ + #delimit ; global wage_eqn lwage_hour demAge demAgeSq -eduHighestC4LowL1 -eduHighestC4MediumL1 -eduHighestC4HighL1 -eduHighestC4LowL1_demAge -eduHighestC4MediumL1_demAge -eduHighestC4HighL1_demAge +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge eduHighestParentC3Medium -eduHighestParentC3High +eduHighestParentC3Low healthDsblLongtermFlag -healthPhysicalPcsL1 +healthPhysicalPcsL1 healthMentalMcsL1 +$regions labPt realWageGrowth -$regions demYear2020 demYear2021 $ethnicity ; #delimit cr + #delimit ; global seln_eqn -labStatusC3StudentL1 +labStatusC3StudentL1 labStatusC3NotEmployedL1 demAge demAgeSq -eduHighestC4LowL1 -eduHighestC4MediumL1 -eduHighestC4HighL1 -eduHighestC4LowL1_demAge -eduHighestC4MediumL1_demAge -eduHighestC4HighL1_demAge +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge eduHighestParentC3Medium -eduHighestParentC3High +eduHighestParentC3Low +demPartnerStatusPartnered +demDChild healthDsblLongtermFlag -healthPhysicalPcsL1 +healthPhysicalPcsL1 healthMentalMcsL1 -demPartnerStatusPartnered -demNChild $regions demYear2020 demYear2021 @@ -238,8 +255,77 @@ process_heckman, /// rmserow(2) + /********************** WAGES: MEN, NO PREV WAGE OBSERVED *********************/ + +/* +global wage_eqn "lwage_hour dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 pt real_wage_growth y2020 y2021 i.dot" +global seln_eqn "i.L1les_c3 dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 mar child dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 y2020 y2021 i.dot" + +local filter = "${wages_m_no_prev_if_condition}" + +heckman $wage_eqn if `filter', select($seln_eqn) twostep mills(lambda) + +process_heckman, /// + process("W1ma_orig") /// + ifcond("`filter'") /// + savefile("Male_NPW_sample") /// + graphsubtitle("Males, No previously observed wage") /// + wordfile("$dir_raw_results/wages/Output_NWM.doc") /// + wordtitle("Heckman-corrected wage equation: men not in employment last year") /// + wordctitle("Not working men") /// + sheet2("W1ma_orig") sheet1("W1ma-sel_orig") /// + rmserow(3) +*/ + * globals are the same as for women +#delimit ; +global wage_eqn +lwage_hour +demAge +demAgeSq +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge +eduHighestParentC3Medium +eduHighestParentC3Low +healthDsblLongtermFlag +healthPhysicalPcsL1 +healthMentalMcsL1 +$regions +labPt +realWageGrowth +demYear2020 +demYear2021 +$ethnicity +; +#delimit cr + + +#delimit ; +global seln_eqn +labStatusC3StudentL1 +labStatusC3NotEmployedL1 +demAge +demAgeSq +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge +eduHighestParentC3Medium +eduHighestParentC3Low +demPartnerStatusPartnered +demDChild +healthDsblLongtermFlag +healthPhysicalPcsL1 +healthMentalMcsL1 +$regions +demYear2020 +demYear2021 +$ethnicity +; +#delimit cr local filter = "${wages_m_no_prev_if_condition}" @@ -258,6 +344,25 @@ process_heckman, /// /********************** WAGES: WOMEN, PREV WAGE OBSERVED **********************/ +/* +global wage_eqn "lwage_hour L1.lwage_hour dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 pt real_wage_growth y2020 y2021 i.dot" +global seln_eqn "dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 mar child dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 y2020 y2021 i.dot" + +local filter = "${wages_f_prev_if_condition}" + +heckman $wage_eqn if `filter', select($seln_eqn) twostep mills(lambda) + +process_heckman, /// + process("W1fb_orig") /// + ifcond("`filter'") /// + savefile("Female_PW_sample") /// + graphsubtitle("Females, Previously observed wage") /// + wordfile("$dir_raw_results/wages/Output_WW.doc") /// + wordtitle("Heckman-corrected wage equation: women in employment last year") /// + wordctitle("Working women") /// + sheet2("W1fb_orig") sheet1("W1fb-sel_orig") /// + rmserow(4) +*/ #delimit ; global wage_eqn2 @@ -265,43 +370,40 @@ lwage_hour labWageHrlyLogL1 demAge demAgeSq -eduHighestC4LowL1 -eduHighestC4MediumL1 -eduHighestC4HighL1 -eduHighestC4LowL1_demAge -eduHighestC4MediumL1_demAge -eduHighestC4HighL1_demAge +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge eduHighestParentC3Medium -eduHighestParentC3High +eduHighestParentC3Low healthDsblLongtermFlag healthPhysicalPcsL1 healthMentalMcsL1 +$regions labPt realWageGrowth -$regions demYear2020 demYear2021 $ethnicity ; #delimit cr + #delimit ; global seln_eqn2 demAge demAgeSq -eduHighestC4LowL1 -eduHighestC4MediumL1 -eduHighestC4HighL1 -eduHighestC4LowL1_demAge -eduHighestC4MediumL1_demAge -eduHighestC4HighL1_demAge +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge eduHighestParentC3Medium -eduHighestParentC3High +eduHighestParentC3Low +demPartnerStatusPartnered +demDChild healthDsblLongtermFlag healthPhysicalPcsL1 healthMentalMcsL1 -demPartnerStatusPartnered -demNChild $regions demYear2020 demYear2021 @@ -326,7 +428,73 @@ process_heckman, /// /********************** WAGES: MEN, PREV WAGE OBSERVED ************************/ +/* +global wage_eqn "lwage_hour L1.lwage_hour dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 pt real_wage_growth y2020 y2021 i.dot" +global seln_eqn "dag dagsq ib1.deh_c4 ib1.deh_c4#c.dag i.dehmf_c3 mar child dlltsd01 l.dhe_pcs l.dhe_mcs ib8.drgn1 y2020 y2021 i.dot" + +local filter = "${wages_m_prev_if_condition}" + +heckman $wage_eqn if `filter', select($seln_eqn) twostep mills(lambda) + +process_heckman, /// + process("W1mb_orig") /// + ifcond("`filter'") /// + savefile("Male_PW_sample") /// + graphsubtitle("Male, Previously observed wage") /// + wordfile("$dir_raw_results/wages/Output_WM.doc") /// + wordtitle("Heckman-corrected wage equation: men in employment last year") /// + wordctitle("Working men") /// + sheet2("W1mb_orig") sheet1("W1mb-sel_orig") /// + rmserow(5) +*/ + * globals are the same as for women +#delimit ; +global wage_eqn2 +lwage_hour +labWageHrlyLogL1 +demAge +demAgeSq +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge +eduHighestParentC3Medium +eduHighestParentC3Low +healthDsblLongtermFlag +healthPhysicalPcsL1 +healthMentalMcsL1 +$regions +labPt +realWageGrowth +demYear2020 +demYear2021 +$ethnicity +; +#delimit cr + + +#delimit ; +global seln_eqn2 +demAge +demAgeSq +eduHighestC4Medium +eduHighestC4Low +eduHighestC4Medium_demAge +eduHighestC4Low_demAge +eduHighestParentC3Medium +eduHighestParentC3Low +demPartnerStatusPartnered +demDChild +healthDsblLongtermFlag +healthPhysicalPcsL1 +healthMentalMcsL1 +$regions +demYear2020 +demYear2021 +$ethnicity +; +#delimit cr local filter = "${wages_m_prev_if_condition}" diff --git a/input/InitialPopulations/compile/RegressionEstimates/09_reg_income.do b/input/InitialPopulations/compile/RegressionEstimates/09_reg_income.do index 09b16f0ad..800391305 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/09_reg_income.do +++ b/input/InitialPopulations/compile/RegressionEstimates/09_reg_income.do @@ -29,7 +29,7 @@ log using "${dir_log}/reg_income.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_income", sheet("Info") replace +putexcel set "$dir_results/reg_income", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "This file contains regression estimates used by processes I1 (capital income), I2 (private pension, retired last year), I3 (private pension income, not retired last year) " putexcel A2 = "Authors:" @@ -86,6 +86,21 @@ save "$dir_external_data\growth_rates", replace * Load data use "${estimation_sample2}", clear //panel with predicted wages +/*variable update +cap drop Ypnoab +gen Ypnoab= ypnoab +compare Ypnoab ypnoab + +cap drop Ypncp +gen Ypncp = ypncp +compare Ypncp ypncp + +gen Dhhtp_c4_CoupleNoChildren = (dhhtp_c4 == 1) if !missing(dhhtp_c4) +gen Dhhtp_c4_CoupleChildren = (dhhtp_c4 == 2) if !missing(dhhtp_c4) +gen Dhhtp_c4_SingleNoChildren = (dhhtp_c4 == 3) if !missing(dhhtp_c4) +gen Dhhtp_c4_SingleChildren = (dhhtp_c4 == 4) if !missing(dhhtp_c4) +*/ + * Merge in growth rates merge m:1 stm using "$dir_external_data/growth_rates", keep(3) nogen /// keepusing(real_wage_growth) @@ -99,6 +114,7 @@ sort idperson swv capture confirm variable labWageHrly if _rc == 0 { gen labWageHrlyL1 = l.labWageHrly + gen Hourly_wage = labWageHrly } @@ -113,43 +129,82 @@ do "${dir_do}/programs.do" /*************** I1a: PROBABILITY OF RECEIVEING CAPITAL INCOME ****************/ display "${i1a_if_condition}" - +/* +logit receives_ypncp /// + i.Ded i.Dgn c.Dag c.Dag_sq /// + l.Dhe_pcs l.Dhe_mcs /// + lc.Ypncp lc.Yplgrs_dv /// + l2c.Yplgrs_dv l2c.Ypncp /// + Ded_Dgn /*Ded_Dag Ded_Dag_sq*/ /// + l.Ded_Dhe_pcs l.Ded_Dhe_mcs /// + l.Ded_Ypncp l.Ded_Yplgrs_dv l2.Ded_Yplgrs_dv l2.Ded_Ypncp /// + i.Deh_c4_Low i.Deh_c4_Medium i.Deh_c4_High /// + li.Les_c4_Student li.Les_c4_NotEmployed li.Les_c4_Retired /// + li.Dhhtp_c4_CoupleChildren li.Dhhtp_c4_SingleNoChildren li.Dhhtp_c4_SingleChildren /// + $regions Year_transformed Y2020 Y2021 $ethnicity if /// + ${i1a_if_condition} [pw=${weight}], /// + vce(cluster idperson) base + +process_regression, domain("income") process("I1a") sheet("I1a_orig") /// + title("Process I1a: Prob. recieve capital income") /// + gofrow(3) goflabel("I1a - Receive capital income ") /// + ifcond("${i1a_if_condition}") probit + */ + logit receives_ypncp /// eduSampleFlag demMaleFlag demAge demAgeSq /// healthPhysicalPcsL1 healthMentalMcsL1 /// yCapitalPersMonthL1 yEmpPersGrossMonthL1 /// - yCapitalPersMonthL2 yEmpPersGrossMonthL2 /// + yEmpPersGrossMonthL2 yCapitalPersMonthL2 /// eduSampleFlag_Male /// eduSampleFlag_PcsL1 eduSampleFlag_McsL1 /// - eduSampleFlag_yCapitalPersL1 eduSampleFlag_yCapitalPersL2 eduSampleFlag_yEmpPersGrossL1 eduSampleFlag_yEmpPersGrossL2 /// - eduHighestC4LowL1 eduHighestC4MediumL1 eduHighestC4HighL1 /// + eduSampleFlag_yCapitalPersL1 eduSampleFlag_yEmpPersGrossL1 eduSampleFlag_yEmpPersGrossL2 eduSampleFlag_yCapitalPersL2 /// + eduHighestC4Low eduHighestC4Medium eduHighestC4High /// labStatusC4StudentL1 labStatusC4NotEmployedL1 labStatusC4RetiredL1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${i1a_if_condition} [pw=${weight}], vce(cluster idperson) base process_regression, domain("income") process("I1a") sheet("I1a") /// title("Process I1a: Prob. recieve capital income") /// gofrow(3) goflabel("I1a - Receive capital income ") /// ifcond("${i1a_if_condition}") probit - + /********************** I1b: AMOUNT OF CAPITAL INCOME *************************/ * DV: ypncp = Inverse hyperbolic sine (IHS) of gross capital income display "${i1b_if_condition}" +/* +reg ypncp i.Dgn c.Dag c.Dag_sq /// + i.Deh_c4_Low i.Deh_c4_Medium i.Deh_c4_High /// + li.Les_c4_Student li.Les_c4_NotEmployed li.Les_c4_Retired /// + li.Dhhtp_c4_CoupleChildren li.Dhhtp_c4_SingleNoChildren li.Dhhtp_c4_SingleChildren /// + l.Dhe_pcs l.Dhe_mcs /// + lc.Ypncp l2c.Ypncp lc.Yplgrs_dv l2c.Yplgrs_dv /// + Ded_Dgn /*Ded_Dag Ded_Dag_sq*/ /// + l.Ded_Ypncp l.Ded_Yplgrs_dv l2.Ded_Yplgrs_dv l2.Ded_Ypncp /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${i1b_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("income") process("I1b") sheet("I1b_orig") /// + title("Process I1b: Amount of capital income") /// + gofrow(7) goflabel("I1b - Amount of capital income") /// + ifcond("${i1b_if_condition}") +*/ + reg ypncp /// demMaleFlag demAge demAgeSq /// - eduHighestC4LowL1 eduHighestC4MediumL1 eduHighestC4HighL1 /// + eduHighestC4Low eduHighestC4Medium eduHighestC4High /// labStatusC4StudentL1 labStatusC4NotEmployedL1 labStatusC4RetiredL1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// yCapitalPersMonthL1 yCapitalPersMonthL2 /// - yEmpPersGrossMonthL1 yEmpPersGrossMonthL2 /// + yEmpPersGrossMonthL1 yEmpPersGrossMonthL2 /// eduSampleFlag_Male /// - eduSampleFlag_yCapitalPersL1 eduSampleFlag_yCapitalPersL2 eduSampleFlag_yEmpPersGrossL1 eduSampleFlag_yEmpPersGrossL2 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + eduSampleFlag_yCapitalPersL1 eduSampleFlag_yEmpPersGrossL1 eduSampleFlag_yEmpPersGrossL2 eduSampleFlag_yCapitalPersL2 /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${i1b_if_condition} [pw=${weight}], vce(cluster idperson) process_regression, domain("income") process("I1b") sheet("I1b") /// @@ -180,14 +235,28 @@ restore * pension income display "${i2b_if_condition}" +/* +reg ypnoab i.Dgn c.Dag /// + i.Deh_c4_High i.Deh_c4_Medium i.Deh_c4_Na /// + li.Dhhtp_c4_CoupleChildren li.Dhhtp_c4_SingleNoChildren li.Dhhtp_c4_SingleChildren /// + l.Dhe_pcs l.Dhe_mcs /// + lc.Ypnoab l2c.Ypnoab /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${i2b_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("income") process("I2b") sheet("I2b_orig") /// + title("Process I2b: Amount of private pension income, retired L1") /// + gofrow(11) goflabel("I2b - Amount of private pension income") /// + ifcond("${i2b_if_condition}") +*/ reg ypnoab /// - demAge demAgeSq /// + demMaleFlag demAge /// eduHighestC4High eduHighestC4Medium eduHighestC4Na /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// yPensPersGrossMonthL1 yPensPersGrossMonthL2 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${i2b_if_condition} [pw=${weight}], vce(cluster idperson) process_regression, domain("income") process("I2b") sheet("I2b") /// @@ -215,15 +284,31 @@ restore *Sample: Retired individuals who were not retired in the previous year. display "${i3a_if_condition}" +/* +logit receives_ypnoab /// + i.Dgn i.Reached_Retirement_Age /// + i.Deh_c4_High i.Deh_c4_Medium i.Deh_c4_Na /// + li.Les_c4_NotEmployed /// + li.Dhhtp_c4_CoupleChildren li.Dhhtp_c4_SingleNoChildren li.Dhhtp_c4_SingleChildren /// + l.Dhe_pcs l.Dhe_mcs /// + l.Hourly_wage /// + $regions Year_transformed Y2020 Y2021 $ethnicity if /// + ${i3a_if_condition} [pw=${weight}], vce(cluster idperson) base + +process_regression, domain("income") process("I3a") sheet("I3a_orig") /// + title("Process I3a: Amount of private pension income, not retired L1") /// + gofrow(15) goflabel("I3a - Receive private pension income ") /// + ifcond("${i3a_if_condition}") probit +*/ logit receives_ypnoab /// demMaleFlag demPensAgeFlag /// eduHighestC4High eduHighestC4Medium eduHighestC4Na /// labStatusC4NotEmployedL1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// labWageHrlyL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${i3a_if_condition} [pw=${weight}], vce(cluster idperson) base process_regression, domain("income") process("I3a") sheet("I3a") /// @@ -239,15 +324,30 @@ process_regression, domain("income") process("I3a") sheet("I3a") /// *pension income display "${i3b_if_condition}" +/* +reg ypnoab i.Dgn c.Dag /// + i.Deh_c4_High i.Deh_c4_Medium i.Deh_c4_Na /// + li.Les_c4_NotEmployed /// + li.Dhhtp_c4_CoupleChildren li.Dhhtp_c4_SingleNoChildren li.Dhhtp_c4_SingleChildren /// + l.Dhe_pcs l.Dhe_mcs /// + l.Hourly_wage /// + $regions Year_transformed Y2020 Y2021 $ethnicity /// + if ${i3b_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("income") process("I3b") sheet("I3b_orig") /// + title("Process I3b: Amount of private pension income, retired L1") /// + gofrow(19) goflabel("I3b - Amount of private pension income") /// + ifcond("${i3b_if_condition}") + */ reg ypnoab /// demMaleFlag demAge /// eduHighestC4High eduHighestC4Medium eduHighestC4Na /// labStatusC4NotEmployedL1 /// - demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4L1SingleChL1 /// + demCompHhC4CoupleChL1 demCompHhC4SingleNoChL1 demCompHhC4SingleChL1 /// healthPhysicalPcsL1 healthMentalMcsL1 /// labWageHrlyL1 /// - $regions demYear demYear2020 demYear2021 $ethnicity /// + $regions demYearTransformed demYear2020 demYear2021 $ethnicity /// if ${i3b_if_condition} [pw=${weight}], vce(cluster idperson) process_regression, domain("income") process("I3b") sheet("I3b") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/10_reg_socialcare.do b/input/InitialPopulations/compile/RegressionEstimates/10_reg_socialcare.do index d8add75dc..0fb095d5a 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/10_reg_socialcare.do +++ b/input/InitialPopulations/compile/RegressionEstimates/10_reg_socialcare.do @@ -63,7 +63,7 @@ log using "${dir_log}/reg_socialcare.log", replace /********************************* SET EXCEL FILE *****************************/ -putexcel set "$dir_results/reg_socialcare", sheet("Info") replace +putexcel set "$dir_results/reg_socialcare", sheet("Info") modify //replace putexcel A1 = "Description:", bold putexcel B1 = "Model parameters for social care module" putexcel A2 = "Authors:" @@ -134,6 +134,25 @@ table stm, c(count provide_informal_care mean provide_informal_care) /************************ Probit need care (S2a) ******************************/ +display "${s2a_if_condition}" +/* +probit NeedCare /// + NeedCare_L1 /// + Dgn /// + Age67to68 Age69to70 Age71to72 Age73to74 Age75to76 /// + Age77to78 Age79to80 Age81to82 Age83to84 Age85plus /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Partnered /// + Deh_c4_Medium Deh_c4_Low /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s2a_if_condition} [pw=${weight}], vce(r) + +process_regression, domain("socialcare") process("S2a") sheet("S2a_orig") /// + title("Process S2a: Prob. need care") /// + gofrow(3) goflabel("S2a - Need care") /// + ifcond("${s2a_if_condition}") probit +*/ + probit careNeedFlag /// careNeedFlagL1 /// @@ -142,8 +161,8 @@ probit careNeedFlag /// demAge77to78 demAge79to80 demAge81to82 demAge83to84 demAge85plus /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// demPartnerStatusPartnered /// - eduHighestC4Low eduHighestC4Medium /// - $regions demYear2020 demYear2021 $ethnicity /// + eduHighestC4Medium eduHighestC4Low /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s2a_if_condition} [pw=${weight}], vce(r) process_regression, domain("socialcare") process("S2a") sheet("S2a") /// @@ -153,7 +172,26 @@ process_regression, domain("socialcare") process("S2a") sheet("S2a") /// /************************ Probit receive care (S2b) ***************************/ - +display "${s2b_if_condition}" +/* +probit ReceiveCare /// + ReceiveCare_L1 /// + Dgn /// + Age67to68 Age69to70 Age71to72 Age73to74 Age75to76 /// + Age77to78 Age79to80 Age81to82 Age83to84 Age85plus /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Partnered /// + Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s2b_if_condition} [pw=${weight}], vce(r) + +process_regression, domain("socialcare") process("S2b") sheet("S2b_orig") /// + title("Process S2b: Prob. receive care") /// + gofrow(7) goflabel("S2b - Receive care") /// + ifcond("${s2b_if_condition}") probit + */ + probit careReceivedFlag /// careReceivedFlagL1 /// demMaleFlag /// @@ -161,9 +199,9 @@ probit careReceivedFlag /// demAge77to78 demAge79to80 demAge81to82 demAge83to84 demAge85plus /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// demPartnerStatusPartnered /// - eduHighestC4Low eduHighestC4Medium /// + eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s2b_if_condition} [pw=${weight}], vce(r) process_regression, domain("socialcare") process("S2b") sheet("S2b") /// @@ -173,11 +211,30 @@ process_regression, domain("socialcare") process("S2b") sheet("S2b") /// /************************ Mlogit formal/informal (S2c) ************************/ + +display "${s2c_if_condition}" /* Informal is base outcome Mixed is 1st outcome Formal is 2nd outcomes */ +/* +mlogit CareMarket CareMarketFormal_L1 CareMarketInformal_L1 CareMarketMixed_L1 Dgn /// + Age67to68 Age69to70 Age71to72 Age73to74 Age75to76 /// + Age77to78 Age79to80 Age81to82 Age83to84 Age85plus /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Partnered /// + Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s2c_if_condition} [pw=${weight}], vce(r) base(2) + +process_gologit, domain("socialcare") process("S2c") sheet("S2c_orig") /// + title("Process S2c: Formal vs Informal") /// + gofrow(11) goflabel("S2c - Formal vs Informal") /// + outcomes(3) /// + ifcond("${s2c_if_condition}") +*/ mlogit CareMarket /// careMarketFormalL1 careMarketInformalL1 careMarketMixedL1 /// @@ -186,9 +243,9 @@ mlogit CareMarket /// demAge77to78 demAge79to80 demAge81to82 demAge83to84 demAge85plus /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// demPartnerStatusPartnered /// - eduHighestC4Low eduHighestC4Medium /// + eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s2c_if_condition} [pw=${weight}], vce(r) base(2) process_gologit, domain("socialcare") process("S2c") sheet("S2c") /// @@ -199,6 +256,22 @@ process_gologit, domain("socialcare") process("S2c") sheet("S2c") /// /******************** OLS informal care hours received (S2d) ******************/ +display "${s2d_if_condition}" +/* +reg HrsReceivedInformalIHS HrsReceivedInformalIHS_L1 CareMarketMixed Dgn /// + Age AgeSquared /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Partnered /// + Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} /*${ethnicity} Ethn_White*/ /// + if ${s2d_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S2d") sheet("S2d_orig") /// + title("Process S2d: Informal care hours received") /// + gofrow(15) goflabel("S2d - Hours of informal care received") /// + ifcond("${s2d_if_condition}") +*/ reg careHrsInformalIhs /// careHrsInformalIhsL1 /// @@ -207,9 +280,9 @@ reg careHrsInformalIhs /// demAge demAgeSq /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// demPartnerStatusPartnered /// - eduHighestC4Low eduHighestC4Medium /// + eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 /*$ethnicity*/ /// + demYear2020 demYear2021 $regions /*$ethnicity*/ /// if ${s2d_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S2d") sheet("S2d") /// @@ -236,16 +309,31 @@ putexcel A9 = ("S2d") B9 = (rmse) restore /********************* OLS formal care hours received (S2e) *******************/ - +display "${s2e_if_condition}" +/* +reg HrsReceivedFormalIHS HrsReceivedFormalIHS_L1 CareMarketMixed Dgn /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Partnered /// + Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s2e_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S2e") sheet("S2e_orig") /// + title("Process S2e: Formal care hours received") /// + gofrow(19) goflabel("S2e - Hours of formal care received") /// + ifcond("${s2e_if_condition}") + */ + reg careHrsFormalIhs /// careHrsFormalIhsL1 /// careMarketMixed /// demMaleFlag /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// demPartnerStatusPartnered /// - eduHighestC4Low eduHighestC4Medium /// + eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s2e_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S2e") sheet("S2e") /// @@ -273,6 +361,23 @@ restore /***************** Probit provide care, Singles (S3a) *************************/ +display "${s3a_if_condition}" +/* +probit ProvideCare ProvideCare_L1 NeedCare ReceiveCare Dgn /// + Age30to34 Age35to39 Age40to44 Age45to49 Age50to54 /// + Age55to59 Age60to64 Age65to69 Age70to74 Age75to79 Age80to84 Age85plus /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Deh_c4_High Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s3a_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S3a") sheet("S3a_orig") /// + title("Process S3a: Prob. provide care, Singles") /// + gofrow(23) goflabel("S3a - Provide care, Singles") /// + ifcond("${s3a_if_condition}") probit +*/ + probit careProvidedFlag /// careProvidedFlagL1 /// careNeedFlag careReceivedFlag /// @@ -280,9 +385,9 @@ probit careProvidedFlag /// demAge30to34 demAge35to39 demAge40to44 demAge45to49 demAge50to54 /// demAge55to59 demAge60to64 demAge65to69 demAge70to74 demAge75to79 demAge80to84 demAge85plus /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// - eduHighestC4Low eduHighestC4Medium eduHighestC4High /// + eduHighestC4High eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s3a_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S3a") sheet("S3a") /// @@ -298,6 +403,23 @@ tab CareMarket ProvideCare if ${s3b_if_condition} tab deh_c4 ProvideCare if ${s3b_if_condition} deh_c4 =0 is excluded because there's just 1 obs providing care and probit would not converge */ +display "${s3b_if_condition}" +/* +capture drop in_sample p +probit ProvideCare ProvideCare_L1 NeedCare ReceiveCare Dgn /// + ReceiveCarePartner CareMarketFormalPartner CareMarketInformalPartner CareMarketMixedPartner /// + Dhe_Poor Dhe_Fair Dhe_Good Dhe_VeryGood /// + Dhesp_Fair Dhesp_Good Dhesp_VeryGood Dhesp_Excellent /// + Deh_c4_High Deh_c4_Medium /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s3b_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S3b") sheet("S3b_orig") /// + title("Process S3b: Prob. provide care, Partnered") /// + gofrow(27) goflabel("S3b - Provide care, Partnered") /// + ifcond("${s3b_if_condition}") probit +*/ //capture drop in_sample p probit careProvidedFlag /// @@ -305,11 +427,11 @@ probit careProvidedFlag /// careNeedFlag careReceivedFlag /// demMaleFlag /// careReceivedPartnerFlag careMarketFormalPartner careMarketInformalPartner careMarketMixedPsrtner /// - healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// - healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcellent /// - eduHighestC4Medium eduHighestC4High /// + healthSelfRatedPoor healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood /// + healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcel /// + eduHighestC4High eduHighestC4Medium /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s3b_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S3b") sheet("S3b") /// @@ -317,20 +439,35 @@ process_regression, domain("socialcare") process("S3b") sheet("S3b") /// gofrow(27) goflabel("S3b - Provide care, Partnered") /// ifcond("${s3b_if_condition}") probit - - + /******************* OLS care hours provided, Singles (S3c) ******************/ - +display "${s3c_if_condition}" +/* +reg HrsProvidedInformalIHS HrsProvidedInformalIHS_L1 Dgn /// + Age20to24 Age25to29 Age30to34 Age35to39 Age40to44 Age45to49 Age50to54 /// + Age55to59 Age60to64 Age65to69 Age70to74 Age75to79 Age80to84 Age85plus /// + Dhe_Fair Dhe_Good Dhe_VeryGood Dhe_Excellent /// + Deh_c4_High Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s3c_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S3c") sheet("S3c_orig") /// + title("Process S3c: Informal care hours provided, Singles") /// + gofrow(31) goflabel("S3c - Hours of informal care provided, Singles") /// + ifcond("${s3c_if_condition}") + */ + reg careHrsProvidedWeekIhs /// careHrsProvidedWeekIhsL1 /// demMaleFlag /// demAge20to24 demAge25to29 demAge30to34 demAge35to39 demAge40to44 demAge45to49 demAge50to54 /// demAge55to59 demAge60to64 demAge65to69 demAge70to74 demAge75to79 demAge80to84 demAge85plus /// healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// - eduHighestC4Low eduHighestC4Medium eduHighestC4High /// + eduHighestC4High eduHighestC4Medium eduHighestC4Low /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s3c_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S3c") sheet("S3c") /// @@ -357,6 +494,24 @@ restore /****************** OLS care hours provided, Partnered (S3d) *****************/ +display "${s3d_if_condition}" +/* +reg HrsProvidedInformalIHS HrsProvidedInformalIHS_L1 Dgn /// + Age20to24 Age25to29 Age30to34 Age35to39 Age40to44 Age45to49 Age50to54 /// + Age55to59 Age60to64 Age65to69 Age70to74 Age75to79 Age80to84 Age85plus /// + ReceiveCarePartner CareMarketFormalPartner CareMarketInformalPartner CareMarketMixedPartner /// + Dhe_Poor Dhe_Fair Dhe_Good Dhe_VeryGood /// + Dhesp_Fair Dhesp_Good Dhesp_VeryGood Dhesp_Excellent /// + Deh_c4_High Deh_c4_Medium Deh_c4_Low /// + HHincomeQ2 HHincomeQ3 HHincomeQ4 HHincomeQ5 /// + Y2020 Y2021 ${regions} ${ethnicity} /// + if ${s3d_if_condition} [pweight=${weight}], vce(r) + +process_regression, domain("socialcare") process("S3d") sheet("S3d_orig") /// + title("Process S3d: Informal care hours provided, Partnered") /// + gofrow(35) goflabel("S3d - Hours of informal care provided, Partnered") /// + ifcond("${s3d_if_condition}") + */ reg careHrsProvidedWeekIhs /// careHrsProvidedWeekIhsL1 /// @@ -364,11 +519,11 @@ reg careHrsProvidedWeekIhs /// demAge20to24 demAge25to29 demAge30to34 demAge35to39 demAge40to44 demAge45to49 demAge50to54 /// demAge55to59 demAge60to64 demAge65to69 demAge70to74 demAge75to79 demAge80to84 demAge85plus /// careReceivedPartnerFlag careMarketFormalPartner careMarketInformalPartner careMarketMixedPsrtner /// - healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent /// - healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcellent /// - eduHighestC4Low eduHighestC4Medium eduHighestC4High /// + healthSelfRatedPoor healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood /// + healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcel /// + eduHighestC4High eduHighestC4Medium /// yHhQuintilesMonthC5Q2 yHhQuintilesMonthC5Q3 yHhQuintilesMonthC5Q4 yHhQuintilesMonthC5Q5 /// - $regions demYear2020 demYear2021 $ethnicity /// + demYear2020 demYear2021 $regions $ethnicity /// if ${s3d_if_condition} [pweight=${weight}], vce(r) process_regression, domain("socialcare") process("S3d") sheet("S3d") /// diff --git a/input/InitialPopulations/compile/RegressionEstimates/programs.do b/input/InitialPopulations/compile/RegressionEstimates/programs.do index 5800889ed..b67ca6e6a 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/programs.do +++ b/input/InitialPopulations/compile/RegressionEstimates/programs.do @@ -195,6 +195,14 @@ void export_labels_gologit(string scalar domain, string scalar sheet) { // Add category suffix only for non-prop odds vars (unique_flag == 1) labels_no_bl = labels_no_bl :+ (("_" :+ catnames_no_bl) :* (unique_flag[1::rows(labels_no_bl)] :== 1)) + + // Add _ to end end of vars with common coefs + real matrix is_unique, is_common + is_common = (unique_flag[1::rows(labels_no_bl)] :== 0) + + labels_no_bl = labels_no_bl :+ ( + (("_") :* is_common) + ) // Filter by structure final_labels = select(labels_no_bl, structure[1::rows(labels_no_bl)] :== 1) diff --git a/input/InitialPopulations/compile/RegressionEstimates/variable_update.do b/input/InitialPopulations/compile/RegressionEstimates/variable_update.do index c0c32fe92..4ef9f9b6e 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/variable_update.do +++ b/input/InitialPopulations/compile/RegressionEstimates/variable_update.do @@ -21,6 +21,7 @@ foreach var in idhh idperson idpartner idfather idmother dct drgn1 dwt dnc02 dnc xtset idperson swv sort idperson swv + *================================================== * Student flag *================================================== @@ -31,27 +32,86 @@ replace Dst = 1 if les_c3 == 2 replace Dst = . if les_c3 == . *================================================== -* Age transformations +* In first education spell +*================================================== +gen Ded = ded +gen eduSampleFlag = ded +gen eduSampleFlagL1 = l.ded + + +*================================================== +* Sex and Age transformations *================================================== -gen Dag = dag +/*--------------------------------------------------*/ +/* Sex */ +/*--------------------------------------------------*/ + +gen Dgn = dgn +gen demMaleFlag = dgn + + +/*--------------------------------------------------*/ +/* Raw age variables */ +/*--------------------------------------------------*/ + +gen Dag = dag gen Dag_sq = dagsq + gen Age = dag -gen AgeSquared = dag^2 +gen AgeSquared = dag^2 if !missing(dag) + +gen demAge = dag +gen demAgeSq = dagsq + + +/*--------------------------------------------------*/ +/* Centered age terms */ +/*--------------------------------------------------*/ + +gen Dag_c = dag - 23 if !missing(dag) +gen Dag_c_sq = Dag_c^2 if !missing(Dag_c) -gen Dag_c = dag - 23 -gen Dag_c_sq = Dag_c^2 -gen Dag_post25 = (dag > 25) * (dag - 25) +/*--------------------------------------------------*/ +/* Piecewise linear age terms */ +/*--------------------------------------------------*/ -gen Dag_post21 = (dag > 21) * (dag - 21) -gen Dag_post18_sq = (dag > 18) * (dag - 18)^2 -gen Dag_post21_sq = (dag > 21) * (dag - 21)^2 -gen Dag_post25_sq = (dag > 25) * (dag - 25)^2 -gen Dag_post26_sq = (dag > 26) * (dag - 26)^2 +gen Dag_post21 = (dag > 21) * (dag - 21) if !missing(dag) +gen Dag_post25 = (dag > 25) * (dag - 25) if !missing(dag) + + +/*--------------------------------------------------*/ +/* Piecewise quadratic age terms */ +/*--------------------------------------------------*/ + +gen Dag_post18_sq = (dag > 18) * (dag - 18)^2 if !missing(dag) +gen Dag_post21_sq = (dag > 21) * (dag - 21)^2 if !missing(dag) +gen Dag_post25_sq = (dag > 25) * (dag - 25)^2 if !missing(dag) +gen Dag_post26_sq = (dag > 26) * (dag - 26)^2 if !missing(dag) + + +/*--------------------------------------------------*/ +/* Restricted cubic splines */ +/*--------------------------------------------------*/ mkspline rcs = dag, cubic knots(18 21 23 26) + +/*--------------------------------------------------*/ +/* Pension age eligibility */ +/*--------------------------------------------------*/ + +gen Elig_pen = dagpns +gen Elig_pen_L1 = L1.dagpns + +gen Reached_Retirement_Age = dagpns +gen Reached_Retirement_Age_Sp = dagpns_sp + +gen demPensAgeFlag = dagpns +gen demPensPartnerAgeFlag = dagpns_sp + + *================================================== * Time transformations *================================================== @@ -73,33 +133,153 @@ gen Year_transformed = stm gen Year = stm gen YearSquared = stm^2 -*================================================== -* Income variables -*================================================== +*refactored -gen receives_ypncp = ypncp > 0 & !missing(ypncp) //capital income +gen demYearTransformed = stm -gen receives_ypnoab = ypnoab > 0 & !missing(ypnoab) //private pension income +gen demYear= stm +foreach y of numlist 11/25 { + gen demYear20`y' = (demYear == `y') + } -recode ynbcpdf_dv (-999 = .) +/*==================================================*/ +/* INCOME */ +/*==================================================*/ -tab ydses_c5 , gen(Ydses_c5_Q) +/*--------------------------------------------------*/ +/* Raw income variables */ +/*--------------------------------------------------*/ -*================================================== -* Education recoding -*================================================== -cap drop deh_c3_recoded -recode deh_c3 (1 = 3) (3 = 1), gen(deh_c3_recoded) +gen Ydses_c5 = ydses_c5 + +gen Ypncp = ypncp +gen Ypnoab = ypnoab +gen Yplgrs_dv = yplgrs_dv +gen Ypnbihs_dv = ypnbihs_dv +gen Ypnbihs_dv_sq = ypnbihs_dv^2 if !missing(ypnbihs_dv) +gen Ynbcpdf_dv = ynbcpdf_dv +gen Yptciihs_dv = yptciihs_dv + + +/*--------------------------------------------------*/ +/* Income receipt indicators */ +/*--------------------------------------------------*/ + +gen receives_ypncp = (ypncp > 0) if !missing(ypncp) +gen receives_ypnoab = (ypnoab > 0) if !missing(ypnoab) + + +/*--------------------------------------------------*/ +/* Household income quintiles */ +/*--------------------------------------------------*/ + +gen Ydses_c5_Q1 = (ydses_c5 == 1) if !missing(ydses_c5) +gen Ydses_c5_Q2 = (ydses_c5 == 2) if !missing(ydses_c5) +gen Ydses_c5_Q3 = (ydses_c5 == 3) if !missing(ydses_c5) +gen Ydses_c5_Q4 = (ydses_c5 == 4) if !missing(ydses_c5) +gen Ydses_c5_Q5 = (ydses_c5 == 5) if !missing(ydses_c5) + +gen L_Ydses_c5 = L1.ydses_c5 + +gen L_Ydses_c5_Q1 = (L1.ydses_c5 == 1) if !missing(L1.ydses_c5) +gen L_Ydses_c5_Q2 = (L1.ydses_c5 == 2) if !missing(L1.ydses_c5) +gen L_Ydses_c5_Q3 = (L1.ydses_c5 == 3) if !missing(L1.ydses_c5) +gen L_Ydses_c5_Q4 = (L1.ydses_c5 == 4) if !missing(L1.ydses_c5) +gen L_Ydses_c5_Q5 = (L1.ydses_c5 == 5) if !missing(L1.ydses_c5) + +gen yHhQuintilesMonthC5 = ydses_c5 + +gen yHhQuintilesMonthC5Q1 = (ydses_c5 == 1) if !missing(ydses_c5) +gen yHhQuintilesMonthC5Q2 = (ydses_c5 == 2) if !missing(ydses_c5) +gen yHhQuintilesMonthC5Q3 = (ydses_c5 == 3) if !missing(ydses_c5) +gen yHhQuintilesMonthC5Q4 = (ydses_c5 == 4) if !missing(ydses_c5) +gen yHhQuintilesMonthC5Q5 = (ydses_c5 == 5) if !missing(ydses_c5) + +gen yHhQuintilesMonthC5L1 = L1.ydses_c5 + +gen yHhQuintilesMonthC5Q1L1 = (L1.ydses_c5 == 1) if !missing(L1.ydses_c5) +gen yHhQuintilesMonthC5Q2L1 = (L1.ydses_c5 == 2) if !missing(L1.ydses_c5) +gen yHhQuintilesMonthC5Q3L1 = (L1.ydses_c5 == 3) if !missing(L1.ydses_c5) +gen yHhQuintilesMonthC5Q4L1 = (L1.ydses_c5 == 4) if !missing(L1.ydses_c5) +gen yHhQuintilesMonthC5Q5L1 = (L1.ydses_c5 == 5) if !missing(L1.ydses_c5) + + +/*--------------------------------------------------*/ +/* Continuous income variables */ +/*--------------------------------------------------*/ + +gen yNonBenPersGrossMonth = Ypnbihs_dv +gen yNonBenPersGrossMonthL1 = L1.Ypnbihs_dv + +gen yPersAndPartnerGrossDiffMonth = Ynbcpdf_dv +gen yPersAndPartnerGrossDiffMonthL1 = L1.Ynbcpdf_dv + + +/*--------------------------------------------------*/ +/* Capital income */ +/*--------------------------------------------------*/ + +sum ypncp, detail + +scalar p99 = r(p99) + +replace ypncp = . if ypncp >= p99 & !missing(ypncp) +replace Ypncp = . if Ypncp >= p99 & !missing(Ypncp) + + +gen yCapitalPersMonth = ypncp +gen yCapitalPersMonthL1 = L1.ypncp +gen yCapitalPersMonthL2 = L2.ypncp + + +/*--------------------------------------------------*/ +/* Employment income */ +/*--------------------------------------------------*/ + +gen yEmpPersGrossMonth = yplgrs_dv + +gen yEmpPersGrossMonthL1 = L1.yplgrs_dv +gen yEmpPersGrossMonthL2 = L2.yplgrs_dv +gen yEmpPersGrossMonthL3 = L3.yplgrs_dv -cap lab define deh_c3_recoded 1 "Low" 2 "Medium" 3 "High" -label values deh_c3_recoded deh_c3_recoded + +/*--------------------------------------------------*/ +/* Pension income */ +/*--------------------------------------------------*/ + +sum ypnoab, detail + +scalar p99 = r(p99) + +replace ypnoab = . if ypnoab >= p99 & !missing(ypnoab) +replace Ypnoab = . if Ypnoab >= p99 & !missing(Ypnoab) + +gen yPensPersGrossMonth = ypnoab +gen yPensPersGrossMonthL1 = L1.ypnoab +gen yPensPersGrossMonthL2 = L2.ypnoab + + +/*--------------------------------------------------*/ +/* Miscellaneous income */ +/*--------------------------------------------------*/ + +gen yMiscPersGrossMonth = yptciihs_dv +gen yMiscPersGrossMonthL1 = L1.yptciihs_dv + + +/*--------------------------------------------------*/ +/* Housing wealth */ +/*--------------------------------------------------*/ + +gen Dhh_owned = dhh_owned + +gen wealthPrptyFlag = dhh_owned +gen wealthPrptyFlagL1 = L1.dhh_owned *================================================== * Region dummies *================================================== - -gen Dgn = dgn tab drgn1, gen(UK) rename UK1 UKC @@ -115,241 +295,692 @@ rename UK10 UKL rename UK11 UKM rename UK12 UKN -*================================================== -* Employment dummies -*================================================== +*refactored +gen demRgn = drgn1 + +tab drgn1, gen(demRgn_) + +rename demRgn_1 demRgnUKC +rename demRgn_2 demRgnUKD +rename demRgn_3 demRgnUKE +rename demRgn_4 demRgnUKF +rename demRgn_5 demRgnUKG +rename demRgn_6 demRgnUKH +rename demRgn_7 demRgnUKI +rename demRgn_8 demRgnUKJ +rename demRgn_9 demRgnUKK +rename demRgn_10 demRgnUKL +rename demRgn_11 demRgnUKM +rename demRgn_12 demRgnUKN + + +*================================================== +* Employment dummies +*================================================== + +/*-------------------------------------------------- +Own labour status C3 +--------------------------------------------------*/ +gen Les_c3 = les_c3 +gen L1les_c3 = l.les_c3 + +gen Les_c3_Employed = (les_c3 == 1) if !missing(les_c3) +gen Les_c3_Student = (les_c3 == 2) if !missing(les_c3) +gen Les_c3_NotEmployed = (les_c3 == 3) if !missing(les_c3) + +gen labStatusC3 = les_c3 +gen labStatusC3L1 = L1.les_c3 + +gen labStatusC3Employed = (les_c3 == 1) if !missing(les_c3) +gen labStatusC3Student = (les_c3 == 2) if !missing(les_c3) +gen labStatusC3NotEmployed = (les_c3 == 3) if !missing(les_c3) + +gen labStatusC3EmployedL1 = (L1.les_c3 == 1) if !missing(L1.les_c3) +gen labStatusC3StudentL1 = (L1.les_c3 == 2) if !missing(L1.les_c3) +gen labStatusC3NotEmployedL1 = (L1.les_c3 == 3) if !missing(L1.les_c3) + + +/*-------------------------------------------------- +Partner labour status C3 +--------------------------------------------------*/ + +gen Lessp_c3_Employed = (lessp_c3 == 1) if !missing(lessp_c3) +gen Lessp_c3_Student = (lessp_c3 == 2) if !missing(lessp_c3) +gen Lessp_c3_NotEmployed = (lessp_c3 == 3) if !missing(lessp_c3) + +gen labStatusPartnerC3 = lessp_c3 +gen labStatusPartnerC3L1 = L1.lessp_c3 + +gen labStatusPartnerC3Employed = (lessp_c3 == 1) if !missing(lessp_c3) +gen labStatusPartnerC3Student = (lessp_c3 == 2) if !missing(lessp_c3) +gen labStatusPartnerC3NotEmployed = (lessp_c3 == 3) if !missing(lessp_c3) + +gen labStatusPartnerC3EmployedL1 = (L1.lessp_c3 == 1) if !missing(L1.lessp_c3) +gen labStatusPartnerC3StudentL1 = (L1.lessp_c3 == 2) if !missing(L1.lessp_c3) +gen labStatusPartnerC3NotEmployedL1 = (L1.lessp_c3 == 3) if !missing(L1.lessp_c3) + + +/*-------------------------------------------------- +Own labour status C4 +--------------------------------------------------*/ + +gen Les_c4 = les_c4 +gen Les_c4_Employed = (les_c4 == 1) if !missing(les_c4) +gen Les_c4_Student = (les_c4 == 2) if !missing(les_c4) +gen Les_c4_NotEmployed = (les_c4 == 3) if !missing(les_c4) +gen Les_c4_Retired = (les_c4 == 4) if !missing(les_c4) + +/* lagged */ +gen L_Les_c4 = L1.les_c4 +gen L_Les_c4_Employed = (L1.les_c4 == 1) if !missing(L1.les_c4) +gen L_Les_c4_Student = (L1.les_c4 == 2) if !missing(L1.les_c4) +gen L_Les_c4_NotEmployed = (L1.les_c4 == 3) if !missing(L1.les_c4) +gen L_Les_c4_Retired = (L1.les_c4 == 4) if !missing(L1.les_c4) + +gen labStatusC4 = les_c4 +gen labStatusC4L1 = L1.les_c4 + +gen labStatusC4Employed = (les_c4 == 1) if !missing(les_c4) +gen labStatusC4Student = (les_c4 == 2) if !missing(les_c4) +gen labStatusC4NotEmployed = (les_c4 == 3) if !missing(les_c4) +gen labStatusC4Retired = (les_c4 == 4) if !missing(les_c4) + +gen labStatusC4EmployedL1 = (L1.les_c4 == 1) if !missing(L1.les_c4) +gen labStatusC4StudentL1 = (L1.les_c4 == 2) if !missing(L1.les_c4) +gen labStatusC4NotEmployedL1 = (L1.les_c4 == 3) if !missing(L1.les_c4) +gen labStatusC4RetiredL1 = (L1.les_c4 == 4) if !missing(L1.les_c4) + + +/*-------------------------------------------------- +Joint labour status +--------------------------------------------------*/ +gen Lesdf_c4 = lesdf_c4 +gen Lesdf_c4_BothEmployed = (lesdf_c4 == 1) if !missing(lesdf_c4) +gen Lesdf_c4_EmpSpouseNotEmp = (lesdf_c4 == 2) if !missing(lesdf_c4) +gen Lesdf_c4_NotEmpSpouseEmp = (lesdf_c4 == 3) if !missing(lesdf_c4) +gen Lesdf_c4_BothNotEmployed = (lesdf_c4 == 4) if !missing(lesdf_c4) + +gen labStatusPartnerAndOwnC4 = lesdf_c4 +gen labStatusPartnerAndOwnC4L1 = L1.lesdf_c4 + +gen labStatusPartnerAndOwnC41 = (lesdf_c4 == 1) if !missing(lesdf_c4) +gen labStatusPartnerAndOwnC42 = (lesdf_c4 == 2) if !missing(lesdf_c4) +gen labStatusPartnerAndOwnC43 = (lesdf_c4 == 3) if !missing(lesdf_c4) +gen labStatusPartnerAndOwnC44 = (lesdf_c4 == 4) if !missing(lesdf_c4) + +gen labStatusPartnerAndOwnC41L1 = (L1.lesdf_c4 == 1) if !missing(L1.lesdf_c4) +gen labStatusPartnerAndOwnC42L1 = (L1.lesdf_c4 == 2) if !missing(L1.lesdf_c4) +gen labStatusPartnerAndOwnC43L1 = (L1.lesdf_c4 == 3) if !missing(L1.lesdf_c4) +gen labStatusPartnerAndOwnC44L1 = (L1.lesdf_c4 == 4) if !missing(L1.lesdf_c4) + + +/*-------------------------------------------------- +Interactions with sex +--------------------------------------------------*/ + +gen labStatusC4Employed_Male = Dgn * labStatusC4Employed +gen labStatusC4Student_Male = Dgn * labStatusC4Student +gen labStatusC4NotEmployed_Male = Dgn * labStatusC4NotEmployed +gen labStatusC4Retired_Male = Dgn * labStatusC4Retired + +gen labStatusC4Employed_MaleL1 = L1.labStatusC4Employed_Male +gen labStatusC4Student_MaleL1 = L1.labStatusC4Student_Male +gen labStatusC4NotEmployed_MaleL1 = L1.labStatusC4NotEmployed_Male +gen labStatusC4Retired_MaleL1 = L1.labStatusC4Retired_Male + + +*================================================== +* Education dummies +*================================================== + +/*-------------------------------------------------- +Education recoding C3 +--------------------------------------------------*/ +cap drop deh_c3_recoded +recode deh_c3 (1 = 3) (3 = 1), gen(deh_c3_recoded) + +cap lab define deh_c3_recoded 1 "Low" 2 "Medium" 3 "High" +label values deh_c3_recoded deh_c3_recoded + + +/*-------------------------------------------------- +Own education C3 +--------------------------------------------------*/ + +gen eduHighestC3 = deh_c3 +gen eduHighestC3L1 = L1.deh_c3 + +gen eduHighestC3High = (deh_c3 == 1) if !missing(deh_c3) +gen eduHighestC3Medium = (deh_c3 == 2) if !missing(deh_c3) +gen eduHighestC3Low = (deh_c3 == 3) if !missing(deh_c3) + +gen eduHighestC3HighL1 = (L1.deh_c3 == 1) if !missing(L1.deh_c3) +gen eduHighestC3MediumL1 = (L1.deh_c3 == 2) if !missing(L1.deh_c3) +gen eduHighestC3LowL1 = (L1.deh_c3 == 3) if !missing(L1.deh_c3) + + +/*-------------------------------------------------- +Own education C4 +--------------------------------------------------*/ +gen Deh_c4_Na = (deh_c4 == 0) if !missing(deh_c4) +gen Deh_c4_High = (deh_c4 == 1) if !missing(deh_c4) +gen Deh_c4_Medium = (deh_c4 == 2) if !missing(deh_c4) +gen Deh_c4_Low = (deh_c4 == 3) if !missing(deh_c4) + +gen eduHighestC4 = deh_c4 +gen eduHighestC4L1 = L1.deh_c4 + +gen eduHighestC4Na = (deh_c4 == 0) if !missing(deh_c4) +gen eduHighestC4High = (deh_c4 == 1) if !missing(deh_c4) +gen eduHighestC4Medium = (deh_c4 == 2) if !missing(deh_c4) +gen eduHighestC4Low = (deh_c4 == 3) if !missing(deh_c4) + +gen eduHighestC4NaL1 = (L1.deh_c4 == 0) if !missing(L1.deh_c4) +gen eduHighestC4HighL1 = (L1.deh_c4 == 1) if !missing(L1.deh_c4) +gen eduHighestC4MediumL1 = (L1.deh_c4 == 2) if !missing(L1.deh_c4) +gen eduHighestC4LowL1 = (L1.deh_c4 == 3) if !missing(L1.deh_c4) + + +/*-------------------------------------------------- +Partner education C3 +--------------------------------------------------*/ + +gen Dehsp_c3_High = (dehsp_c3 == 1) if !missing(dehsp_c3) +gen Dehsp_c3_Medium = (dehsp_c3 == 2) if !missing(dehsp_c3) +gen Dehsp_c3_Low = (dehsp_c3 == 3) if !missing(dehsp_c3) + +gen eduHighestPartnerC3 = dehsp_c3 +gen eduHighestPartnerC3L1 = L1.dehsp_c3 + +gen eduHighestPartnerC3High = (dehsp_c3 == 1) if !missing(dehsp_c3) +gen eduHighestPartnerC3Medium = (dehsp_c3 == 2) if !missing(dehsp_c3) +gen eduHighestPartnerC3Low = (dehsp_c3 == 3) if !missing(dehsp_c3) + +gen eduHighestPartnerC3HighL1 = (L1.dehsp_c3 == 1) if !missing(L1.dehsp_c3) +gen eduHighestPartnerC3MediumL1 = (L1.dehsp_c3 == 2) if !missing(L1.dehsp_c3) +gen eduHighestPartnerC3LowL1 = (L1.dehsp_c3 == 3) if !missing(L1.dehsp_c3) + + +/*-------------------------------------------------- +Highest parental education +--------------------------------------------------*/ +gen Dehmf_c3_High = (dehmf_c3 == 1) if !missing(dehmf_c3) +gen Dehmf_c3_Medium = (dehmf_c3 == 2) if !missing(dehmf_c3) +gen Dehmf_c3_Low = (dehmf_c3 == 3) if !missing(dehmf_c3) + +gen L_Dehmf_c3 = L1.dehmf_c3 + +gen L_Dehmf_c3_High = (L1.dehmf_c3 == 1) if !missing(L1.dehmf_c3) +gen L_Dehmf_c3_Medium = (L1.dehmf_c3 == 2) if !missing(L1.dehmf_c3) +gen L_Dehmf_c3_Low = (L1.dehmf_c3 == 3) if !missing(L1.dehmf_c3) + +gen eduHighestParentC3 = dehmf_c3 +gen eduHighestParentC3L1 = L1.dehmf_c3 + +gen eduHighestParentC3High = (dehmf_c3 == 1) if !missing(dehmf_c3) +gen eduHighestParentC3Medium = (dehmf_c3 == 2) if !missing(dehmf_c3) +gen eduHighestParentC3Low = (dehmf_c3 == 3) if !missing(dehmf_c3) + +gen eduHighestParentC3HighL1 = (L1.dehmf_c3 == 1) if !missing(L1.dehmf_c3) +gen eduHighestParentC3MediumL1 = (L1.dehmf_c3 == 2) if !missing(L1.dehmf_c3) +gen eduHighestParentC3LowL1 = (L1.dehmf_c3 == 3) if !missing(L1.dehmf_c3) + + + +*================================================== +* Health dummies +*================================================== +gen Dhe = dhe +gen Dhe_pcs = dhe_pcs +gen Dhe_mcs = dhe_mcs +gen Dhe_pcssp = dhe_pcssp +gen Dhe_mcssp = dhe_mcssp + +/*-------------------------------------------------- +Value labels +--------------------------------------------------*/ + +cap lab define dhe /// + 1 "Poor" /// + 2 "Fair" /// + 3 "Good" /// + 4 "VeryGood" /// + 5 "Excellent", modify + +lab values dhe dhe + +/*-------------------------------------------------- +Own self-rated health +--------------------------------------------------*/ +gen Dhe_Poor = (dhe == 1) if !missing(dhe) +gen Dhe_Fair = (dhe == 2) if !missing(dhe) +gen Dhe_Good = (dhe == 3) if !missing(dhe) +gen Dhe_VeryGood = (dhe == 4) if !missing(dhe) +gen Dhe_Excellent = (dhe == 5) if !missing(dhe) + +gen healthSelfRated = dhe +gen healthSelfRatedL1 = L1.dhe + +gen healthSelfRatedPoor = (dhe == 1) if !missing(dhe) +gen healthSelfRatedFair = (dhe == 2) if !missing(dhe) +gen healthSelfRatedGood = (dhe == 3) if !missing(dhe) +gen healthSelfRatedVeryGood = (dhe == 4) if !missing(dhe) +gen healthSelfRatedExcellent = (dhe == 5) if !missing(dhe) + +gen healthSelfRatedPoorL1 = (L1.dhe == 1) if !missing(L1.dhe) +gen healthSelfRatedFairL1 = (L1.dhe == 2) if !missing(L1.dhe) +gen healthSelfRatedGoodL1 = (L1.dhe == 3) if !missing(L1.dhe) +gen healthSelfRatedVeryGoodL1 = (L1.dhe == 4) if !missing(L1.dhe) +gen healthSelfRatedExcellentL1 = (L1.dhe == 5) if !missing(L1.dhe) + +/*-------------------------------------------------- +Partner self-rated health +--------------------------------------------------*/ + +gen Dhesp_Poor = (dhesp == 1) if !missing(dhesp) +gen Dhesp_Fair = (dhesp == 2) if !missing(dhesp) +gen Dhesp_Good = (dhesp == 3) if !missing(dhesp) +gen Dhesp_VeryGood = (dhesp == 4) if !missing(dhesp) +gen Dhesp_Excellent = (dhesp == 5) if !missing(dhesp) + +gen healthPartnerSelfRated = dhesp +gen healthPartnerSelfRatedL1 = L1.dhesp + +gen healthPartnerSelfRatedPoor = (dhesp == 1) if !missing(dhesp) +gen healthPartnerSelfRatedFair = (dhesp == 2) if !missing(dhesp) +gen healthPartnerSelfRatedGood = (dhesp == 3) if !missing(dhesp) +gen healthPartnerSelfRatedVeryGood = (dhesp == 4) if !missing(dhesp) +gen healthPartnerSelfRatedExcel = (dhesp == 5) if !missing(dhesp) + +gen healthPartnerSelfRatedPoorL1 = (L1.dhesp == 1) if !missing(L1.dhesp) +gen healthPartnerSelfRatedFairL1 = (L1.dhesp == 2) if !missing(L1.dhesp) +gen healthPartnerSelfRatedGoodL1 = (L1.dhesp == 3) if !missing(L1.dhesp) +gen healthPartnerSelfRatedVeryGoodL1 = (L1.dhesp == 4) if !missing(L1.dhesp) +gen healthPartnerSelfRatedExcelL1 = (L1.dhesp == 5) if !missing(L1.dhesp) + + +/*-------------------------------------------------- +Continuous health measures +--------------------------------------------------*/ +foreach v in dhe dhe_pcs dhe_mcs { + gen l_`v' = L.`v' +} + +gen L_Dhe = l_dhe +gen L_Dhe_pcs = l_dhe_pcs +gen L_Dhe_mcs = l_dhe_mcs + + +gen healthPhysicalPcs = dhe_pcs +gen healthMentalMcs = dhe_mcs + +gen healthPhysicalPcsL1 = L1.dhe_pcs +gen healthMentalMcsL1 = L1.dhe_mcs + +gen healthPhysicalPartnerPcs = dhe_pcssp +gen healthMentalPartnerMcs = dhe_mcssp + +gen healthPhysicalPartnerPcsL1 = L1.dhe_pcssp +gen healthMentalPartnerMcsL1 = L1.dhe_mcssp + + +*================================================== +* Long-term sick or disabled +*================================================== + +gen Dlltsd = dlltsd +gen Dlltsd01 = dlltsd01 + +gen L_Dlltsd01 = l.dlltsd01 + +gen Dlltsdsp = dlltsd_sp +gen Dlltsd01sp = dlltsd01_sp + +gen healthDsblLongtermFlag = dlltsd01 +gen healthDsblLongtermFlagL1 = l.dlltsd01 + +*================================================== +* Ethnicity +*================================================== + +tab dot, gen(dot_) +rename dot_1 Ethn_White +rename dot_2 Ethn_Asian +rename dot_3 Ethn_Black +rename dot_4 Ethn_Other + +gen demEthnC4 = dot +tab demEthnC4, gen(demEthnC4_) + +rename demEthnC4_1 demEthnC4White +rename demEthnC4_2 demEthnC4Asian +rename demEthnC4_3 demEthnC4Black +rename demEthnC4_4 demEthnC4Other + + +*================================================== +* Household type and relationship dynamics +*================================================== + +/*--------------------------------------------------*/ +/* Raw variables */ +/*--------------------------------------------------*/ + +gen New_rel = new_rel + +gen Dnc = dnc +gen Dnc02 = dnc02 + +gen Dcpyy = dcpyy +gen Dcpagdf = dcpagdf + +gen fertilityRate = dukfr +gen FertilityRate = dukfr + +/*--------------------------------------------------*/ +/* Household type C4 */ +/*--------------------------------------------------*/ + +gen Dhhtp_c4_CoupleNoChildren = (dhhtp_c4 == 1) if !missing(dhhtp_c4) +gen Dhhtp_c4_CoupleChildren = (dhhtp_c4 == 2) if !missing(dhhtp_c4) +gen Dhhtp_c4_SingleNoChildren = (dhhtp_c4 == 3) if !missing(dhhtp_c4) +gen Dhhtp_c4_SingleChildren = (dhhtp_c4 == 4) if !missing(dhhtp_c4) + +gen L_Dhhtp_c4 = L1.dhhtp_c4 + +gen L_Dhhtp_c4_CoupleNoChildren = (L1.dhhtp_c4 == 1) if !missing(L1.dhhtp_c4) +gen L_Dhhtp_c4_CoupleChildren = (L1.dhhtp_c4 == 2) if !missing(L1.dhhtp_c4) +gen L_Dhhtp_c4_SingleNoChildren = (L1.dhhtp_c4 == 3) if !missing(L1.dhhtp_c4) +gen L_Dhhtp_c4_SingleChildren = (L1.dhhtp_c4 == 4) if !missing(L1.dhhtp_c4) + +gen demCompHhC4 = dhhtp_c4 + +gen demCompHhC4L1 = L1.dhhtp_c4 + +gen demCompHhC4CoupleNoChL1 = (L1.dhhtp_c4 == 1) if !missing(L1.dhhtp_c4) +gen demCompHhC4CoupleChL1 = (L1.dhhtp_c4 == 2) if !missing(L1.dhhtp_c4) +gen demCompHhC4SingleNoChL1 = (L1.dhhtp_c4 == 3) if !missing(L1.dhhtp_c4) +gen demCompHhC4SingleChL1 = (L1.dhhtp_c4 == 4) if !missing(L1.dhhtp_c4) + +gen householdTypeC4 = dhhtp_c4 +gen householdTypeC4L1 = L1.dhhtp_c4 + +gen householdTypeC4CoupleNoCh = (dhhtp_c4 == 1) if !missing(dhhtp_c4) +gen householdTypeC4CoupleCh = (dhhtp_c4 == 2) if !missing(dhhtp_c4) +gen householdTypeC4SingleNoC = (dhhtp_c4 == 3) if !missing(dhhtp_c4) +gen householdTypeC4SingleCh = (dhhtp_c4 == 4) if !missing(dhhtp_c4) + +gen householdTypeC4CoupleNoChL1 = (L1.dhhtp_c4 == 1) if !missing(L1.dhhtp_c4) +gen householdTypeC4CoupleChL1 = (L1.dhhtp_c4 == 2) if !missing(L1.dhhtp_c4) +gen householdTypeC4SingleNoChL1 = (L1.dhhtp_c4 == 3) if !missing(L1.dhhtp_c4) +gen householdTypeC4SingleCh1 = (L1.dhhtp_c4 == 4) if !missing(L1.dhhtp_c4) + + +/*--------------------------------------------------*/ +/* Household type C8 */ +/*--------------------------------------------------*/ + +gen Dhhtp_c8_1 = (dhhtp_c8 == 1) if !missing(dhhtp_c8) +gen Dhhtp_c8_2 = (dhhtp_c8 == 2) if !missing(dhhtp_c8) +gen Dhhtp_c8_3 = (dhhtp_c8 == 3) if !missing(dhhtp_c8) +gen Dhhtp_c8_4 = (dhhtp_c8 == 4) if !missing(dhhtp_c8) +gen Dhhtp_c8_5 = (dhhtp_c8 == 5) if !missing(dhhtp_c8) +gen Dhhtp_c8_6 = (dhhtp_c8 == 6) if !missing(dhhtp_c8) +gen Dhhtp_c8_7 = (dhhtp_c8 == 7) if !missing(dhhtp_c8) +gen Dhhtp_c8_8 = (dhhtp_c8 == 8) if !missing(dhhtp_c8) + +gen householdTypeC8 = dhhtp_c8 + +gen demCompHhC8 = dhhtp_c8 +gen demCompHhC8L1 = L1.dhhtp_c8 + +gen demCompHhC81 = (dhhtp_c8 == 1) if !missing(dhhtp_c8) +gen demCompHhC82 = (dhhtp_c8 == 2) if !missing(dhhtp_c8) +gen demCompHhC83 = (dhhtp_c8 == 3) if !missing(dhhtp_c8) +gen demCompHhC84 = (dhhtp_c8 == 4) if !missing(dhhtp_c8) +gen demCompHhC85 = (dhhtp_c8 == 5) if !missing(dhhtp_c8) +gen demCompHhC86 = (dhhtp_c8 == 6) if !missing(dhhtp_c8) +gen demCompHhC87 = (dhhtp_c8 == 7) if !missing(dhhtp_c8) +gen demCompHhC88 = (dhhtp_c8 == 8) if !missing(dhhtp_c8) + + +gen demCompHhC81L1 = (L1.dhhtp_c8 == 1) if !missing(L1.dhhtp_c8) +gen demCompHhC82L1 = (L1.dhhtp_c8 == 2) if !missing(L1.dhhtp_c8) +gen demCompHhC83L1 = (L1.dhhtp_c8 == 3) if !missing(L1.dhhtp_c8) +gen demCompHhC84L1 = (L1.dhhtp_c8 == 4) if !missing(L1.dhhtp_c8) +gen demCompHhC85L1 = (L1.dhhtp_c8 == 5) if !missing(L1.dhhtp_c8) +gen demCompHhC86L1 = (L1.dhhtp_c8 == 6) if !missing(L1.dhhtp_c8) +gen demCompHhC87L1 = (L1.dhhtp_c8 == 7) if !missing(L1.dhhtp_c8) +gen demCompHhC88L1 = (L1.dhhtp_c8 == 8) if !missing(L1.dhhtp_c8) + + +/*--------------------------------------------------*/ +/* Relationship status */ +/*--------------------------------------------------*/ +gen mar = (dcpst == 1) + +gen Dcpst = dcpst + +gen Partnered = (dcpst == 1) if !missing(dcpst) +gen Single = (dcpst == 2) if !missing(dcpst) + +gen Dcpst_Partnered = (dcpst == 1) if !missing(dcpst) +gen Dcpst_Single = (dcpst == 2) if !missing(dcpst) + +gen demPartnerStatus = dcpst +gen demPartnerStatusL1 = L1.dcpst + +gen demPartnerStatusPartnered = (dcpst == 1) if !missing(dcpst) +gen demPartnerStatusSingle = (dcpst == 2) if !missing(dcpst) + +gen demPartnerStatusPartneredL1 = (L1.dcpst == 1) if !missing(L1.dcpst) +gen demPartnerStatusSingleL1 = (L1.dcpst == 2) if !missing(L1.dcpst) + + +/*--------------------------------------------------*/ +/* Relationship dynamics */ +/*--------------------------------------------------*/ + +gen demPartnerNYear = dcpyy +gen demPartnerNYearL1 = L1.dcpyy + +gen demEnterPartnerFlag = new_rel +gen demEnterPartnerFlagL1 = L1.new_rel + +gen demAgePartnerDiff = dcpagdf +gen demAgePartnerDiffL1 = L1.dcpagdf + + +/*--------------------------------------------------*/ +/* Children */ +/*--------------------------------------------------*/ +cap drop child +gen child = (dnc>0) + +gen demNChild = dnc +gen demNChild0to2 = dnc02 + +gen demNChildL1 = L1.dnc +gen demNChild0to2L1 = L1.dnc02 + +gen demDChild = (dnc > 0) if !missing(dnc) +gen demDChild0to2 = (dnc02 > 0) if !missing(dnc02) + +gen demDChildL1 = (L1.dnc > 0) if !missing(L1.dnc) +gen demDChild0to2L1 = (L1.dnc02 > 0) if !missing(L1.dnc02) + + + +/*==================================================*/ +/* INTERACTIONS */ +/*==================================================*/ + +/*--------------------------------------------------*/ +/* Education × demographics */ +/*--------------------------------------------------*/ + +gen Ded_Dag = Ded * Dag if !missing(Ded, Dag) + +gen Ded_Dag_sq = Ded * Dag_sq if !missing(Ded, Dag_sq) + +gen Ded_Dgn = Ded * Dgn if !missing(Ded, Dgn) + +gen eduSampleFlag_demMaleFlag = eduSampleFlag * demMaleFlag if !missing(eduSampleFlag, demMaleFlag) + +gen eduSampleFlag_Male = eduSampleFlag * demMaleFlag if !missing(eduSampleFlag, demMaleFlag) + + +/*--------------------------------------------------*/ +/* Education × children */ +/*--------------------------------------------------*/ + +gen Ded_Dnc_L1_ = Ded * L1.Dnc if !missing(Ded, L1.Dnc) + +gen Ded_Dnc02_L1 = Ded * L1.Dnc02 if !missing(Ded, L1.Dnc02) + +gen eduSampleFlag_demNChildL1 = eduSampleFlag * demNChildL1 if !missing(eduSampleFlag, demNChildL1) + +gen eduSampleFlag_demNChild0to2L1 = eduSampleFlag * demNChild0to2L1 if !missing(eduSampleFlag, demNChild0to2L1) + + +/*--------------------------------------------------*/ +/* Education × partnership status */ +/*--------------------------------------------------*/ + +gen Ded_Dcpst_Single = Dcpst_Single * Ded if !missing(Dcpst_Single, Ded) + +gen Ded_Dcpst_Single_L1 = L1.Dcpst_Single * Ded if !missing(L1.Dcpst_Single, Ded) + +gen eduSampleFlag_Single = eduSampleFlag * demPartnerStatusSingle if !missing(eduSampleFlag, demPartnerStatusSingle) -tab les_c3, gen(Les_c3_) -rename Les_c3_1 Les_c3_Employed -rename Les_c3_2 Les_c3_Student -rename Les_c3_3 Les_c3_NotEmployed -tab lessp_c3, gen(Lessp_c3_) -rename Lessp_c3_1 Lessp_c3_Employed -rename Lessp_c3_2 Lessp_c3_Student -rename Lessp_c3_3 Lessp_c3_NotEmployed +/*--------------------------------------------------*/ +/* Education × income quintiles */ +/*--------------------------------------------------*/ -tab les_c4, gen(Les_c4_) -rename Les_c4_1 Les_c4_Employed -rename Les_c4_2 Les_c4_Student -rename Les_c4_3 Les_c4_NotEmployed -rename Les_c4_4 Les_c4_Retired +forvalues i = 1/5 { + gen Ded_Ydses_c5_Q`i'_L1 = Ded * L1.Ydses_c5_Q`i' if !missing(Ded, L1.Ydses_c5_Q`i') +} -tab lesdf_c4, gen(Lesdf_c4_) -rename Lesdf_c4_1 Lesdf_c4_BothEmployed -rename Lesdf_c4_2 Lesdf_c4_EmpSpouseNotEmp -rename Lesdf_c4_3 Lesdf_c4_NotEmpSpouseEmp -rename Lesdf_c4_4 Lesdf_c4_BothNotEmployed +gen eduSampleFlag_Q2L1 = eduSampleFlag * yHhQuintilesMonthC5Q2L1 if !missing(eduSampleFlag, yHhQuintilesMonthC5Q2L1) -*================================================== -* Education dummies -*================================================== +gen eduSampleFlag_Q3L1 = eduSampleFlag * yHhQuintilesMonthC5Q3L1 if !missing(eduSampleFlag, yHhQuintilesMonthC5Q3L1) -tab deh_c3, gen(Deh_c3_) -rename Deh_c3_1 Deh_c3_High -rename Deh_c3_2 Deh_c3_Medium -rename Deh_c3_3 Deh_c3_Low +gen eduSampleFlag_Q4L1 = eduSampleFlag * yHhQuintilesMonthC5Q4L1 if !missing(eduSampleFlag, yHhQuintilesMonthC5Q4L1) -tab deh_c4, gen(Deh_c4_) -rename Deh_c4_1 Deh_c4_Na -rename Deh_c4_2 Deh_c4_High -rename Deh_c4_3 Deh_c4_Medium -rename Deh_c4_4 Deh_c4_Low +gen eduSampleFlag_Q5L1 = eduSampleFlag * yHhQuintilesMonthC5Q5L1 if !missing(eduSampleFlag, yHhQuintilesMonthC5Q5L1) -tab dehmf_c3, gen(Dehmf_c3_) -rename Dehmf_c3_1 Dehmf_c3_High -rename Dehmf_c3_2 Dehmf_c3_Medium -rename Dehmf_c3_3 Dehmf_c3_Low -tab dehsp_c3, gen(Dehsp_c3_) -rename Dehsp_c3_1 Dehsp_c3_High -rename Dehsp_c3_2 Dehsp_c3_Medium -rename Dehsp_c3_3 Dehsp_c3_Low +/*--------------------------------------------------*/ +/* Education × spouse education */ +/*--------------------------------------------------*/ -*================================================== -* Health dummies -*================================================== -cap lab define dhe 1 "Poor" 2 "Fair" 3 "Good" 4 "VeryGood" 5 "Excellent" , modify -lab values dhe dhe +gen Ded_Dehsp_c3_Medium_L1 = L1.Dehsp_c3_Medium * Ded if !missing(L1.Dehsp_c3_Medium, Ded) -tab dhe, gen(Dhe_) -rename Dhe_1 Dhe_Poor -rename Dhe_2 Dhe_Fair -rename Dhe_3 Dhe_Good -rename Dhe_4 Dhe_VeryGood -rename Dhe_5 Dhe_Excellent +gen Ded_Dehsp_c3_Low_L1 = L1.Dehsp_c3_Low * Ded if !missing(L1.Dehsp_c3_Low, Ded) -tab dhesp, gen(Dhesp_) -rename Dhesp_1 Dhesp_Poor -rename Dhesp_2 Dhesp_Fair -rename Dhesp_3 Dhesp_Good -rename Dhesp_4 Dhesp_VeryGood -rename Dhesp_5 Dhesp_Excellent -gen Dhe_pcs = dhe_pcs -gen Dhe_mcs = dhe_mcs -gen Dhe_pcssp = dhe_pcssp -gen Dhe_mcssp = dhe_mcssp +/*--------------------------------------------------*/ +/* Education × health */ +/*--------------------------------------------------*/ -*================================================== -* Long-term sick or disabled -*================================================== +gen Ded_Dhesp_Good_L1 = L1.Dhesp_Good * Ded if !missing(L1.Dhesp_Good, Ded) -gen Dlltsd = dlltsd -gen Dlltsd01 = dlltsd01 +gen Ded_Dhesp_Fair_L1 = L1.Dhesp_Fair * Ded if !missing(L1.Dhesp_Fair, Ded) +gen Ded_Dhe_Fair_L1 = L1.Dhe_Fair * Ded if !missing(L1.Dhe_Fair, Ded) -*================================================== -* Ethnicity -*================================================== +gen Ded_Dhe_Good_L1 = L1.Dhe_Good * Ded if !missing(L1.Dhe_Good, Ded) -tab dot, gen(dot_) -rename dot_1 Ethn_White -rename dot_2 Ethn_Asian -rename dot_3 Ethn_Black -rename dot_4 Ethn_Other +gen Ded_Dhe_VeryGood_L1 = L1.Dhe_VeryGood * Ded if !missing(L1.Dhe_VeryGood, Ded) -*================================================== -* Household type and relationship dynamics -*================================================== +gen Ded_Dhe_Excellent_L1 = L1.Dhe_Excellent * Ded if !missing(L1.Dhe_Excellent, Ded) -tab dhhtp_c4, gen(Dhhtp_c4_) -rename Dhhtp_c4_1 Dhhtp_c4_CoupleNoChildren -rename Dhhtp_c4_2 Dhhtp_c4_CoupleChildren -rename Dhhtp_c4_3 Dhhtp_c4_SingleNoChildren -rename Dhhtp_c4_4 Dhhtp_c4_SingleChildren +gen Ded_Dhe_pcs = Ded * Dhe_pcs if !missing(Ded, Dhe_pcs) -tab dhhtp_c8, gen(Dhhtp_c8_) +gen Ded_Dhe_mcs = Ded * Dhe_mcs if !missing(Ded, Dhe_mcs) -gen New_rel = new_rel +gen Ded_Dhe = Dhe * Ded if !missing(Dhe, Ded) -tab dcpst, gen(Dcpst_) -rename Dcpst_1 Dcpst_Partnered -rename Dcpst_2 Dcpst_Single -gen Partnered = Dcpst_Partnered -gen Single = Dcpst_Single -*================================================== -* Explicit lags -*================================================== -cap drop l_* L_* +/*--------------------------------------------------*/ +/* Retirement interactions */ +/*--------------------------------------------------*/ -xtset idperson swv +gen Reached_Retirement_Age_Les = Reached_Retirement_Age * L1.Les_c3_NotEmployed if !missing(Reached_Retirement_Age, L1.Les_c3_NotEmployed) -foreach v in ydses_c5 dhe dhe_pcs dhe_mcs les_c3 les_c4 dhhtp_c4 dlltsd01 need_socare dehmf_c3 { - gen l_`v' = L.`v' -} +gen demPensAgeFlag_NotEmployedL1 = demPensAgeFlag * labStatusC3NotEmployedL1 if !missing(demPensAgeFlag, labStatusC3NotEmployedL1) -gen L_Ydses_c5 = l_ydses_c5 -gen L_Dhe = l_dhe -gen L_Dhe_pcs = l_dhe_pcs -gen L_Dhe_mcs = l_dhe_mcs -gen L_Dlltsd01 = l_dlltsd01 -gen L_Need_socare = l_need_socare -gen L_Dehmf_c3 = l_dehmf_c3 -tab l_les_c4, gen(L_Les_c4_) -rename L_Les_c4_1 L_Les_c4_Employed -rename L_Les_c4_2 L_Les_c4_Student -rename L_Les_c4_3 L_Les_c4_NotEmployed -rename L_Les_c4_4 L_Les_c4_Retired +/*--------------------------------------------------*/ +/* Education × income */ +/*--------------------------------------------------*/ -tab l_ydses_c5, gen(L_Ydses_c5_Q) +gen Ded_Ypncp = Ded * Ypncp if !missing(Ded, Ypncp) -tab l_dhhtp_c4, gen(L_Dhhtp_c4_) -rename L_Dhhtp_c4_1 L_Dhhtp_c4_CoupleNoChildren -rename L_Dhhtp_c4_2 L_Dhhtp_c4_CoupleChildren -rename L_Dhhtp_c4_3 L_Dhhtp_c4_SingleNoChildren -rename L_Dhhtp_c4_4 L_Dhhtp_c4_SingleChildren +gen Ded_Yplgrs_dv = Ded * Yplgrs_dv if !missing(Ded, Yplgrs_dv) -tab l_dehmf_c3, gen(L_Dehmf_c3_) -rename L_Dehmf_c3_1 L_Dehmf_c3_High -rename L_Dehmf_c3_2 L_Dehmf_c3_Medium -rename L_Dehmf_c3_3 L_Dehmf_c3_Low +gen eduSampleFlag_yCapitalPers = eduSampleFlag * yCapitalPersMonth if !missing(eduSampleFlag, yCapitalPersMonth) +gen eduSampleFlag_yCapitalPersL1 = L1.eduSampleFlag_yCapitalPers +gen eduSampleFlag_yCapitalPersL2 = L2.eduSampleFlag_yCapitalPers -*================================================== -* Copy variables for nice labels -*================================================== -gen Dnc = dnc -gen Dnc02 = dnc02 -gen Ded = ded -gen Dhe = dhe -gen Ydses_c5 = ydses_c5 -gen Dcpyy = dcpyy -gen Dcpagdf = dcpagdf -gen fertilityRate = dukfr -gen Dhh_owned = dhh_owned +gen eduSampleFlag_yEmpPersGross = eduSampleFlag * yEmpPersGrossMonth if !missing(eduSampleFlag, yEmpPersGrossMonth) -gen Elig_pen = dagpns -gen Elig_pen_L1 = l.dagpns +gen eduSampleFlag_yEmpPersGrossL1 = L1.eduSampleFlag_yEmpPersGross -gen Reached_Retirement_Age = dagpns -gen Reached_Retirement_Age_Sp = dagpns_sp +gen eduSampleFlag_yEmpPersGrossL2 = L2.eduSampleFlag_yEmpPersGross -gen Dlltsdsp = dlltsd_sp -gen Dlltsd01sp = dlltsd01_sp -gen Ypncp = ypncp -gen Ypnoab = ypnoab -gen Yplgrs_dv = yplgrs_dv -gen Ypnbihs_dv = ypnbihs_dv -gen Ypnbihs_dv_sq = ypnbihs_dv^2 -gen Ynbcpdf_dv = ynbcpdf_dv -gen Yptciihs_dv = yptciihs_dv +/*--------------------------------------------------*/ +/* Education × health scores */ +/*--------------------------------------------------*/ +gen eduSampleFlag_Pcs = eduSampleFlag * healthPhysicalPcs if !missing(eduSampleFlag, healthPhysicalPcs) -*================================================== -* Interactions -*================================================== -cap drop Les_c4_*_Dgn Ded_* Reached_Retirement_Age_Les +gen eduSampleFlag_Mcs = eduSampleFlag * healthMentalMcs if !missing(eduSampleFlag, healthMentalMcs) -gen Les_c4_Student_Dgn = Dgn * Les_c4_Student -gen Les_c4_NotEmployed_Dgn = Dgn * Les_c4_NotEmployed -gen Les_c4_Retired_Dgn = Dgn * Les_c4_Retired +gen eduSampleFlag_PcsL1 = L1.eduSampleFlag_Pcs -gen Ded_Dag = Ded * Dag -gen Ded_Dag_sq = Ded * Dag_sq -gen Ded_Dgn = Ded * Dgn +gen eduSampleFlag_McsL1 = L1.eduSampleFlag_Mcs -gen Ded_Dnc_L1_ = Ded * l.Dnc -gen Ded_Dnc02_L1 = Ded * l.Dnc02 -forvalues i = 1/5 { - gen Ded_Ydses_c5_Q`i'_L1 = Ded * l.Ydses_c5_Q`i' -} +/*--------------------------------------------------*/ +/* Education × age */ +/*--------------------------------------------------*/ -gen Ded_Dehsp_c3_Medium_L1 = l.Dehsp_c3_Medium * Ded -gen Ded_Dehsp_c3_Low_L1 = l.Dehsp_c3_Low * Ded +gen eduHighestC4Na_demAge = eduHighestC4Na * dag if !missing(eduHighestC4Na, dag) -gen Ded_Dhesp_Good_L1 = l.Dhesp_Good * Ded -gen Ded_Dhesp_Fair_L1 = l.Dhesp_Fair * Ded +gen eduHighestC4Low_demAge = eduHighestC4Low * dag if !missing(eduHighestC4Low, dag) -gen Ded_Dhe_Fair_L1 = l.Dhe_Fair * Ded -gen Ded_Dhe_Good_L1 = l.Dhe_Good * Ded -gen Ded_Dhe_VeryGood_L1 = l.Dhe_VeryGood * Ded -gen Ded_Dhe_Excellent_L1 = l.Dhe_Excellent * Ded +gen eduHighestC4Medium_demAge = eduHighestC4Medium * dag if !missing(eduHighestC4Medium, dag) -gen Ded_Dhe_pcs = Ded * Dhe_pcs -gen Ded_Dhe_mcs = Ded * Dhe_mcs +gen eduHighestC4High_demAge = eduHighestC4High * dag if !missing(eduHighestC4High, dag) -gen Ded_Dhe = Dhe * Ded -gen Ded_Dcpst_Single = Dcpst_Single * Ded -gen Ded_Dcpst_Single_L1 = l.Dcpst_Single * Ded +gen eduHighestC4NaL1_demAge = eduHighestC4NaL1 * demAge if !missing(eduHighestC4NaL1, demAge) -gen Reached_Retirement_Age_Les = Reached_Retirement_Age * l.Les_c3_NotEmployed +gen eduHighestC4LowL1_demAge = eduHighestC4LowL1 * demAge if !missing(eduHighestC4LowL1, demAge) -gen Ded_Ypncp= Ded * Ypncp -gen Ded_Yplgrs_dv = Ded *Yplgrs_dv +gen eduHighestC4MediumL1_demAge = eduHighestC4MediumL1 * demAge if !missing(eduHighestC4MediumL1, demAge) + +gen eduHighestC4HighL1_demAge = eduHighestC4HighL1 * demAge if !missing(eduHighestC4HighL1, demAge) + + +/*--------------------------------------------------*/ +/* Part-time work indicator */ +/*--------------------------------------------------*/ + +gen pt = (lhw > 0 & lhw <= 25) if !missing(lhw) +gen labPt = (lhw > 0 & lhw <= 25) if !missing(lhw) *================================================== * Prepare data for social care regressions *================================================== * Care received variables (Processes S2) - -rename need_socare need_care +gen need_care = need_socare +//rename need_socare need_care gen receive_formal_care = formal_socare_hrs > 0 gen receive_informal_care = (partner_socare_hrs + daughter_socare_hrs + son_socare_hrs + other_socare_hrs) > 0 @@ -505,6 +1136,78 @@ drop _merge erase "$dir_work/partner.dta" +* refactoring social care +xtset idperson stm + +gen demAge20to24 = Age20to24 +gen demAge25to29 = Age25to29 +gen demAge30to34 = Age30to34 +gen demAge35to39 = Age35to39 +gen demAge40to44 = Age40to44 +gen demAge45to49 = Age45to49 +gen demAge50to54 = Age50to54 +gen demAge55to59 = Age55to59 +gen demAge60to64 = Age60to64 +gen demAge65to69 = Age65to69 +gen demAge70to74 = Age70to74 +gen demAge75to79 = Age75to79 +gen demAge80to84 = Age80to84 +cap confirm variable Age85plus +if !_rc gen demAge85plus = Age85plus + + +gen demAge65to66 = Age65to66 +gen demAge67to68 = Age67to68 +gen demAge69to70 = Age69to70 +gen demAge71to72 = Age71to72 +gen demAge73to74 = Age73to74 +gen demAge75to76 = Age75to76 +gen demAge77to78 = Age77to78 +gen demAge79to80 = Age79to80 +gen demAge81to82 = Age81to82 +gen demAge83to84 = Age83to84 + +gen careMarket = CareMarket +gen careMarketL1 = l.careMarket + + +gen careMarketInformal = (careMarket == 2) if !missing(careMarket) +gen careMarketMixed = (careMarket == 3) if !missing(careMarket) +gen careMarketFormal = (careMarket == 4) if !missing(careMarket) + +gen careMarketInformalL1 = (L1.careMarket == 2) if !missing(L1.careMarket) +gen careMarketMixedL1 = (L1.careMarket == 3) if !missing(L1.careMarket) +gen careMarketFormalL1 = (L1.careMarket == 4) if !missing(L1.careMarket) + +gen careHrsInformalIhs = HrsReceivedInformalIHS +gen careHrsInformalIhsL1 = l.HrsReceivedInformalIHS + +gen careHrsFormalIhs = HrsReceivedFormalIHS +gen careHrsFormalIhsL1 = l.HrsReceivedFormalIHS + + +gen careNeedFlag = NeedCare +gen careNeedFlagL1 = l.NeedCare + +gen careReceivedFlag = ReceiveCare +gen careReceivedFlagL1 = l.ReceiveCare + +gen careProvidedFlag = ProvideCare +gen careProvidedFlagL1 = l.ProvideCare + +gen careNeedPartnerFlag = NeedCarePartner +gen careReceivedPartnerFlag = ReceiveCarePartner + +gen careMarketInformalPartner = CareMarketInformalPartner +gen careMarketMixedPsrtner = CareMarketMixedPartner +gen careMarketFormalPartner = CareMarketFormalPartner + +gen careHrsProvidedWeekIhs = HrsProvidedInformalIHS +gen careHrsProvidedWeekIhsL1 = l.HrsProvidedInformalIHS + + + + /********************************************************************* Additional variables required for the following estimation scripts: - reg_financial_distress.do @@ -641,358 +1344,6 @@ label define lhwsp 0 "Zero" 10 "Ten" 20 "Twenty" 30 "Thirty" 40 "Forty" label value lhw_c5 lhwsp la var lhw_c5 "Hours worked per week (category)" - -*================================================== -* Refactoring variable names -*================================================== -xtset idperson stm - -gen demMaleFlag = dgn -gen demAge = dag -gen demAgeSq = dagsq -gen eduSampleFlag = ded - - -gen eduSampleFlagL1 = l.ded - -gen eduHighestParentC3 = dehmf_c3 -tab eduHighestParentC3, gen(eduHighestParentC3_) - -rename eduHighestParentC3_1 eduHighestParentC3High -rename eduHighestParentC3_2 eduHighestParentC3Medium -rename eduHighestParentC3_3 eduHighestParentC3Low - -gen eduHighestParentC3L1 = l.dehmf_c3 -tab eduHighestParentC3L1, gen(eduHighestParentC3L1_) - -rename eduHighestParentC3L1_1 eduHighestParentC3HighL1 -rename eduHighestParentC3L1_2 eduHighestParentC3MediumL1 -rename eduHighestParentC3L1_3 eduHighestParentC3LowL1 - -gen yHhQuintilesMonthC5 = ydses_c5 -tab yHhQuintilesMonthC5 , gen(yHhQuintilesMonthC5Q) - -gen yHhQuintilesMonthC5L1 = l.ydses_c5 -tab yHhQuintilesMonthC5L1 , gen(yHhQuintilesMonthC5L1_Q) - -rename yHhQuintilesMonthC5L1_Q1 yHhQuintilesMonthC5Q1L1 -rename yHhQuintilesMonthC5L1_Q2 yHhQuintilesMonthC5Q2L1 -rename yHhQuintilesMonthC5L1_Q3 yHhQuintilesMonthC5Q3L1 -rename yHhQuintilesMonthC5L1_Q4 yHhQuintilesMonthC5Q4L1 -rename yHhQuintilesMonthC5L1_Q5 yHhQuintilesMonthC5Q5L1 - -gen demRgn = drgn1 - -tab drgn1, gen(demRgn_) - -rename demRgn_1 demRgnUKC -rename demRgn_2 demRgnUKD -rename demRgn_3 demRgnUKE -rename demRgn_4 demRgnUKF -rename demRgn_5 demRgnUKG -rename demRgn_6 demRgnUKH -rename demRgn_7 demRgnUKI -rename demRgn_8 demRgnUKJ -rename demRgn_9 demRgnUKK -rename demRgn_10 demRgnUKL -rename demRgn_11 demRgnUKM -rename demRgn_12 demRgnUKN - -gen demYear = stm - -foreach y of numlist 11/25 { - gen demYear20`y' = (demYear == `y') - } - -gen demEthnC4 = dot -tab demEthnC4, gen(demEthnC4_) - -rename demEthnC4_1 demEthnC4White -rename demEthnC4_2 demEthnC4Asian -rename demEthnC4_3 demEthnC4Black -rename demEthnC4_4 demEthnC4Other - -gen demPartnerStatus = dcpst -gen demPartnerStatusPartnered = (dcpst==1) -gen demPartnerStatusSingle = (dcpst==2) - -gen demPartnerStatusL1 = l.dcpst -gen demPartnerStatusPartneredL1 = (demPartnerStatusL1==1) -gen demPartnerStatusSingleL1 = (demPartnerStatusL1==2) - -gen eduHighestC4 = deh_c4 -gen eduHighestC4L1 = l.deh_c4 - -gen eduHighestC4Na = (eduHighestC4==0) -gen eduHighestC4High = (eduHighestC4==1) -gen eduHighestC4Medium = (eduHighestC4==2) -gen eduHighestC4Low = (eduHighestC4==3) - -gen eduHighestC4NaL1 = (eduHighestC4L1==0) -gen eduHighestC4HighL1 = (eduHighestC4L1==1) -gen eduHighestC4MediumL1 = (eduHighestC4L1==2) -gen eduHighestC4LowL1 = (eduHighestC4L1==3) - -gen eduHighestPartnerC3 = dehsp_c3 -gen eduHighestPartnerC3L1 = l.dehsp_c3 - -gen eduHighestPartnerC3HighL1 = (eduHighestPartnerC3L1==1) -gen eduHighestPartnerC3MediumL1 = (eduHighestPartnerC3L1==2) -gen eduHighestPartnerC3LowL1 = (eduHighestPartnerC3L1==3) - -gen labStatusC3 = les_c3 -gen labStatusC3L1 = l.les_c3 - -gen labStatusC3EmployedL1 = (labStatusC3L1==1) -gen labStatusC3StudentL1 = (labStatusC3L1==2) -gen labStatusC3NotEmployedL1 = (labStatusC3L1==3) - - -gen labStatusPartnerC3 = lessp_c3 -gen labStatusPartnerC3L1 = l.les_c3 - -gen labStatusPartnerC3EmployedL1 = (labStatusPartnerC3L1==1) -gen labStatusPartnerC3StudentL1 = (labStatusPartnerC3L1==2) -gen labStatusPartnerC3NotEmplL1 = (labStatusPartnerC3L1==3) - -gen labStatusC4 = les_c4 -gen labStatusC4L1 = l.les_c4 - -gen labStatusC4EmployedL1 = (labStatusC4L1==1) -gen labStatusC4StudentL1 = (labStatusC4L1==2) -gen labStatusC4NotEmployedL1 = (labStatusC4L1==3) -gen labStatusC4RetiredL1 = (labStatusC4L1==4) - -gen demNChild = dnc -gen demNChild0to2 = dnc02 - -gen demNChildL1 = l.demNChild -gen demNChild0to2L1 = l.demNChild0to2 - -gen eduSampleFlag_demMaleFlag = eduSampleFlag * demMaleFlag -gen eduSampleFlag_demNChildL1 = eduSampleFlag * demNChildL1 -gen eduSampleFlag_demNChild0to2L1 = eduSampleFlag * demNChild0to2L1 -gen eduSampleFlag_Single = eduSampleFlag * demPartnerStatusSingle - -gen eduSampleFlag_Q2L1 = eduSampleFlag * yHhQuintilesMonthC5Q2L1 -gen eduSampleFlag_Q3L1 = eduSampleFlag * yHhQuintilesMonthC5Q3L1 -gen eduSampleFlag_Q4L1 = eduSampleFlag * yHhQuintilesMonthC5Q4L1 -gen eduSampleFlag_Q5L1 = eduSampleFlag * yHhQuintilesMonthC5Q5L1 - - -gen labStatusC4EmployedL1_Male = labStatusC4EmployedL1 * demMaleFlag -gen labStatusC4StudentL1_Male = labStatusC4StudentL1 * demMaleFlag -//gen labStatusC4NotEmployedL1_Male = labStatusC4NotEmployedL1 * demMaleFlag -gen labStatusC4RetiredL1_Male = labStatusC4RetiredL1 * demMaleFlag - -gen healthPhysicalPcs = dhe_pcs -gen healthMentalMcs = dhe_mcs - -gen healthPhysicalPcsL1 = l.healthPhysicalPcs -gen healthMentalMcsL1 = l.healthMentalMcs - -gen healthPhysicalPartnerPcs = dhe_pcssp -gen healthMentalPartnerMcs = dhe_mcssp - -gen healthPhysicalPartnerPcsL1 = l.dhe_pcssp -gen healthMentalPartnerMcsL1 = l.dhe_mcssp - -gen demPartnerNYear = dcpyy -gen demPartnerNYearL1 = l.demPartnerNYear - -gen demEnterPartnerFlag = new_rel -gen demEnterPartnerFlagL1 = l.new_rel - -gen demAgePartnerDiff = dcpagdf -gen demAgePartnerDiffL1 = l.dcpagdf - -gen labStatusPartnerAndOwnC4 = lesdf_c4 -gen labStatusPartnerAndOwnC4L1 = l.lesdf_c4 - -gen labStatusPartnerAndOwnC41L1 = (labStatusPartnerAndOwnC4L1==1) -gen labStatusPartnerAndOwnC42L1 = (labStatusPartnerAndOwnC4L1==2) -gen labStatusPartnerAndOwnC43L1 = (labStatusPartnerAndOwnC4L1==3) -gen labStatusPartnerAndOwnC44L1 = (labStatusPartnerAndOwnC4L1==4) - -gen yNonBenPersGrossMonth = ypnbihs_dv -gen yNonBenPersGrossMonthL1 = l.ypnbihs_dv - -gen yPersAndPartnerGrossDiffMonth = ynbcpdf_dv -gen yPersAndPartnerGrossDiffMonthL1 = l.ynbcpdf_dv - -gen demCompHhC4 = dhhtp_c4 -gen demCompHhC4L1 = l.dhhtp_c4 - -gen demCompHhC4CoupleNoChL1 = (l.dhhtp_c4==1) -gen demCompHhC4CoupleChL1 = (l.dhhtp_c4==2) -gen demCompHhC4SingleNoChL1 = (l.dhhtp_c4==3) -gen demCompHhC4L1SingleChL1 = (l.dhhtp_c4==4) - -gen healthDsblLongtermFlag = dlltsd01 -gen healthDsblLongtermFlagL1 = l.dlltsd01 - -gen demCompHhC8= dhhtp_c8 -tab demCompHhC8, gen(demCompHhC8) - -gen demCompHhC8L1 = l.dhhtp_c8 - -gen demCompHhC81L1 = (l.dhhtp_c8==1) -gen demCompHhC82L1 = (l.dhhtp_c8==2) -gen demCompHhC83L1 = (l.dhhtp_c8==3) -gen demCompHhC84L1 = (l.dhhtp_c8==4) -gen demCompHhC85L1 = (l.dhhtp_c8==5) -gen demCompHhC86L1 = (l.dhhtp_c8==6) -gen demCompHhC87L1 = (l.dhhtp_c8==7) -gen demCompHhC88L1 = (l.dhhtp_c8==8) - -gen yMiscPersGrossMonth = yptciihs_dv -gen yMiscPersGrossMonthL1 = l.yptciihs_dv - -gen wealthPrptyFlag = dhh_owned -gen wealthPrptyFlagL1 = l.dhh_owned - -gen demPensAgeFlag = dagpns -gen demPensPartnerAgeFlag = dagpns_sp - -gen demPensAgeFlag_NotEmployedL1 = demPensAgeFlag * labStatusC3NotEmployedL1 - - -* adjust capital income -sum ypncp, det -scalar p99 = r(p99) -replace ypncp = . if ypncp >= p99 - -gen yCapitalPersMonth = ypncp -gen yCapitalPersMonthL1 = l.ypncp -gen yCapitalPersMonthL2 = l2.ypncp - -gen yEmpPersGrossMonth = yplgrs_dv -gen yEmpPersGrossMonthL1 = l.yplgrs_dv -gen yEmpPersGrossMonthL2 = l2.yplgrs_dv -gen yEmpPersGrossMonthL3 = l3.yplgrs_dv - -gen eduSampleFlag_Male = eduSampleFlag * demMaleFlag - -gen eduSampleFlag_Pcs = eduSampleFlag * healthPhysicalPcs -gen eduSampleFlag_Mcs = eduSampleFlag * healthMentalMcs - -gen eduSampleFlag_PcsL1 = l.eduSampleFlag_Pcs -gen eduSampleFlag_McsL1 = l.eduSampleFlag_Mcs - -gen eduSampleFlag_yCapitalPers = eduSampleFlag * yCapitalPersMonth -gen eduSampleFlag_yCapitalPersL1 = l.eduSampleFlag_yCapitalPers -gen eduSampleFlag_yCapitalPersL2 = l2.eduSampleFlag_yCapitalPers - -gen eduSampleFlag_yEmpPersGross = eduSampleFlag * yEmpPersGrossMonth -gen eduSampleFlag_yEmpPersGrossL1 = l.eduSampleFlag_yEmpPersGross -gen eduSampleFlag_yEmpPersGrossL2 = l2.eduSampleFlag_yEmpPersGross - -gen eduHighestC4Na_demAge = eduHighestC4Na * dag -gen eduHighestC4Low_demAge = eduHighestC4Low * dag -gen eduHighestC4Medium_demAge = eduHighestC4Medium * dag -gen eduHighestC4High_demAge = eduHighestC4High * dag - -gen eduHighestC4NaL1_demAge = eduHighestC4NaL1 * demAge -gen eduHighestC4LowL1_demAge = eduHighestC4LowL1 * demAge -gen eduHighestC4MediumL1_demAge = eduHighestC4MediumL1 * demAge -gen eduHighestC4HighL1_demAge = eduHighestC4HighL1 * demAge - -gen labPt = (lhw > 0 & lhw <=25) - -* adjust pension income -sum ypnoab, det -scalar p99 = r(p99) -replace ypnoab = . if ypnoab >= p99 - -gen yPensPersGrossMonth = ypnoab -gen yPensPersGrossMonthL1 = l.ypnoab -gen yPensPersGrossMonthL2 = l2.ypnoab - -gen healthSelfRated = dhe - -tab healthSelfRated, gen(healthSelfRated_) -rename healthSelfRated_1 healthSelfRatedPoor -rename healthSelfRated_2 healthSelfRatedFair -rename healthSelfRated_3 healthSelfRatedGood -rename healthSelfRated_4 healthSelfRatedVeryGood -rename healthSelfRated_5 healthSelfRatedExcellent - - -gen healthPartnerSelfRated = dhesp - -tab healthPartnerSelfRated, gen(healthPartnerSelfRated_) -rename healthPartnerSelfRated_1 healthPartnerSelfRatedPoor -rename healthPartnerSelfRated_2 healthPartnerSelfRatedFair -rename healthPartnerSelfRated_3 healthPartnerSelfRatedGood -rename healthPartnerSelfRated_4 healthPartnerSelfRatedVeryGood -rename healthPartnerSelfRated_5 healthPartnerSelfRatedExcellent - - - -rename Age20to24 demAge20to24 -rename Age25to29 demAge25to29 -rename Age30to34 demAge30to34 -rename Age35to39 demAge35to39 -rename Age40to44 demAge40to44 -rename Age45to49 demAge45to49 -rename Age50to54 demAge50to54 -rename Age55to59 demAge55to59 -rename Age60to64 demAge60to64 -rename Age65to69 demAge65to69 -rename Age70to74 demAge70to74 -rename Age75to79 demAge75to79 -rename Age80to84 demAge80to84 -rename Age85plus demAge85plus - -rename Age65to66 demAge65to66 -rename Age67to68 demAge67to68 -rename Age69to70 demAge69to70 -rename Age71to72 demAge71to72 -rename Age73to74 demAge73to74 -rename Age75to76 demAge75to76 -rename Age77to78 demAge77to78 -rename Age79to80 demAge79to80 -rename Age81to82 demAge81to82 -rename Age83to84 demAge83to84 - -gen careMarket = CareMarket -gen careMarketL1 = l.careMarket - - -gen careMarketInformal = (careMarket == 2) -gen careMarketMixed = (careMarket == 3) -gen careMarketFormal = (careMarket == 4) - -gen careMarketInformalL1 = (l.careMarket== 2) -gen careMarketMixedL1 = (l.careMarket == 3) -gen careMarketFormalL1 = (l.careMarket == 4) - -gen careHrsInformalIhs = HrsReceivedInformalIHS -gen careHrsInformalIhsL1 = l.HrsReceivedInformalIHS - -gen careHrsFormalIhs = HrsReceivedFormalIHS -gen careHrsFormalIhsL1 = l.HrsReceivedFormalIHS - - -gen careNeedFlag = NeedCare -gen careNeedFlagL1 = l.NeedCare - -gen careReceivedFlag = ReceiveCare -gen careReceivedFlagL1 = l.ReceiveCare - -gen careProvidedFlag = ProvideCare -gen careProvidedFlagL1 = l.ProvideCare - -gen careNeedPartnerFlag = NeedCarePartner -gen careReceivedPartnerFlag = ReceiveCarePartner - -gen careMarketInformalPartner = CareMarketInformalPartner -gen careMarketMixedPsrtner = CareMarketMixedPartner -gen careMarketFormalPartner = CareMarketFormalPartner - -gen careHrsProvidedWeekIhs = HrsProvidedInformalIHS -gen careHrsProvidedWeekIhsL1 = l.HrsProvidedInformalIHS - *================================================== * End *================================================== diff --git a/input/reg_RMSE.xlsx b/input/reg_RMSE.xlsx index a3370af73..ee23bc1a1 100644 Binary files a/input/reg_RMSE.xlsx and b/input/reg_RMSE.xlsx differ diff --git a/input/reg_education.xlsx b/input/reg_education.xlsx index 6144b07c9..2953b6f60 100644 Binary files a/input/reg_education.xlsx and b/input/reg_education.xlsx differ diff --git a/input/reg_employment_selection.xlsx b/input/reg_employment_selection.xlsx index 9b09898c4..793598abc 100644 Binary files a/input/reg_employment_selection.xlsx and b/input/reg_employment_selection.xlsx differ diff --git a/input/reg_fertility.xlsx b/input/reg_fertility.xlsx index 7f9c987fb..4db85d9a4 100644 Binary files a/input/reg_fertility.xlsx and b/input/reg_fertility.xlsx differ diff --git a/input/reg_financial_distress.xlsx b/input/reg_financial_distress.xlsx index d945ffd9b..7ead454eb 100644 Binary files a/input/reg_financial_distress.xlsx and b/input/reg_financial_distress.xlsx differ diff --git a/input/reg_health.xlsx b/input/reg_health.xlsx index ca589713d..1a5efd200 100644 Binary files a/input/reg_health.xlsx and b/input/reg_health.xlsx differ diff --git a/input/reg_health_mental.xlsx b/input/reg_health_mental.xlsx index beea64a8f..66f1a996e 100644 Binary files a/input/reg_health_mental.xlsx and b/input/reg_health_mental.xlsx differ diff --git a/input/reg_health_wellbeing.xlsx b/input/reg_health_wellbeing.xlsx index 0d0f97abf..5c1101ac5 100644 Binary files a/input/reg_health_wellbeing.xlsx and b/input/reg_health_wellbeing.xlsx differ diff --git a/input/reg_home_ownership.xlsx b/input/reg_home_ownership.xlsx index 5d5fd1bca..cf624e05e 100644 Binary files a/input/reg_home_ownership.xlsx and b/input/reg_home_ownership.xlsx differ diff --git a/input/reg_income.xlsx b/input/reg_income.xlsx index b8b7039ff..591855d23 100644 Binary files a/input/reg_income.xlsx and b/input/reg_income.xlsx differ diff --git a/input/reg_leave_parental_home.xlsx b/input/reg_leave_parental_home.xlsx index 88afbaf9d..c77ac3681 100644 Binary files a/input/reg_leave_parental_home.xlsx and b/input/reg_leave_parental_home.xlsx differ diff --git a/input/reg_partnership.xlsx b/input/reg_partnership.xlsx index c6161df48..1d156f911 100644 Binary files a/input/reg_partnership.xlsx and b/input/reg_partnership.xlsx differ diff --git a/input/reg_retirement.xlsx b/input/reg_retirement.xlsx index 1fc41b9ff..7e90d414a 100644 Binary files a/input/reg_retirement.xlsx and b/input/reg_retirement.xlsx differ diff --git a/input/reg_socialcare.xlsx b/input/reg_socialcare.xlsx index b8af56164..5288fc1ec 100644 Binary files a/input/reg_socialcare.xlsx and b/input/reg_socialcare.xlsx differ diff --git a/input/reg_wages.xlsx b/input/reg_wages.xlsx index a9a94b438..d5cd9e432 100644 Binary files a/input/reg_wages.xlsx and b/input/reg_wages.xlsx differ