Skip to content

Commit 31c88f5

Browse files
authored
Merge pull request #168 from justin-ven/develop
update for UKHLS input data
2 parents 320f43c + 1bda44a commit 31c88f5

4 files changed

Lines changed: 89 additions & 7 deletions

File tree

analysis/employment analysis.do

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**************************************************************************************
2+
*
3+
* PROGRAM TO ANALYSE EMPLOYMENT TRANSATIONS
4+
*
5+
* Last version: Justin van de Ven, 06 May 2025
6+
* First version: Justin van de Ven, 06 May 2025
7+
*
8+
**************************************************************************************/
9+
10+
clear all
11+
global moddir = "C:\Justin\dev\SimPaths\output\20250506123915\csv"
12+
global outdir = "C:\Justin\dev\SimPaths\analysis\"
13+
cd "$outdir"
14+
15+
16+
/**************************************************************************************
17+
* start
18+
**************************************************************************************/
19+
global year_start = 2019
20+
global year_end = 2030
21+
22+
23+
/**************************************************************************************
24+
* load data
25+
**************************************************************************************/
26+
import delimited using "$moddir/BenefitUnit.csv", clear
27+
rename *, l
28+
rename id_benefitunit idbenefitunit
29+
gsort idbenefitunit time
30+
save "$outdir/temp0", replace
31+
import delimited using "$moddir/Person.csv", clear
32+
rename *, l
33+
rename id_person idperson
34+
rename socialcareprovision socialcareprovision_p
35+
gsort idbenefitunit time idperson
36+
merge m:1 idbenefitunit time using temp0
37+
gsort time idbenefitunit idperson
38+
gen refbenefitunit = 0
39+
replace refbenefitunit = 1 if (idbenefitunit != idbenefitunit[_n-1])
40+
41+
destring hoursworkedweekly, replace force
42+
recode hoursworkedweekly (missing=0)
43+
gen idNotEmployedAdult = (hoursworkedweekly<0.1 & dag>17)
44+
45+
gen led = (deh_c3=="Low")
46+
gen med = (deh_c3=="Medium")
47+
gen hed = (deh_c3=="High")
48+
49+
gen male = (dgn=="Male")
50+
51+
gen idna = (dag>17)
52+
gen idnk = (dag<18)
53+
bys time idbenefitunit: egen partnered = sum(idna)
54+
replace partnered = partnered - 1
55+
bys time idbenefitunit: egen nk = sum(idnk)
56+
57+
save "$outdir/temp1", replace
58+
59+
60+
/**************************************************************************************
61+
* analysis
62+
**************************************************************************************/
63+
use "$outdir/temp1", clear
64+
global year_ref = $year_start-1
65+
66+
// block 1 statistics
67+
gen emp = (hoursworkedweekly>0.5)
68+
gen emp_to_nemp = 0
69+
gen nemp_to_emp = 0
70+
gsort idperson time
71+
replace emp_to_nemp = 1 if (idperson[_n-1]==idperson & time[_n-1]+1==time & emp[_n-1]==1 & emp==0)
72+
replace nemp_to_emp = 1 if (idperson[_n-1]==idperson & time[_n-1]+1==time & emp[_n-1]==0 & emp==1)
73+
order time idperson hoursworkedweekly emp emp_to_nemp
74+
matrix store1 = J($year_end-$year_ref,2,.)
75+
forvalues yy = $year_start/$year_end {
76+
qui{
77+
sum emp_to_nemp if (time==`yy' & dag>17 & dag<65), mean
78+
mat store1[`yy'-${year_ref},1] = r(mean)
79+
sum nemp_to_emp if (time==`yy' & dag>17 & dag<65), mean
80+
mat store1[`yy'-${year_ref},2] = r(mean)
81+
}
82+
}
83+
matlist store1

input/DatabaseCountryYear.xlsx

1 Byte
Binary file not shown.

input/EUROMODpolicySchedule.xlsx

84 Bytes
Binary file not shown.

input/InitialPopulations/compile/00_master.do

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* DATA: UKHLS EUL version - UKDA-6614-stata [to wave n]
99
* WAS EUL version - UKDA-7215-stata [to wave 7]
1010
* AUTHORS: Daria Popova, Justin van de Ven
11-
* LAST UPDATE: 14 Jan 2025
11+
* LAST UPDATE: 30 Apr 2025
1212
***************************************************************************************
1313

1414
***************************************************************************************
@@ -36,8 +36,7 @@ set matsize 1000
3636
**************************************************************************************/
3737

3838
* Working directory
39-
//global dir_work "C:\MyFiles\99 DEV ENV\JAS-MINE\data work\initial_populations"
40-
global dir_work "D:\Dasha\ESSEX\ESPON 2024\UK\initial_populations"
39+
global dir_work "C:\MyFiles\99 DEV ENV\JAS-MINE\data work\initial_populations"
4140

4241
* Directory which contains do files
4342
global dir_do "${dir_work}/do"
@@ -49,12 +48,12 @@ global dir_data "${dir_work}/data"
4948
global dir_log "${dir_work}/log"
5049

5150
* Directory which contains UKHLS data
52-
//global dir_ukhls_data "J:\01 DATA\UK\ukhls\wave13\stata\stata13_se\ukhls"
53-
global dir_ukhls_data "D:\Dasha\UK-original-data\USoc\UKDA-6614-stata\stata\stata13_se\ukhls"
51+
global dir_ukhls_data "J:\01 DATA\UK\ukhls\wave14\stata\stata13_se\ukhls"
52+
//global dir_ukhls_data "D:\Dasha\UK-original-data\USoc\UKDA-6614-stata\stata\stata13_se\ukhls"
5453

5554
* Directory which contains WAS data
56-
//global dir_was_data "J:\01 DATA\UK\was\wave7\stata\stata13_se"
57-
global dir_was_data "D:\Dasha\UK-original-data\WAS\UKDA-7215-stata\stata\stata13_se"
55+
global dir_was_data "J:\01 DATA\UK\was\wave7\stata\stata13_se"
56+
//global dir_was_data "D:\Dasha\UK-original-data\WAS\UKDA-7215-stata\stata\stata13_se"
5857

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

0 commit comments

Comments
 (0)