summary.CausalMBSTS {CausalMBSTS} | R Documentation |
Summary of causal effect estimation results obtained with CausalMBSTS
Description
The method extracts and computes various summaries of the causal analysis with CausalMBSTS
.
Usage
## S3 method for class 'CausalMBSTS'
summary(object, ...)
Arguments
object |
An object of class 'CausalMBSTS', a result of a call to |
... |
further arguments passed to or from other methods (currently not used). |
Value
Returns an object of class summary.CausalMBSTS
, which is a list of data frames corresponding to each
date provided in horizon
(or its default value) with the following columns:
mean |
Estimated average causal effect |
lower |
Lower bound of the two-sided (1- |
upper |
Upper bound of the two-sided (1- |
cum.sum |
Pointwise effect |
cum.lower |
Lower bound of a (1- |
cum.upper |
Upper bound of a (1- |
bayes.pval |
Bayesian p-value for the average causal effect |
pct.causal.eff |
Probability of a causal effect (%) |
Examples
set.seed(1)
t <- seq(from = 0,to = 4*pi, length.out=300)
y <- cbind(3*sin(2*t)+rnorm(300), 2*cos(2*t) + rnorm(300))
dates <- seq.Date(from = as.Date("2015-01-01"), by = "week", length.out=300)
int.date <- as.Date("2020-02-27")
y[dates >= int.date,] <- y[dates >= int.date,]+2
# Causal effect estimation
causal.2 <- CausalMBSTS(y, components = c("trend", "cycle"), cycle.period = 75,
dates = dates, int.date = int.date, s0.r = 0.01*diag(2),
s0.eps = 0.1*diag(2), niter = 100, burn = 10)
sum.causal.2 <- summary(causal.2)
print(sum.causal.2, digits = 2)
sum.causal.2$horizon_default