tsset firm wave
xtabond2 y L LL K LK Ly dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity, gmm (L LL K LK Ly) iv(dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity ,eq(level)) small two robust
matrix cov1 = e(V)
matrix b1 =e(b)
md_ar1, nx(2) beta(e(b)) cov(e(V))
scalar betaL=theta[1,1]
******************** I have a balanced panel of firms for T=3
******************** Bootstrap program begins here:
capture program drop myboot2
program define myboot2, rclass
preserve
generate newfirm=firm
bsample , cluster(firm) idcluster(newfirm)
tsset newfirm wave
xtabond2 y L LL K LK Ly dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity, gmm (L LL K LK Ly) iv(dum2 dum3 wood1 textile1 metal1 anystat anyfor capcity ,eq(level)) small two robust
tempname cov1
matrix cov1 = e(V)
tempname b1
matrix b1 =e(b)
md_ar1, nx(2) beta(b1) cov(cov1)
tempname betaL
return scalar betaL=theta[1,1]
tempname MRPLb
gen MRPLb=(1/L)
sum MRPLb
tempname MRm
return scalar MRm=r(mean)
restore
end
simulate betaL=theta[1,1] MRm=r(mean) , reps(3) seed(12345) :myboot2 trace
Here is the output in the data editor:
betaL MRm
.531211 .
.013747 .
.300624 .
Clearly, the code is bootstrapping betaL, but unable to calculate MRm.
Related Posts with Block bootstrapping panel: Unable to generate new variable using each bootstrap replication
Drop values that are more than 0.1 decimal pointsDear all I have a simple question but not sure how to address it. I have the following dataset Co…
margins, dydx() questionHi, Just a quick question. Just say you were to find a significant interaction between two categor…
calculating proportions by groupsI’m using administrative data (I’ve included an example below) and I am trying to calculate the prop…
RDD with multivariate local-linear regressionGreetings to everyone, For my research, I am conducting an RD analysis where in addition to the run…
bayerhanck errorDear community, I am trying to run a bayerhanck cointegration command for a time series model contai…
Subscribe to:
Post Comments (Atom)
0 Response to Block bootstrapping panel: Unable to generate new variable using each bootstrap replication
Post a Comment