| ggplot.mscmt | R Documentation |
ggplot.mscmt plots results of mscmt based on
ggplot.
## S3 method for class 'mscmt'
ggplot(
data,
mapping = aes(),
what,
type = c("gaps", "comparison", "placebo.gaps", "placebo.data", "p.value"),
treatment.time,
zero.line = TRUE,
ylab,
xlab = "Date",
main,
col,
lty,
lwd,
legend = TRUE,
bw = FALSE,
date.format,
unit.name,
full.legend = TRUE,
include.smooth = FALSE,
include.mean = FALSE,
include.synth = FALSE,
draw.estwindow = TRUE,
what.set,
limits = NULL,
alpha = 1,
alpha.min = 0.1,
exclude.units = NULL,
exclude.ratio = Inf,
ratio.type = c("rmspe", "mspe"),
alternative = c("two.sided", "less", "greater"),
draw.points = TRUE,
control.name = "control units",
size = 1,
treated.name = "treated unit",
labels = c("actual data", "synthsized data"),
...,
environment = parent.frame()
)
data |
An object of class |
mapping |
An object necessary to match the definition of the
|
what |
A character vector. Name(s) of the variables to be plotted. If missing, the (first) dependent variable will be used. |
type |
A character scalar denoting the type of the plot containing
either |
treatment.time |
An optional scalar (numeric, character, or
|
zero.line |
A logical scalar. If |
ylab |
Optional label for the y-axis, automatically generated if missing. |
xlab |
Optional label for the x-axis, defaults to |
main |
Optional main title for the plot, automatically generated if missing. |
col |
Optional character vector with length 1 (for gaps plots) or
2 (for all other plot types). For comparison plots, |
lty |
Optional numerical vector with length 1 (for gaps plots) or
2 (for all other plot types). For comparison plots, |
lwd |
Optional numerical vector with length 1 (for gaps plots) or
2 (for all other plot types). For comparison plots, |
legend |
A logical scalar. If |
bw |
A logical scalar. If |
date.format |
A character string giving the format for the tick labels
of the x axis as documented in |
unit.name |
A character string with the title of the legend for comparison and placebo plots. Defaults to "Estimation" for comparison and "Unit" for placebo plots. |
full.legend |
A logical scalar. If |
include.smooth |
A logical scalar. If |
include.mean |
A logical scalar. If |
include.synth |
A logical scalar. If |
draw.estwindow |
A logical scalar. If |
what.set |
An optional character string for a convenient selection of
multiple variables. Accepted values are |
limits |
An optional vector of length 2 giving the range of the plot or
|
alpha |
Either a numerical scalar, a numerical vector of length
corresponding to the number of units, or the character string |
alpha.min |
A numerical scalar (default: |
exclude.units |
An optional (default: |
exclude.ratio |
A numeric scalar (default: |
ratio.type |
A character string. Either |
alternative |
A character string giving the alternative of the test for
plots of type |
draw.points |
A logical scalar. If |
control.name |
A character string for the naming of the non-treated
units in placebo plots. Defaults to |
size |
A numerical scalar (default: |
treated.name |
A character string giving the label for the treated
unit. Defaults to |
labels |
A character vector of length 2 giving the labels for the actual
and synthesized data. Defaults to |
... |
Necessary to match the definition of the
|
environment |
An object necessary to match the definition of the
|
A unified plot method for gaps plots, comparison of treated and synthetic
values, as well as plots for placebo studies, based on
ggplot. ggplot.mscmt is the preferred
plot method and has more functionality than plot.mscmt.
An object of class ggplot.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.