I'm estimating an unbalanced panel data model which first accounts for self-selection bias (xtprobit and derived inverse Mills ratio), for omitted variable bias (xtreg and derived control function CF), and concludes with a structural equation (xtreg SALESGR). To obtain the correct SE in the structural equation, I'd like to bootstrap the three equations together. I used the following code, but received an error message:
Bootstrap replications (200)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 50
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 150
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 200
insufficient observations to compute bootstrap standard errors
no results will be saved
The code works if I run each line separately, in other words, not within the program specification. Any suggestions would be greatly appreciated.
Code:
program spec10 xtprobit Select at l.SME_IND SALESGR PROFITGR HHI DAENT CIAE mosRate i.date_fiscal, vce(robust) predict phat, xb gen mills = exp(-.5*phat^2)/(sqrt(2*_pi)*normprob(phat)) xtreg SME_1lag at SME_IND_1lag HHI DAENT CIAE ROA , fe vce(robust) predict res rename res CF xtreg SALESGR c.SME_1lag##c.AVESIAE_1lag HHI ROA LNCIAE DAENT at AVECD JVPERCENT MKTDIV PARDIV sale mills CF, fe vce(robust) drop phat mills CF end program bootstrap, reps(200): spec10
Bootstrap replications (200)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 50
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 150
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 200
insufficient observations to compute bootstrap standard errors
no results will be saved
The code works if I run each line separately, in other words, not within the program specification. Any suggestions would be greatly appreciated.
Comment