knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(kableExtra)
augsynth
: Estimating multiple outcome effectsTo demonstrate augsynth
with multiple outcomes, we'll use data on the impact of personal income tax cuts in Kansas that comes with the AugSynth
package. Our interest is in estimating the effect of income tax cuts on gross state product (GSP) per capita, wages, establishment counts, and other macroeconomic indicators.
library(magrittr) library(dplyr) library(augsynth) data(kansas)
The kansas
dataset contains the GSP per capita (the outcome measure) lngdpcapita
for all 50 states from the first quarter of 1990 to the first quarter of 2016.
To run augsynth
, we need to include a treatment status column that indicates which region was treated and at what time. The table in kansas
contains the column treated
to denote this. In the original study, the second quarter of 2012 was the implementation of the tax cut in Kansas.
kansas %>% select(year, qtr, year_qtr, state, treated, gdp, lngdpcapita) %>% filter(state == "Kansas" & year_qtr >= 2012 & year_qtr < 2013)
We will begin by running the synthetic controls method on GDP per capita, wages, and the number of establishments. To run the vanilla synthetic controls method using augsynth
, set progfunc
to None
and scm
to TRUE
.
First, we will examine each outcome variable separately, beginning with log GDP per capita lngdpcapita
.
syn_lngdpcapita <- augsynth(lngdpcapita ~ treated, fips, year_qtr, kansas, progfunc="None", scm=T) summary(syn_lngdpcapita)
plot(syn_lngdpcapita)
Next we will examine the log total wages per capita. Since this column doesn't already exist in the dataframe, we will create a lntotalwagescapita
column.
kansas$lntotalwagescapita <- log(kansas$totalwagescapita) syn_lntotalwagescapita <- augsynth(lntotalwagescapita ~ treated, fips, year_qtr, kansas, progfunc="None", scm=T) summary(syn_lntotalwagescapita)
plot(syn_lntotalwagescapita)
Lastly, we will examine the number of establishments per capita, estabscapita
.
syn_estabscapita <- augsynth(estabscapita ~ treated, fips, year_qtr, kansas, progfunc="None", scm=T) summary(syn_estabscapita)
plot(syn_estabscapita)
Now we will combine our outcome variables into one study. To add more outcome variables, we add them to the LHS of the formula.
syn_multi <- augsynth(lngdpcapita + lntotalwagescapita + estabscapita ~ treated, fips, year_qtr, kansas, progfunc="None", scm=T) summary(syn_multi)
plot(syn_multi)
We will now repeat the study using the Augmented Synthetic Controls Method with ridge regression. In ASCM, we first fit the SCM weights, then combine it with a ridge regression, thus setting progfunc="Ridge", scm=T
.
asyn_lngdpcapita <- augsynth(lngdpcapita ~ treated, fips, year_qtr, kansas, progfunc="Ridge", scm=T) summary(asyn_lngdpcapita)
plot(asyn_lngdpcapita)
asyn_lntotalwagescapita <- augsynth(lntotalwagescapita ~ treated, fips, year_qtr, kansas, progfunc="Ridge", scm=T) summary(asyn_lntotalwagescapita)
plot(asyn_lntotalwagescapita)
asyn_estabscapita <- augsynth(estabscapita ~ treated, fips, year_qtr, kansas, progfunc="Ridge", scm=T) summary(asyn_estabscapita)
plot(asyn_estabscapita)
Now we will combine our outcome variables into one study. To add more outcome variables, we add them to the LHS of the formula.
asyn_multi <- augsynth(lngdpcapita + lntotalwagescapita + estabscapita ~ treated, fips, year_qtr, kansas, progfunc="Ridge", scm=T, lambda = 1e-4) summary(asyn_multi)
plot(asyn_multi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.