Skip to content

Revised refactored regresssions#478

Open
dariaple wants to merge 1 commit into
simpaths:developfrom
dariaple:refactored-regressions
Open

Revised refactored regresssions#478
dariaple wants to merge 1 commit into
simpaths:developfrom
dariaple:refactored-regressions

Conversation

@dariaple
Copy link
Copy Markdown
Contributor

@dariaple dariaple commented Jun 1, 2026

Replaced demYear with demYearTransformed.

Changed demYear with demYearTransformed
@dariaple
Copy link
Copy Markdown
Contributor Author

dariaple commented Jun 1, 2026

@dav-sonn @justin-ven

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the regression-estimation pipeline Stata do-files by introducing a standardized set of “dem*” covariates (including demYearTransformed) in variable_update.do, and updating the downstream estimation scripts to use the refactored variable names and revised Excel output behavior.

Changes:

  • Refactors variable_update.do to generate a large set of standardized demographic, income, region, education, health, and social-care variables (including demYearTransformed).
  • Updates multiple regression do-files (education → social care) to use the refactored variable names and switch putexcel set from replace to modify.
  • Updates programs.do gologit label export logic to append an underscore for common-coefficient variables.

Reviewed changes

Copilot reviewed 13 out of 28 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
input/InitialPopulations/compile/RegressionEstimates/variable_update.do Major refactor generating standardized covariates (incl. demYearTransformed) and additional derived/interaction variables.
input/InitialPopulations/compile/RegressionEstimates/programs.do Adjusts gologit label formatting for proportional-odds/common-coefficient terms.
input/InitialPopulations/compile/RegressionEstimates/10_reg_socialcare.do Updates social care regressions to use refactored covariates and Excel output modify mode.
input/InitialPopulations/compile/RegressionEstimates/09_reg_income.do Updates income regressions to use refactored covariates and Excel output modify mode.
input/InitialPopulations/compile/RegressionEstimates/08_reg_wages.do Updates wage equations/covariates and Excel output modify mode; adjusts wage growth variable handling.
input/InitialPopulations/compile/RegressionEstimates/07_reg_retirement.do Updates retirement regressions to use demYearTransformed and refactored covariates; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/06_reg_home_ownership.do Reorders xtset/variable update to occur after benefit-unit head restriction; uses refactored covariates.
input/InitialPopulations/compile/RegressionEstimates/05_reg_health.do Updates health regressions to use refactored covariates and demYearTransformed; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/04_reg_fertility.do Updates fertility regression covariates and demYearTransformed; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/03_reg_partnership.do Updates partnership regressions to use refactored covariates and demYearTransformed; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/02_reg_leave_parental_home.do Updates leave-parental-home regression to use demYearTransformed; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/01_reg_education.do Updates education regressions to use demYearTransformed; Excel output modify.
input/InitialPopulations/compile/RegressionEstimates/00_master_regression_estimates.do Minor comment formatting edits and retains orchestration of regression estimation scripts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

gen healthPartnerSelfRatedFair = (dhesp == 2) if !missing(dhesp)
gen healthPartnerSelfRatedGood = (dhesp == 3) if !missing(dhesp)
gen healthPartnerSelfRatedVeryGood = (dhesp == 4) if !missing(dhesp)
gen healthPartnerSelfRatedExcel = (dhesp == 5) if !missing(dhesp)
gen healthPartnerSelfRatedFairL1 = (L1.dhesp == 2) if !missing(L1.dhesp)
gen healthPartnerSelfRatedGoodL1 = (L1.dhesp == 3) if !missing(L1.dhesp)
gen healthPartnerSelfRatedVeryGoodL1 = (L1.dhesp == 4) if !missing(L1.dhesp)
gen healthPartnerSelfRatedExcelL1 = (L1.dhesp == 5) if !missing(L1.dhesp)
Comment on lines +1201 to +1203
gen careMarketInformalPartner = CareMarketInformalPartner
gen careMarketMixedPsrtner = CareMarketMixedPartner
gen careMarketFormalPartner = CareMarketFormalPartner
Comment on lines 429 to +432
careReceivedPartnerFlag careMarketFormalPartner careMarketInformalPartner careMarketMixedPsrtner ///
healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent ///
healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcellent ///
eduHighestC4Medium eduHighestC4High ///
healthSelfRatedPoor healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood ///
healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcel ///
eduHighestC4High eduHighestC4Medium ///
Comment on lines 521 to +524
careReceivedPartnerFlag careMarketFormalPartner careMarketInformalPartner careMarketMixedPsrtner ///
healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood healthSelfRatedExcellent ///
healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcellent ///
eduHighestC4Low eduHighestC4Medium eduHighestC4High ///
healthSelfRatedPoor healthSelfRatedFair healthSelfRatedGood healthSelfRatedVeryGood ///
healthPartnerSelfRatedFair healthPartnerSelfRatedGood healthPartnerSelfRatedVeryGood healthPartnerSelfRatedExcel ///
eduHighestC4High eduHighestC4Medium ///
Comment on lines +199 to +202
// Add _ to end end of vars with common coefs
real matrix is_unique, is_common
is_common = (unique_flag[1::rows(labels_no_bl)] :== 0)

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants