Title

itsamatch -- Matching for multiple group interrupted time-series analysis

Syntax

itsamatch varlist [if] [in] [weight],
trperiod(date)
treatid(#)
lag(#)
[ pr(#)
praisk
local(macname)
model_options ]

The panel variable must be declared by using either tsset panelvar timevar
or xtset panelvar timevar. See tsset or xtset.

* trperiod(date) specifies the time period when the intervention begins

* treatid(#) specifies the identifier of the single treated unit

* lag(#) specify the maximum lag to be considered

pr(#) specifies the minimum significance level (P-value) for assessing balance; default is pr(0.05)

praisk specifies to fit a praisk model; the default is a glm model with Newey-West standard errors

local(macname) stores the control identifiers in local macro macname, making them accessible for later use.

model_options specifies all available options for prais when the prais
option is chosen; otherwise all available options of glm

* trperiod(), treatid() and lag() must be specified.

aweights are allowed when a glm model (the default)
is specified; see weight.

Description

itsamatch is a data pre-processing procedure that identifies units not-exposed
to the intervention that will best serve as matched controls for the single treatment unit,
in multiple group interrupted time-series analysis (ITSA). Matches are defined by assessing
balance on the baseline level and trend of each variable specified in the varlist -- where
balance is determined by a user-defined minimum significance level (P-value).

itsamatch generates a list of control group identifiers that can be passed on to itsa
to assess treatment effects. Under the ignorability assumption, we approximate a randomized experiment
by evaluating outcomes using matches that are balanced on observed pretreatment characteristics.

Options

trperiod(date) specifies the time period (date) when the
intervention begins. The value entered for the time period must be in the same
time unit as the panel time variable specified in tsset timevar; see
tsset. The date should be specified using the respective
pseudofunction (see datetime), such as trperiod(2020)
for a four-digit year, trperiod(2019m11) for quarterly data or
trperiod(08jan2021) for daily data. trperiod() is
required.

treatid(#) specifies the identifier of the single treated
unit. The value entered must be in the same units as the panel variable
specified in tsset panelvar timevar; see tsset.
treatid() is required.

lag(#) specifies the maximum lag to be considered in the
autocorrelation structure. lag() is required.

pr(#) specifies the minimum significance level (P-value) for determining
balance on each variable in the varlist. While pr can be set to any value between
0 and 1.0, 0.05 is the usual convention for considering balance. Naturally, higher values will
ensure closer balance, but it comes at a trade-off of losing observations as potential matches.
The default is pr(0.05).

praisk specifies to fit a praisk model. If praisk is
not specified, itsa will use glm with Newey-West standard errors,
as the default model.

local(macname) stores the control identifiers in local macro macname within the calling program's space,
thereby making the control identifiers accessible after itsamatch has finished. This is helpful for later use with itsa.

model_options specify all available options for prais when the
prais option is chosen; otherwise, all available options for
glm are specified.

Remarks

In the ITSA context, an investigator will want to find control units that are comparable to the treated
unit on the baseline level and trend of the outcome variable (see [Linden 2015, 2017a, 2017b, 2017c] for
examples). However, ensuring balance on covariates (i.e. possible confounders) will further improve causal
inference. Whereas the synthetic controls [Abadie et al. 2010] and propensity score weighting
[Linden and Adams 2011] methods reweight observations to adjust for observed confounders, itsamatch
matches on the variables directly. In doing so, it retains the straightforward interpretation of
the estimates derived from the ITSA model (see [Linden 2017a] for these estimates).

The basic regression model for a multiple group ITSA is as follows (Linden 2015):

Y_t = Beta_0 + Beta_1(T) + Beta_2(X_t) + Beta_3(TX_t) +
Beta_4(Z) + Beta_5(ZT) + Beta_6(ZX_t) + Beta_7(ZTX_t)

The two parameters Beta_4 and Beta_5 play a particularly important role in establishing whether
the treatment and control groups are balanced on both the level and the trajectory of the dependent
variable in the pre-intervention period. If these data were from a randomized controlled trial, we would
expect similar levels and slopes before the intervention. However, in an observational study
where equivalence between groups cannot be ensured, any observed differences will likely raise
concerns about the ability to draw causal inferences about the relationship between the intervention
and the outcomes (Linden and Adams 2011).

itsamatch assesses the P-value for the Beta_4 and Beta_5 coefficients for each variable specified
by the user in the varlist by replacing Y_t with the covariate. Thus, good matches will be identified
as those having non-statistically significant differences on baseline level (Beta_4) and baseline trend
(Beta_5) for any variables tested.

A final note relating to "the curse of dimensionality." As the number of variables assessed for matching
grows, fewer matches will likely be found. Naturally, this is also a function of heterogenity in the sample, so fewer
matches will be found in a heterogeneous sample on even one variable. In such situations, the investigator may
choose to limit the variables to only those that are most important for causal inference (i.e. outcome variable and
perhaps one or two other suspected confounders) or consider rescaling all the variables to reduce heterogeneity and
increase likelihood of matching on more variables.

Examples

Load data and declare the dataset as panel:

. use cigsales, clear

. tsset state year

We find controls that match the treated unit(3) on the outcome variable "cigsale". We set the minimum
cutoff P-value at 0.20, specify autocorrelation at lag 1, and specify that the the stored local macro be named "controls".

. itsamatch cigsale, treatid(3) trperiod(1989) pr(0.20) lag(1) local(controls)

Three matches were found, control units 4, 8, and 9. We now plug those values in contid() in an itsa model using the stored local(controls).

. itsa cigsale, treatid(3) trperiod(1989) contid(`controls') lag(1) replace figure(xlabel(1970(5)2000)) posttrend

We now add the covariate "retprice" to varlist and rerun itsamatch.

. itsamatch cigsale retprice, treatid(3) trperiod(1989) pr(0.20) lag(1) local(controls)

The same three matches were found, control units 4, 8, and 9. We now verify (numerically and visually) the balance on "retprice"
by specifying "retprice" as the dependent variable in the itsa model.

. itsa retprice, treatid(3) trperiod(1989) contid(`controls') lag(1) replace figure(xlabel(1970(5)2000)) posttrend

We now find controls that match the treated unit(3) on a count outcome variable "cigsale_count" specifying the Poisson family() in glm.
We set the minimum cutoff P-value at 0.40, specify autocorrelation at lag 1, and specify that the the stored local macro be named "controls".

. itsamatch cigsale_count, trperiod(1989) treat(3) p(0.40) local(controls) f(poisson)

Same as above, but we now use a scaled (between 0 and 1) outcome variable "cigsale_scaled" specifying the binomial family() in glm.
We set the minimum cutoff P-value at 0.20, specify autocorrelation at lag 1, and specify that the the stored local macro be named "controls".

. itsamatch cigsale_scaled, trperiod(1989) treat(3) p(0.20) local(controls) f(binomial)

Stored results

itsamatch stores the following in r():

matrices

r(contids) matrix containing control identifiers

r(results) matrix containing results

Acknowledgments

I wish to thank Nicholas J. Cox for his support in the original development of itsamatch.

References

Abadie, A., A. Diamond, and J. Hainmueller. 2010. Synthetic control methods for comparative
case studies: Estimating the effect of California’s tobacco control program.
Journal of the American Statistical Association 105: 493–505.

Linden, A. 2015.
Conducting interrupted time series analysis for single and multiple group comparisons.
Stata Journal.
15: 480-500.

------. 2017a.
A comprehensive set of postestimation measures to enrich interrupted time-series analysis.
Stata Journal
17: 73-88.

------. 2017b.
Challenges to validity in single-group interrupted time series analysis.
Journal of Evaluation in Clinical Practice.
23: 413-418.

------. 2017c.
Persistent threats to validity in single-group interrupted time series analysis with a crossover design.
Journal of Evaluation in Clinical Practice.
23: 419-425.

------. 2017d.
A matching framework to improve causal inference in interrupted time series analysis.
Journal of Evaluation in Clinical Practice.
DOI:10.1111/jep.12874

------. 2022.
Erratum: A comprehensive set of postestimation measures to enrich interrupted time-series analysis.
Stata Journal
22: 231-233.

Linden, A., and J. L. Adams. 2011.
Applying a propensity-score based weighting model to interrupted time
series data: Improving causal inference in program evaluation.
Journal of Evaluation in Clinical Practice
17: 1231-1238.

Author

Ariel Linden

Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Help: glm, newey, praisk, itsa (if installed), itsaperm (if installed)