help stackscpvals

Title

Version 1.2 - Release date: November 11, 2024. Tested on Stata 15.1 and above.

stackscpvals -- Post-estimation command for use in conjunction with allsynth. stackscpvals automates the stacking and averaging of
(generally, modified) synthetic control estimated gaps for multiple treated units and the donor pool units, the creation of the sample empirical ditribution of placebo
average treatment effects, and the calculation of specified p-values.
As allsynth automates these procedures with ''classic'' and ''bias-corrected'' synthetic control estimates, stackscpvals should be used when making additional
corrections to the outcome variables after estimating the synthetic control donor weights (e.g. correcting for the impact of local pandemic response shocks as in
Wiltshire et al. Forthcoming).

Syntax

stackscpvals gap(gapvar) time(timevar) unit(unitvar) pvalues(string) filepath(string)
[ filepath_2(string)... filepath_9(string) savepath(string) savename(string) keeptrunits(numlist)
numavg(#) emin(#) emax(#) avgwts(string) balance ]

Variables specified in gapvar, timevar, and unitvar must be numeric variables; abbreviations are not allowed.

Description

stackscpvals is a post-estimation command for use in conjunction with the allsynth command (Wiltshire Forthcoming),
which should be understood prior to implementation of stackscpvals and which automates the implementation of several synthetic control estimation features.
stackscpvals permits simple post-estimation stacking and averaging of synthetic control estimated gaps (and placebo gaps) and especially post-estimation adjusted versions thereof
for users who have already estimated those gaps using allsynth.

Required Settings

gapvar the variable observing the synthetic control estimated gaps. allsynth produces gap and/or gap_bc, but users may choose to make adjustments
(e.g. adjusting outcome variables for the impact of local pandemic responses as in Wiltshire et al. Forthcoming)
and may thus rename gapvar, which must be observed for all units in each data set in the directory specified by filepath(filepath) unless particular
units are excluded using the keeptrunits(numlist)

timevar the time variable.

unitvar the unit variable.

pvalues(rmspe|variance) automates estimation of in-space placebo gaps across the donor pool units, for the purpose of calculating p-values. This means that
the allsynth option pvalues(string) must have been specified and the placebo gap estimated for the donor pool units affiliated with each treated unit.

At least one of rmspe or variance is required, and both are permitted.
rmspe will calculate RMSPE-ranked p-values for each post-treatment period. variance will calculate p-values and 95% confidence intervals for each post
treatment period based on the variance of the sample distribution of placebo average gaps (see Wiltshire Forthcoming
for further discussion). The variables RMSPE, RMSPE_rank, and p (based on
the form of the variables in the specified data sets) will be estimated if rmspe is specified. The variables _Se, _Tstat, _Pval, LB_95, and
UB_95 (based on the form of the variables in the specified data sets) will be estimated if variance is specified.

filepath(filepath) specifies the directory where the (possibly adjusted) files containing the estimates to be stacked can be found.

stackscpvals Options

filepath_2(filepath)... filepath_9(filepath) specifies the directories of additional files to be stacked beyond those in filepath(filepath).

savepath(directory) specifies the directory where the results should be saved as savename(file).

savename(file) specifies the filename to be used to save the results

keeptrunits(numlist) specifies a list of at least two treated units--and the associated donor pool units--to be stacked (and averaged). Any estimates found
in filepath(string) [ filepath_2(string)... filepath_9(string) ] associated with treated units not specified in keeptrunits(numlist)
will be excluded from the stack.

numavg(#) specifies the number of placebo average gaps that should be sampled from the population of possibilities. If pvalues(rmspe) is specified, the default
setting for numavg(#) is 100 and the minimum is 30 (stackscpvals will automatically set numavg(#) to 30 if a lower number is specified. If
pvalues(variance) is specified, cmd:numavg}(#) will be ignored and stackscpvals will automatically sample 1000 placebo average gaps.

emin(#) specifies the earliest period in event time to be considered, where e=0 is the period of treatment. emin(#) must be < 0, and the default
setting is -5. The earliest event period actually observed can (obviously) not be earlier than what exists in the data.

emax(#) specifies the latest period in event time to be considered, where e=0 is the period of treatment. emax(#) must be > 0, and the default
setting is 5. The latest event period actually observed can (obviously) not be later than what exists in the data.

avgwts(varname) specifies a numeric variable that identifies the treated-unit weights to be used to calculated the (weighted) average treatment effects.
For each treated unit i the weights must be non-missing and constant across all timevar periods. avgwts(varname) is likely to be the same
variable as specified in the avgweights() option of the stacked() option of allsynth.

balance specifies that the estimated average treatment effects (gaps) should be displayed and saved only for those event periods
in which every treated unit is observed. This ensures common interpretability of the estimated average gap across retained event periods (this
is true even if the results are displayed and saved in calendar time).

Users are pointed to "2_qcew_stack.do" and "4_qwi_stack.do" of the replication package for Wiltshire et al. Forthcoming
to see examples of how stackscpvals can be used.

References

Wiltshire, J.C., McPherson, C., Reich, M. and D. Sosinskiy, Forthcoming. Minimum Wage Effects and Monopsony Explanations. Journal of Labor Economics.

Wiltshire, J.C., Forthcoming. allsynth: (Stacked) Synthetic Control Bias-Correction Utilities for Stata. Working paper.

Author

Justin C. Wiltshire
University of Victoria, Department of Economics