*! version 1.0.0 28 January, 2024

Title

tscb -- Two-Stage Cluster Bootstrap Estimator

Syntax

tscb depvar treatment groupvar [if] [in], qk(#) [options]

qk(#) proportion of clusters sampled from population.

fe indicates that a fixed effects model is desired.

seed(#) set random-number seed to #.

reps(#) repetitions for bootstrap.

Description

tscb implements the Two-Stage Cluster Bootstrap Estimator (TSCB), a bootstrap variance
estimator proposed by Abadie et al. (2023), for models where average treated
effects are desired, and where standard error estimates need to account for clustering.
The TSCB is a variance estimate which considers both the standard sampling component which
induces variance in estimated regression coefficients, but also incorporates a design-based
component, accounting for variability in estimates owing to treatment assignment mechanisms.
When the data which is used to estimate treatment effects includes an important proportion of
clusters in the full population, standard cluster-robust standard errors can be significantly
inflated, and the CCV produces a correction for this.

This procedure assumes that some depvar should be regressed on some treatment variable, and the estimand of interest is the average treatment effect. The population is assumed partitioned into clusters,
indicated by groupvar.
By default, tscb is based on a standard linear regression of depvar on groupvar, though regressions also including groupvar fixed effects can be requested if desired.

The TSCB procedure works in two stages. First, the fraction of treated units for each cluster is drawn from the empirical distribution of cluster-specific treatment fractions.
Second, treatment and control units are resampled from each cluster, with the number of units determined in the first stage.
The TSCB algorithm is explained in detail in Abadie et al. (2023); refer in particular to their Algorithm 1.

The tscb command is closely related to the ccv (Causal Cluster
Variance) command. ccv
(if installed) implements an analytic version of the cluster
variance formula of Abadie et al. (2023), and shares quite a
similar syntax and logic. tscb requires the user-written moremata command,
and this should be installed from the SSC prior to running tscb.

Some further details related to this command can be found on an accompanying github page located at https://github.com/Daniel-Pailanir/TSCB-CCV.

Options

Main

qk(#) Indicates the proportion of clusters from the population which are
sampled in the data. This value should be strictly greater than 0, and less than
or equal to 1. Values of 1 imply that all clusters are observed in the data,
whereas values less than 1 imply that only this proportion of clusters were sampled.
This is required. For example, if clusters are states in a country, and observations
exist in data from each state, qk should be set as 1.

fe Indicates that the underlying estimator desired is a fixed effects estimator
where the dependent variable is regressed on treatment exposure as well as groupvar
fixed effects.
In this case, the CCV estimator defined in Abadie et al. (2023)
section V will be implemented. If not specified, bivariate OLS regression is estimated.

seed(#) Set seed for pseudo-random number generation. This ensures that variance
estimates can be replicated exactly if desired, despite bootstrap resampling.

reps(#) Indicates the number of repetitions used for conducting bootstrap resamples. Default is 50.

Stored results

tscb stores the following in e():

Scalars

e(ATE) Average Treatment Effect

e(se_tscb) Two-Stage Cluster Bootstrap (TSCB) standard error

e(se_robust) Heteroskedasticity robust standard error

e(se_cluster) Cluster robust standard error

e(reps) Number of bootstrap resamples

e(N_clust) Number of units (groups) observed in the original panel

Macros

e(cmd) Returns command name (tscb)

e(cmdline) Returns command as typed

e(depvar) Lists name of dependent variable

e(clustvar) Provides the name of the unit (group) variable

Examples

Load data from 1% extract from 2000 US Census (20-50 years old) Abadie et al. (2023).

. webuse set www.damianclarke.net/stata/

. webuse "census2000_1pc.dta", clear

Run regression without FE.

. tscb ln_earnings college state, qk(1)

Using FE at state level.

. tscb ln_earnings college state, fe qk(1)

Over another dependent variable.

. tscb hours college state, qk(1)

Using FE at state level.

. tscb hours college state, fe qk(1)

Using a bigger sample at 5 percent.

. webuse "census2000_5pc.dta", clear

. tscb ln_earnings college state, qk(1)

. tscb ln_earnings college state, fe qk(1)

References

Alberto Abadie, Susan Athey, Guido W Imbens, Jeffrey M Wooldridge (2023).
When Should You Adjust Standard Errors for Clustering?. The Quarterly Journal of Economics, 138(1):1-35.

Author

Damian Clarke, Universidad de Chile.
Email dclarke@fen.uchile.cl
Website http://www.damianclarke.net/

Daniel Pailañir, Universidad de Chile.
Email dpailanir@fen.uchile.cl
Website https://daniel-pailanir.github.io/

Website

tscb is maintained at https://github.com/Daniel-Pailanir/TSCB-CCV