diff --git a/input/InitialPopulations/compile/RegressionEstimates/00_master_conditions.do b/input/InitialPopulations/compile/RegressionEstimates/00_master_conditions.do index 20ee28b3b..afb51d00f 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/00_master_conditions.do +++ b/input/InitialPopulations/compile/RegressionEstimates/00_master_conditions.do @@ -217,3 +217,9 @@ global s3d_if_condition "provide_informal_care & Partnered & stm >= 15" // I * Finanicial distress and health processes * TO ADD + +global hwb1_if_condition "stm!=20 & stm!=21 & dag>=18 & dag<=64 & swv!=12" + +global hwb2_if_condition "stm!=20 & stm!=21 & dag>=25 & dag<=64 & swv!=12" + +global findis_if_condition "dag >= 16" diff --git a/input/InitialPopulations/compile/RegressionEstimates/11_reg_financial_distress.do b/input/InitialPopulations/compile/RegressionEstimates/11_reg_financial_distress.do index d21395387..2f065fd3a 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/11_reg_financial_distress.do +++ b/input/InitialPopulations/compile/RegressionEstimates/11_reg_financial_distress.do @@ -3,7 +3,7 @@ * SECTION: Health and wellbeing * OBJECT: Financial distress * AUTHORS: Andy Baxter, Erik Igelström -* LAST UPDATE: 17 Feb 2026 +* LAST UPDATE: 4 September 2026 * COUNTRY: UK * * NOTES: @@ -19,10 +19,28 @@ cap log close log using "${dir_log}/reg_financial_distress.log", replace ******************************************************************* +/********************************* SET EXCEL FILE *****************************/ + +putexcel set "$dir_results/reg_financial_distress", sheet("Info") modify //replace +putexcel A1 = "Description:", bold +putexcel B1 = "This file contains regression estimates for Financial Distress" +putexcel A2 = "Authors:" +putexcel B2 = "Andy Baxter, Erik Igelström" +putexcel A3 = "Last edit: 4 September 2026 (AB)" + +putexcel A5 = "Process:", bold +putexcel B5 = "Description:", bold + +putexcel A6 = "Process FinDis" +putexcel B6 = "Financial Distress (0/1) - logit model" + +putexcel set "$dir_results/reg_financial_distress", sheet("Gof") modify +putexcel A1 = "Goodness of fit", bold /********************************* PREPARE DATA *******************************/ -use ${estimation_sample}, clear +* Load data +use "${estimation_sample}", clear * Set data xtset idperson swv @@ -30,205 +48,38 @@ sort idperson swv * Adjust variables do "${dir_do}/variable_update.do" -/* DP: Household income/poverty/employment transition variables are moved to variable_update.do */ + + +/********************************** ESTIMATION ********************************/ -* Remove children -drop if dag < 16 +* Run Stata programs to produce Excel file +do "${dir_do}/programs.do" ********************************************************************** -* HM1_L: GHQ12 score 0-36 of all working-age adults - baseline effects * +* FinDis - Financial Distress ********************************************************************** logit financial_distress /// -ib11.exp_emp i.lhw_c5 D.log_income i.exp_incchange ib0.exp_poverty L.ypncp L.ypnoab /// -L.i.econ_benefits L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.dhe_mcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.financial_distress /// -i.dgn L.dag L.dagsq i.deh_c3 i.dot stm /// -[pweight=${weight}] /// -, vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/financial_distress/financial_distress", sheet("UK") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/financial_distress", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) - - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/financial_distress/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/financial_distress/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_financial_distress", sheet("UK") modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_financial_distress", sheet("UK") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" // 13.exp_emp -putexcel A3 = "UnemployedToEmployed" // 31.exp_emp -putexcel A4 = "PersistentUnemployed" // 33.exp_emp -putexcel A5 = "Lhw_10" // 10.lhw_c5 -putexcel A6 = "Lhw_20" // 20.lhw_c5 -putexcel A7 = "Lhw_30" // 30.lhw_c5 -putexcel A8 = "Lhw_40" // 40.lhw_c5 -putexcel A9 = "RealIncomeChange" // D.log_income -putexcel A10 = "RealIncomeDecrease_D" // 1.exp_incchange -putexcel A11 = "NonPovertyToPoverty" // 1.exp_poverty -putexcel A12 = "PovertyToNonPoverty" // 2.exp_poverty -putexcel A13 = "PersistentPoverty" // 3.exp_poverty -putexcel A14 = "Ypncp_L1" // L.ypncp -putexcel A15 = "Ypnoab_L1" // L.ypnoab -putexcel A16 = "D_Econ_benefits" // 1L.econ_benefits -putexcel A17 = "D_Home_owner_L1" // 1L.dhh_owned -putexcel A18 = "Dcpst_Single_L1" // 2L.dcpst -putexcel A19 = "Dnc_L1" // L.dnc -putexcel A20 = "Dhe_pcs_L1" // L.dhe_pcs -putexcel A21 = "Dhe_mcs_L1" // L.dhe_mcs -putexcel A22 = "UKC" // 1L.drgn1 -putexcel A23 = "UKD" // 2L.drgn1 -putexcel A24 = "UKE" // 4L.drgn1 -putexcel A25 = "UKF" // 5L.drgn1 -putexcel A26 = "UKG" // 6L.drgn1 -putexcel A27 = "UKH" // 7L.drgn1 -putexcel A28 = "UKJ" // 9L.drgn1 -putexcel A29 = "UKK" // 10L.drgn1 -putexcel A30 = "UKL" // 11L.drgn1 -putexcel A31 = "UKM" // 12L.drgn1 -putexcel A32 = "UKN" // 13L.drgn1 -putexcel A33 = "Ydses_c5_Q2_L1" // 2L.ydses_c5 -putexcel A34 = "Ydses_c5_Q3_L1" // 3L.ydses_c5 -putexcel A35 = "Ydses_c5_Q4_L1" // 4L.ydses_c5 -putexcel A36 = "Ydses_c5_Q5_L1" // 5L.ydses_c5 -putexcel A37 = "Dlltsd01_L1" // L.dlltsd01 -putexcel A38 = "FinancialDistress" // L.financial_distress -putexcel A39 = "Dgn" // 1.dgn -putexcel A40 = "Dag_L1" // L.dag -putexcel A41 = "Dag_sq_L1" // L.dagsq -putexcel A42 = "Deh_c3_Medium" // 2.deh_c3 -putexcel A43 = "Deh_c3_Low" // 3.deh_c3 -putexcel A44 = "EthnicityAsian" // 2.dot -putexcel A45 = "EthnicityBlack" // 3.dot -putexcel A46 = "EthnicityOther" // 4.dot -putexcel A47 = "Year_transformed" // stm -putexcel A48 = "Constant" // _cons - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" // 13.exp_emp -putexcel D1 = "UnemployedToEmployed" // 31.exp_emp -putexcel E1 = "PersistentUnemployed" // 33.exp_emp -putexcel F1 = "Lhw_10" // 10.lhw_c5 -putexcel G1 = "Lhw_20" // 20.lhw_c5 -putexcel H1 = "Lhw_30" // 30.lhw_c5 -putexcel I1 = "Lhw_40" // 40.lhw_c5 -putexcel J1 = "RealIncomeChange" // D.log_income -putexcel K1 = "RealIncomeDecrease_D" // 1.exp_incchange -putexcel L1 = "NonPovertyToPoverty" // 1.exp_poverty -putexcel M1 = "PovertyToNonPoverty" // 2.exp_poverty -putexcel N1 = "PersistentPoverty" // 3.exp_poverty -putexcel O1 = "Ypncp_L1" // L.ypncp -putexcel P1 = "Ypnoab_L1" // L.ypnoab -putexcel Q1 = "D_Econ_benefits" // 1L.econ_benefits -putexcel R1 = "D_Home_owner_L1" // 1L.dhh_owned -putexcel S1 = "Dcpst_Single_L1" // 2L.dcpst -putexcel T1 = "Dnc_L1" // L.dnc -putexcel U1 = "Dhe_pcs_L1" // L.dhe_pcs -putexcel V1 = "Dhe_mcs_L1" // L.dhe_mcs -putexcel W1 = "UKC" // 1L.drgn1 -putexcel X1 = "UKD" // 2L.drgn1 -putexcel Y1 = "UKE" // 4L.drgn1 -putexcel Z1 = "UKF" // 5L.drgn1 -putexcel AA1 = "UKG" // 6L.drgn1 -putexcel AB1 = "UKH" // 7L.drgn1 -putexcel AC1 = "UKJ" // 9L.drgn1 -putexcel AD1 = "UKK" // 10L.drgn1 -putexcel AE1 = "UKL" // 11L.drgn1 -putexcel AF1 = "UKM" // 12L.drgn1 -putexcel AG1 = "UKN" // 13L.drgn1 -putexcel AH1 = "Ydses_c5_Q2_L1" // 2L.ydses_c5 -putexcel AI1 = "Ydses_c5_Q3_L1" // 3L.ydses_c5 -putexcel AJ1 = "Ydses_c5_Q4_L1" // 4L.ydses_c5 -putexcel AK1 = "Ydses_c5_Q5_L1" // 5L.ydses_c5 -putexcel AL1 = "Dlltsd01_L1" // L.dlltsd01 -putexcel AM1 = "FinancialDistress" // L.financial_distress -putexcel AN1 = "Dgn" // 1.dgn -putexcel AO1 = "Dag_L1" // L.dag -putexcel AP1 = "Dag_sq_L1" // L.dagsq -putexcel AQ1 = "Deh_c3_Medium" // 2.deh_c3 -putexcel AR1 = "Deh_c3_Low" // 3.deh_c3 -putexcel AS1 = "EthnicityAsian" // 2.dot -putexcel AT1 = "EthnicityBlack" // 3.dot -putexcel AU1 = "EthnicityOther" // 4.dot -putexcel AV1 = "Year_transformed" // stm -putexcel AW1 = "Constant" // _cons - -drop in_sample p -scalar drop r2_p N chi2 ll + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + Lhw_10 Lhw_20 Lhw_30 Lhw_40 /// + RealIncomeChange RealIncomeDecrease_D NoPoverty PovertyToNonPoverty PersistentPoverty /// + L_Ypncp L_Ypnoab /// + D_Econ_benefits Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Dhe_pcs L_Dhe_mcs /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 L_FinancialDistress /// + Dgn Dag_L1 Dag_sq_L1 /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${findis_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("financial_distress") process("FinDis") sheet("FinDis") /// + title("Process FinDis: Financial Distress (0/1)") /// + gofrow(3) goflabel("Financial Distress") /// + ifcond("${findis_if_condition}") + + +************************************************************************** +* END +************************************************************************** diff --git a/input/InitialPopulations/compile/RegressionEstimates/12_reg_health_mental.do b/input/InitialPopulations/compile/RegressionEstimates/12_reg_health_mental.do index 831e52eae..17df3d426 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/12_reg_health_mental.do +++ b/input/InitialPopulations/compile/RegressionEstimates/12_reg_health_mental.do @@ -1,982 +1,215 @@ -******************************************************************************** -* PROJECT: UC and mental health -* SECTION: Health and wellbeing -* OBJECT: Health status and Disability -* AUTHORS: Andy Baxter -* LAST UPDATE: 17 Feb 2026 -* COUNTRY: UK -* -* NOTES: -* - This file updates GHQ12 Level (0-36) and Caseness (0-12) variables -******************************************************************************** +/****************************************************************************/ +* PROJECT: SimPaths UK +* SECTION: Mental Health +* OBJECT: Final Regresion Models +* AUTHORS: Andy Baxter +* LAST UPDATE: 3 September 2026 (AB) +* COUNTRY: UK +******************************************************************************/ + clear all set more off set mem 200m +set type double +//set maxvar 120000 set maxvar 30000 -******************************************************************* +/********************************* SET LOG FILE *******************************/ cap log close -log using "${dir_log}/reg_health_mental.log", replace -******************************************************************* - -/********************************* PREPARE DATA *******************************/ +log using "${dir_log}/reg_health_mental_simple.log", replace -use ${estimation_sample}, clear - -* Set data -xtset idperson swv -sort idperson swv -* Adjust variables -do "${dir_do}/variable_update.do" -/* DP: Household income/poverty/employment transition variables are moved to variable_update.do */ +/********************************* SET EXCEL FILE *****************************/ -* Remove children -drop if dag < 16 +putexcel set "$dir_results/reg_health_mental_simple", sheet("Info") modify //replace +putexcel A1 = "Description:", bold +putexcel B1 = "This file contains regression estimates used by mental health (HM*) processes" +putexcel A2 = "Authors:" +putexcel B2 = "Andy Baxter" +putexcel A3 = "Last edit: 3 September 2026 (AB)" -********************************************************************** -* HM1_L: GHQ12 score 0-36 of all working-age adults - baseline effects * -********************************************************************** +putexcel A5 = "Process:", bold +putexcel B5 = "Description:", bold -reg dhm /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhm /// -L.dag L.dagsq i.deh_c3 i.dot i.dgn stm /// -[pweight=${weight}] /// -, vce(cluster idperson) +putexcel A6 = "Process HM1_L" +putexcel B6 = "Mental Health (level), Stage 1 - estimated before labour supply : GHQ score 0-36" +putexcel A7 = "Process HM2_Females_L" +putexcel B7 = "Mental Health (level), Stage 2 - causal estimate post labour-supply (Females) : GHQ score 0-36" +putexcel A8 = "Process HM2_Males_L" +putexcel B8 = "Mental Health (level), Stage 2 - causal estimate post labour-supply (Males) : GHQ score 0-36" +putexcel A9 = "Process HM1_C" +putexcel B9 = "Mental Health (categorical), Stage 1 - estimated before labour supply : GHQ score 0-12" +putexcel A10 = "Process HM2_Females_C" +putexcel B10 = "Mental Health (categorical), Stage 2 - causal estimate post labour-supply (Females) : GHQ score 0-12" +putexcel A11 = "Process HM2_Males_C" +putexcel B11 = "Mental Health (categorical), Stage 2 - causal estimate post labour-supply (Males) : GHQ score 0-12" - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM1_L") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) +putexcel set "$dir_results/reg_health_mental_simple", sheet("Gof") modify +putexcel A1 = "Goodness of fit", bold -gen in_sample = e(sample) +/********************************* PREPARE DATA *******************************/ -predict p +* Load data +use "${estimation_sample}", clear -save "$dir_validation_data/HM1_L_sample", replace +* Set data +xtset idperson swv +sort idperson swv +* Adjust variables +do "${dir_do}/variable_update.do" + -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) +/********************************** ESTIMATION ********************************/ +* Run Stata programs to produce Excel file +do "${dir_do}/programs.do" -* Results -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) +/**************************** HM1_L: GHQ score 0-36 ***************************/ -* Store variance-covariance matrix +reg dhm /// + Ded Dgn Dag Dag_sq /// + Dhm_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb1_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("health_mental_simple") process("HM1_L") sheet("HM1_L") /// + title("Process HM1_L: GHQ score 0-36") /// + gofrow(3) goflabel("HM1_L GHQ score 0-36") /// + ifcond("${hwb1_if_condition}") + +* Calculate RMSE +cap drop residuals squared_residuals +predict residuals , residuals +gen squared_residuals = residuals^2 preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM1_L", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM1_L") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "D_Home_owner_L1" -putexcel A3 = "Dcpst_Single_L1" -putexcel A4 = "Dnc_L1" -putexcel A5 = "Dhe_pcs_L1" -putexcel A6 = "UKC" -putexcel A7 = "UKD" -putexcel A8 = "UKE" -putexcel A9 = "UKF" -putexcel A10 = "UKG" -putexcel A11 = "UKH" -putexcel A12 = "UKJ" -putexcel A13 = "UKK" -putexcel A14 = "UKL" -putexcel A15 = "UKM" -putexcel A16 = "UKN" -putexcel A17 = "Ydses_c5_Q2_L1" -putexcel A18 = "Ydses_c5_Q3_L1" -putexcel A19 = "Ydses_c5_Q4_L1" -putexcel A20 = "Ydses_c5_Q5_L1" -putexcel A21 = "Dlltsd01_L1" -putexcel A22 = "Dhm_L1" -putexcel A23 = "Dag_L1" -putexcel A24 = "Dag_sq_L1" -putexcel A25 = "Deh_c3_Medium" -putexcel A26 = "Deh_c3_Low" -putexcel A27 = "EthnicityAsian" -putexcel A28 = "EthnicityBlack" -putexcel A29 = "EthnicityOther" -putexcel A30 = "Dgn" -putexcel A31 = "Year_transformed" -putexcel A32 = "Constant" - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "D_Home_owner_L1" -putexcel D1 = "Dcpst_Single_L1" -putexcel E1 = "Dnc_L1" -putexcel F1 = "Dhe_pcs_L1" -putexcel G1 = "UKC" -putexcel H1 = "UKD" -putexcel I1 = "UKE" -putexcel J1 = "UKF" -putexcel K1 = "UKG" -putexcel L1 = "UKH" -putexcel M1 = "UKJ" -putexcel N1 = "UKK" -putexcel O1 = "UKL" -putexcel P1 = "UKM" -putexcel Q1 = "UKN" -putexcel R1 = "Ydses_c5_Q2_L1" -putexcel S1 = "Ydses_c5_Q3_L1" -putexcel T1 = "Ydses_c5_Q4_L1" -putexcel U1 = "Ydses_c5_Q5_L1" -putexcel V1 = "Dlltsd01_L1" -putexcel W1 = "Dhm_L1" -putexcel X1 = "Dag_L1" -putexcel Y1 = "Dag_sq_L1" -putexcel Z1 = "Deh_c3_Medium" -putexcel AA1 = "Deh_c3_Low" -putexcel AB1 = "EthnicityAsian" -putexcel AC1 = "EthnicityBlack" -putexcel AD1 = "EthnicityOther" -putexcel AE1 = "Dgn" -putexcel AF1 = "Year_transformed" -putexcel AG1 = "Constant" - -* save RMSE +sum squared_residuals [w = dwt] +di "RMSE for GHQ score 0-36" sqrt(r(mean)) putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A13 = ("HM1_L") B13 = rmse +putexcel A13 = ("HM1_L") B13 = (sqrt(r(mean))) +restore -drop in_sample p - -scalar drop r2_p N chi2 ll - -*************************************************************** -* HM2_Females_L: GHQ12 Score 0-36 - causal employment effects * -*************************************************************** +/************************** HM2_Females_L: GHQ score 0-36 *********************/ *Stage 2 -*Female reghdfe dhm /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhm /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==0 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM2_Females_L") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dhm_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 0 [pw=${weight}], absorb(idperson) vce(cluster idperson) -save "$dir_validation_data/HM2_Females_L_sample", replace +process_regression, domain("health_mental_simple") process("HM2_Females_L") sheet("HM2_Females_L") /// + title("Process HM2_Females_L: GHQ score 0-36") /// + gofrow(7) goflabel("HM2_Females_L: GHQ score 0-36") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Females_L", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Females_L") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A14 = ("HM2_Females_L") B14 = rmse - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* HM2_Males_L: GHQ12 Score 0-36 - causal employment effects * -*************************************************************** +/************************** HM2_Males_L: GHQ score 0-36 *********************/ *Stage 2 -*Male reghdfe dhm /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhm /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==1 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM2_Males_L") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/HM2_Males_L_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dhm_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 1 [pw=${weight}], absorb(idperson) vce(cluster idperson) -preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Males_L", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Males_L") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A15 = ("HM2_Males_L") B15 = rmse - -drop in_sample p -scalar drop r2_p N chi2 ll - - -********************************************************************** -* HM1_C: GHQ12 score 0-12 of all working-age adults - baseline effects * -********************************************************************** - -* New ordered logistic regression model, reflecting observed distributions - -ologit scghq2_dv /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.scghq2_dv /// -L.dag L.dagsq i.deh_c3 i.dot i.dgn stm /// -if stm!=20 & stm!=21 & dag>=25 & dag<=64 & swv!=12 /// -[pweight=${weight}] /// -, vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM1_C") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/HM1_C_sample", replace +process_regression, domain("health_mental_simple") process("HM2_Males_L") sheet("HM2_Males_L") /// + title("Process HM2_Males_L: GHQ score 0-36") /// + gofrow(11) goflabel("HM2_Males_L: GHQ score 0-36") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) +/************************** HM1_C: GHQ score 0-12 *********************/ -* Results +*Stage 1 +ologit dhm_ghq /// + Ded Dgn Dag Dag_sq /// + Dhmghq_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} [pw=${weight}], vce(robust) -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) +process_ologit, domain("health_mental_simple") process("HM1_C") sheet("HM1_C") /// + title("Process HM1_C:Post-labour supply GHQ score 0-12") /// + gofrow(15) goflabel("HM1_C: GHQ score 0-12") /// + ifcond("${hwb2_if_condition}") -* Store variance-covariance matrix -preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM1_C", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM1_C") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "D_Home_owner_L1" -putexcel A3 = "Dcpst_Single_L1" -putexcel A4 = "Dnc_L1" -putexcel A5 = "Dhe_pcs_L1" -putexcel A6 = "UKC" -putexcel A7 = "UKD" -putexcel A8 = "UKE" -putexcel A9 = "UKF" -putexcel A10 = "UKG" -putexcel A11 = "UKH" -putexcel A12 = "UKJ" -putexcel A13 = "UKK" -putexcel A14 = "UKL" -putexcel A15 = "UKM" -putexcel A16 = "UKN" -putexcel A17 = "Ydses_c5_Q2_L1" -putexcel A18 = "Ydses_c5_Q3_L1" -putexcel A19 = "Ydses_c5_Q4_L1" -putexcel A20 = "Ydses_c5_Q5_L1" -putexcel A21 = "Dlltsd01_L1" -putexcel A22 = "Dhm_L1" -putexcel A23 = "Dag_L1" -putexcel A24 = "Dag_sq_L1" -putexcel A25 = "Deh_c3_Medium" -putexcel A26 = "Deh_c3_Low" -putexcel A27 = "EthnicityAsian" -putexcel A28 = "EthnicityBlack" -putexcel A29 = "EthnicityOther" -putexcel A30 = "Dgn" -putexcel A31 = "Year_transformed" -putexcel A32 = "Cut1" -putexcel A33 = "Cut2" -putexcel A34 = "Cut3" -putexcel A35 = "Cut4" -putexcel A36 = "Cut5" -putexcel A37 = "Cut6" -putexcel A38 = "Cut7" -putexcel A39 = "Cut8" -putexcel A40 = "Cut9" -putexcel A41 = "Cut10" -putexcel A42 = "Cut11" -putexcel A43 = "Cut12" - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "D_Home_owner_L1" -putexcel D1 = "Dcpst_Single_L1" -putexcel E1 = "Dnc_L1" -putexcel F1 = "Dhe_pcs_L1" -putexcel G1 = "UKC" -putexcel H1 = "UKD" -putexcel I1 = "UKE" -putexcel J1 = "UKF" -putexcel K1 = "UKG" -putexcel L1 = "UKH" -putexcel M1 = "UKJ" -putexcel N1 = "UKK" -putexcel O1 = "UKL" -putexcel P1 = "UKM" -putexcel Q1 = "UKN" -putexcel R1 = "Ydses_c5_Q2_L1" -putexcel S1 = "Ydses_c5_Q3_L1" -putexcel T1 = "Ydses_c5_Q4_L1" -putexcel U1 = "Ydses_c5_Q5_L1" -putexcel V1 = "Dlltsd01_L1" -putexcel W1 = "Dhm_L1" -putexcel X1 = "Dag_L1" -putexcel Y1 = "Dag_sq_L1" -putexcel Z1 = "Deh_c3_Medium" -putexcel AA1 = "Deh_c3_Low" -putexcel AB1 = "EthnicityAsian" -putexcel AC1 = "EthnicityBlack" -putexcel AD1 = "EthnicityOther" -putexcel AE1 = "Dgn" -putexcel AF1 = "Year_transformed" -putexcel AG1 = "Cut1" -putexcel AH1 = "Cut2" -putexcel AI1 = "Cut3" -putexcel AJ1 = "Cut4" -putexcel AK1 = "Cut5" -putexcel AL1 = "Cut6" -putexcel AM1 = "Cut7" -putexcel AN1 = "Cut8" -putexcel AO1 = "Cut9" -putexcel AP1 = "Cut10" -putexcel AQ1 = "Cut11" -putexcel AR1 = "Cut12" - -/* save RMSE - not strictly needed for ologit predictions -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A16 = ("HM1_C") B16 = rmse -*/ - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* HM2_Females_C: GHQ12 Score 0-12 - causal employment effects * -*************************************************************** - -* Kept as linear as adding an 'additional' causal effect on baseline - -gen RealIncomeDecrease_D = log_income - L.log_income -gen scghq2_dv_L1 = L.scghq2_dv +/************************** HM2_Females_C: GHQ score 0-12 *********************/ *Stage 2 -*Female -reghdfe scghq2_dv /// -ib11.exp_emp i.exp_poverty i.exp_incchange RealIncomeDecrease_D financial_distress /// -y2020 y2021 /// -i.dhh_owned i.dcpst dnc dhe_pcs ib8.drgn i.ydses_c5 dlltsd01 /// -dag dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==0 /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM2_Females_C") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/HM2_Females_C_sample", replace +reghdfe dhm_ghq /// + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dhmghq_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 0 [pw=${weight}], absorb(idperson) vce(cluster idperson) +process_regression, domain("health_mental_simple") process("HM2_Females_C") sheet("HM2_Females_C") /// + title("Process HM2_Females_C: GHQ score 0-12") /// + gofrow(19) goflabel("HM2_Females_C: GHQ score 0-12") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Females_C", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Females_C") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A16 = ("HM2_Females_C") B16 = rmse - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* HM2_Males_C: GHQ12 Score 0-12 - causal employment effects * -*************************************************************** - +/************************** HM2_Males_C: GHQ score 0-12 *********************/ *Stage 2 -*Male -reghdfe scghq2_dv /// -ib11.exp_emp i.exp_poverty i.exp_incchange RealIncomeDecrease_D financial_distress /// -y2020 y2021 /// -i.dhh_owned i.dcpst dnc dhe_pcs ib8.drgn i.ydses_c5 dlltsd01 /// -dag dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==1 /// -, absorb(idperson) vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_mental/health_mental", sheet("HM2_Males_C") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) +reghdfe dhm_ghq /// + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dhmghq_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 1 [pw=${weight}], absorb(idperson) vce(cluster idperson) + +process_regression, domain("health_mental_simple") process("HM2_Males_C") sheet("HM2_Males_C") /// + title("Process HM2_Males_C: GHQ score 0-12") /// + gofrow(23) goflabel("HM2_Males_C: GHQ score 0-12") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -predict p -save "$dir_validation_data/HM2_Males_C_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_mental/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_mental/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Males_C", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_mental", sheet("HM2_Males_C") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A17 = ("HM2_Males_C") B17 = rmse -drop in_sample p -scalar drop r2_p N chi2 ll diff --git a/input/InitialPopulations/compile/RegressionEstimates/13_reg_health_wellbeing.do b/input/InitialPopulations/compile/RegressionEstimates/13_reg_health_wellbeing.do index b3319bc94..33c67189c 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/13_reg_health_wellbeing.do +++ b/input/InitialPopulations/compile/RegressionEstimates/13_reg_health_wellbeing.do @@ -1,28 +1,63 @@ -******************************************************************************** -* PROJECT: UC and mental health -* SECTION: Health and wellbeing -* OBJECT: Health status and Disability -* AUTHORS: Andy Baxter -* LAST UPDATE: 17 Feb 2026 -* COUNTRY: UK -* -* NOTES: -* - This file updates SF12 MCS and PCS, and Life Satisfaction (7 levels) -******************************************************************************** +/****************************************************************************/ +* PROJECT: SimPaths UK +* SECTION: Wellbeing +* OBJECT: Final Regresion Models +* AUTHORS: Andy Baxter +* LAST UPDATE: 3 September 2026 (AB) +* COUNTRY: UK +******************************************************************************/ + clear all set more off set mem 200m +set type double +//set maxvar 120000 set maxvar 30000 -******************************************************************* +/********************************* SET LOG FILE *******************************/ cap log close -log using "${dir_log}/reg_health_wellbeing.log", replace -******************************************************************* +log using "${dir_log}/reg_health_wellbeing_simple.log", replace + + +/********************************* SET EXCEL FILE *****************************/ + +putexcel set "$dir_results/reg_health_wellbeing_simple", sheet("Info") modify //replace +putexcel A1 = "Description:", bold +putexcel B1 = "This file contains regression estimates for wellbeing processes: MCS, PCS and Life Satisfaction scores" +putexcel A2 = "Authors:" +putexcel B2 = "Andy Baxter" +putexcel A3 = "Last edit: 3 September 2026 (AB)" + +putexcel A5 = "Process:", bold +putexcel B5 = "Description:", bold + +putexcel A6 = "Process DHE_MCS1" +putexcel B6 = "Mental Wellbeing, Stage 1 - estimated before labour supply : SF12 MCS Score (0-100)" +putexcel A7 = "Process DHE_MCS2_Females" +putexcel B7 = "Mental Wellbeing, Stage 2 - causal estimate post labour-supply (Females) : SF12 MCS Score (0-100)" +putexcel A8 = "Process DHE_MCS2_Males" +putexcel B8 = "Mental Wellbeing, Stage 2 - causal estimate post labour-supply (Males) : SF12 MCS Score (0-100)" +putexcel A9 = "Process DHE_PCS1" +putexcel B9 = "Phsyical Wellbeing, Stage 1 - estimated before labour supply : SF12 PCS Score (0-100)" +putexcel A10 = "Process DHE_PCS2_Females" +putexcel B10 = "Phsyical Wellbeing, Stage 2 - causal estimate post labour-supply (Females) : SF12 PCS Score (0-100)" +putexcel A11 = "Process DHE_PCS2_Males" +putexcel B11 = "Phsyical Wellbeing, Stage 2 - causal estimate post labour-supply (Males) : SF12 PCS Score (0-100)" +putexcel A12 = "Process DLS1" +putexcel B12 = "Life Satisfaction, Stage 1 - estimated before labour supply : Life Satisfaction Score (0-10)" +putexcel A13 = "Process DLS2_Females" +putexcel B13 = "Life Satisfaction, Stage 2 - causal estimate post labour-supply (Females) : Life Satisfaction Score (0-10)" +putexcel A14 = "Process DLS2_Males" +putexcel B14 = "Life Satisfaction, Stage 2 - causal estimate post labour-supply (Males) : Life Satisfaction Score (0-10)" + +putexcel set "$dir_results/reg_health_wellbeing_simple", sheet("Gof") modify +putexcel A1 = "Goodness of fit", bold /********************************* PREPARE DATA *******************************/ -use ${estimation_sample}, clear +* Load data +use "${estimation_sample}", clear * Set data xtset idperson swv @@ -30,1402 +65,241 @@ sort idperson swv * Adjust variables do "${dir_do}/variable_update.do" -/* DP: Household income/poverty/employment transition variables are moved to variable_update.do */ + -* Remove children -drop if dag < 16 +/********************************** ESTIMATION ********************************/ +* Run Stata programs to produce Excel file +do "${dir_do}/programs.do" -******************************************************************************** -* DHE_MCS1 - SF12 MCS score 0-100 of all working-age adults - baseline effects * -******************************************************************************** +/**************************** DHE_MCS1: SF12 MCS Score (0-100) ***************************/ reg dhe_mcs /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_mcs /// -L.dag L.dagsq i.deh_c3 i.dot i.dgn stm /// -[pweight=${weight}] /// -, vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_MCS1") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DHE_MCS1_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) - - -* Store variance-covariance matrix + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb1_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("health_wellbeing_simple") process("DHE_MCS1") sheet("DHE_MCS1") /// + title("Process DHE_MCS1: SF12 MCS Score (0-100)") /// + gofrow(3) goflabel("DHE_MCS1 SF12 MCS Score (0-100)") /// + ifcond("${hwb1_if_condition}") + +* Calculate RMSE +cap drop residuals squared_residuals +predict residuals , residuals +gen squared_residuals = residuals^2 preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS1", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS1") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "D_Home_owner_L1" -putexcel A3 = "Dcpst_Single_L1" -putexcel A4 = "Dnc_L1" -putexcel A5 = "Dhe_pcs_L1" -putexcel A6 = "UKC" -putexcel A7 = "UKD" -putexcel A8 = "UKE" -putexcel A9 = "UKF" -putexcel A10 = "UKG" -putexcel A11 = "UKH" -putexcel A12 = "UKJ" -putexcel A13 = "UKK" -putexcel A14 = "UKL" -putexcel A15 = "UKM" -putexcel A16 = "UKN" -putexcel A17 = "Ydses_c5_Q2_L1" -putexcel A18 = "Ydses_c5_Q3_L1" -putexcel A19 = "Ydses_c5_Q4_L1" -putexcel A20 = "Ydses_c5_Q5_L1" -putexcel A21 = "Dlltsd01_L1" -putexcel A22 = "Dhe_mcs_L1" -putexcel A23 = "Dag_L1" -putexcel A24 = "Dag_sq_L1" -putexcel A25 = "Deh_c3_Medium" -putexcel A26 = "Deh_c3_Low" -putexcel A27 = "EthnicityAsian" -putexcel A28 = "EthnicityBlack" -putexcel A29 = "EthnicityOther" -putexcel A30 = "Dgn" -putexcel A31 = "Year_transformed" -putexcel A32 = "Constant" - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "D_Home_owner_L1" -putexcel D1 = "Dcpst_Single_L1" -putexcel E1 = "Dnc_L1" -putexcel F1 = "Dhe_pcs_L1" -putexcel G1 = "UKC" -putexcel H1 = "UKD" -putexcel I1 = "UKE" -putexcel J1 = "UKF" -putexcel K1 = "UKG" -putexcel L1 = "UKH" -putexcel M1 = "UKJ" -putexcel N1 = "UKK" -putexcel O1 = "UKL" -putexcel P1 = "UKM" -putexcel Q1 = "UKN" -putexcel R1 = "Ydses_c5_Q2_L1" -putexcel S1 = "Ydses_c5_Q3_L1" -putexcel T1 = "Ydses_c5_Q4_L1" -putexcel U1 = "Ydses_c5_Q5_L1" -putexcel V1 = "Dlltsd01_L1" -putexcel W1 = "Dhe_mcs_L1" -putexcel X1 = "Dag_L1" -putexcel Y1 = "Dag_sq_L1" -putexcel Z1 = "Deh_c3_Medium" -putexcel AA1 = "Deh_c3_Low" -putexcel AB1 = "EthnicityAsian" -putexcel AC1 = "EthnicityBlack" -putexcel AD1 = "EthnicityOther" -putexcel AE1 = "Dgn" -putexcel AF1 = "Year_transformed" -putexcel AG1 = "Constant" - -* save RMSE +sum squared_residuals [w = dwt] +di "RMSE for SF12 MCS Score (0-100)" sqrt(r(mean)) putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A18 = ("DHE_MCS1") B18 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - - -*************************************************************** -* DHE_MCS2_Females: SF12 MCS score 0-100 - causal employment effects * -*************************************************************** +putexcel A14 = ("DHE_MCS1") B14 = (sqrt(r(mean))) +restore +/************************** DHE_MCS2_Females: SF12 MCS Score (0-100) *********************/ *Stage 2 -*Female reghdfe dhe_mcs /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_mcs /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==0 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_MCS2_Females") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 0 [pw=${weight}], absorb(idperson) vce(cluster idperson) -predict p +process_regression, domain("health_wellbeing_simple") process("DHE_MCS2_Females") sheet("DHE_MCS2_Females") /// + title("Process DHE_MCS2_Females: SF12 MCS Score (0-100)") /// + gofrow(7) goflabel("DHE_MCS2_Females: SF12 MCS Score (0-100)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -save "$dir_validation_data/DHE_MCS2_Females_sample", replace -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS2_Females", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS2_Females") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A19 = ("DHE_MCS2_Females") B19 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* DHE_MCS2_Males: SF12 MCS score 0-100 - causal employment effects * -*************************************************************** - +/************************** DHE_MCS2_Males: SF12 MCS Score (0-100) *********************/ *Stage 2 -*Male reghdfe dhe_mcs /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_mcs /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==1 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_MCS2_Males") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DHE_MCS2_Males_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 1 [pw=${weight}], absorb(idperson) vce(cluster idperson) +process_regression, domain("health_wellbeing_simple") process("DHE_MCS2_Males") sheet("DHE_MCS2_Males") /// + title("Process DHE_MCS2_Males: SF12 MCS Score (0-100)") /// + gofrow(11) goflabel("DHE_MCS2_Males: SF12 MCS Score (0-100)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -* Results -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS2_Males", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_MCS2_Males") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A20 = ("DHE_MCS2_Males") B20 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - - -******************************************************************************* -* DHE_PCS1 - SF12 PCS score 0-100 of all working-age adults - baseline effects * -******************************************************************************** +/**************************** DHE_PCS1: SF12 PCS Score (0-100) ***************************/ reg dhe_pcs /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_mcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_pcs /// -L.dag L.dagsq i.deh_c3 i.dot i.dgn stm /// -[pweight=${weight}] /// -, vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_PCS1") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DHE_PCS1_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) - - -* Store variance-covariance matrix + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb1_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("health_wellbeing_simple") process("DHE_PCS1") sheet("DHE_PCS1") /// + title("Process DHE_PCS1: SF12 PCS Score (0-100)") /// + gofrow(15) goflabel("DHE_PCS1 SF12 PCS Score (0-100)") /// + ifcond("${hwb1_if_condition}") + +* Calculate RMSE +cap drop residuals squared_residuals +predict residuals , residuals +gen squared_residuals = residuals^2 preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS1", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS1") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "D_Home_owner_L1" -putexcel A3 = "Dcpst_Single_L1" -putexcel A4 = "Dnc_L1" -putexcel A5 = "Dhe_mcs_L1" -putexcel A6 = "UKC" -putexcel A7 = "UKD" -putexcel A8 = "UKE" -putexcel A9 = "UKF" -putexcel A10 = "UKG" -putexcel A11 = "UKH" -putexcel A12 = "UKJ" -putexcel A13 = "UKK" -putexcel A14 = "UKL" -putexcel A15 = "UKM" -putexcel A16 = "UKN" -putexcel A17 = "Ydses_c5_Q2_L1" -putexcel A18 = "Ydses_c5_Q3_L1" -putexcel A19 = "Ydses_c5_Q4_L1" -putexcel A20 = "Ydses_c5_Q5_L1" -putexcel A21 = "Dlltsd01_L1" -putexcel A22 = "Dhe_pcs_L1" -putexcel A23 = "Dag_L1" -putexcel A24 = "Dag_sq_L1" -putexcel A25 = "Deh_c3_Medium" -putexcel A26 = "Deh_c3_Low" -putexcel A27 = "EthnicityAsian" -putexcel A28 = "EthnicityBlack" -putexcel A29 = "EthnicityOther" -putexcel A30 = "Dgn" -putexcel A31 = "Year_transformed" -putexcel A32 = "Constant" - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "D_Home_owner_L1" -putexcel D1 = "Dcpst_Single_L1" -putexcel E1 = "Dnc_L1" -putexcel F1 = "Dhe_mcs_L1" -putexcel G1 = "UKC" -putexcel H1 = "UKD" -putexcel I1 = "UKE" -putexcel J1 = "UKF" -putexcel K1 = "UKG" -putexcel L1 = "UKH" -putexcel M1 = "UKJ" -putexcel N1 = "UKK" -putexcel O1 = "UKL" -putexcel P1 = "UKM" -putexcel Q1 = "UKN" -putexcel R1 = "Ydses_c5_Q2_L1" -putexcel S1 = "Ydses_c5_Q3_L1" -putexcel T1 = "Ydses_c5_Q4_L1" -putexcel U1 = "Ydses_c5_Q5_L1" -putexcel V1 = "Dlltsd01_L1" -putexcel W1 = "Dhe_pcs_L1" -putexcel X1 = "Dag_L1" -putexcel Y1 = "Dag_sq_L1" -putexcel Z1 = "Deh_c3_Medium" -putexcel AA1 = "Deh_c3_Low" -putexcel AB1 = "EthnicityAsian" -putexcel AC1 = "EthnicityBlack" -putexcel AD1 = "EthnicityOther" -putexcel AE1 = "Dgn" -putexcel AF1 = "Year_transformed" -putexcel AG1 = "Constant" - -* save RMSE +sum squared_residuals [w = dwt] +di "RMSE for SF12 PCS Score (0-100)" sqrt(r(mean)) putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A21 = ("DHE_PCS1") B21 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - - -*************************************************************** -* DHE_PCS2_Females: SF12 PCS score 0-100 - causal employment effects * -*************************************************************** +putexcel A15 = ("DHE_PCS1") B15 = (sqrt(r(mean))) +restore +/************************** DHE_PCS2_Females: SF12 PCS Score (0-100) *********************/ *Stage 2 -*Female reghdfe dhe_pcs /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_mcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_pcs /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==0 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_PCS2_Females") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DHE_PCS2_Females_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 0 [pw=${weight}], absorb(idperson) vce(cluster idperson) -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear +process_regression, domain("health_wellbeing_simple") process("DHE_PCS2_Females") sheet("DHE_PCS2_Females") /// + title("Process DHE_PCS2_Females: SF12 PCS Score (0-100)") /// + gofrow(19) goflabel("DHE_PCS2_Females: SF12 PCS Score (0-100)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS2_Females", replace) modify -putexcel C2 = matrix(var) - -restore -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS2_Females") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A22 = ("DHE_PCS2_Females") B22 = rmse - - - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* DHE_PCS2_Males: SF12 PCS score 0-100 - causal employment effects * -*************************************************************** - +/************************** DHE_PCS2_Males: SF12 PCS Score (0-100) *********************/ *Stage 2 -*Male reghdfe dhe_pcs /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_mcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dhe_pcs /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==1 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DHE_PCS2_Males") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DHE_PCS2_Males_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS2_Males", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + L_Dhe_mcs L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 1 [pw=${weight}], absorb(idperson) vce(cluster idperson) -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b +process_regression, domain("health_wellbeing_simple") process("DHE_PCS2_Males") sheet("DHE_PCS2_Males") /// + title("Process DHE_PCS2_Males: SF12 PCS Score (0-100)") /// + gofrow(23) goflabel("DHE_PCS2_Males: SF12 PCS Score (0-100)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DHE_PCS2_Males") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A23 = ("DHE_PCS2_Males") B23 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - - -******************************************************************************* -* DLS1 - Life Satisfaction 1-7 of all working-age adults - baseline effects * -******************************************************************************** +/**************************** DLS1: Life Satisfaction Score (0-10) ***************************/ reg dls /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dls /// -L.dag L.dagsq i.deh_c3 i.dot i.dgn stm /// -[pweight=${weight}] /// -, vce(cluster idperson) - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1...]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DLS1") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DLS1_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) - - -* Store variance-covariance matrix + Ded Dgn Dag Dag_sq /// + Dls_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb1_if_condition} [pw=${weight}], vce(cluster idperson) + +process_regression, domain("health_wellbeing_simple") process("DLS1") sheet("DLS1") /// + title("Process DLS1: Life Satisfaction Score (0-10)") /// + gofrow(27) goflabel("DLS1 Life Satisfaction Score (0-10)") /// + ifcond("${hwb1_if_condition}") + +* Calculate RMSE +cap drop residuals squared_residuals +predict residuals , residuals +gen squared_residuals = residuals^2 preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS1", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS1") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "D_Home_owner_L1" -putexcel A3 = "Dcpst_Single_L1" -putexcel A4 = "Dnc_L1" -putexcel A5 = "Dhe_pcs_L1" -putexcel A6 = "UKC" -putexcel A7 = "UKD" -putexcel A8 = "UKE" -putexcel A9 = "UKF" -putexcel A10 = "UKG" -putexcel A11 = "UKH" -putexcel A12 = "UKJ" -putexcel A13 = "UKK" -putexcel A14 = "UKL" -putexcel A15 = "UKM" -putexcel A16 = "UKN" -putexcel A17 = "Ydses_c5_Q2_L1" -putexcel A18 = "Ydses_c5_Q3_L1" -putexcel A19 = "Ydses_c5_Q4_L1" -putexcel A20 = "Ydses_c5_Q5_L1" -putexcel A21 = "Dlltsd01_L1" -putexcel A22 = "Dls_L1" -putexcel A23 = "Dag_L1" -putexcel A24 = "Dag_sq_L1" -putexcel A25 = "Deh_c3_Medium" -putexcel A26 = "Deh_c3_Low" -putexcel A27 = "EthnicityAsian" -putexcel A28 = "EthnicityBlack" -putexcel A29 = "EthnicityOther" -putexcel A30 = "Dgn" -putexcel A31 = "Year_transformed" -putexcel A32 = "Constant" - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "D_Home_owner_L1" -putexcel D1 = "Dcpst_Single_L1" -putexcel E1 = "Dnc_L1" -putexcel F1 = "Dhe_pcs_L1" -putexcel G1 = "UKC" -putexcel H1 = "UKD" -putexcel I1 = "UKE" -putexcel J1 = "UKF" -putexcel K1 = "UKG" -putexcel L1 = "UKH" -putexcel M1 = "UKJ" -putexcel N1 = "UKK" -putexcel O1 = "UKL" -putexcel P1 = "UKM" -putexcel Q1 = "UKN" -putexcel R1 = "Ydses_c5_Q2_L1" -putexcel S1 = "Ydses_c5_Q3_L1" -putexcel T1 = "Ydses_c5_Q4_L1" -putexcel U1 = "Ydses_c5_Q5_L1" -putexcel V1 = "Dlltsd01_L1" -putexcel W1 = "Dls_L1" -putexcel X1 = "Dag_L1" -putexcel Y1 = "Dag_sq_L1" -putexcel Z1 = "Deh_c3_Medium" -putexcel AA1 = "Deh_c3_Low" -putexcel AB1 = "EthnicityAsian" -putexcel AC1 = "EthnicityBlack" -putexcel AD1 = "EthnicityOther" -putexcel AE1 = "Dgn" -putexcel AF1 = "Year_transformed" -putexcel AG1 = "Constant" - -* save RMSE +sum squared_residuals [w = dwt] +di "RMSE for Life Satisfaction Score (0-10)" sqrt(r(mean)) putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A24 = ("DLS1") B24 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - - -*************************************************************** -* DLS2_Females: Life Satisfaction 1-7 - causal employment effects * -*************************************************************** +putexcel A16 = ("DLS1") B16 = (sqrt(r(mean))) +restore +/************************** DLS2_Females: Life Satisfaction Score (0-10) *********************/ *Stage 2 -*Female reghdfe dls /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dls /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==0 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DLS2_Females") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dls_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 0 [pw=${weight}], absorb(idperson) vce(cluster idperson) -predict p +process_regression, domain("health_wellbeing_simple") process("DLS2_Females") sheet("DLS2_Females") /// + title("Process DLS2_Females: Life Satisfaction Score (0-10)") /// + gofrow(31) goflabel("DLS2_Females: Life Satisfaction Score (0-10)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) -save "$dir_validation_data/DLS2_Females_sample", replace -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS2_Females", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS2_Females") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A25 = ("DLS2_Females") B25 = rmse - - -drop in_sample p -scalar drop r2_p N chi2 ll - -*************************************************************** -* DLS2_Males: Life Satisfaction 1-7 - causal employment effects * -*************************************************************** - +/************************** DLS2_Males: Life Satisfaction Score (0-10) *********************/ *Stage 2 -*Male reghdfe dls /// -ib11.exp_emp i.exp_poverty i.exp_incchange D.log_income financial_distress /// -y2020 y2021 /// -L.i.dhh_owned L.i.dcpst L.dnc L.dhe_pcs L.ib8.drgn L.i.ydses_c5 L.dlltsd01 L.dls /// -L.dag L.dagsq i.deh_c3 stm /// -if dag>=25 & dag<=64 & dgn==1 /// -[pweight=${weight}] /// -, absorb(idperson) vce(cluster idperson) - - - * save raw results -matrix results = r(table) -matrix results = results[1..6,1..10]' -putexcel set "$dir_raw_results/health_wellbeing/health_wellbeing", sheet("DLS2_Males") replace -putexcel A3 = matrix(results), names nformat(number_d2) -putexcel J4 = matrix(e(V)) - -gen in_sample = e(sample) - -predict p - -save "$dir_validation_data/DLS2_Males_sample", replace - - -scalar r2_p = e(r2_p) -scalar N = e(N) -scalar rmse = e(rmse) -scalar chi2 = e(chi2) -scalar ll = e(ll) - - -* Results - -* Note: Zeros values are eliminated - -matrix b = e(b) -matrix V = e(V) -matrix V = V[1..14,1..14] - -forvalues i = 1/14 { - forvalues j = 1/14 { - if `i' == `j' { - continue - } - matrix V[`i',`j'] = 0 - } -} - -* Store variance-covariance matrix - -preserve - -putexcel set "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") replace -putexcel A1 = matrix(V) - -import excel "$dir_raw_results/health_wellbeing/var_cov", sheet("var_cov") clear - -describe -local no_vars = `r(k)' - -forvalues i = 1/2 { - egen row_sum = rowtotal(*) - drop if row_sum == 0 - drop row_sum - xpose, clear -} - -mkmat v*, matrix(var) -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS2_Males", replace) modify -putexcel C2 = matrix(var) - -restore - - -* Store estimated coefficients - -// Initialize a counter for non-zero coefficients -local non_zero_count = 0 -//local names : colnames b - -// Loop through each element in `b` to count non-zero coefficients -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - local non_zero_count = `non_zero_count' + 1 - } -} - -// Create a new row vector to hold only non-zero coefficients -matrix nonzero_b = J(1, `non_zero_count', .) - -// Populate nonzero_b with non-zero coefficients from b -local index = 1 -forvalues i = 1/`no_vars' { - if (b[1, `i'] != 0) { - matrix nonzero_b[1, `index'] = b[1, `i'] - local index = `index' + 1 - } -} - -putexcel set "$dir_results/reg_health_wellbeing", sheet("DLS2_Males") modify -putexcel A1 = matrix(nonzero_b'), names nformat(number_d2) - -* Labelling - -putexcel A1 = "REGRESSOR" -putexcel A2 = "EmployedToUnemployed" -putexcel A3 = "UnemployedToEmployed" -putexcel A4 = "PersistentUnemployed" -putexcel A5 = "NonPovertyToPoverty" -putexcel A6 = "PovertyToNonPoverty" -putexcel A7 = "PersistentPoverty" -putexcel A8 = "RealIncomeChange" -putexcel A9 = "RealIncomeDecrease_D" -putexcel A10 = "FinancialDistress" -putexcel A11 = "Covid_2020_D" -putexcel A12 = "Covid_2021_D" - - -putexcel B1 = "COEFFICIENT" -putexcel C1 = "EmployedToUnemployed" -putexcel D1 = "UnemployedToEmployed" -putexcel E1 = "PersistentUnemployed" -putexcel F1 = "NonPovertyToPoverty" -putexcel G1 = "PovertyToNonPoverty" -putexcel H1 = "PersistentPoverty" -putexcel I1 = "RealIncomeChange" -putexcel J1 = "RealIncomeDecrease_D" -putexcel K1 = "FinancialDistress" -putexcel L1 = "Covid_2020_D" -putexcel M1 = "Covid_2021_D" - -* save RMSE -putexcel set "$dir_results/reg_RMSE.xlsx", sheet("UK") modify -putexcel A26 = ("DLS2_Males") B26 = rmse + PersistentEmployed UnemployedToEmployed PersistentUnemployed /// + NoPoverty PovertyToNonPoverty PersistentPoverty /// + RealIncomeChange RealIncomeDecrease_D FinancialDistress D_Econ_benefits_NonUC /// + D_Econ_benefits_UC /// + Ded Dgn Dag Dag_sq /// + Dls_L1 L_Dhe_pcs /// + i.Deh_c4_Medium i.Deh_c4_Low i.Deh_c4_Na /// + Dhh_owned_L1 Dcpst_Single_L1 Dnc_L1 /// + L_Ydses_c5_Q2 L_Ydses_c5_Q3 L_Ydses_c5_Q4 L_Ydses_c5_Q5 /// + L_Dlltsd01 $regions Year_transformed /// + Y2020 Y2021 $ethnicity /// + if ${hwb2_if_condition} & Dgn == 1 [pw=${weight}], absorb(idperson) vce(cluster idperson) + +process_regression, domain("health_wellbeing_simple") process("DLS2_Males") sheet("DLS2_Males") /// + title("Process DLS2_Males: Life Satisfaction Score (0-10)") /// + gofrow(35) goflabel("DLS2_Males: Life Satisfaction Score (0-10)") /// + ifcond("${hwb2_if_condition}") gformula maxestimates(11) - -drop in_sample p -scalar drop r2_p N chi2 ll diff --git a/input/InitialPopulations/compile/RegressionEstimates/variable_update.do b/input/InitialPopulations/compile/RegressionEstimates/variable_update.do index 898469a8d..da253e7d2 100644 --- a/input/InitialPopulations/compile/RegressionEstimates/variable_update.do +++ b/input/InitialPopulations/compile/RegressionEstimates/variable_update.do @@ -153,7 +153,9 @@ foreach y of numlist 11/25 { gen Ydses_c5 = ydses_c5 gen Ypncp = ypncp +gen L_Ypncp = L.ypncp if !missing(L.Ypncp) gen Ypnoab = ypnoab +gen L_Ypnoab = L.ypnoab if !missing(L.Ypnoab) gen Yplgrs_dv = yplgrs_dv gen Ypnbihs_dv = ypnbihs_dv gen Ypnbihs_dv_sq = ypnbihs_dv^2 if !missing(ypnbihs_dv) @@ -1344,6 +1346,59 @@ 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)" + +*================================================== +* Health and wellbeing variables +*================================================== + +gen Dhh_owned_L1= L1.Dhh_owned if !missing(L1.Dhh_owned) +gen Dcpst_Single_L1 = L1.Dcpst_Single if !missing(L1.Dcpst_Single) +gen Dnc_L1 = L1.Dnc if !missing(L1.Dnc) + +gen Dhm = dhm +gen Dhm_L1 = L1.Dhm if !missing(L1.Dhm) + +gen Dhmghq = dhm_ghq +gen Dhmghq_L1 = L1.Dhmghq if !missing(L1.Dhmghq) + +gen Dls = dls +gen Dls_L1 = L1.Dls if !missing(L1.Dls) + +gen Dag_L1 = L1.Dag if !missing(L1.Dag) +gen Dag_sq_L1 = L1.Dag_sq if !missing(L1.Dag_sq) + +gen EmployedToUnemployed = L1.Les_c3_Employed == 1 & Les_c3_NotEmployed == 1 if !missing(L1.Les_c3_Employed) +gen UnemployedToEmployed = Les_c3_Employed == 1 & L1.Les_c3_NotEmployed == 1 if !missing(L1.Les_c3_NotEmployed) +gen PersistentUnemployed = Les_c3_NotEmployed == 1 & L1.Les_c3_NotEmployed == 1 if !missing(L1.Les_c3_NotEmployed) +gen PersistentEmployed = Les_c3_Employed == 1 & L1.Les_c3_Employed == 1 if !missing(L1.Les_c3_Employed) + +gen NonPovertyToPoverty = exp_poverty == 1 +gen PovertyToNonPoverty = exp_poverty == 2 +gen PersistentPoverty = exp_poverty == 3 +gen NoPoverty = exp_poverty == 0 + +gen RealIncomeChange = exp_incchange == 1 +gen RealIncomeDecrease_D = D.log_income + +gen FinancialDistress = financial_distress == 1 +gen L_FinancialDistress = L.financial_distress == 1 if !missing(L.financial_distress) +gen D_Econ_benefits_NonUC = econ_benefits_nonuc == 1 +gen D_Econ_benefits_UC = econ_benefits_uc == 1 +gen D_Econ_benefits = econ_benefits_nonuc == 1 | econ_benefits_uc == 1 + +gen Lhw_c5 = lhw_c5 +gen D_Econ_benefits_UC_Lhw_ZERO = D_Econ_benefits_UC == 1 & Lhw_c5 == 0 +gen D_Econ_benefits_UC_Lhw_TEN = D_Econ_benefits_UC == 1 & Lhw_c5 == 10 +gen D_Econ_benefits_UC_Lhw_TWENTY = D_Econ_benefits_UC == 1 & Lhw_c5 == 20 +gen D_Econ_benefits_UC_Lhw_THIRTY = D_Econ_benefits_UC == 1 & Lhw_c5 == 30 +gen D_Econ_benefits_UC_Lhw_FORTY = D_Econ_benefits_UC == 1 & Lhw_c5 == 40 + + +gen Lhw_10 = Lhw_c5 == 10 +gen Lhw_20 = Lhw_c5 == 20 +gen Lhw_30 = Lhw_c5 == 30 +gen Lhw_40 = Lhw_c5 == 40 + *================================================== * End *================================================== diff --git a/input/reg_RMSE.xlsx b/input/reg_RMSE.xlsx index 1a65005ad..75f14fa75 100644 Binary files a/input/reg_RMSE.xlsx and b/input/reg_RMSE.xlsx differ diff --git a/input/reg_financial_distress.xlsx b/input/reg_financial_distress.xlsx index d945ffd9b..ec3f8890a 100644 Binary files a/input/reg_financial_distress.xlsx and b/input/reg_financial_distress.xlsx differ diff --git a/input/reg_health_mental.xlsx b/input/reg_health_mental.xlsx index beea64a8f..32c5268ae 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..f76732e7e 100644 Binary files a/input/reg_health_wellbeing.xlsx and b/input/reg_health_wellbeing.xlsx differ diff --git a/src/main/java/simpaths/data/Parameters.java b/src/main/java/simpaths/data/Parameters.java index ac40f8372..fa513c7a0 100644 --- a/src/main/java/simpaths/data/Parameters.java +++ b/src/main/java/simpaths/data/Parameters.java @@ -1129,30 +1129,28 @@ public static void loadParameters(Country country, int maxAgeModel, boolean enab coeffCovarianceUnemploymentU1d = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_unemployment.xlsx", "U1d", 1); //Financial distress - coeffCovarianceFinancialDistress = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_financial_distress.xlsx", countryString, 1); + coeffCovarianceFinancialDistress = safeReadExcel(Parameters.getInputDirectory() + "reg_financial_distress.xlsx", "FinDis", 1); //Health mental: level and case-based - coeffCovarianceHM1Level = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM1_L", 1); - coeffCovarianceHM2LevelMales = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Males_L", 1); - coeffCovarianceHM2LevelFemales = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Females_L", 1); - coeffCovarianceHM1Case = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM1_C", 1); - coeffCovarianceHM2CaseMales = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Males_C", 1); - coeffCovarianceHM2CaseFemales = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Females_C", 1); - - validateRegressors(coeffCovarianceHM2CaseMales, "reg_health_mental.xlsx", "HM2_Males_C"); + coeffCovarianceHM1Level = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM1_L", 1); + coeffCovarianceHM2LevelMales = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Males_L", 1); + coeffCovarianceHM2LevelFemales = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Females_L", 1); + coeffCovarianceHM1Case = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM1_C", 1); + coeffCovarianceHM2CaseMales = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Males_C", 1); + coeffCovarianceHM2CaseFemales = safeReadExcel(Parameters.getInputDirectory() + "reg_health_mental.xlsx", "HM2_Females_C", 1); //Health - coeffCovarianceDHE_MCS1 = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS1", 1); - coeffCovarianceDHE_MCS2Males = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS2_Males", 1); - coeffCovarianceDHE_MCS2Females = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS2_Females", 1); + coeffCovarianceDHE_MCS1 = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS1", 1); + coeffCovarianceDHE_MCS2Males = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS2_Males", 1); + coeffCovarianceDHE_MCS2Females = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_MCS2_Females", 1); - coeffCovarianceDHE_PCS1 = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS1", 1); - coeffCovarianceDHE_PCS2Males = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS2_Males", 1); - coeffCovarianceDHE_PCS2Females = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS2_Females", 1); + coeffCovarianceDHE_PCS1 = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS1", 1); + coeffCovarianceDHE_PCS2Males = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS2_Males", 1); + coeffCovarianceDHE_PCS2Females = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DHE_PCS2_Females", 1); - coeffCovarianceDLS1 = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS1", 1); - coeffCovarianceDLS2Males = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS2_Males", 1); - coeffCovarianceDLS2Females = ExcelAssistant.loadCoefficientMap(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS2_Females", 1); + coeffCovarianceDLS1 = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS1", 1); + coeffCovarianceDLS2Males = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS2_Males", 1); + coeffCovarianceDLS2Females = safeReadExcel(Parameters.getInputDirectory() + "reg_health_wellbeing.xlsx", "DLS2_Females", 1); loadEQ5DParameters(countryString); diff --git a/src/main/java/simpaths/model/Person.java b/src/main/java/simpaths/model/Person.java index d37260fec..2558b846c 100644 --- a/src/main/java/simpaths/model/Person.java +++ b/src/main/java/simpaths/model/Person.java @@ -2581,6 +2581,7 @@ public enum DoublesVariables { demAge_12, demAge_13, demAge_14, + Dnc_L1_, Ded_Ydses_c5_Q3_L1, Ded_Ydses_c5_Q4_L1, Ded_Ydses_c5_Q5_L1, @@ -2713,6 +2714,7 @@ public enum DoublesVariables { Dnc_L1, //Lag(1) of number of children of all ages in the benefitUnit Dnc02_L1, //Lag(1) of number of children aged 0-2 in the benefitUnit Dnc017, //Number of children aged 0-17 in the benefitUnit + PersistentEmployed, EmployedToUnemployed, Employmentsonflexiblefurlough, Employmentsonfullfurlough, @@ -2733,6 +2735,7 @@ public enum DoublesVariables { Female, FertilityRate, FinancialDistress, + L_FinancialDistress, GrossEarningsYearly, GrossLabourIncomeMonthly, InverseMillsRatio, @@ -2798,6 +2801,7 @@ public enum DoublesVariables { PersistentPoverty, PersistentUnemployed, PovertyToNonPoverty, + NoPoverty, Pt, Reached_Retirement_Age, //Indicator whether individual is at or above retirement age Reached_Retirement_Age_Les, //Interaction term for being at or above retirement age and not employed in the previous year @@ -2997,8 +3001,10 @@ public enum DoublesVariables { Ypnbihs_dv_L1, //Gross personal non-benefit income lag(1) Ypnbihs_dv_L1_sq, //Square of gross personal non-benefit income lag(1) Ypncp_L1, //Lag(1) of capital income + L_Ypncp, Ypncp_L2, //Lag(2) of capital income Ypnoab_L1, //Lag(1) of pension income + L_Ypnoab, Ypnoab_L2, //Lag(2) of pension income Yptciihs_dv_L1, //Lag(1) of gross personal non-employment non-benefit income Yptciihs_dv_L2, //Lag(2) of gross personal non-employment non-benefit income @@ -4277,6 +4283,9 @@ else throw new IllegalArgumentException( case Dhmghq_L1 -> { return gethealthPsyDstrss_lag1(); } + case Dnc_L1_ -> { + return getDoubleValue(DoublesVariables.Dnc_L1); + } case Dhesp_L1 -> { return (healthPartnerSelfRatedL1 != null) ? (double) healthPartnerSelfRatedL1.getValue() : 0.0; } @@ -5115,13 +5124,13 @@ else throw new IllegalArgumentException( case Yptciihs_dv_L3 -> { return yMiscPersGrossMonthL3; } - case Ypncp_L1 -> { + case Ypncp_L1, L_Ypncp -> { return yCapitalPersMonthL1; } case Ypncp_L2 -> { return yCapitalPersMonthL2; } - case Ypnoab_L1 -> { + case Ypnoab_L1, L_Ypnoab -> { return yPensPersGrossMonthL1; } case Ypnoab_L2 -> { @@ -5186,6 +5195,10 @@ else throw new IllegalArgumentException( case PersistentUnemployed -> { return (labC4.equals(Les_c4.NotEmployed) && labC4L1.equals(Les_c4.NotEmployed) && healthDsblLongtermFlag.equals(Indicator.False) && healthDsblLongtermFlagL1.equals(Indicator.False)) ? 1. : 0.; } + case PersistentEmployed -> { + // Take the negative of the coefficient for the EmployedToUnemployed refactored baseline + return (labC4L1.equals(Les_c4.EmployedOrSelfEmployed) && labC4.equals(Les_c4.NotEmployed) && healthDsblLongtermFlag.equals(Indicator.False)) ? -1. : 0.; + } case NonPovertyToPoverty -> { if (benefitUnit.getYPvrtyFlagL1() != null) { return (benefitUnit.getYPvrtyFlagL1() == 0 && benefitUnit.getYPvrtyFlag() == 1) ? 1. : 0.; @@ -5201,6 +5214,12 @@ else throw new IllegalArgumentException( return (benefitUnit.getYPvrtyFlagL1() == 1 && benefitUnit.getYPvrtyFlag() == 1) ? 1. : 0.; } else return 0.; } + case NoPoverty -> { + // Take the negative of the coefficient for the NonPovertyToPoverty refactored baseline + if (benefitUnit.getYPvrtyFlagL1() != null) { + return (benefitUnit.getYPvrtyFlagL1() == 0 && benefitUnit.getYPvrtyFlag() == 1) ? -1. : 0.; + } else return 0.; + } case RealIncomeChange -> { return (benefitUnit.getYearlyChangeInLogEDI()); } @@ -5894,7 +5913,7 @@ else throw new IllegalArgumentException( case econ_benefits_L1 -> { return isReceivesBenefitsFlag_L1() ? 1. : 0.; } - case financial_distress_L1 -> { + case financial_distress_L1, L_FinancialDistress -> { return (yFinDstrssFlag != null && yFinDstrssFlag) ? 1. : 0.; } case labWageHrlyL1 -> { diff --git a/src/test/java/simpaths/integrationtest/expected/AlignmentStatistics.csv b/src/test/java/simpaths/integrationtest/expected/AlignmentStatistics.csv index c61ee15c0..3f4513ba3 100644 --- a/src/test/java/simpaths/integrationtest/expected/AlignmentStatistics.csv +++ b/src/test/java/simpaths/integrationtest/expected/AlignmentStatistics.csv @@ -1,9 +1,9 @@ run,time,id_AlignmentStatistics,alignEmpSimACFShare,alignEmpSimACMShare,alignEmpSimCouplesShare,alignEmpSimFWithDepShare,alignEmpSimMWithDepShare,alignEmpSimSingleFShare,alignEmpSimSingleMShare,alignEmpTgtACFShare,alignEmpTgtACMShare,alignEmpTgtCouplesShare,alignEmpTgtFWithDepShare,alignEmpTgtMWithDepShare,alignEmpTgtSingleFShare,alignEmpTgtSingleMShare,alignFertAdj,alignFertRateSim,alignFertRateTgt,alignInSchoolAdj,alignInSchoolSimShare,alignInSchoolTgtShare,alignPartnerAdj,alignPartnerSimShare,alignPartnerTgtShare,alignUtilAdjACF,alignUtilAdjACM,alignUtilAdjCouple,alignUtilAdjFWithDep,alignUtilAdjMWithDep,alignUtilAdjSingleF,alignUtilAdjSingleM -1,2019.0,1,0.5017182130584192,0.567524115755627,0.877972027972028,0.3619047619047619,0.43356643356643354,0.4658780709736124,0.5353901996370236,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.049877149877149876,0.05113363440615968,0.0,0.2955160999097201,0.3023858368396759,0.0,0.5256896326317165,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2020.0,1,0.43312101910828027,0.5306122448979592,0.9078327444051826,0.47128378378378377,0.48026315789473684,0.3220149253731343,0.4368347987043036,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.049367402629620444,0.04996578478889472,0.0,0.2982028632348462,0.2760101854801178,1.6784928515650515,0.6225113858165257,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2021.0,1,0.45417515274949083,0.5142314990512334,0.9229081334113517,0.4868421052631579,0.48084291187739464,0.38556067588325654,0.4810187409899087,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.04747700720855083,0.04833442666835588,0.0,0.333027803238619,0.2792655229568481,0.6593871275540656,0.6310886862022123,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2022.0,1,0.46678321678321677,0.5377207062600321,0.9290780141843972,0.49420289855072463,0.4889867841409692,0.4170650974623023,0.48663594470046084,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.048296151017406225,0.04938041570024613,0.0,0.3152634766807995,0.2648949027061462,0.1264374109098567,0.6110969061621069,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2019.0,1,0.5008576329331046,0.567524115755627,0.8775831873905429,0.3632075471698113,0.43617021276595747,0.46504559270516715,0.5347826086956522,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.049926217412690606,0.05113363440615968,0.0,0.29627403846153844,0.3023858368396759,0.0,0.525599947688485,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2020.0,1,0.461038961038961,0.5132382892057027,0.9080357142857143,0.4685430463576159,0.4911504424778761,0.323781168589505,0.42994505494505497,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.049838026414153996,0.04996578478889472,0.0,0.3029286150091519,0.2760101854801178,1.7347871913004633,0.6206357477853048,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2021.0,1,0.4891304347826087,0.5209923664122137,0.9225455614344503,0.484375,0.4885057471264368,0.39113971980310486,0.4810187409899087,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.05320735952262556,0.04833442666835588,0.0,0.31098867462503826,0.2792655229568481,0.8022430892446019,0.630488278720373,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2022.0,1,0.48518518518518516,0.5364667747163695,0.9302117506710409,0.49449035812672176,0.4955555555555556,0.4186558942343004,0.48984302862419205,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.04865398863917016,0.04938041570024613,0.0,0.31907794965119807,0.2648949027061462,0.0,0.6119383825417202,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2019.0,1,0.5008576329331046,0.567524115755627,0.8778906797477225,0.3632075471698113,0.43448275862068964,0.46587082950719316,0.5367620427381383,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.04998768776163506,0.05113363440615968,0.0,0.2963297232250301,0.3023858368396759,0.0,0.5264191710862306,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2020.0,1,0.44782608695652176,0.532,0.9079763663220088,0.47019867549668876,0.4881516587677725,0.3241430700447094,0.4269195189639223,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.049143708116157855,0.04996578478889472,0.0,0.2973548190939495,0.2760101854801178,1.6394822663817876,0.6224967490247074,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2021.0,1,0.48,0.5146771037181996,0.9240323512420566,0.48970588235294116,0.49356223175965663,0.38479174627435997,0.4746168582375479,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.06331288343558282,0.04833442666835588,0.0,0.3330294743239137,0.2792655229568481,0.798803578747153,0.6316535636035572,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2022.0,1,0.4825174825174825,0.5305785123966942,0.9319395017793595,0.5,0.4936708860759494,0.42005921539600294,0.5064695009242144,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.048605970885763634,0.04938041570024613,0.0,0.311420781581339,0.2648949027061462,0.0,0.6118568951120817,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2019.0,1,0.5008576329331046,0.5682182985553772,0.8777972027972027,0.3619047619047619,0.43661971830985913,0.46896973402629166,0.5368688703232837,0.5403293808853606,0.5311791259117856,0.8735970003111929,0.3943366638089926,0.465356415881109,0.4438849669010334,0.4705375056413739,0.0,0.0498159509202454,0.05113363440615968,0.0,0.2962406015037594,0.3023858368396759,0.0,0.5271419228253761,0.632472038269043,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2020.0,1,0.4647577092511013,0.5019230769230769,0.9121900826446281,0.46842105263157896,0.49324324324324326,0.31473214285714285,0.40483946021405304,0.5501985392408713,0.5109522836960044,0.8754389771797882,0.3941959194429085,0.4620365639995361,0.4428142056392469,0.4648045911203806,0.0,0.050049800796812746,0.04996578478889472,0.0,0.30399025281754494,0.2760101854801178,1.6425315273217163,0.6216550556676868,0.6234807968139648,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2021.0,1,0.4918032786885246,0.49625468164794007,0.9281112737920937,0.4851190476190476,0.493801652892562,0.3728357060407849,0.4553786782440907,0.5382718801505548,0.5130523068280014,0.8776418122289941,0.3980978816455363,0.4641592336214714,0.4451259300414946,0.4776386065456221,0.0,0.04769038701622971,0.04833442666835588,0.0,0.32842686292548295,0.2792655229568481,0.8300183718463234,0.6303557517527915,0.6310330629348755,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2022.0,1,0.5053763440860215,0.5126582278481012,0.9344602609727165,0.4911504424778761,0.5,0.4049373618275608,0.48732394366197185,0.5382469728746202,0.5423248579660446,0.8712018643202526,0.4133664269810563,0.4635896862300199,0.4530541291186285,0.5097880138188646,0.0,0.04848634014275166,0.04938041570024613,0.0,0.3207261724659607,0.2648949027061462,0.0,0.6132051282051282,0.6104874014854431,0.0,0.0,0.0,0.0,0.0,0.0,0.0 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/DemographicStatistics.csv b/src/test/java/simpaths/integrationtest/expected/DemographicStatistics.csv index e060d9931..e8f5c2121 100644 --- a/src/test/java/simpaths/integrationtest/expected/DemographicStatistics.csv +++ b/src/test/java/simpaths/integrationtest/expected/DemographicStatistics.csv @@ -1,9 +1,9 @@ run,time,id_DemographicStatistics,demMarried18to29Share,demMarried30to54Share,demMarried55to74Share,demNChild18to29Avg,demNChild30to54Avg,demNChild55to74Avg,demPop18to29N,demPop30to54N,demPop55to74N -1,2019.0,1,0.24441388793399793,0.6560854753793744,0.5961178671655754,0.2743210725335167,0.933106224837411,0.07881197380729654,2909.0,6458.0,4276.0 -1,2020.0,1,0.4400977995110024,0.7572074177964782,0.6537927844588344,0.3328676213761788,0.9501324606513948,0.08464384828862165,2863.0,6417.0,4324.0 -1,2021.0,1,0.43946346629015176,0.7648980861988486,0.6626533393911859,0.33603953406283094,0.9394740936673409,0.09336665152203544,2833.0,6427.0,4402.0 -1,2022.0,1,0.37985309548793283,0.7480012300123001,0.6591683708248125,0.3196922000699545,0.9377306273062731,0.0924789820495342,2859.0,6504.0,4401.0 -2,2019.0,1,0.2449330127104088,0.6559256390395043,0.5952715355805244,0.2741326004809344,0.9344694035631294,0.07911985018726592,2911.0,6455.0,4272.0 -2,2020.0,1,0.43212036389083275,0.7521100343857455,0.655268022181146,0.33484954513645904,0.952172553923101,0.08456561922365989,2858.0,6398.0,4328.0 -2,2021.0,1,0.43840451817860926,0.7624318004676539,0.6642435256701499,0.3363925167666784,0.9457521434138737,0.09450249886415266,2833.0,6415.0,4402.0 -2,2022.0,1,0.38431921596079804,0.7467784505511567,0.6618982742960945,0.3227161358067903,0.9326191585157584,0.09673024523160763,2857.0,6441.0,4404.0 \ No newline at end of file +1,2019.0,1,0.24441388793399793,0.6559789343246593,0.5963925977980792,0.2743210725335167,0.9347893432465924,0.07870695713281799,2909.0,6456.0,4269.0 +1,2020.0,1,0.4407252440725244,0.7552992518703242,0.6516724336793541,0.32461645746164575,0.9583852867830424,0.08442906574394464,2868.0,6416.0,4335.0 +1,2021.0,1,0.43992994746059544,0.769361570567321,0.6556743234023198,0.34430823117338005,0.9556345648477353,0.09460996133727541,2855.0,6469.0,4397.0 +1,2022.0,1,0.381035689293212,0.7503107520198882,0.6551802312400816,0.3275017494751575,0.9341205717837165,0.09589662208116073,2858.0,6436.0,4411.0 +2,2019.0,1,0.2443298969072165,0.6555933250927071,0.5974238875878221,0.27422680412371137,0.9330964153275649,0.07868852459016394,2910.0,6472.0,4270.0 +2,2020.0,1,0.4407549807759525,0.7581678911989995,0.6460687110906156,0.32995456134218804,0.9527903704861654,0.0894627622780724,2861.0,6397.0,4337.0 +2,2021.0,1,0.4359518754423213,0.7710485133020344,0.6520054694621695,0.34147204529370134,0.9374021909233177,0.09731084776663627,2826.0,6390.0,4388.0 +2,2022.0,1,0.3812849162011173,0.7555383423702556,0.6506787330316742,0.33135474860335196,0.9268783888458559,0.09615384615384616,2864.0,6455.0,4420.0 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/HealthStatistics.csv b/src/test/java/simpaths/integrationtest/expected/HealthStatistics.csv index 2c5c636d7..4e1365f19 100644 --- a/src/test/java/simpaths/integrationtest/expected/HealthStatistics.csv +++ b/src/test/java/simpaths/integrationtest/expected/HealthStatistics.csv @@ -1,9 +1,9 @@ run,time,id_HealthStatistics,healthDsbl18to29Share,healthDsbl30to54Share,healthDsbl55to74Share,healthScore18to29Avg,healthScore30to54Avg,healthScore55to74Avg -1,2019.0,1,0.044001375042970095,0.08237844533911427,0.06711880261927035,3.655895496734273,3.476618148033447,3.055659494855005 -1,2020.0,1,0.044009779951100246,0.08991740688795387,0.06938020351526364,3.5745721271393642,3.388187626616799,3.0353839037927846 -1,2021.0,1,0.03882809742322626,0.09506768321145169,0.06428895956383462,3.5135898340981293,3.3304807841916912,3.0165833711949115 -1,2022.0,1,0.04686953480237845,0.10654981549815498,0.061576914337650536,3.4249737670514167,3.261992619926199,2.9529652351738243 -2,2019.0,1,0.04397114393679148,0.082571649883811,0.0671816479400749,3.6561319134318104,3.475445391169636,3.055945692883895 -2,2020.0,1,0.04443666899930021,0.092841512972804,0.06816081330868762,3.5675297410776765,3.3740231322288214,3.0309611829944547 -2,2021.0,1,0.04376985527709142,0.10023382696804364,0.06519763743752839,3.522414401694317,3.3178487918939985,3.002044525215811 -2,2022.0,1,0.04585229261463073,0.10588417947523676,0.060626702997275204,3.4441722086104307,3.272938984629716,2.9439146230699365 \ No newline at end of file +1,2019.0,1,0.044001375042970095,0.08255885997521685,0.06699461232138675,3.6565830182193193,3.4761462205700124,3.05621925509487 +1,2020.0,1,0.04707112970711297,0.09304862842892768,0.0671280276816609,3.560320781032078,3.387001246882793,3.045674740484429 +1,2021.0,1,0.040280210157618214,0.10078837532848972,0.05640209233568342,3.4938704028021017,3.2657288607203587,3.003183989083466 +1,2022.0,1,0.04548635409377187,0.10891858297078931,0.06143731580140558,3.428271518544437,3.2054070851460534,2.9523917479029698 +2,2019.0,1,0.04398625429553265,0.08189122373300371,0.06674473067915691,3.6560137457044672,3.4769777503090236,3.049648711943794 +2,2020.0,1,0.04893393918210416,0.09504455213381273,0.06778879409730228,3.541768612373296,3.3773643895576053,3.0373530089923912 +2,2021.0,1,0.049893842887473464,0.10610328638497653,0.05765724703737466,3.484076433121019,3.262284820031299,2.9945305378304465 +2,2022.0,1,0.04818435754189944,0.11092176607281178,0.060407239819004525,3.4179469273743015,3.18280402788536,2.9518099547511314 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/LabourStatistics.csv b/src/test/java/simpaths/integrationtest/expected/LabourStatistics.csv index 8c9645eaa..206c0a79a 100644 --- a/src/test/java/simpaths/integrationtest/expected/LabourStatistics.csv +++ b/src/test/java/simpaths/integrationtest/expected/LabourStatistics.csv @@ -1,9 +1,9 @@ run,time,id_LabourStatistics,labEmpShare,labEmpToNotEmpShare,labNotEmpToEmpShare,labUnempShare,labWorkFullTime18to29Share,labWorkFullTime30to54Share,labWorkFullTime55to74Share,labWorkPartTime18to29Share,labWorkPartTime30to54Share,labWorkPartTime55to74Share -1,2019.0,1,0.7223091493041258,0.0,0.0,0.14568063905130527,0.5472671020969405,0.70548157324249,0.2778297474275023,0.10175317978686833,0.13084546299163827,0.09494855004677269 -1,2020.0,1,0.7217721937510332,0.07681940700808626,0.3997754070746771,0.14572656637460737,0.4966818023052742,0.7472339099267571,0.3348751156336725,0.15263709395738737,0.09085242325074022,0.05735430157261795 -1,2021.0,1,0.7530417625780993,0.023785594639865997,0.39060773480662986,0.10662610983229201,0.5171196611366043,0.7885483118095534,0.3759654702407996,0.13907518531591953,0.08588766142834915,0.057928214447978195 -1,2022.0,1,0.7617886178861789,0.02887249736564805,0.29992576095025986,0.10382113821138211,0.5124169289961525,0.7919741697416974,0.3965007952738014,0.15389996502273523,0.08825338253382534,0.05998636673483299 -2,2019.0,1,0.7212750185322461,0.0,0.0,0.14611646487109795,0.5475781518378564,0.7039504260263362,0.2778558052434457,0.1016832703538303,0.13121611154144075,0.09363295880149813 -2,2020.0,1,0.7183774834437087,0.07982909826849562,0.4,0.14908940397350992,0.4940517844646606,0.7463269771803689,0.33964879852125696,0.14485654303708886,0.08690215692403876,0.05822550831792976 -2,2021.0,1,0.7551255660765748,0.020894181082902717,0.3797740720817644,0.11082750102923014,0.5301800211789622,0.7861262665627435,0.3736937755565652,0.14401694316978467,0.08448947778643803,0.05929123125851885 -2,2022.0,1,0.7635278731404284,0.027689706193193827,0.3020908435472242,0.1015203531142717,0.5110255512775639,0.7904052165812762,0.3994096276112625,0.15960798039901994,0.08927185219686384,0.06085376930063579 \ No newline at end of file +1,2019.0,1,0.721681780708986,0.0,0.0,0.14583676834295137,0.5476108628394637,0.7041511771995044,0.27758257203092057,0.10140941904434514,0.13088599752168525,0.09440149918013586 +1,2020.0,1,0.7192765113974232,0.08158901643033986,0.4116666666666667,0.1490749917409977,0.5034867503486751,0.737998753117207,0.332641291810842,0.13389121338912133,0.09912718204488778,0.05974625144175317 +1,2021.0,1,0.756099557884395,0.019745649263721552,0.3903225806451613,0.10406091370558376,0.5229422066549912,0.7931674138197558,0.3788947009324539,0.1316987740805604,0.0842479517699799,0.056174664544007276 +1,2022.0,1,0.7685768004577781,0.02567353407290016,0.3109048723897912,0.09874928472165453,0.5272918124562631,0.8018955873213176,0.4008161414645205,0.14310706787963612,0.08871970167806091,0.05712990251643618 +2,2019.0,1,0.7218930041152264,0.0,0.0,0.14551440329218107,0.547766323024055,0.7053461063040791,0.27728337236533956,0.1013745704467354,0.13056242274412855,0.0936768149882904 +2,2020.0,1,0.7170279662419328,0.08129715122170926,0.40570789031897037,0.149346351150091,0.5075148549458232,0.7472252618414882,0.3294904311736223,0.12373296050332051,0.09019853056120056,0.060179847821074474 +2,2021.0,1,0.7513017604760724,0.018983050847457626,0.36599891716296695,0.10967848582527481,0.5176928520877565,0.7954616588419405,0.37556973564266183,0.12880396319886767,0.07793427230046948,0.059708295350957154 +2,2022.0,1,0.7630741617035164,0.025304393859184753,0.3040590405904059,0.10141143836175247,0.520949720670391,0.802013942680093,0.3941176470588235,0.14175977653631286,0.08102246320681643,0.061764705882352944 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/WealthIncomeStatistics.csv b/src/test/java/simpaths/integrationtest/expected/WealthIncomeStatistics.csv index 8c71f82c8..1ea0269de 100644 --- a/src/test/java/simpaths/integrationtest/expected/WealthIncomeStatistics.csv +++ b/src/test/java/simpaths/integrationtest/expected/WealthIncomeStatistics.csv @@ -1,9 +1,9 @@ run,time,id_WealthIncomeStatistics,statInvestLoss18to29Avg,statInvestLoss30to54Avg,statInvestLoss55to74Avg,statSIndexP50,statYDispGrossOfLosses18to29Avg,statYDispGrossOfLosses30to54Avg,statYDispGrossOfLosses55to74Avg,statYHhDispEquivNatGini,statYInvest18to29Avg,statYInvest30to54Avg,statYInvest55to74Avg,statYLabWeeklyPerWorker18to29Avg,statYLabWeeklyPerWorker30to54Avg,statYLabWeeklyPerWorker55to74Avg,statYMktNatGini,statYPens18to29Avg,statYPens30to54Avg,statYPens55to74Avg,wealth18to29Avg,wealth30to54Avg,wealth55to74Avg,yHhDispEquivP50,yHhQuintilesC5P20,yHhQuintilesC5P40,yHhQuintilesC5P60,yHhQuintilesC5P80,yLabP20,yLabP40,yLabP60,yLabP80 -1,2019.0,1,0.0,0.0,0.0,0.0,1031.2494710491426,1657.7406238267768,1562.9547541500126,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15751.617600000001,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -1,2020.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16283.058028118841,5.977584300385669,7.396355354574935,8.108897415752347,8.665867672167579,624.6825800939089,1486.1130942772668,2471.8220406055743,4151.642488756834 -1,2021.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16379.967347473626,6.177813108214614,7.45310922629252,8.1410107648745,8.694185148382058,762.3502620718175,1572.2382052866676,2544.74016172959,4210.789651944029 -1,2022.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16679.467668613863,6.268615570294203,7.504785946786127,8.16541164625361,8.707906611672232,759.7176689744649,1590.5858294412774,2573.544415714072,4269.280704865495 -2,2019.0,1,0.0,0.0,0.0,0.0,1031.0741948715065,1656.383215316451,1567.405011984656,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15755.1816,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 -2,2020.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16941.95449495689,5.913483264109271,7.4432276502538866,8.209969239951125,8.793580531823213,655.1606771183261,1695.724672045708,2872.7218327604787,4823.908522203283 -2,2021.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,17144.59786664643,6.200487790558318,7.5221100308260915,8.249982108239418,8.81767529803498,817.8211845767195,1819.8519291966963,2979.2435430051496,4927.364252821702 -2,2022.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,17213.779257599344,6.298369699763875,7.533738907132372,8.256738801983554,8.849786460591709,849.0814770119758,1856.641966032503,3018.7928994020353,4957.024082264723 \ No newline at end of file +1,2019.0,1,0.0,0.0,0.0,0.0,1031.262845373309,1654.6440818576732,1564.8302980225947,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15759.4746,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +1,2020.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15988.622847044104,5.845190835458205,7.3991087491264125,8.099827173989214,8.652176488140022,602.0219029604868,1455.5037360560127,2410.434471349028,4005.235582853968 +1,2021.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16445.624912469557,6.242943927974262,7.499571535781826,8.14496964864102,8.703414106511717,747.6269915076127,1583.9698469638302,2550.7102409680815,4204.888935667221 +1,2022.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16870.435546534034,6.326327359620668,7.4933492919382685,8.169152635539223,8.716410263002945,774.1196121854346,1617.4307481689632,2574.268664640331,4275.376320182765 +2,2019.0,1,0.0,0.0,0.0,0.0,1031.5757636051394,1656.0915044876533,1562.495644407366,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,15774.958200000001,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 +2,2020.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,16971.562797582683,5.827090986352837,7.463616974193044,8.217209765876635,8.797307414081324,683.7942363905247,1718.9192061927863,2838.180717356006,4794.260585197614 +2,2021.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,17207.004511038336,6.201454230537901,7.542845767795889,8.249884168350732,8.823610193034279,855.4175240249256,1854.2328659496968,3016.431388682202,5013.143409754925 +2,2022.0,1,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,NaN,NaN,NaN,0.0,0.0,0.0,0.0,0.0,0.0,0.0,17642.278308371788,6.320982220333727,7.546500607162401,8.268056313462795,8.846920736510034,839.6375657783755,1886.1310877739413,3020.4332175339214,5045.722486597564 \ No newline at end of file diff --git a/src/test/java/simpaths/integrationtest/expected/WellbeingByGender.csv b/src/test/java/simpaths/integrationtest/expected/WellbeingByGender.csv index 78b7af26f..4952cc412 100644 --- a/src/test/java/simpaths/integrationtest/expected/WellbeingByGender.csv +++ b/src/test/java/simpaths/integrationtest/expected/WellbeingByGender.csv @@ -1,25 +1,25 @@ run,time,id_WellbeingByGender,demLifeSatScore0to10Avg,demLifeSatScore0to10P10,demLifeSatScore0to10P25,demLifeSatScore0to10P50,demLifeSatScore0to10P75,demLifeSatScore0to10P90,demSex,healthLifeYearQualAdj,healthLifeYearWbAdj,healthMentalMcsAvg,healthMentalMcsP10,healthMentalMcsP25,healthMentalMcsP50,healthMentalMcsP75,healthMentalMcsP90,healthNObsSubGroup,healthPhysicalPcsAvg,healthPhysicalPcsP10,healthPhysicalPcsP25,healthPhysicalPcsP50,healthPhysicalPcsP75,healthPhysicalPcsP90,healthWbScore0to36Avg,healthWbScore0to36P10,healthWbScore0to36P25,healthWbScore0to36P50,healthWbScore0to36P75,healthWbScore0to36P90 -1,2019.0,1,6.756175393447495,3.33,5.0,8.0,8.33,8.33,Total,8346.680086830402,68257.64000000327,47.14089280411759,32.09,41.3,49.13,54.79,57.92,10103,51.36303870137582,37.15,48.0,54.63,57.49,60.05,11.751855884390778,6.0,8.0,11.0,13.0,20.0 -1,2019.0,2,6.725988289925295,3.33,5.0,7.0,8.33,8.33,Male,4171.563445653993,33313.82000000077,48.062239047042205,33.472,42.86,50.33,55.565,58.22400000000002,4953,51.87814052089643,38.506,49.0,54.8,57.49,59.89,11.252170401776736,6.0,8.0,10.0,13.0,19.0 -1,2019.0,3,6.785207766990293,3.33,5.0,8.165,8.33,8.33,Female,4175.116641176408,34943.82000000122,46.25479029126213,30.94,40.47,48.28,54.2,57.33,5150,50.867640776699034,35.54,46.974999999999994,54.38,57.61,60.18,12.232427184466019,6.0,8.0,11.0,14.0,21.0 -1,2020.0,1,6.6135548926036725,3.7408615300142953,5.20746235137531,6.738993421026553,8.19460417082176,9.47118023958373,Total,8144.099203698618,66691.08753701567,45.83006855548575,32.15797404439278,39.10160160724462,46.34987763560427,53.077370491018534,58.85051827609748,10084,51.52147553280504,38.38323782231299,45.758100400979565,52.49343513495421,58.457079044134844,63.46943524623862,12.731139606848766,5.760445572589244,8.887756045809182,12.422862514541553,16.23253725993914,20.063649757519542 -1,2020.0,2,6.597821833914836,3.7243142197695094,5.219733407588199,6.710947327673868,8.159905302438416,9.419591428883331,Male,4074.7110498150046,32593.239859539284,47.082819474520456,33.61465769293,40.654655231300204,47.613577016304575,54.34524748024336,59.504460877530455,4940,51.999533090404725,39.348954803193585,46.46584433464587,52.90572421005392,58.58979925876683,63.74100888778429,12.07330702290265,5.247096392427416,8.255378633450018,11.747879026541714,15.560527724525501,19.2221175576465 -1,2020.0,3,6.62866401195104,3.7555183474700207,5.184500360914294,6.754586690026169,8.237761945366604,9.517381713117345,Female,4069.3881538836135,34097.8476774762,44.6269990492588,31.06527837907814,37.770936356271314,45.06789894041008,51.710708535415804,57.94444127196678,5144,51.06237671193754,37.2597016179,44.97196493352142,52.02197449733886,58.28673262460657,63.25968932751248,13.362883962349118,6.3815716786190455,9.49138146082011,13.037325088403001,16.884158806874346,20.752284715280204 -1,2021.0,1,6.551045326822757,3.7370575171076945,5.146432616511683,6.661141704711037,8.07105391283681,9.367707215848778,Total,8142.341724326387,66434.15065930951,45.517491946476575,32.001385190172556,38.66689415554784,45.62800616261879,52.639420346566524,58.769774995290156,10141,51.50014556229936,37.95381252047378,44.68896451196224,51.97301400258788,58.95074796704476,64.37442661527727,13.052326290418002,6.146663617192843,9.230692501111776,12.887096233050846,16.644904568016972,20.154805077987373 -1,2021.0,2,6.533671431940558,3.7442550100646295,5.109716436454889,6.6365613343267205,8.066447579655328,9.290895840053771,Male,4076.0246777116204,32478.880688176614,46.79741414915698,33.49025498563218,40.08846867350861,46.9071211795649,53.79917750384438,59.87242470445621,4971,51.91819486015358,38.668810886592716,45.36918724008264,52.419869892927146,59.12502473187696,64.37818412833347,12.516554709536514,5.605657177611228,8.743460608435715,12.341655677381342,16.160599005134294,19.56695274646869 -1,2021.0,3,6.567750477975447,3.7298715059013348,5.167336702369599,6.682241998036636,8.075213892868222,9.449217314146034,Female,4066.3170466147662,33955.26997113304,44.28683560807728,31.01434587431847,37.32871879196249,44.32978584964574,51.30761554111863,57.532470636125375,5170,51.09818752368557,37.17096000793924,44.117614933793675,51.57224673888308,58.71946972220316,64.34904918292412,13.567475328824553,6.7220897738998096,9.737382102614687,13.47139059141549,17.17640260510093,20.733839537503474 -1,2022.0,1,6.466753600079206,3.7116359178514307,5.032600006368673,6.561144216600892,7.996557722044543,9.288518605506537,Total,8119.762071219679,66361.82544401288,45.32125333130359,32.056880853145024,38.388647439610324,45.505559350960596,52.26663439902998,58.34852073190471,10262,50.80905304477684,36.87910744410754,44.00543379425421,51.158015543685956,58.06553393236512,64.21083196726823,12.950071626029683,5.901332799443898,9.085003940456655,12.885273643713532,16.69812370884248,19.976072539963884 -1,2022.0,2,6.462579799710827,3.725889337500369,5.018167890813484,6.544333944049834,7.9616586424561095,9.294150807957232,Male,4054.193620034069,32416.30027534949,46.46964284620754,33.182668954894545,39.78225069500215,46.70835022131587,53.354580443256864,59.2468358824234,5016,51.32421192610889,38.11274208376965,44.63496331981919,51.64483409105593,58.44791274501242,64.3770063203758,12.43488410304338,5.452391232932519,8.660333750067046,12.349521479312997,16.160748603171516,19.39101776027707 -1,2022.0,3,6.470744408818775,3.698532349298335,5.041958437375135,6.582662836151028,8.027705617155554,9.273152362447458,Female,4065.56845118561,33945.52516866326,44.22321257515448,31.063654307707075,37.31117336301573,44.40775355662339,50.96358638793197,57.34679394721924,5246,50.31648023715931,36.08172739133687,43.334995900401076,50.809124864939676,57.76540604363788,64.0834565394696,13.44267181956748,6.317004432788039,9.579013432704684,13.433880873183995,17.210704812534484,20.488947907038494 -2,2019.0,1,6.755340200059429,3.33,5.0,8.0,8.33,8.33,Total,8340.271508342477,68208.67000000326,47.12877587402199,32.08,41.3,49.11,54.79,57.92,10097,51.36335446172131,37.144,48.0,54.69,57.54,60.08,11.75408537189264,6.0,8.0,11.0,13.0,20.0 -2,2019.0,2,6.724623612512618,3.33,5.0,7.0,8.33,8.33,Male,4172.040611994369,33320.51000000076,48.037731584258324,33.358,42.79,50.27,55.56,58.21600000000002,4955,51.882038345105954,38.482,49.0,54.8,57.49,59.89,11.261553985872848,6.0,8.0,10.0,13.0,19.0 -2,2019.0,3,6.784939712174252,3.33,5.0,8.0,8.33,8.33,Female,4168.230896348108,34888.16000000122,46.25287631271879,30.94,40.46,48.28,54.2,57.33,5142,50.8635336444963,35.54,46.8975,54.465,57.61,60.18,12.228704784130692,6.0,8.0,11.0,14.0,21.0 -2,2020.0,1,6.649898366619695,3.8061648193325652,5.254168179471878,6.7840663746888445,8.225344652147854,9.512923974833987,Total,8141.119471324132,66937.87695839381,45.81617701687895,32.16849163007635,39.005949641215324,46.31728871496223,53.0774887552752,58.90025503279414,10066,51.618446608437154,38.524612908368226,45.79221431310007,52.569425459701876,58.530996891151446,63.6150521144817,12.984442478320803,5.957053954618807,9.159817768710198,12.655671696274819,16.477046345778728,20.3531294762337 -2,2020.0,2,6.654403254506229,3.8399881559104845,5.285200517207464,6.781246684087717,8.212586648017398,9.496731734396674,Male,4058.1441001356507,32839.48006098828,47.00743274410231,33.50342815318687,40.47584197759136,47.488851478772126,54.252562580141024,59.53435926841552,4935,51.859025442972104,39.20799724156667,46.21813961483735,52.83587690623675,58.43235127222917,63.612310917523,12.274545602841497,5.389134479982179,8.503614329632317,11.940893351152786,15.775884127979133,19.422301201074138 -2,2020.0,3,6.645565561762934,3.769876931349322,5.227743651972633,6.788685327528539,8.239668727451823,9.524643867679716,Female,4082.975371188482,34098.39689740564,44.67042628332852,31.147620953091455,37.79473037468961,45.05146366749269,51.728102609858254,58.01735599285098,5131,51.387057688454696,37.5939494562262,45.29570091501165,52.32383743509163,58.62296101255498,63.619500887571796,13.667221874245646,6.628917920999526,9.821335680010128,13.328775960913157,17.188030889714145,21.034090033287217 -2,2021.0,1,6.581860788612988,3.7845361647226206,5.164943066777251,6.689310073375769,8.114591298132694,9.413855310638107,Total,8134.375230566831,66641.3404847066,45.63288031928133,32.110810135644016,38.728429995313306,45.76371274819867,52.71096091943345,58.906778261713725,10125,51.51298509156969,37.941861650691244,44.74895881574689,52.09423641081538,58.907584064363974,64.47684278446538,13.239355660141612,6.206795711017258,9.373248185566037,13.077119624496568,16.855010933215503,20.377494138957275 -2,2021.0,2,6.638664489102274,3.8721207553830674,5.2312592361956085,6.751174164731447,8.198209466451601,9.42762568427134,Male,4051.5968827412294,32914.49853696898,46.81770898955625,33.393570974644376,40.01432574408417,46.96152201822847,53.866237936585996,59.97468464017027,4958,51.739368413780205,38.44804202025027,45.16308695597863,52.29490108445856,59.0073551263508,64.40789717341252,12.479716714831252,5.497386663911917,8.71845807740002,12.299833138321365,16.16301423983729,19.54193862742913 -2,2021.0,3,6.527354741191683,3.691226939490055,5.117330762109283,6.649982178225147,8.027332968258547,9.397180006296296,Female,4082.778347825602,33726.84194773747,44.495976787788564,31.089627166618417,37.52254466653446,44.64431863732558,51.65314487834755,57.757840244438725,5167,51.29575874910409,37.525820544381666,44.3924904295155,51.829498856331604,58.79391389620286,64.56756756120136,13.968267967253816,7.060817853556014,10.085832637142712,13.85291234538754,17.549570625099754,21.152705527450408 -2,2022.0,1,6.4812982776568315,3.7024221997558926,5.030710294510082,6.564965556089741,8.012393997183715,9.361961132020571,Total,8088.91482490903,66102.761133822,45.42827864318316,32.193649892119694,38.48741693414672,45.62576408156959,52.34867709869488,58.54669884686165,10199,50.93115829932625,37.1248274144288,44.02648574034228,51.33933417626778,58.2146120716324,64.34329708702212,13.05992362908522,5.891322908454027,9.18971992693785,13.026146210787516,16.828218337545557,20.1726413958251 -2,2022.0,2,6.532323378197319,3.7413843826703865,5.076189945243078,6.60773985575197,8.052501567416687,9.444537397351542,Male,4026.1590177309613,32609.358303961042,46.39422690530224,33.05884403849508,39.7574148324242,46.701545029935566,53.39890116300504,59.262074642822114,4992,51.26901243823052,38.13654593292096,44.549273412966315,51.64829015681717,58.29509794984891,64.34097980241319,12.368524487235973,5.368965602525099,8.62414894896972,12.305587830472755,16.079428382953907,19.325908809813022 -2,2022.0,3,6.4323800326216665,3.6429332939631363,4.986290665896133,6.512122619213386,7.9710896754653024,9.265804428149165,Female,4062.7558071780695,33493.402829861036,44.50221493577037,31.23621209713921,37.5900450565491,44.67839708084409,51.21820961917776,57.69566538175109,5207,50.60725435052461,36.305938111961176,43.54992095305396,51.10371551328898,58.03806680054555,64.35343338737796,13.722774506003109,6.427332478714938,9.763468454428022,13.730108069794912,17.534572339328577,20.928919002629122 \ No newline at end of file +1,2019.0,1,6.752327056491578,3.33,5.0,8.0,8.33,8.33,Total,8334.900007302407,68130.98000000327,47.137401387512384,32.094,41.3,49.125,54.79,57.91,10090,51.36004360753222,37.150999999999996,48.0,54.635000000000005,57.49,60.05,11.752130822596612,6.0,8.0,11.0,13.0,20.0 +1,2019.0,2,6.72337237479806,3.33,5.0,7.0,8.33,8.33,Male,4169.989832329956,33294.14000000078,48.043200726978995,33.469,42.8425,50.305,55.53,58.15,4952,51.8866155088853,38.576,49.0,54.8,57.49,59.89,11.258885298869155,6.0,8.0,10.0,13.0,19.0 +1,2019.0,3,6.780233553912029,3.33,5.0,8.0,8.33,8.33,Female,4164.910174972451,34836.84000000121,46.26439275982872,30.94,40.47,48.28,54.2,57.33,5138,50.852534059945505,35.537,46.9325,54.38,57.57,60.18,12.227520435967303,6.0,8.0,11.0,14.0,21.0 +1,2020.0,1,6.457464209786759,3.644952640835136,5.089433402800994,6.542619628328168,8.005347696374153,9.228166001927294,Total,8115.611979475984,65175.18626937761,46.14538816142714,32.61315000667649,39.5350637027949,46.68558122404082,53.328284986953264,58.88096913796529,10093,50.83684228620649,37.9229802602667,45.40407977053882,51.98441905793961,57.67059284295667,62.3913317353679,12.33293605324351,5.758432463816858,8.624360890311538,11.971612689870641,15.72432591160647,19.401422349035936 +1,2020.0,2,6.471784309636127,3.7170448466258295,5.106721495188634,6.562159235530459,7.977318514532003,9.196244909067309,Male,4057.03925528784,32048.275901318073,46.773072428564795,33.58153734164527,40.32983038932689,47.305636296123616,53.89714971499005,59.24032509067043,4952,51.49151505622667,38.84180088018357,46.286801745167594,52.5685501731423,58.02214707899451,62.707830865691854,11.888885869790629,5.510250860172204,8.340021438271325,11.578975264441597,15.195903982513022,18.655969782685244 +1,2020.0,3,6.443670563715163,3.5730140955383476,5.067015322311207,6.5277718286172295,8.025351258030401,9.254713141360169,Female,4058.572724188144,33126.910368059565,45.54077962400919,31.935192977617366,38.86050975637835,46.056652773810775,52.74422379098694,58.41405439362422,5141,50.20623743167625,36.57462322224107,44.61226648776811,51.35717249951831,57.23679405890782,62.10003272524962,12.760661497409753,6.0066683265512495,8.88373583365591,12.37326254283919,16.25064026781429,20.017171327719705 +1,2021.0,1,6.289854541940707,3.5184288943315822,4.885397340723403,6.3616873603238,7.820837131823268,9.023060823662721,Total,8068.603886560984,64099.90763691762,45.54689910030753,32.50015889381395,38.92759917072576,45.835449473507175,52.40920756195835,58.510004828558024,10191,50.435159922908674,37.648834137163185,44.41324621061813,50.84472984529874,57.23008419204943,62.47253493111388,12.628177377598933,5.947619579979348,9.015023785576624,12.405728082776431,15.988079381655204,19.557534126921443 +1,2021.0,2,6.303130928741614,3.4934958329679238,4.943278958573682,6.374589196581805,7.844368217377179,9.024157138955907,Male,4010.5357555527416,31389.59202513322,46.13737983213482,32.76932660534847,39.60862090179428,46.536784518098074,52.91931613801813,58.711207374107126,4980,51.02693965887569,38.40993375861882,45.03498099271805,51.38652945459882,57.766738761919456,62.87424353700018,12.069575290131688,5.630010630063066,8.607963421020042,11.892665739858696,15.343378870063123,18.744108782786796 +1,2021.0,3,6.277166688118308,3.545369485016031,4.812888802203655,6.347108507756133,7.783560250205383,9.012667895091916,Female,4058.068131008243,32710.315611784456,44.98259396799129,32.12128095412575,38.3138604579455,45.03760837776565,51.92777351451651,58.270931946224984,5211,49.86961337040134,37.05799643895121,43.706231697676415,50.34301675618302,56.68585803855315,62.05026642804426,13.162017023652835,6.428181347133078,9.42515484583915,12.946297899012709,16.540809740192138,20.332961091677973 +1,2022.0,1,6.254768054738956,3.497258299188969,4.829345366304603,6.326379078243345,7.779011297988523,8.993016917285214,Total,7938.639677942172,63761.10555000872,44.835006490338216,31.684621133631452,38.04648692372642,45.00899788666046,51.73775739868942,57.893106561074696,10194,49.96806966807326,37.038003624558385,43.47648573612215,50.44557589619676,56.76878373391435,62.366490221216544,12.863924505794916,6.130504863149156,9.269878049786044,12.81813780429395,16.315579296499852,19.635547079748804 +1,2022.0,2,6.1987906039102985,3.481882824351486,4.763325066072002,6.269526351707756,7.7224262179801055,8.897926813354077,Male,3950.5489525216,30900.971160492827,45.44471779336739,32.53626953390845,38.54908178213526,45.68069868652123,52.14778160036141,58.55987327009464,4985,50.588999571037924,37.96163592232419,44.36952228931922,51.00043495372919,57.29800167307383,62.60264359729543,12.320972805272238,5.6726378175382575,8.654898394076042,12.272465650264017,15.692923857502453,18.994766382407363 +1,2022.0,3,6.308338335480145,3.5080939514775054,4.884658142970065,6.393412939228545,7.840864797164771,9.07739538034821,Female,3988.090725420572,32860.1343895161,44.25151429498394,31.107993779229243,37.50351599214878,44.366588348774776,51.442309145614104,56.959088617324596,5209,49.37384130057876,36.15428395441477,42.6111924331543,49.75680133414894,56.251779479584435,62.00864217863853,13.383527928161119,6.66953448532945,9.857349020639258,13.3994125337131,16.892519805313192,20.20358182077466 +2,2019.0,1,6.755271072417884,3.33,5.0,8.0,8.33,8.33,Total,8349.582124325601,68282.28000000329,47.1230223585279,32.089000000000006,41.3,49.114999999999995,54.79,57.91,10108,51.365154333201424,37.159,48.0,54.65,57.49,60.05,11.752572220023753,6.0,8.0,11.0,13.0,20.0 +2,2019.0,2,6.722640710106919,3.33,5.0,7.0,8.33,8.33,Male,4174.453356463703,33324.13000000078,48.024859794230366,33.46,42.82,50.18,55.5,58.15,4957,51.89419406899334,38.562,49.0,54.8,57.49,59.89,11.266088359895102,6.0,8.0,10.0,13.0,19.0 +2,2019.0,3,6.78667249077849,3.33,5.0,8.33,8.33,8.33,Female,4175.128767861897,34958.150000001224,46.25515045622209,30.94,40.47,48.28,54.2,57.33,5151,50.856039603960404,35.54,46.91,54.38,57.57,60.18,12.220733838089691,6.0,8.0,11.0,14.0,20.800000000000182 +2,2020.0,1,6.469159220271885,3.6641554650882378,5.104769912548064,6.563964636793461,8.009368044748188,9.22818737680657,Total,8091.324450438363,65163.84082579875,46.106613528704315,32.66400258866222,39.49065697432136,46.68324215512363,53.244639989112926,58.79678135087245,10073,50.8002971965081,37.95182763647367,45.35255014096598,51.89710613081172,57.62976202358959,62.34516832628256,12.345030661821589,5.7619435637666605,8.60279063318494,11.982931481404357,15.721909230822567,19.422813456676238 +2,2020.0,2,6.500917460954964,3.735206172434222,5.1571363158695975,6.593370771992657,8.012003676887234,9.219588410001368,Male,4036.474491086885,32127.5340920394,46.87548512424562,33.843647190437565,40.3899617977008,47.417341122599375,53.94093501553655,59.30313002743127,4942,51.23483798705945,38.69647128457886,46.00927339979339,52.31380001158213,57.78252572168702,62.45621774360134,11.862772112908786,5.440889356908014,8.299363408680078,11.537499931705566,15.202035004837422,18.658519522902324 +2,2020.0,3,6.438570792001414,3.5900186976922885,5.0574697593747615,6.5111894612690335,8.002998583712925,9.233576395324556,Female,4054.8499593514775,33036.306733759135,45.36606326069318,31.841197507911275,38.73284812669728,45.94519523731761,52.64929253198872,58.15389864911198,5131,50.381762683371335,36.86088136738555,44.7631931895716,51.44846564408056,57.419619488370664,62.24683799737044,12.80952525327103,6.047133169517464,8.903827122230961,12.421515726288066,16.244444784678393,20.1685456287569 +2,2021.0,1,6.3124087294277205,3.552431944751777,4.881382303574991,6.36919524008003,7.857805827919764,9.06298033048008,Total,7961.135054438289,63641.704810090334,45.49044883981773,32.374078155876006,38.902354921828795,45.75916724564654,52.36381834448481,58.40699028307784,10082,50.3084373631216,37.625576876552095,44.330310389243344,50.73078910430227,57.04087432775216,62.23884591541562,12.626815573097367,5.962849794951819,9.017942281328283,12.385965989710161,16.035737228214447,19.536681384407284 +2,2021.0,2,6.331282644173343,3.5046840756273414,4.940085569114405,6.392858043005421,7.8821330583850635,9.12754681882115,Male,3952.5842036712024,31282.86754486053,46.253801069275234,33.09073619640183,39.72574377957451,46.633021202483214,52.989415972810846,58.754950520246794,4941,50.5193221215592,37.95344137083541,44.62207094302375,50.91525585711151,57.27122269269648,62.25945393277179,12.034508018555577,5.512237036753681,8.633278915120892,11.84248831534249,15.371129823062251,18.68873934593905 +2,2021.0,3,6.294269065401632,3.583859850146458,4.837188188001103,6.350853735152489,7.825832548056732,8.994593657632704,Female,4008.5508507670875,32358.837265229722,44.756793254182725,31.737252457145917,38.103547954823,44.862409060654436,51.74742326252915,57.96112001074027,5141,50.10575664119198,37.324482586626935,44.050148200800706,50.5395405648071,56.851203788907796,62.21006956159715,13.196080624058462,6.385694491017668,9.489171266334221,12.976122722378514,16.63179533531057,20.417708966437814 +2,2022.0,1,6.273240587468309,3.506108621634597,4.848420912091784,6.341265663522525,7.807285655170948,9.017956406670908,Total,7934.0446090048545,64099.97232275135,44.783273123400996,31.671622983277658,37.975345808340016,44.972693489600644,51.640812611123906,57.86168309317552,10218,49.80020909231505,36.880107088089595,43.33589943227795,50.21363001692791,56.59789073222782,61.99323595092617,12.900121505541382,6.13947527981219,9.232446732248087,12.819671094814627,16.387268711969778,19.730355547636588 +2,2022.0,2,6.229410196175183,3.493400134900776,4.812076231892081,6.290025214040182,7.757625316487039,8.926431671968407,Male,3923.57297688161,31115.90392989501,45.509438053801304,32.68077901759401,38.686660559814506,45.71524636545065,52.065339495745945,58.51402344253121,4995,49.96441439630823,37.32330233143777,43.798243404165795,50.438796066046876,56.705895298734845,61.85150680197461,12.385481923281198,5.651715251587991,8.730333896085739,12.236016810565381,15.852815316229357,19.146054349676735 +2,2022.0,3,6.315157647493038,3.509937281964083,4.895016748707732,6.395778781318909,7.8358813478439435,9.098844215663394,Female,4010.471632123245,32984.06839285607,44.0888075236787,30.81299651122208,37.35062191124863,44.22592210070282,51.22425454402625,56.98277144938087,5223,49.6431718544353,36.56438423490543,42.96205112436923,49.97467911321641,56.47673782736294,62.17717031421793,13.392295488575966,6.687548106467013,9.76552892698364,13.329862762018568,16.896953050983853,20.343303511114772 \ No newline at end of file