generate.placebos: Function to generate placebo synthetic controls

Description Usage Arguments Value Examples

View source: R/generate.placebos.R

Description

Constructs a synthetic control unit for each unit in the donor pool of an implementation of the synthetic control method for a single treated unit. Used for placebo tests (see plot_placebos, mspe.test, mspe.plot) to assess the strength and significance of a causal inference based on the synthetic control method. On placebo tests, see Abadie and Gardeazabal (2003), and Abadie, Diamond, and Hainmueller (2010, 2011, 2014).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
generate.placebos(
  dataprep.out,
  synth.out,
  Sigf.ipop = 5,
  strategy = "sequential"
)

generate_placebos(
  dataprep.out,
  synth.out,
  Sigf.ipop = 5,
  strategy = "sequential"
)

Arguments

dataprep.out

A data.prep object produced by the dataprep command

synth.out

A synth.out object produced by the synth command

Sigf.ipop

The Precision setting for the ipop optimization routine. Default of 5.

strategy

The processing method you wish to use "sequential" or "multiprocess". Use "multiprocess" to parallelize operations and reduce computing time. Default is sequential.

Value

df

Data frame with outcome data for each control unit and their respective synthetic control and for the original treated and its control

mspe.placs

Mean squared prediction error for the pretreatment period for each placebo

t0

First time unit in time.optimize.ssr

t1

First time unit after the highest value in time.optimize.ssr

tr

Unit number of the treated unit

names.and.numbers

Dataframe with two columns showing all unit numbers and names from control units

n

Number of control units

treated.name

Unit name of the treated unit

loss.v

Pretreatment MSPE of the treated unit's synthetic control

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Not run: ## Example with toy data from Synth
library(Synth)
# Load the simulated data
data(synth.data)

# Execute dataprep to produce the necessary matrices for synth
dataprep.out<-
  dataprep(
    foo = synth.data,
    predictors = c("X1"),
    predictors.op = "mean",
    dependent = "Y",
    unit.variable = "unit.num",
    time.variable = "year",
    special.predictors = list(
      list("Y", 1991, "mean")
    ),
    treatment.identifier = 7,
    controls.identifier = c(29, 2, 13, 17),
    time.predictors.prior = c(1984:1989),
    time.optimize.ssr = c(1984:1990),
    unit.names.variable = "name",
    time.plot = 1984:1996
)

# run the synth command to create the synthetic control
synth.out <- synth(dataprep.out, Sigf.ipop=2)

## run the generate.placebos command to reassign treatment status
## to each unit listed as control, one at a time, and generate their
## synthetic versions. Sigf.ipop = 2 for faster computing time. 
## Increase to the default of 5 for better estimates. 
tdf <- generate.placebos(dataprep.out,synth.out, Sigf.ipop = 2)

## End(Not run)

SCtools documentation built on Aug. 26, 2020, 9:06 a.m.