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
Request for help- interpreting results post margins.Hello everyone, I am using probit model in Stata 16.1 to identify [dependent var] whether a firm ch…
Fixed Effects With Cross Sectional Data - Inconsistent Standard ErrorsDear all I have a cross-sectional dataset organised in three levels Individuals, nested within... …
arellano-bover/blundell-bondHello people, I have a panel data of 9 firms for a period of 11 years with no missing data. In 2017,…
separate regression of subgroupsHope you are enjoying the coziness of the weekend or early Monday already!. I have a data set with t…
Free books on Stata programmingHi all, Can anyone recommend free books that provide an introduction to programming with Stata, som…
Subscribe to:
Post Comments (Atom)
0 Response to bootstrap "repeated time values within panel" 2 SRI
Post a Comment