plot.gsynth: Plotting

Description Usage Arguments Details Author(s) References See Also

View source: R/plot.R

Description

Visualizes estimation results of the generalized synthetic control method.

Usage

1
2
3
4
5
## S3 method for class 'gsynth'
plot(x, type = "gap", xlim = NULL, ylim = NULL,
            xlab = NULL, ylab = NULL, legendOff = FALSE, raw = "none",
            main = NULL, nfactors = NULL, id = NULL, axis.adjust = FALSE,
            theme.bw = TRUE, shade.post = FALSE, ...)

Arguments

x

a gsynth object.

type

a string that specifies the type of the plot. Must be one of the following: "gap" (plotting the average treatment effect on the treated; "raw" (plotting the raw data); "counterfactual", or "ct" for short, (plotting predicted Y(0)'s); "factors" (plotting estimated factors); "loadings" (plotting the distribution of estimated factor loadings); "missing" (plotting status of each unit at each time point).

xlim

a two-element numeric vector specifying the range of x-axis. When class of time variable is string, must specify not original value but a counting number e.g. xlim=c(1,30).

ylim

a two-element numeric vector specifying the range of y-axis.

xlab

a string indicating the label of the x-axis.

ylab

a string indicating the label of the y-axis.

legendOff

a logical flag controlling whether to show the legend.

raw

a string indicating whether or how raw data for the outcome variable will be shown in the "counterfactual" plot. Ignored if type is not "counterfactual". Must be one of the following: "none" (not showing the raw data); "band" (showing the middle 90 percentiles of the raw data); and "all" (showing the raw data as they are).

main

a string that controls the title of the plot. If not supplied, no title will be shown.

nfactors

a positive integer that specifies the number of factors to be shown. The maximum number if 4. Ignored if type is not "factors"

id

a unit identifier of which the predicted counterfactual or the difference between actual and predicted counterfactual is to be shown. It can also be a vector specifying units to be plotted if type=="missing" when data magnitude is large. Ignored if type is none of "missing", "counterfactual", "gap".

axis.adjust

a logical flag indicating whether to adjust labels on x-axis. Useful when class of time variable is string and data magnitude is large.

theme.bw

a logical flag indicating whether to use a black/white theme.

shade.post

a logical flag controlling whether to shade the post-treatment periods.

...

other argv.

Details

plot.gsynth visualizes the raw data used by, or estimation results obtained from, the generalized synthetic control method.

Author(s)

Yiqing Xu <yiqingxu@stanfprd.edu>, Stanford University

Licheng Liu <liulch@mit.edu>, M.I.T.

References

Yiqing Xu. 2017. "Generalized Synthetic Control Method: Causal Inference with Interactive Fixed Effects Models." Political Analysis, Vol. 25, Iss. 1, January 2017, pp. 57-76.

See https://yiqingxu.org/packages/gsynth/ for more detailed information.

See Also

gsynth and print.gsynth


xuyiqing/gsynth documentation built on Feb. 23, 2022, 9:09 p.m.