Hi, I am trying to bootstrap standard errors for a system of equations (its a 2SLS where I create the first stage fitted values, and use in second stage as regressors; see my code below). But it produces ONLY the second stage output; how do I retrieve the first stage output too with bootstrapped standard errors?
Many thanks
* Produce bootstrap standard errors
capture program drop bootiv
program bootiv, eclass
{
* 1st stage T11 col1
reg inq d_sob past_rel low_score medium_score high_score male_dum log_age ///
i.tier i.qtr_yr, cl(fid) /* 1st stage */
predict xbvar, xb
** 2nd stage col 2 t11
reg default2_360 xbvar past_rel low_score medium_score high_score male_dum log_age ///
log_loan i.new_acctid i.tier i.qtr_yr if e(sample), cl(fid) /* 2nd stage */
sum xbvar if e(sample), detail
drop xbvar
}
end
set seed 1
bootstrap, reps(5) seed(123): bootiv
outreg2 using "BS check.xls", append ctitle("Boostrapped SE") bdec(4) tdec(4) se
Related Posts with Boostrapping system of equations
Comparing 3 correlation coefficientsI have a group of about 1300 patients who had had disease 1 (subgroup 1), disease 2 (subgroup 2), or…
Sample ExtractionDear All, I have a panel monthly dataset (id and month), from 2001 - 2018, and I need 10 year (120 …
Word cloud and sentiment analysis using StataDear Stata Forum members, I wish to find a user-written program to perform high quality "word clou…
Duplicating previous year data Code: +----------------------------------------+ | country year dbagdp pcrdbgd…
-mkcons- .ado to make a constantDear data cleaners I made a small program to check whether there is a constant called cons in the d…
Subscribe to:
Post Comments (Atom)
0 Response to Boostrapping system of equations
Post a Comment