help clusterbsversion: 1.1.0

Title

clusterbs - Pairs cluster bootstrap-t program for calculating standard errors for linear and GLM models using clustered data.

Syntax

clusterbs
depvar
indepvars
, cluster(varname) [fe(string) reps(integer) seed(integer) festruc(string)]

Options

- If specified, the reps option requires an integer for the number of bootstrap iterations that will be used to calculate the
t-statistics and standard errors. More iterations will yield more precise
p-values for t-statistics and the standard errors will have more accuracy. The default number of iterations is 1000. For p-values with three digits of accuracy, specify reps(5000) or more.

- If specified, the fe option requires a string that equals (inside), (external), or (cluster). If fe is specified, then the program
uses the xt- prefix regression commands to generate fixed effects for the given variables.
The specification (external) should be used for fixed effects that are not the same as or related to the clustering dimension.
The specification (inside) should be used for fixed effects that are given to sub-units inside of the clustering units.
The specification (cluster) should be used for fixed effects that are given to each of the clustering units themselves.
The (cluster) specification allows for one to include cluster-level fixed effects to remove the variation of the
cluster means, thereby running a within cluster model.
These fixed effects are re-sampled with the bootstrapping for unique clusters in the bootstrap sample, even if the cluster
was already drawn for the sample. So, if the bootstrap sample draws cluster 1 twice, then the program will give each of these
draws of cluster 1 a new fixed effect.
When the specification (external) is given, one must specify the fixed effect indicator variable as a string in the option festruc.
When the specification (inside) is given, one must specify the indicator variable that is combined with the cluster dimension
to create the fixed effects. For example, if the fixed effects are given to product-store combinations, and the cluster dimension
is the store, then one would specify the name of the product indicator variable in the option festruc.

- If the fe option is specified as (inside) or (external), the festruc option must be specified. For (inside) fixed effects,
it should contain the name of the variable used to create the fixed effects inside of each
cluster. For example, if the fixed effects are given to product-store combinations, and the cluster dimension
is the store, then one would specify the name of the product indicator variable in the option festruc.
For (external) fixed effects, it should contain the name of the variable used to create the fixed effects.

Notes

- You must specify a clustering variable (cluster()).

- clusterbs does not work with random effects, instrumental variables, or time series models at this time. The program currently does not accept weights or other options at this time. Standard regression and glm models like logit are supported.

- The p-value is based on the empirical distribution of the absolute value of the t-statistics. It is given by the fraction of t-statistics from the bootstrap iterations above the initial t-statistic. Therefore, the
p-value comes from the symmetric pairs cluster bootstrap-t method, which assumes the symmetry of the t-statistic based on asymptotic theory.

- The confidence interval is based on the distribution of the the t-statistics. It reports the 5th and 95th percentiles of the coefficients as calculated from the pairs cluster bootstrap-t
procedure rather than from the bootstrap distribution
of the parameter itself. This ensures that they are pivotal statistics.

- The program does not post results into ereturn. Therefore, the variance-covariance matrix and parameter values cannot be retrieved post-estimation. In fact, the model only uses a VCV for the initial calculation of the parameters,
but not for the standard errors or other statistics.
No postestimation statistics can be run on these models.

Description

clusterbs performs pairs bootstrapping by sampling observations (independent and dependent variables together)
with replacement by cluster groups, similarly to bootstrap with the cluster() option. However, clusterbs bootstraps the pivotal
t-statistic and uses the distribution of the t-statistic over the bootstrap samples for inference, while the bootstrap command simply uses the variance of
the parameter estimates across the bootstrap samples. clusterbs is intended to use for obtaining
accurate inference about the statistical significance of a parameter when the data is clustered with
a small number of clusters, or a moderate number of clusters of uneven size.

Because it is based on the pivotal t-statistic,
clusterbs has better properties for statistical inference in clustered data than the bootstrap command.
Simulations in Esarey and Menger (forthcoming) show that the pairs cluster bootstrap-t procedure produces favorable power characteristics
and the desired false positive rates even for a small number of clusters. When the number of clusters
is large (generally greater than 50 for clusters of balanced size), the cluster robust
standard errors given by the cluster option are faster to calculate and may provide accurate inference. However, when the number of clusters
is small or they are of unbalanced sizes, the cluster option can produce
misleading standard errors and p-values (see Cameron, Gelbach, and Miller 2008).

Example

As an example, we will use the nlsw88.dta dataset in Stata to estimate the effects of average hours worked, experience,
and college education on wages, with clustering at the industry level.

webuse nlsw88

regress wage hours ttl_exp collgrad, cluster(industry)

clusterbs regress wage hours ttl_exp collgrad, cluster(industry)

clusterbs regress wage hours ttl_exp collgrad, cluster(industry) fe(cluster)

clusterbs regress wage hours ttl_exp collgrad, cluster(industry) reps(2000) seed(13932)

References

- Esarey, Justin and Andrew Menger. Forthcoming. Practical and Effective Approaches to Dealing with Clustered Data.

- Cameron, A., J. Gelbach and D. Miller. 2008. Bootstrap-based improvements for inference with clustered errors. Review of Economics and Statistics 90(3): 414-427.

Author

Andrew Menger, Rice University, andrew.m.menger@rice.edu