Last active
July 12, 2017 23:13
-
-
Save bgweber/3e9d9f929583a530d7aa06efd5f9b7a6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(CausalImpact) | |
data <- read.csv(file = "DailySessions.csv") | |
# Create a DataFrame and plot the input data | |
ts <- cbind(data$test, data$control) | |
matplot(ts, type = "l") | |
# Use two week prior and post periods and plot results | |
pre.period <- c(1, 14) | |
post.period <- c(15, 30) | |
impact <- CausalImpact(ts, pre.period, post.period) | |
# Plot the results and explain the outcome | |
plot(impact, c("original", "pointwise")) | |
summary(impact, "report") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment