Skip to content

Instantly share code, notes, and snippets.

@MarkEdmondson1234
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkEdmondson1234/d489bc867be7eeb453bb to your computer and use it in GitHub Desktop.
Save MarkEdmondson1234/d489bc867be7eeb453bb to your computer and use it in GitHub Desktop.
Apply CausalImpact package to the GA output.
## do the causalImpact
# here the effect took place on the 200th day of the data imported, so the pre.period = 200
# Data is examined and compared in the post perid to day 244
impact <- CausalImpact(data = gadata$visits,
pre.period = c(1,200),
post.period = c(201,244),
model.args = NULL,
bsts.model = NULL,
post.period.response = NULL,
alpha = 0.05)
plot(impact)
# this gives you a nice verbose report
impact$report
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment