Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ global estimation_sample "${path}\initial_populations\data\ukhls_pooled_ipop.dta
* Pooled dataset with predicted wages after Heckman
global estimation_sample2 "${path}\initial_populations\data\UKHLS_pooled_ipop2.dta"

* Directory containing external data used for the estimates (e.g. fertility rates, wage growth)
* Directory containing external data used +for the estimates (e.g. fertility rates, wage growth)
global dir_external_data "${dir_work}/external_data"

* Directory to save data for internal validation
Expand All @@ -92,7 +92,7 @@ do "${path}\00_master_conditions.do"
Two additional do-files are called from each of these do-files
- variable_update.do refactors variable names
- programs.do contains Stata programs to process the output of regressions and create Excel files with results used by Simpaths
*/
*/

do "${dir_do}/01_reg_education.do"

Expand All @@ -114,7 +114,9 @@ do "${dir_do}/09_reg_income.do"

do "${dir_do}/10_reg_socialcare.do"


/*Note that the do-files below are not yet refactored */

do "${dir_do}/11_reg_financial_distress.do"

do "${dir_do}/12_reg_health_mental.do"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ log using "${dir_log}/reg_education.log", replace

/******************************* SET EXCEL FILE *******************************/

putexcel set "$dir_results/reg_education", sheet("Info") replace
putexcel set "$dir_results/reg_education", sheet("Info") modify //replace
putexcel A1 = "Description:", bold
putexcel B1 = "Model parameters governing projection of education status"
putexcel A2 = "Authors:"
Expand Down Expand Up @@ -79,34 +79,55 @@ do "${dir_do}/programs.do"
/****************** E1a: PROBABILITY OF REMAINING IN EDUCATION ****************/
display "${e1a_if_condition}"


