Here is the code:
Code:
foreach s in qe nqe {
foreach pi in t3m t6m t1y t2y t3y t5y t7y t10y {
foreach iv of varlist mp1 mp2 mp3 mp4 ff1 ff2 ff3 ff4 ed1 ed2 ed3 ed4 {
forval h = 0(1)7{
set level 90
*reghdfe f`h'r_p_asset l(1/4).lr_p_asset_`s' l(1/4).`pi'_e_`s' l(0/4).p_grgdp_`s' l(0/4).p_policyrate_`s' crisis (`pi'_e_`s' = `iv'_`s') if clean_f`h'r_p_asset==0 & date>tq(1991q4) & p_policyrate<1000 & eme==0 & r_p_asset>0.005, absorb(pifscode) cluster(date)
qui: xtivreg2 lr_p_asset (`pi'_e=`iv') l(1/3).lr_p_asset_`s' l(0/3).p_grgdp_`s' l(1/3).l`pi'_`s' l(0/3).qe , fe cluster(pairid)
*xtivreg2 lr_p_asset (`pi'_e=`iv') l(1/3).lr_p_asset_nqe l(0/3).p_grgdp_nqe l(1/3).`pi'_nqe l(0/3).qe , fe cluster(paired)
replace F10_`pi'_`iv'_`s'_90= e(widstat)-16.38 if _n == `h'+1 /* Diff with Kleibergen-Paap rk Wald F statistic*/
replace F15_`pi'_`iv'_`s'_90= e(widstat)-8.96 if _n == `h'+1 /* Diff with Kleibergen-Paap rk Wald F statistic*/
qui: lincomest l`pi'_`s'
tab date if e(sample)==1
parmest,label saving(`"asset_`pi'_`iv'_`h'_90_`s'"', replace)
set level 68
qui: xtivreg2 lr_p_asset (`pi'_e=`iv') l(1/3).lr_p_asset_`s' l(0/3).p_grgdp_`s' l(1/3).l`pi'_`s' l(0/3).qe , fe cluster(pairid)
*reghdfe f`h'r_p_asset l(1/4).lr_p_asset_`s' l(1/4).`pi'_e_`s' l(0/4).p_grgdp_`s' l(0/4).p_policyrate_`s' crisis (`pi'_e_`s' = `iv'_`s') if clean_f`h'r_p_asset==0 & date>tq(1991q4) & p_policyrate<1000 & eme==0 & r_p_asset>0.005, absorb(pifscode) cluster(date)
replace F10_`pi'_`iv'_`s'_68= e(widstat)-16.38 if _n == `h'+1 /* Diff with Kleibergen-Paap rk Wald F statistic*/
replace F15_`pi'_`iv'_`s'_68= e(widstat)-8.96 if _n == `h'+1 /* Diff with Kleibergen-Paap rk Wald F statistic*/
qui: lincomest l`pi'_`s'
parmest,label saving(`"asset_`pi'_`iv'_`h'_68_`s'"', replace)
}
}
}
}
Thank you for your help!!

0 Response to Regressor not found in a loop with existing variable.
Post a Comment