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