Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ input/EUROMODoutput/baseline/*
.DS_Store

input/InitialPopulations/original/*
input/InitialPopulations/base/*
6 changes: 3 additions & 3 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
maxNumberOfRuns: 1 # number of sequential simulation runs
executeWithGui: false # true = launch JAS-mine GUI; false = headless (required on servers/CI)
randomSeed: 606 # seed for the first run; incremented automatically if randomSeedInnov is true
startYear: 2019 # first year of simulation (must have matching input/donor data)
endYear: 2022 # last year of simulation (inclusive)
popSize: 50000 # simulated population size (larger = more accurate, slower)
startYear: 2011 # first year of simulation (must have matching input/donor data)
endYear: 2024 # last year of simulation (inclusive)
popSize: 100000 # simulated population size (larger = more accurate, slower)
Comment on lines +20 to +22
# countryString: "United Kingdom" # Auto-detected from donor DB if omitted
# integrationTest: false # true = write output to a fixed folder for comparison in CI tests

Expand Down
Binary file modified input/DatabaseCountryYear.xlsx
Binary file not shown.
Binary file modified input/EUROMODpolicySchedule.xlsx
Binary file not shown.
62 changes: 60 additions & 2 deletions input/InitialPopulations/compile/00_master.do
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ global scProvWaves "f g h i j k l m n o" //Next time available in wave 16 p
global firstSimYear = 2010
global lastSimYear = 2024
global wealthStartYear = 2015
global wealthEndYear = 2019
global wealthEndYear = 2021


* Define threshold ages
Expand Down Expand Up @@ -216,6 +216,65 @@ global age_force_leave_spell1_edu 30
global age_have_child_max 49 // allow this to be led by the data


/**************************************************************************************
* INFLATION FOR DEFLATING FINANCIALS TO REFERENCE YEAR

CPIH INDEX 00: ALL ITEMS 2015=100
CDID L522
Source dataset ID MM23
PreUnit
Unit Index, base year = 100
Release date 20-03-2024
Next release 17 April 2024
https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/l522/mm23
**************************************************************************************/
global inflation_minyear = 2008
global inflation_maxyear = 2025
matrix inflation = ( ///
0.862 \ /// 2009
0.879 \ /// 2009
0.901 \ /// 2010
0.936 \ /// 2011
0.96 \ /// 2012
0.982 \ /// 2013
0.996 \ /// 2014
1 \ /// 2015
1.01 \ /// 2016
1.036 \ /// 2017
1.06 \ /// 2018
1.078 \ /// 2019
1.089 \ /// 2020
1.116 \ /// 2021
1.205 \ /// 2022
1.286 \ /// 2023
1.329 \ /// 2024
1.329) /// 2025 //to update when becomes available


/**************************************************************************************
* social care wage rates (real 2015 prices for consistency with inflation figures)
**************************************************************************************/
global careWageRate_minyear = 2010
global careWageRate_maxyear = 2025
matrix careHourlyWageRates = ( ///
9.04 \ /// 2010
9.12 \ /// 2011
8.91 \ /// 2012
8.71 \ /// 2013
8.58 \ /// 2014
8.79 \ /// 2015
9.13 \ /// 2016
9.22 \ /// 2017
9.37 \ /// 2018
9.61 \ /// 2019
9.97 \ /// 2020
9.92 \ /// 2021
10.01 \ /// 2022
10.01 \ /// 2023
10.01 \ /// 2024
10.01) /// 2025


/**************************************************************************************
* ROUTE TO WORKER FILES
**************************************************************************************/
Expand All @@ -230,7 +289,6 @@ do "${dir_do}/04_social_care_provided.do"
do "${dir_do}/05_create_benefit_units.do"
* reweight data and slice into yearly segments
do "${dir_do}/06_reweight_and_slice.do"

