Skip to content

Add financial distress#198

Merged
andrewbaxter439 merged 17 commits intosimpaths:developfrom
igelstorm:feature/financial-distress
Jun 20, 2025
Merged

Add financial distress#198
andrewbaxter439 merged 17 commits intosimpaths:developfrom
igelstorm:feature/financial-distress

Conversation

@igelstorm
Copy link
Copy Markdown
Contributor

@igelstorm igelstorm commented Jun 9, 2025

What

  • Add financial distress variable to the initial population data (dichotomous variable defined as 4 or 5 for UKHLS variable finnow)
  • Add process to update financial distress (see below for model specification)
  • Add code to include ethnicity in simulation
    • This is needed as a predictor for financial distress, and was already in initial population data but not yet used

Why

Resolves #181.

To do before merging

  • Update training data to include financial distress
  • Update expected output for integration test

Model specification for financial distress process

Logit model estimated in UKHLS. Predictors:

  • Economic variables:
    • Employment transition
    • Working hours
    • Change in log income
    • Income decrease (binary)
    • Poverty transition
    • Gross personal non-employment capital income (L1)
    • Gross personal private pension income (L1)
  • Lagged/fixed confounders
    • Receives benefits (L1)
    • Owns home (L1)
    • Partnership status (L1)
    • Number of children (L1)
    • SF-12 PCS (L1)
    • SF-12 MCS (L1)
    • Region (L1)
    • HH income quintile (L1)
    • Long-term sick/disabled (L1)
    • Financial distress (L1)
    • Gender
    • Age (L1)
    • Age^2 (L1)
    • Education
    • Ethnicity
    • Year

@igelstorm igelstorm requested a review from andrewbaxter439 June 9, 2025 15:14
@igelstorm igelstorm linked an issue Jun 9, 2025 that may be closed by this pull request
@igelstorm igelstorm force-pushed the feature/financial-distress branch from b5a380c to f28f96b Compare June 12, 2025 08:12
Copy link
Copy Markdown
Collaborator

@andrewbaxter439 andrewbaxter439 left a comment

Choose a reason for hiding this comment

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

This code seems good! Failing validation tests - is that likely caused by different initial population?

@igelstorm igelstorm force-pushed the feature/financial-distress branch from f28f96b to 5ff9d91 Compare June 12, 2025 13:26
@igelstorm
Copy link
Copy Markdown
Contributor Author

igelstorm commented Jun 12, 2025

This code seems good! Failing validation tests - is that likely caused by different initial population?

I thought so at first, but I tried to keep the initial population unchanged except for the financial distress variable, and there are still small differences. (In theory, there shouldn't be, because the new process doesn't interact with any existing processes)

I think because I've added a process that involves additional random draws, all the subsequent random draws will be different, leading to slightly different random noise in the output. I have to say that diminishes the value of that test a bit. But maybe we can be content with verifying that the output statistics remain approximately the same?

@andrewbaxter439
Copy link
Copy Markdown
Collaborator

I had wondered if the additional draws were partly to blame, though these don't seem to affect the previous draws in the same Innovations object:

class InnovationsTest {

    @Test
    public void checkSame() {

        Innovations innovation1 = new Innovations(2, 100);
        Innovations innovation2 = new Innovations(3, 100);


        assertTrue(innovation1.getDoubleDraw(0) == innovation2.getDoubleDraw(0) );
        assertFalse(innovation1.getDoubleDraw(1) == innovation2.getDoubleDraw(2) );

    }

}

... passes fine?

@matteorichiardi
Copy link
Copy Markdown
Contributor

matteorichiardi commented Jun 13, 2025 via email

@igelstorm igelstorm force-pushed the feature/financial-distress branch from 07ef062 to 7409aab Compare June 13, 2025 10:27
@andrewbaxter439
Copy link
Copy Markdown
Collaborator

Awesome that everything's working now! Shouldn't add any breaking changes so if this were able to be merged (@pbronka /@justin-ven) I'd be keen to bring this new parameter into re-estimating mental health effects?

@igelstorm igelstorm force-pushed the feature/financial-distress branch 2 times, most recently from 869acec to 1d8780f Compare June 18, 2025 14:36
@igelstorm igelstorm force-pushed the feature/financial-distress branch from 1d8780f to 77816cc Compare June 19, 2025 11:54
@igelstorm
Copy link
Copy Markdown
Contributor Author

@andrewbaxter439 I've updated this based on discussions:

  • Still using 5 ethnicity categories
  • Including non-employment capital income and private pension income as covariates
  • Using cross-sectional weights (dimxwt)
  • Updated description of covariates to reflect lags correctly

@andrewbaxter439
Copy link
Copy Markdown
Collaborator

Awesome that this is working - think ready to merge I'd say!

@andrewbaxter439 andrewbaxter439 merged commit 94ffedb into simpaths:develop Jun 20, 2025
5 checks passed
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.

Add financial distress

3 participants