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'
Help with loop for rename functionHi all, I am a new user to STATA. I want to rename 12 different variables: Instead of coding 12 diff…
Calculate income household (=the total income of the members) in each householdI have a dataset with some variables: ID_I (individual id), ID_H (household id), J60 (total income).…
Trying to keep data between two specific datesI am trying to keep data between 3Jan1999 and 15mar 1999 and remove the remaining observations. I us…
Dynamic and No endogeneityI am working on panel data and I found none of the regressor to be Endogenous. But I found Lag of my…
Two way clustering versus clustering on the interaction term?Suppose I want to cluster on country and year effects. Specifically, I am using reghdfe command but …
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