knitr::opts_chunk$set(echo = TRUE)
\thispagestyle{fancy}
library(xts) library(magrittr) library(huxtable) library(flextable) library(tscausal) library(rmarkdown) x <- readRDS(paste0(params$dir,"/causal_tmp.rds")) idate <- x$intervention_date horizon <- NROW(x$post_actual)
r params$namer params$modelr params$frequencyr as.character(idate)r 100*as.numeric(x$alpha) \%r ifelse(x$summary_table$p[1] <= x$alpha,"Reject","Fail to Reject")xx <- tscausal:::.table.print.tscausal(x, digits = 4) tab <- as_hux(xx, add_colnames = TRUE) %>% add_rownames(colname = "Statistic", TRUE) %>% theme_grey() %>% map_align(by_cols("left","right","right")) %>% huxtable::set_caption("Causal Analysis") %>% huxtable::set_caption_pos("bottom") %>% huxtable::set_position("left") tab$Statistic[1] <- "Statistic" tab
p <- x$summary$p[1] cat("Forecast Distribution tail-area probability p: ", round(p, 5), " \n") cat("Forecast Distribution prob. of a causal effect: ", round((1 - p) * 100, ifelse(p < 0.01, 5, ifelse(p < 0.05, 3, 0))), "\\% \n")
plot(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.