#knitr::opts_chunk$set(eval=FALSE)
This is a mini version of the package walk through that runs quickly for doing tests. Right now the only difference is that we use fewer variants to compute the nuisance parameters and there is no supporting text.
library(readr) library(dplyr) library(cause)
system("mkdir example_data/") download.file("https://github.com/jean997/cause/blob/master/example_data/LDL_CAD_merged.RDS", destfile = "example_data/LDL_CAD_merged.RDS")
X <- readRDS("example_data/LDL_CAD_merged.RDS")
head(X)
set.seed(100) varlist <- with(X, sample(snp, size=10000, replace=FALSE)) params <- est_cause_params(X, varlist)
download.file("https://github.com/jean997/cause/blob/master/example_data/top_ldl_pruned_vars.RDS", destfile = "example_data/top_ldl_pruned_vars.RDS")
top_vars <- readRDS("example_data/top_ldl_pruned_vars.RDS") res <- cause(X=X, variants = top_vars, param_ests = params)
class(res) names(res) res$elpd class(res$sharing) class(res$causal)
plot(res$sharing) plot(res$causal)
The summary
method will summarize the posterior medians and credible intervals.
summary(res, ci_size=0.95)
The plot
method applied to a cause
object will arrange all of this information on one spread.
plot(res)
plot(res, type="data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.