Hi,
I want to use bootstrap to estimate subsample regressions.
I use two ways but both don't work.
First:
bootstrap t=((_b[tenure])/(_se[tenure])), size(int(_N*0.5)) reps(2) seed(2435) saving(b_se_3, replace): areg ncskew_tp1 tenure ncskew kur sigma ret mb lev lnsize roa dturn age1 accrm ana tra i.fyear, absorb(sic2) cluster(gvkey)
error: size() must not be greater than number of clusters
I think maybe stata regard 'cluster (gvkey)' as for bootstrap, but my 'cluster (gvkey)' is for areg not for bootstrap. Bootstrap is just for resampling data. So I write the second code. What i want is the median of T value (coeff/se) in each subsample. But It still has an error. I don't how to solve. Thanks for anyone's help.
Second:
capture noisily program drop sim
program define sim, rclass
areg ncskew_tp1 tenure ncskew kur sigma ret mb lev lnsize roa dturn age1 accrm ana tra i.fyear, absorb(sic2) cluster(gvkey)
local coeff=_b[tenure]
local se=_se[tenure]
return scalar t = `coeff'/`se'
end
bootstrap median=r(t), size(int(_N*0.5)) reps(2) seed(2435) saving(b_se_3, replace) : sim
Error:
Bootstrap replications (2)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
xx
insufficient observations to compute bootstrap standard errors
no results will be saved
Related Posts with bootstrap: 'size() must not be greater than number of clusters' and 'insufficient observations to compute bootstrap standard errors'
Fixed effect ordered logitDear all, I have a panel dataset of 2700 firms with quarterly dates from 1985 to 2017. My panel is …
Estimating Women Multidimensional Poverty from Different DatasetsI want to estimate women multidimensional poverty using MICS dataset. The problem I have is that, th…
Create a variable that indicates when unit was first treated with panel dataHello everyone. This is my first post here, I have been looking for information on how to do this bu…
t-test to check if two means are statistically differentHi, I have a dataset like this. Each patient has multiple admissions and cost corresponding to that…
Number of firms and observations decreases in fixed effects ordered logit modelHi Statalist members, I recently found we are able to run fixed effects to the ordered logit model.…
Subscribe to:
Post Comments (Atom)
0 Response to bootstrap: 'size() must not be greater than number of clusters' and 'insufficient observations to compute bootstrap standard errors'
Post a Comment