#knitr::opts_chunk$set(eval=FALSE)

Introduction

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.

Step 1: Format Data for CAUSE

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)

Step 2: Calculate nuisance parameters

set.seed(100)
varlist <- with(X, sample(snp, size=10000, replace=FALSE))
params <- est_cause_params(X, varlist)

Step 3: LD Pruning

download.file("https://github.com/jean997/cause/blob/master/example_data/top_ldl_pruned_vars.RDS", destfile = "example_data/top_ldl_pruned_vars.RDS")

Step 4: Fit CAUSE

top_vars <- readRDS("example_data/top_ldl_pruned_vars.RDS")
res <- cause(X=X, variants = top_vars, param_ests = params)

Step 5: Look at Results

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")


jean997/cause documentation built on Dec. 25, 2021, 10 p.m.