Dear Prof. Clyde Schechter,

I am currently using 2sls bootstrapping for my paper. I have problem in saving the coefficients.
These are the commands that i use.


HTML Code:
capture postutil clear
tempfile coefficients
postfile handle int rep float b_x1 using `coefficients'
forvalues i = 1/4 {
use "C:\Users\rose\Documents\tryA_`i'.dta", clear
bootstrap, reps(100)saving(mybootsample.dta, replace):xtpoisson D yhat_`i' X1 X2 X3 X4 X5 DM1 DM2
}
post handle (`i') (_b[yhat_`i'])
estimates store one_i
preserve
save mybootsample_`i', replace
restore
}
 postclose yhat_`i'
Where;
D= dependent variable
yhat_i = 100 values of bhat that I obtained from 100reps of bootstrap in the 1st stage of 2sls.
DM = Dummies


Stata give red notice when it comes to the 'post handle (`i') (_b[yhat_`i'])' command. It says

invalid syntax
post: above message corresponds to expression 1, variable rep
r(198);


At the end of this bootstrapping, I would need to save 100 coefficient for each variables in each bootstrapping.

Thank you for your time Prof. Clyde Schechter,