Can we use a synthetic controls strategy to come up with a statistical test of the effect of Trump’s election in 2016 on carbon emissions by the U.S.? Provide a proposed research design complete with necessary data and estimator, explain the required assumptions, and discuss the strengths and weaknesses of your proposal. Then show your results if possible.
The library for synthetic controls in R is Synth, documented here.
This library works in somewhat unusual ways relative to most other stuff in R. Most of the work is done inside the dataprep command:
example.prep <- dataprep(
foo=DATAFRAME,
predictors=c(
"BACKGROUND_VARIABLE_1",
"BACKGROUND_VARIABLE_2",
"BACKGROUND_VARIABLE_3",
"BACKGROUND_VARIABLE_4"
),
dependent="OUTCOME_VARIABLE",
unit.variable="SEQUENTIAL_NUMBER_THAT_IDENTIFIES_CASES",
time.variable="SEQUENTIAL_NUMBER_THAT_IDENTIFIES_TIME_PERIODS",
treatment.identifier="NAME_OF_TREATMENT_CASE",
controls.identifier=LIST_OF_NAMES_OF_CONTROL_CASES,
time.predictors.prior=c(1975:1990), #The first number should be the time
#period that the data starts, and the second
#should be the time period before the treatment.
time.optimize.ssr=c(1975:1989), #Optimize over the period before the treatment.
time.plot=c(1975:2008), #Plot all the data.
unit.names.variable="ALPHABETICAL_VARIABLE_THAT_IDENTIFIES_CASES"
)Then, once you’ve set up the scenario, you can run the synthetic control:
Finally, we usually like to get graphs for this process:
path.plot(synth.res=example.synth, dataprep.res=example.prep,
Ylab="OUTCOME_VARIABLE", Legend=NA, tr.intake=1991,
Ylim=c(6,8) , Main="NAME_OF_TREATMENT_CASE"
)```
You may need to change the tr.intake to match your treatment year, and you may need to change the Ylim to match the range of your outcome variable.