help wcbregress

Title

wcbregress --Estimating a Linear Regression Model and Carrying Accurate Inference with Clustered Errors Using the Wild Cluster Bootstrap Standard Errors Procedure and Bootstrap-T procedure.

Descriptions

The command wcbregress estimates a linear regression model with clustered errors and provides accurate inference either when cluster number is large or small, using the method proposed in Cameron, A. C., Gelbach, J. B., & Miller, D. L. (2008), "Bootstrap-based improvements for inference with clustered errors". The Review of Economics and Statistics.

This command depends on the Stata in-built regress command, hence, most of the options for regress are compatible with wcbregress. (e.g., options for the constant term, for allowing weights, for the level of confidence intervals, and for dialog box)

The output (panel A) of the command provides the results from OLS estimation and inferences using the wild cluster bootstrap standard error procedure discussed in section 3.2 of Colin et al(2008). The inference is valid under standard modelling assumptions. In most cases, it requires the cluster number to be large enough (i.e., greater than 30).
For the data with fewer clusters, panel B provides a more accurate inference using the bootstrap-t procedure shown in section 3.3 of Colin et al.(2008). Please refer to Cameron, A. C., Gelbach, J. B., & Miller, D. L. (2008) for more details.

Syntax

wcbregress
depvar varlist
[if] [in] [weight]
[, options]

Model
group(varname) ID variable for groups within cluster()

robust robust to misspecification

vce(vcetype) vcetype could only be jackknife since cluster is considered during the procedure

noconstant(varname) suppress constant term

hascons has user-supplied constant

tsscons compute total sum of squares with constant;seldom used

Reporting
level(#) set confidence level to #; default is level(95)

seed(#) set random-number seed to #

Other options
detail displays intermediate command outputs

rep(#) number of the bootstrap replications for calculating the standard errors or confidence interval; default is 500.

Examples

Setup

. clear all

. sysuse auto,clear

Fit the model with the following specification: specify the cluster variable as rep78, set confidence level to 99.

. wcbregress price mpg headroom trunk weight, group(rep78) level(99)

Set replication times to 50.

. wcbregress price mpg headroom trunk weight, group(rep78) rep(50) level(99)

Set random-number seed to 666.

. wcbregress price mpg headroom trunk weight, group(rep78) rep(50) level(95) seed(666)

Add robust option or noconstant option.

. wcbregress price mpg headroom trunk weight, group(rep78) rep(50) level(90) seed(2333) robust

. wcbregress price mpg headroom trunk weight, group(rep78) rep(80) level(90) seed(2333) noconstant

Use weights.

. gen n_aweight = ceil(5 * uniform())

. wcbregress price mpg headroom trunk weight [aweight=n_aweight], group(rep78) rep(50) level(95) seed(666)

Stored results

wcbregress stores the following in e():

Scalars
e(N) number of observations

e(r2) R-squared

e(r2_a) adjusted R-squared

e(rmse) root mean squared error

Macros
e(cmd) wcbregress

e(vcetype) "Wild Cluster Bootstrap SE"

e(title) Wild cluster bootstrap SE and T-tests for the linear regression

e(Brep) number of bootstrap replications

e(properties) “b V”

Matrices
e(b) coefficient vector

e(V) variance and covariance matrix of the estimator

e(WCB_pvalue) p-value of t-test under wild cluster bootstrap

e(WCB_V) Variance vector under wild cluster bootstrap

Functions
e(sample) marks estimation sample

Authors

Zizhong Yan (code maintainer)
Institute for Economic and Social Research, Jinan University, Guangzhou, China
E-mail: helloyzz@gmail.com.

Bingkun Lin
Institute for Economic and Social Research, Jinan University, Guangzhou, China
E-mail:linbingkun.iesr18u@foxmail.com

E-mail helloyzz@gmail.com if you observe any problems.

References

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