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
Backing out the level variable from a first-differenced logHi I have a variable that is only available in my dataset as first-differenced log variable (dtfp, w…
convert GPX file to CSV file in StataHi all, I have many gpx files. I want to show the tracking point by using spmap, which needs lon an…
panel data with three equationsHi all, I am trying to solve the following equation system. The data is panel and I will include fi…
replace multiple variables at the same timeHi, I have 10 variables. All of these variables are dummy, 0 or 1. The original data set is 1 and . …
I want my string values to become numeric values Code: * Example generated by -dataex-. To install: ssc install dataex clear input str26(q11r1_faceb…
Subscribe to:
Post Comments (Atom)
0 Response to Boostrapping system of equations
Post a Comment