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
Age in Months to the exact day?Hi everyone, I'm looking to find the exact age of survey participants in months. Right now I'm subt…
Listing specific lowsI'm wondering if I can list pre-selected rows. Let's say, I would like to list var1 and var2 for obs…
Problem with calculating the cumulated frequencyHi, Using the code below, I am trying to calculate the cumulated frequency at age x and above it. Ho…
How would I apply a control function approach (CF)/Two-Stage Residual Inclusion (2SRI), when the first stage is an ordinal probit/logit?I read this post, with a very nice answer by Mr. Wooldridge: Sven: It's easy to extend Procedur…
Panel Data Manipulation: Divide All By Group of DataHi, I am trying to recreate the table below: Array I have created the mean education for period b…
Subscribe to:
Post Comments (Atom)
0 Response to bootstrap "repeated time values within panel" 2 SRI
Post a Comment