Skip to content

Add do file for estimating financial distress parameters#315

Merged
justin-ven merged 8 commits intosimpaths:developfrom
igelstorm:financial-distress-estimation-files
Jan 21, 2026
Merged

Add do file for estimating financial distress parameters#315
justin-ven merged 8 commits intosimpaths:developfrom
igelstorm:financial-distress-estimation-files

Conversation

@igelstorm
Copy link
Copy Markdown
Contributor

@igelstorm igelstorm commented Jan 20, 2026

What

This PR:

  • Adds Stata code for estimating parameters for the financial distress process
  • Replaces the existing financial distress parameters (reg_financial_distress.xlsx) with the output from this script based on the current initial population (this is slightly different from what was there before)

And, unrelatedly (but necessary for the above):

  • Fixes an issue that caused all of the existing estimation scripts to error when run with the initial population built using the current Stata code:

Why

We want the code used to estimate model parameters to be stored in this repo. This wasn't the case for the financial distress process.

Validation

  • I've manually verified that the row and column labels are correct.
  • I've compared the old and the new coefficients and they are broadly similar: reg_financial_distress_CHANGES.xlsx
    • Minor differences are expected because the data used to estimate the previous version was different from the current data
    • There are non-trivial differences in the coefficients for number of children (dnc) and a few of the UK regions - I'm guessing these might be due to changes in the estimation data since these were previously estimated

Copy link
Copy Markdown

@dkopasker dkopasker left a comment

Choose a reason for hiding this comment

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

Just two comments: one about duplication of a variable, and one about compliance with the variable naming policy (which perhaps happened while you were on leave).

dimxwt dhhwt jbhrs jshrs j2hrs jbstat les_c3 les_c4 lessp_c3 lessp_c4 lesdf_c4 ydses_c5 month scghq2_dv ydisp ///
ypnbihs_dv yptciihs_dv yplgrs_dv ynbcpdf_dv ypncp ypnoab swv sedex ssscp sprfm sedag stm dagsp lhw l1_lhw pno ppno hgbioad1 hgbioad2 der adultchildflag ///
econ_benefits econ_benefits_nonuc econ_benefits_uc ///
fihhmnnet1_dv ieqmoecd_dv ///
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The equivalence scale is generated later in the do file (see gen moecd_eq = . //Modified OECD equivalence scale). For consistency, it may be best to use the generated variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's good to know. Currently, ieqmoecd_dv this is used to calculate equivalised income in the input\InitialPopulations\compile\RegressionEstimates\variable_update.do which is used by most of the estimation files.

It sounds like a sensible idea to replace this with moecd_eq, but this would affect all estimation scripts and ideally would require all of the scripts to be rerun (i.e. the parameters reestimated). @dav-sonn, @dariaple or others in Essex might have a view on this.

* HM1_L: GHQ12 score 0-36 of all working-age adults - baseline effects *
**********************************************************************

logit financial_distress ///
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does the variable named "financial_distress" comply with the new variable naming structure and does it need to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good question. I understand that @dav-sonn's open PR #313 will rename it to "yFinDstrssFlag" in the initial population CSV files. That said, the regression estimation scripts all use the pooled dataset ukhls_pooled_all_obs_09.dta, which is created before this renaming takes place, so all the variables here (exp_emp, lhw_c5, and so on) will continue to have their "old" names.

I think this is a question that goes beyond this PR and should probably be resolved separately (although @dav-sonn might have a view?).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah it looks like #313 will add the code to change the name in the csv file after the initial population has been created and independent of the regressions. So this change should be compatible with current state and should sync up nicely with refactoring!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As Matteo pointed out below, we haven't refactored the regressors in the processes' estimation scripts. Refactored variables are those in the initial populations, the output CSV files, and the Person, BenefitUnit, and Household classes.
I hope this clarifies!



**********************************************************************
* HM1_L: GHQ12 score 0-36 of all working-age adults - baseline effects *
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Update heading, along lines of:

Suggested change
* HM1_L: GHQ12 score 0-36 of all working-age adults - baseline effects *
* Financial Distress (binary) - estimated log odds of experiencing financial distress *

@matteorichiardi
Copy link
Copy Markdown
Contributor

matteorichiardi commented Jan 20, 2026 via email

@justin-ven justin-ven merged commit d99f968 into simpaths:develop Jan 21, 2026
6 checks passed
@igelstorm igelstorm deleted the financial-distress-estimation-files branch January 26, 2026 09:28
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.

6 participants