Project

General

Profile

Support #1394 » UserForum_Issue1394_public.do

Alita Nandi, 10/14/2020 03:38 PM

 
// datapath is where you have saved the data

foreach w in k l m n o p q r {
local i=strpos("abcdefghijklmnopqr","`w'")
use pidp b`w'_scghq1_dv b`w'_jbstat using "datapath/bhps_w`i'/b`w'_indresp", clear
rename b`w'_* *
g wave=`i'
save `w', replace
}
use k, clear
foreach w in l m n o p q r {
append using `w'
}
save bhps, replace
foreach w in k l m n o p q r {
erase `w'.dta
}
foreach w in b c d e f g h i {
local i=strpos("abcdefghijklmnopqr","`w'")
use pidp `w'_scghq1_dv `w'_jbstat using "datapath/ukhls_w`i'/`w'_indresp", clear
rename `w'_* *
g wave=`i'+18
save `w', replace
}
use b, clear
foreach w in c d e f g h i {
append using `w'
}
append using bhps
fre wave

merge m:1 pidp using "datapath/ukhls_w9/i_indresp", ///
keepus(i_indin01_lw) keep(3) nogen

fre wave

mvdecode jbstat scghq1_dv, mv(-9/-1)
tabstat i_indin01_lw, by(wave)

xtset pidp wave
xtreg scghq1_dv i.jbstat [pw=i_indin01_lw], fe


foreach w in b c d e f g h i {
erase `w'.dta
}
erase bhps.dta

log close
exit


    (1-1/1)