plot.mscmt: Plotting Results of MSCMT

View source: R/plot.r

plot.mscmtR Documentation

Plotting Results of MSCMT

Description

plot.mscmt plots results of mscmt.

Usage

## S3 method for class 'mscmt'
plot(
  x,
  what,
  type = c("gaps", "comparison", "placebo.gaps", "placebo.data"),
  treatment.time,
  zero.line = TRUE,
  ylab,
  xlab = "Date",
  main,
  sub,
  col,
  lty,
  lwd,
  legend = TRUE,
  bw = FALSE,
  ...
)

Arguments

x

An object of class "mscmt", usually obtained as the result of a call to function mscmt.

what

A character scalar. Name of the variable to be plotted. If missing, the (first) dependent variable will be used.

type

A character scalar denoting the type of the plot containing either "gaps", "comparison", "placebo.gaps", or "placebo.data". Partial matching allowed, defaults to "placebo.gaps", if results of a placebo study are present, and to "gaps", else.

treatment.time

An optional numerical scalar. If not missing, a vertical dotted line at the given point in time is included in the plot. treatment.time is measured in years, but may as well be a decimal number to reflect treatment times different from January 1st.

zero.line

A logical scalar. If TRUE (default), a horizontal dotted line (at zero level) is plotted for "gaps" and "placebo" plots.

ylab

Optional label for the y-axis, automatically generated if missing.

xlab

Optional label for the x-axis, defaults to "Date".

main

Optional main title for the plot, automatically generated if missing.

sub

Optional subtitle for the plot. If missing, the subtitle is generated automatically for "comparison" and "gaps" plots.

col

Optional character vector with length corresponding to the number of units. Contains the colours for the different units, automatically generated if missing.

lty

Optional numerical vector with length corresponding to the number of units. Contains the line types for the different units, automatically generated if missing.

lwd

Optional numerical vector with length corresponding to the number of units. Contains the line widths for the different units, automatically generated if missing.

legend

A logical scalar. If TRUE (default), a legend is included in the plot.

bw

A logical scalar. If FALSE (default), the automatically generated colours and line types are optimized for a colour plot, if TRUE, the automatic colours and line types are set for a black and white plot.

...

Further optional parameters for the underlying plot function.

Details

A unified basic plot function for gaps plots, comparison of treated and synthetic values, as well as plots for placebo studies. Consider using ggplot.mscmt instead, which is the preferred plot method and has more functionality than plot.mscmt.

Value

Nothing useful (function is called for its side effects).


MSCMT documentation built on Nov. 13, 2023, 5:07 p.m.