I'm trying to run 2sri approach in Stata 15. My first stage is a probit regression and the second regression is tobit (using xtdpf code from the website)
My code is as:
program twosri, eclass
xtset gvkey year
tempname b
tempvar Xhat
tempvar a1
capture drop Xuhat
global Z "a b c d "
probit X IV $Z i.year i.industry, r
predict `Xhat'
matrix `a1'=e(b)
gen Xuhat=X-`Xhat'
global Z "a b c d"
xtdpf Y X $Z Xuhat, timedummies
matrix `b' = e(b)
ereturn post `b'
end
**************************************************
** Bootstrap. **
*************************************************/
xtset, clear
gen gvkey2=gvkey
bootstrap _b, reps(500) seed (10101) nodots nowarn cluster(gvkey) idcluster(gvkey2) : twosri
then the system reports the error "repeated time values within panel", please help me to figure out the cause of the error. I will appreciate for any help!
Related Posts with bootstrap "repeated time values within panel" 2 SRI
Panel RegressionHello, I am using StataSE 14 and currently working on my final thesis. My advisor told me to robust …
Writing a macro variable into a csv fileI specify here that i'm truly a neophyte in this language and i'm kind of struggling with easy stuff…
Histogram with bin freq and % on yaxisDear Statalist, I want to generate Histogram Stata with percent option and want counts/freq of bins…
How can I change by default stsetHello, I am working on neonatal mortality. So my time points are 0 day- 28 days 0 day is for those…
variable with 2 conditionGood morning everyone, I have a problem on STATA. I have 2 variables (Ebitda08 and Ebitda09) and a t…
Subscribe to:
Post Comments (Atom)
0 Response to bootstrap "repeated time values within panel" 2 SRI
Post a Comment