* impute wealth data for selected years
do "${dir_do}/07_was_wealth_data.do"
forvalues year = $wealthStartYear / $wealthEndYear {
Expand Down
39 changes: 11 additions & 28 deletions input/InitialPopulations/compile/02_create_UKHLS_variables.do
Original file line number Diff line number Diff line change
Expand Up @@ -2107,36 +2107,12 @@ replace moecd_eq = 0.3*dnc013 + 0.5*dnc1418 + 1 if dhhtp_c4 == 4
drop dnc013 dnc1418


/************************Income CPI********************************************/
/*CPIH INDEX 00: ALL ITEMS 2015=100
CDID L522
Source dataset ID MM23
PreUnit
Unit Index, base year = 100
Release date 20-03-2024
Next release 17 April 2024
https://www.ons.gov.uk/economy/inflationandpriceindices/timeseries/l522/mm23
*/
/************************Inflation deflators********************************************/
gen CPI = .
replace CPI = 0.879 if intdaty_dv == 2009
replace CPI = 0.901 if intdaty_dv == 2010
replace CPI = 0.936 if intdaty_dv == 2011
replace CPI = 0.96 if intdaty_dv == 2012
replace CPI = 0.982 if intdaty_dv == 2013
replace CPI = 0.996 if intdaty_dv == 2014
replace CPI = 1 if intdaty_dv == 2015
replace CPI = 1.01 if intdaty_dv == 2016
replace CPI = 1.036 if intdaty_dv == 2017
replace CPI = 1.06 if intdaty_dv == 2018
replace CPI = 1.078 if intdaty_dv == 2019
replace CPI = 1.089 if intdaty_dv == 2020
replace CPI = 1.116 if intdaty_dv == 2021
replace CPI = 1.205 if intdaty_dv == 2022
replace CPI = 1.286 if intdaty_dv == 2023
replace CPI = 1.329 if intdaty_dv == 2024
replace CPI = 1.329 if intdaty_dv == 2025 //to update when becomes available

forvalues yy = $inflation_minyear/$inflation_maxyear {

replace CPI = inflation[`yy'-${inflation_minyear}+1,1] if intdaty_dv == `yy'
}


/**************************** Hourly labour income ***************************************/
Expand Down Expand Up @@ -3480,13 +3456,20 @@ gen total_wealth = -9
gen total_pensions = -9
gen housing_wealth = -9
gen mortgage_debt = -9
gen unsecured_low_debt = -9
gen unsecured_high_debt = -9
gen contRateOPEe = -9
gen contRateOPEr = -9
gen contRatePP = -9
gen smp = -9
gen rnk = -9
gen mtc = -9
label var total_wealth "total wealth net of liabilities of benefit unit including housing, business and private (personal and occupational) pensions"
label var total_pensions "value of all private (personal and occupational) pensions of benefit unit"
label var housing_wealth "value of main home gross of mortgage debt of benefit unit"
label var mortgage_debt "total mortgage debt owed on main home of benefit unit"
label var unsecured_low_debt "low-cost unsecured debt"
label var unsecured_high_debt "high-cost unsecured debt"

*check for duplicates in the pooled dataset
duplicates tag idperson idhh swv, gen(dup)
Expand Down
41 changes: 5 additions & 36 deletions input/InitialPopulations/compile/03_social_care_received.do
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,7 @@ global seedBase = 3141592
global seedAdjust = 0

global careWageRate_minyear = 2010
* social care wage rates (real 2015 prices for consistency with inflation figures)
matrix careHourlyWageRates = (9.04 \ /// 2010
9.12 \ /// 2011
8.91 \ /// 2012
8.71 \ /// 2013
8.58 \ /// 2014
8.79 \ /// 2015
9.13 \ /// 2016
9.22 \ /// 2017
9.37 \ /// 2018
9.61 \ /// 2019
9.97 \ /// 2020
9.92 \ /// 2021
10.01 \ /// 2022
10.01 \ /// 2023
10.01 \ /// 2024
10.01) /// 2025

/*TO UPDATE FOR RECENT YEARS */


/**********************************************************************
* start analysis
Expand Down Expand Up @@ -459,23 +441,10 @@ tab formal_socare_hrs if rec_care2==3
* evaluate formal care costs
*************************************************************************************/
cap gen formal_socare_cost = -9
//replace formal_socare_cost = $careHourlyWageRates[`year' - $careWageRate_minyear + 1] * formal_socare_hrs if (formal_socare_hrs>0)
replace formal_socare_cost = 9.04 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2010
replace formal_socare_cost = 9.12 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2010
replace formal_socare_cost = 8.91 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2011
replace formal_socare_cost = 8.71 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2012
replace formal_socare_cost = 8.58 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2013
replace formal_socare_cost = 8.79 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2014
replace formal_socare_cost = 9.13 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2016
replace formal_socare_cost = 9.22 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2017
replace formal_socare_cost = 9.37 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2018
replace formal_socare_cost = 9.61 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2019
replace formal_socare_cost = 9.97 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2020
replace formal_socare_cost = 9.92 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2021
replace formal_socare_cost = 10.01 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2022
replace formal_socare_cost = 10.01 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2023
replace formal_socare_cost = 10.01 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2024
replace formal_socare_cost = 10.01 * formal_socare_hrs if (formal_socare_hrs>0) & stm==2025
forvalues yy = $careWageRate_minyear/$careWageRate_maxyear {

replace formal_socare_cost = formal_socare_hrs * careHourlyWageRates[`yy'-${careWageRate_minyear},1] if (formal_socare_hrs>0) & stm==`yy'
}


/**************************************************************************************
Expand Down
57 changes: 51 additions & 6 deletions input/InitialPopulations/compile/04_social_care_provided.do
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* COUNTRY: UK
* DATA: UKHLS EUL version - UKDA-6614-stata [to wave o]
* AUTHORS: Justin van de Ven, Daria Popova
* LAST UPDATE: 15 Jan 2026 DP
* LAST UPDATE: 11 Aug 2026 JV
* NOTE: Called from 00_master.do - see master file for further details
***************************************************************************************

Expand All @@ -20,6 +20,7 @@ log using "${dir_log}/04_social_care_provided.log", replace
**********************************************************************/
cd "${dir_data}"
disp "identifying social care provision"
set seed 12345

// pooled data
foreach waveid in $scProvWaves {
Expand All @@ -30,7 +31,52 @@ foreach waveid in $scProvWaves {
rename *, l
rename `waveid'_* *
gen swv = `waveno'
keep pidp swv aidhrs aidhu*
if (`waveno' < 14) {
rename indinui_xw wgt
}
else {
rename inding2_xw wgt
}

// reallocate aidhrs categories 8 and 9 to categories 1 to 7
qui {

sum wgt if inlist(aidhrs, 1,2,3), meanonly
local sumw123 = r(sum)
sum wgt if aidhrs==1, meanonly
local p1 = r(sum) / `sumw123'
sum wgt if aidhrs==2, meanonly
local p2 = r(sum) / `sumw123'
local cut1 = `p1'
local cut2 = `p1' + `p2'

sum wgt if inlist(aidhrs, 4,5,6,7), meanonly
local sumw4567 = r(sum)
sum wgt if aidhrs==4, meanonly
local p4 = r(sum) / `sumw4567'
sum wgt if aidhrs==5, meanonly
local p5 = r(sum) / `sumw4567'
sum wgt if aidhrs==6, meanonly
local p6 = r(sum) / `sumw4567'
local cut4 = `p4'
local cut5 = `cut4' + `p5'
local cut6 = `cut5' + `p6'

gen _u = runiform()
rename aidhrs aidhrs_orig
gen aidhrs = aidhrs_orig
replace aidhrs = 1 if (aidhrs == 8 & _u <= `cut1')
replace aidhrs = 2 if (aidhrs == 8 & _u <= `cut2')
replace aidhrs = 3 if (aidhrs == 8)

replace aidhrs = 4 if (aidhrs == 9 & _u <= `cut4')
replace aidhrs = 5 if (aidhrs == 9 & _u <= `cut5')
replace aidhrs = 6 if (aidhrs == 9 & _u <= `cut6')
replace aidhrs = 7 if (aidhrs == 9)
drop _u
}

keep pidp swv aidhrs aidhu* wgt
save "${dir_data}/int_temp.dta", replace

use "${dir_ukhls_data}/`waveid'_egoalt.dta", clear
Expand All @@ -48,10 +94,9 @@ foreach waveid in $scProvWaves {
drop if (chk==1)
drop chk
merge 1:1 pidp using "${dir_data}/int_temp.dta", keep(2 3) nogen
keep pidp swv aidhrs aidhu* rindiv*
keep pidp swv aidhrs aidhu* rindiv* wgt
save "${dir_data}/ukhls_scprov_`waveid'.dta", replace
}
clear all
foreach waveid in $scProvWaves {
if ("`waveid'" == "f") {
use "${dir_data}/ukhls_scprov_`waveid'.dta", clear
Expand Down Expand Up @@ -109,8 +154,8 @@ replace aidhrs_adj = 27 if (aidhrs==4)
replace aidhrs_adj = 42 if (aidhrs==5)
replace aidhrs_adj = 74.5 if (aidhrs==6)
replace aidhrs_adj = 120 if (aidhrs==7)
replace aidhrs_adj = 5.48 if (aidhrs==8) //weighted average of 1 to 3
replace aidhrs_adj = 71.5 if (aidhrs==9) //weighted average of 4 to 7
//replace aidhrs_adj = 5.48 if (aidhrs==8) //weighted average of 1 to 3
//replace aidhrs_adj = 71.5 if (aidhrs==9) //weighted average of 4 to 7

gen care_nonpartner = (care_parent + care_child + care_others > 0)
gen careWho = 0
Expand Down
Loading
Loading