/*
probit Dst i.Dgn Dag Dag_sq /*Dag_c Dag_c_sq Dag_post18_sq*/ li.Ded ///
li.Dehmf_c3_Medium li.Dehmf_c3_Low ///
li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${e1a_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("education") process("E1a") sheet("E1a_orig") ///
title("Process E1a: Prob. remain in education") ///
gofrow(3) goflabel("E1a - Remain in education") ///
ifcond("${e1a_if_condition}") probit
*/
probit Dst ///
demMaleFlag demAge demAgeSq eduSampleFlagL1 ///
eduHighestParentC3MediumL1 eduHighestParentC3LowL1 ///
yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${e1a_if_condition} [pw=${weight}], vce(robust)


process_regression, domain("education") process("E1a") sheet("E1a") ///
title("Process E1a: Prob. remain in education") ///
gofrow(3) goflabel("E1a - Remain in education") ///
ifcond("${e1a_if_condition}") probit



/****************** E1b: PROBABILITY OF RETURNING TO EDUCATION ****************/
display "${e1b_if_condition}"

/*
probit der i.Dgn Dag Dag_sq li.Dcpst_Partnered ///
li.Deh_c4_High li.Deh_c4_Low li.Dehmf_c3_Medium li.Dehmf_c3_Low ///
li.Les_c3_NotEmployed li.Les_c3_Employed l.Dnc l.Dnc02 ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${e1b_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("education") process("E1b") sheet("E1b_orig") ///
title("Process E1b: Prob. return to education") ///
gofrow(7) goflabel("E1b - Return to education") ///
ifcond("${e1b_if_condition}") probit
*/
probit der ///
demMaleFlag demAge demAgeSq demPartnerStatusPartneredL1 ///
eduHighestC4HighL1 eduHighestC4LowL1 ///
eduHighestParentC3MediumL1 eduHighestParentC3LowL1 ///
labStatusC3NotEmployedL1 /*labStatusC3EmployedL1*/ ///
labStatusC3NotEmployedL1 labStatusC3EmployedL1 ///
demNChildL1 demNChild0to2L1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${e1b_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("education") process("E1b") sheet("E1b") ///
title("Process E1b: Prob. return to education") ///
gofrow(7) goflabel("E1b - Return to education") ///
Expand All @@ -116,13 +137,24 @@ process_regression, domain("education") process("E1b") sheet("E1b") ///
/****************** E2: EDUCATION ATTAINMENT WHEN LEAVE SCHOOL ****************/
display "${e2_if_condition}"

/*
gologit2 deh_c3_recoded i.Dgn Dag Dag_sq ///
i.L_Dehmf_c3_Medium i.L_Dehmf_c3_Low ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${e2_if_condition} [pw=${weight}], autofit

process_gologit, domain("education") process("E2") sheet("E2_orig") ///
title("Process E2: Educational Attainment When Leave School") ///
gofrow(11) goflabel("E2 - Education attainment") ///
outcomes(3) ///
ifcond("${e2_if_condition}")
*/
gologit2 deh_c3_recoded ///
demMaleFlag demAge demAgeSq ///
eduHighestParentC3MediumL1 eduHighestParentC3LowL1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${e2_if_condition} [pw=${weight}] , autofit


process_gologit, domain("education") process("E2") sheet("E2") ///
title("Process E2: Educational Attainment When Leave School") ///
gofrow(11) goflabel("E2 - Education attainment") ///
Expand All @@ -132,5 +164,5 @@ process_gologit, domain("education") process("E2") sheet("E2") ///

display "Education analysis complete!"


capture log close
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log using "${dir_log}/reg_leave_parental_home.log", replace

/********************************* SET EXCEL FILE *****************************/

putexcel set "$dir_results/reg_leave_parental_home", sheet("Info") replace
putexcel set "$dir_results/reg_leave_parental_home", sheet("Info") modify //replace
putexcel A1 = "Description:", bold
putexcel B1 = "Model parameters governing leaving parental home"
putexcel A2 = "Authors:"
Expand Down Expand Up @@ -65,13 +65,26 @@ do "${dir_do}/programs.do"

/**************** P1: PROBABILITY OF LEAVING THE PARENTAL HOME ****************/
display "${p1_if_condition}"

/*
probit dlftphm i.Dgn Dag Dag_sq li.Deh_c4_Na li.Deh_c4_Medium li.Deh_c4_Low ///
li.Les_c3_Student li.Les_c3_NotEmployed ///
li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${p1_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("leave_parental_home") process("P1") sheet("P1_orig") ///
title("Process P1: Prob. leave parental home") ///
gofrow(3) goflabel("P1 - Leave parental home") ///
ifcond("${p1_if_condition}") probit
*/

probit dlftphm ///
demMaleFlag demAge demAgeSq ///
eduHighestC4NaL1 eduHighestC4MediumL1 eduHighestC4LowL1 ///
labStatusC3StudentL1 labStatusC3NotEmployedL1 ///
yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${p1_if_condition} [pw=${weight}], vce(robust)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log using "${dir_log}/reg_partnership.log", replace

/********************************* SET EXCEL FILE *****************************/

putexcel set "$dir_results/reg_partnership", sheet("Info") replace
putexcel set "$dir_results/reg_partnership", sheet("Info") modify //replace
putexcel A1 = "Description:", bold
putexcel B1 = "Model parameters for relationship status projection"
putexcel A2 = "Authors:"
Expand Down Expand Up @@ -66,18 +66,36 @@ do "${dir_do}/programs.do"

/******************** U1: PROBABILITY FORMING PARTNERSHIP *********************/
display "${u1_if_condition}"

/*
probit dcpen ///
i.Ded Dgn Dag Dag_sq ///
lc.Dnc lc.Dnc02 ///
li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 ///
/*Ded_Dag Ded_Dag_sq*/ Ded_Dgn Ded_Dnc_L1 Ded_Dnc02_L1 ///
Ded_Ydses_c5_Q2_L1 Ded_Ydses_c5_Q3_L1 Ded_Ydses_c5_Q4_L1 Ded_Ydses_c5_Q5_L1 ///
i.Deh_c4_Na i.Deh_c4_High i.Deh_c4_Medium i.Deh_c4_Low ///
li.Les_c4_Student li.Les_c4_NotEmployed li.Les_c4_Retired ///
li.Les_c4_Student_Dgn li.Les_c4_NotEmployed_Dgn li.Les_c4_Retired_Dgn ///
l.Dhe_pcs l.Dhe_mcs ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${u1_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("partnership") process("U1") sheet("U1_orig") ///
title("Process U1: Prob. form partnership") ///
gofrow(3) goflabel("U1 - Form partnership") ///
ifcond("${u1_if_condition}") probit
*/
probit dcpen ///
eduSampleFlag demMaleFlag demAge demAgeSq ///
demNChildL1 demNChild0to2L1 ///
yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 ///
eduSampleFlag_demMaleFlag eduSampleFlag_demNChildL1 eduSampleFlag_demNChild0to2L1 ///
eduSampleFlag_Q2L1 eduSampleFlag_Q3L1 eduSampleFlag_Q4L1 eduSampleFlag_Q5L1 ///
eduHighestC4NaL1 eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 ///
labStatusC4EmployedL1 labStatusC4StudentL1 labStatusC4RetiredL1 ///
labStatusC4EmployedL1_Male labStatusC4StudentL1_Male labStatusC4RetiredL1_Male ///
eduHighestC4High eduHighestC4Medium /*eduHighestC4Low*/ ///
labStatusC4StudentL1 labStatusC4NotEmployedL1 labStatusC4RetiredL1 ///
labStatusC4Student_MaleL1 labStatusC4NotEmployed_MaleL1 labStatusC4Retired_MaleL1 ///
healthPhysicalPcsL1 healthMentalMcsL1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${u1_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("partnership") process("U1") sheet("U1") ///
Expand All @@ -88,18 +106,40 @@ process_regression, domain("partnership") process("U1") sheet("U1") ///

/******************* U2: PROBABILITY TERMINATE PARTNERSHIP ********************/
display "${u2_if_condition}"


/*
probit dcpex ///
i.Ded Dag Dag_sq /*Ded_Dag Ded_Dag_sq*/ ///
li.Deh_c4_Na li.Deh_c4_Low li.Deh_c4_Medium li.Deh_c4_High ///
li.Dehsp_c3_Medium li.Dehsp_c3_Low ///
li.Dhe_Fair li.Dhe_Good li.Dhe_VeryGood li.Dhe_Excellent ///
l.Dhe_pcs l.Dhe_mcs ///
l.Dhe_pcssp l.Dhe_mcssp ///
l.Dcpyy l.New_rel l.Dcpagdf ///
l.Dnc l.Dnc02 ///
li.Lesdf_c4_EmpSpouseNotEmp li.Lesdf_c4_NotEmpSpouseEmp li.Lesdf_c4_BothNotEmployed ///
l.Ypnbihs_dv l.Ynbcpdf_dv ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${u2_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("partnership") process("U2") sheet("U2_orig") ///
title("Process U2: Prob. end partnership") ///
gofrow(7) goflabel("U2 - End partnership") ///
ifcond("${u2_if_condition}") probit
*/

probit dcpex ///
eduSampleFlag demMaleFlag demAge demAgeSq ///
eduHighestC4NaL1 eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 ///
eduSampleFlag demAge demAgeSq ///
eduHighestC4NaL1 eduHighestC4LowL1 eduHighestC4MediumL1 eduHighestC4HighL1 ///
eduHighestPartnerC3MediumL1 eduHighestPartnerC3LowL1 ///
healthPhysicalPcsL1 healthMentalMcsL1 ///
healthSelfRatedFairL1 healthSelfRatedGoodL1 healthSelfRatedVeryGoodL1 healthSelfRatedExcellentL1 ///
healthPhysicalPcsL1 healthMentalMcsL1 ///
healthPhysicalPartnerPcsL1 healthMentalPartnerMcsL1 ///
demPartnerNYearL1 demEnterPartnerFlagL1 demAgePartnerDiffL1 ///
demNChildL1 demNChild0to2L1 ///
labStatusPartnerAndOwnC42L1 labStatusPartnerAndOwnC43L1 labStatusPartnerAndOwnC44L1 ///
yNonBenPersGrossMonthL1 yPersAndPartnerGrossDiffMonthL1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${u2_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("partnership") process("U2") sheet("U2") ///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log using "${dir_log}/reg_fertility.log", replace

/******************************* SET EXCEL FILE *******************************/

putexcel set "$dir_results/reg_fertility", sheet("Info") replace
putexcel set "$dir_results/reg_fertility", sheet("Info") modify //replace
putexcel A1 = "Description:", bold
putexcel B1 = "Model parameters governing projection of fertility"
putexcel A2 = "Authors:"
Expand Down Expand Up @@ -69,18 +69,38 @@ do "${dir_do}/programs.do"

/*********************** F1: PROBABILITY OF HAVING A CHILD ********************/
display "${f1_if_condition}"
/*
probit dchpd ///
i.Ded Dag Dag_sq ///
l.Dhe_pcs l.Dhe_mcs ///
Dcpst_Single li.Dcpst_Single ///
/*Ded_Dag Ded_Dhe_pcs Ded_Dhe_mcs*/ ///
Ded_Dcpst_Single /*Ded_Dcpst_Single_L1*/ ///
li.Ydses_c5_Q2 li.Ydses_c5_Q3 li.Ydses_c5_Q4 li.Ydses_c5_Q5 ///
l.Dnc l.Dnc02 ///
i.Deh_c4_Low i.Deh_c4_High ///
FertilityRate ///
/*li.Les_c3_Student*/ li.Les_c3_NotEmployed ///
$regions Year_transformed Y2020 Y2021 $ethnicity ///
if ${f1_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("fertility") process("F1") sheet("F1_orig") ///
title("Process F1: Prob. have a child") ///
gofrow(3) goflabel("F1 - Have child") ///
ifcond("${f1_if_condition}") probit
*/

probit dchpd ///
eduSampleFlag demMaleFlag demAge demAgeSq ///
eduSampleFlag demAge demAgeSq ///
healthPhysicalPcsL1 healthMentalMcsL1 ///
demPartnerStatusSingle demPartnerStatusSingleL1 ///
eduSampleFlag_Single ///
yHhQuintilesMonthC5Q2L1 yHhQuintilesMonthC5Q3L1 yHhQuintilesMonthC5Q4L1 yHhQuintilesMonthC5Q5L1 ///
demNChildL1 demNChild0to2L1 ///
eduHighestC4HighL1 eduHighestC4MediumL1 eduHighestC4LowL1 ///
eduHighestC4Low eduHighestC4High ///
fertilityRate ///
/*labStatusC3StudentL1*/ labStatusC3NotEmployedL1 ///
$regions demYear demYear2020 demYear2021 $ethnicity ///
$regions demYearTransformed demYear2020 demYear2021 $ethnicity ///
if ${f1_if_condition} [pw=${weight}], vce(robust)

process_regression, domain("fertility") process("F1") sheet("F1") ///
Expand Down
Loading