Learn R Programming

CausalImpact (version 1.2.7)

CausalImpactMethods: Printing and plotting a CausalImpact object

Description

Methods for printing and plotting the results of an analysis results object returned by CausalImpact().

Usage

# S3 method for CausalImpact
summary(object, ...)
  # S3 method for CausalImpact
print(x, ...)
  # S3 method for CausalImpact
plot(x, ...)

Arguments

object

A CausalImpact results object, as returned by CausalImpact().

x

A CausalImpact results object, as returned by CausalImpact().

...

Optional additional arguments. For summary() and print(), the first optional argument is output, which can be "summary" (default) or "report". Partial matches are allowed. Furthermore, digits can be used to customize the precision of the output, e.g.: summary(..., "summary", digits = 3)

For plot(), the additional argument metrics can be used to specify which panels to include in the plot. The argument can be any combination of "original", "pointwise", "cumulative". Partial matches are allowed.

Author

Kay H. Brodersen kbrodersen@google.com

Examples

Run this code
if (FALSE) {
impact <- CausalImpact(...)

# Print a summary table
print(impact)
summary(impact)

# Print a verbal analysis description
print(impact, "report")
summary(impact, "report")

# Create a plot
plot(impact)
plot(impact, "original")
plot(impact, "pointwise")
plot(impact, "cumulative")
plot(impact, c("original", "pointwise"))

# Customize a plot
impact.plot <- plot(impact)
impact.plot <- impact.plot + theme_bw(base_size = 20)
}

Run the code above in your browser using DataLab