|
tempfile Temp
|
|
local vlist " school fenow jbstat edtype lgaped month sampst ivfio intdatm_dv intdaty_dv"
|
|
foreach i of numlist 1 5{
|
|
local j: word `i' of `c(alpha)'
|
|
local prefixlist: subinstr local vlist " " " `j'_", all
|
|
use pidp `prefixlist' using /*
|
|
*/ "${fld}/${ukhls_path}_w`i'/`j'_indresp${file_type}", clear
|
|
gen `j'_IntDate_MY=ym(`j'_intdaty_dv,`j'_intdatm_dv) /*
|
|
*/ if `j'_intdatm_dv>0 & `j'_intdaty_dv>0
|
|
drop *intdat*
|
|
preserve
|
|
use pidp using /*
|
|
*/ "${fld}/${ukhls_path}_w`i'/`j'_empstat${file_type}", clear
|
|
duplicates drop
|
|
tempfile Temp2
|
|
save "`Temp2'", replace
|
|
restore
|
|
merge 1:1 pidp using "`Temp2'", gen(`j'_empstat)
|
|
capture merge 1:1 pidp using "`Temp'", nogen
|
|
save "`Temp'", replace
|
|
}
|
|
numlabel, add
|
|
order pidp a_* e_*
|
|
keep if a_sampst==1 & a_ivfio==1 & e_ivfio==1
|
|
drop if (a_empstat==3 & e_empstat==3) | (a_lgaped!=-8 & e_lgaped!=-8)
|
|
drop *sampst *ivfio *empstat *lgaped
|
|
|
|
gen LifeHist_Wave=cond(a_month<=6,1,5)
|
|
egen Min_IntDate_MY=min(a_IntDate_MY)
|
|
format *MY %tm
|
|
|
|
#delim ;
|
|
global mergelist "a_ukborn a_scend a_feend a_paju a_maju
|
|
a_lvag14 a_ynlp14 a_racel a_nmar a_sf1
|
|
a_jbhas a_sclfsato a_sex_dv a_ethn_dv
|
|
a_doby_dv a_country a_gor_dv a_urban_dv
|
|
a_scghq1_dv a_sf12pcs_dv a_sf12mcs_dv
|
|
a_swemwbs_dv a_bmi_dv" ;
|
|
#delim cr
|
|
merge 1:1 pidp using "${fld}/${ukhls_path}_w1/a_indresp${file_type}", /*
|
|
*/ keep(match) keepusing($mergelist) nogen
|
|
prog_recodemissing a_*
|
|
local i=0
|
|
gen Variable=""
|
|
gen PVal=.
|
|
foreach var of global mergelist{
|
|
local i=`i'+1
|
|
ttest `var', by(LifeHist_Wave)
|
|
replace Variable="`var'" in `i'
|
|
replace PVal=r(p) in `i'
|
|
}
|
|
tab a_gor_dv LifeHist_Wave if a_gor_dv!=12, m chi2 expected
|
|
|
|
|