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'
How to execute some commands in .do according to conditions?I want to rename the varlists in different files having different the numbers of varlists. e.g…
forvalue index included in csv file nameHey everyone, I'm attempting to assemble a panel dataset using a handful of CSV files each of which…
STATA or other chat / IRC / live realtime help resource? Codementor?Hi all, I am a newcomer to STATA and diving in to the manuals tutorials helpfiles. and now recently …
dataset description that appears with 'describe' commandHi again folks, the describe command generates an overview of the dataset as well as "a brief descri…
bar graph over two variables: unable to adjust the color of barsHi experts; I am plotting a bar graph that has two variables. My code looks like below: #delimit ;…
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