Revised refactored regresssions#478
Open
dariaple wants to merge 1 commit into
Open
Conversation
Changed demYear with demYearTransformed
Contributor
Author
Contributor
There was a problem hiding this comment.
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.doto generate a large set of standardized demographic, income, region, education, health, and social-care variables (includingdemYearTransformed). - Updates multiple regression do-files (education → social care) to use the refactored variable names and switch
putexcel setfromreplacetomodify. - Updates
programs.dogologit 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced demYear with demYearTransformed.