Skip to content
Closed
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
20 changes: 12 additions & 8 deletions input/InitialPopulations/compile/00_master.do
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ set matsize 1000

/**************************************************************************************
* DEFINE DIRECTORIES
**************************************************************************************/
*************************************************************************************/

* Working directory
global dir_work "C:\MyFiles\99 DEV ENV\JAS-MINE\data work\initial_populations"
*global dir_work "C:\MyFiles\99 DEV ENV\JAS-MINE\data work\initial_populations"
global dir_work "C:\Users\Patryk\Documents\SP_prep_pop"

* Directory which contains do files
global dir_do "${dir_work}/do"
*global dir_do "${dir_work}/do"
global dir_do "C:\Users\Patryk\git\SimPathsFork\input\InitialPopulations\compile"

* Directory which contains data files
global dir_data "${dir_work}/data"
Expand All @@ -48,20 +50,22 @@ global dir_data "${dir_work}/data"
global dir_log "${dir_work}/log"

* Directory which contains UKHLS data
global dir_ukhls_data "J:\01 DATA\UK\ukhls\wave14\stata\stata13_se\ukhls"
*global dir_ukhls_data "J:\01 DATA\UK\ukhls\wave14\stata\stata13_se\ukhls"
//global dir_ukhls_data "D:\Dasha\UK-original-data\USoc\UKDA-6614-stata\stata\stata13_se\ukhls"
global dir_ukhls_data "C:\Users\Patryk\Documents\SP_prep_pop\ukhls\UKDA-6614-stata\stata\stata13_se\ukhls"

* Directory which contains WAS data
global dir_was_data "J:\01 DATA\UK\was\wave7\stata\stata13_se"
*global dir_was_data "J:\01 DATA\UK\was\wave7\stata\stata13_se"
//global dir_was_data "D:\Dasha\UK-original-data\WAS\UKDA-7215-stata\stata\stata13_se"
global dir_was_data "C:\Users\Patryk\Documents\WAS\UKDA-7215-stata\stata\stata13_se"

* Directory which contains original initial popultions
global dir_ipop_orig "${dir_work}/original_initial_populations"


/**************************************************************************************
* DEFINE OTHER GLOBAL VARIABLES
**************************************************************************************/
*************************************************************************************/
* Define age to become responsible as defined in the simulation
global age_become_responsible 18

Expand Down Expand Up @@ -96,14 +100,14 @@ global wealthEndYear = 2019

/**************************************************************************************
* ROUTE TO WORKER FILES
**************************************************************************************/
*************************************************************************************/
* Prepare simulated and observed data
do "${dir_do}/01_prepare_UKHLS_pooled_data.do"
* Process UKHLS data
do "${dir_do}/02_create_UKHLS_variables.do"
* add social care
do "${dir_do}/03_social_care_received.do"
do "${dir_do}/04_social_care_provided.do"*/
do "${dir_do}/04_social_care_provided.do"
* screens data and identifies benefit units
do "${dir_do}/05_create_benefit_units.do"
* reweight data and slice into yearly segments
Expand Down
12 changes: 6 additions & 6 deletions input/InitialPopulations/compile/01_prepare_UKHLS_pooled_data.do
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ log using "${dir_log}/01_prepare_UKHLS_pooled_data.log", replace

/**************************************************************************************
* Select and merge UKHLS data
**************************************************************************************/
*************************************************************************************/

*add variables from the all persons (Household grid) dataset
foreach w of global UKHLSwaves {
Expand Down Expand Up @@ -86,7 +86,7 @@ foreach w of global UKHLSwaves {
use pidp `w'_hidp `w'_pno /*`w'_buno_dv*/ `w'_jbhrs `w'_jbot `w'_jshrs `w'_scghq1_dv `w'_scghq2_dv `w'_fimngrs_dv `w'_fimnnet_dv `w'_fimnlabnet_dv ///
`w'_fimnmisc_dv `w'_fimnprben_dv `w'_fimninvnet_dv `w'_fimnsben_dv `w'_fimnlabgrs_dv `w'_fimnpen_dv `w'_jbstat `w'_hiqual_dv `w'_jbhrs ///
/*`w'_j2hrs*/ `w'_jshrs `w'_scsf1 `w'_scghq1_dv `w'_scghq2_dv `w'_jbsic07_cc `w'_bendis* `w'_scghq1_dv `w'_scghq2_dv ///
`w'_indinus_lw `w'_indscus_lw /*`w'_indpxub_xw*/ `w'_indpxui_xw `w'_relup `w'_currpart* `w'_lmcbm* `w'_lmcby4* `w'_indpxui_xw `w'_sf12mcs_dv `w'_sf12pcs_dv ///
`w'_indinus_lw `w'_indscus_lw /*`w'_indpxub_xw `w'_indpxui_xw*/ `w'_relup `w'_currpart* `w'_lmcbm* `w'_lmcby4* `w'_indpxui_xw `w'_sf12mcs_dv `w'_sf12pcs_dv ///
`w'_sclfsato ///
using `w'_indresp.dta, clear
gen m_j2hrs=-9 /*m_j2hrs not available in wave 13*/
Expand Down Expand Up @@ -140,7 +140,7 @@ foreach w of global UKHLSwaves {

/**************************************************************************************
* Prepare and merge income variables:
**************************************************************************************/
*************************************************************************************/
foreach w of global UKHLSwaves {

// find the wave number
Expand Down Expand Up @@ -231,7 +231,7 @@ foreach w of global UKHLSwaves {

/**************************************************************************************
* merge all datasets together
**************************************************************************************/
*************************************************************************************/
use "$dir_data\add_vars_ukhls.dta", clear
merge 1:1 pidp hidp swv using "$dir_data\add_vars_ukhls_indresp.dta", keep(1 3) nogen
merge m:1 hidp swv using "$dir_data\add_vars_ukhls_hhresp.dta", keep(1 3) nogen
Expand All @@ -252,14 +252,14 @@ replace month = 1 if month == -10 // month not available for IEMB (Ethnic Minori

/**************************************************************************************
* save output
**************************************************************************************/
*************************************************************************************/
save "$dir_data\ukhls_pooled_all_obs_01.dta", replace
cap log close


/**************************************************************************************
* clean-up and exit
**************************************************************************************/
*************************************************************************************/
#delimit ;
local files_to_drop
add_vars_ukhls.dta
Expand Down
Loading