cause: CAUSE

Description Usage Arguments Details Value Author(s)

View source: R/cause.R

Description

Fit CAUSE sharing and causal models, calculate ELPD test statistic and estimate posteriors

Implementation of CAUSE described in Morrison et al. (2020)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
cause(
  X,
  param_ests,
  variants = X$snp,
  pval_thresh = 1,
  sigma_g,
  qalpha = 1,
  qbeta = 10,
  max_q = 1,
  force = FALSE,
  n_start_gamma_eta = 21,
  n_start_q = 11
)

Arguments

X

An object of class cause_data containing data for the two traits.

param_ests

Object of class cause_params output by est_cause_params. This contains estimates of the mixing proportions and an estimate of rho, the correlation in test statistics that is due to overlapping samples or population structure.

variants

A vector of variants to include in the analysis.

pval_thresh

Argument supplying the trait M p-value threshold for including a variant. If you would like to use all variants in 'variants' without a threshold, use pval_thresh = 1.

sigma_g

Parameter specifying the prior distribution of gamma and eta. gamma ~ N(0, sigma_g), eta ~ N(0, sigma_g).

qalpha, qbeta

Parameters defining the prior distribution of q. q ~ Beta(qalpha, qbeta)

max_q

Largest value of q to be allowed. If max_q < 1 then the prior will be truncated.

force

If true, do not give an error if parameter estimates did not converge.

n_start_gamma_eta, n_start_q

Number of starting bins for grid approximation. You shouldn't need to change these but if you are suspicious about your results, you might try increasing them. It's best to use odd numbers.

Details

This function estimates posterior distributions for gamma, eta, and q under the sharing and causal models and computes a test statistic comparing the two models. The returned object contains

A note about arguments: The SNPs used to compute posteriors can be specified through two arguments, 'variants' and 'pval_thresh'. 'pval_thresh' was added in a later version and for compatibility with old code, the default value is set to 1. However, we recommend fitting posteriors with some p-value threshold in effect using either or both of the 'variants' and 'pval_thresh' arguments. The new argument makes it more convenient to do this without a separate step.

sharing, causal: posterior estimates under model.

elpd: A data frame giving estimated difference in elpd between the sharing and causal models. A negative delta_elpd favors the model in the "model 2" column. A positive delta_elpd favors the model in the "model 1" column.

data: The data used to compute the object. This data frame also contains posterior estimates for each variant of acting through U under both models.

sigma_g: Prior variance of gamma and eta. This value is chosen based on the data by default but can be supplied using the sigma_g parameter in the function call.

qalpha, qbeta: The prior distribution of q is Beta(qalpha, qbeta)

Functions summary() and plot() can be used with cause objects. See ?summary.cause and ?plot.cause

Value

An object of class "cause" that contains posterior estimates for causal and sharing models as well as results of the model comparison test. See Details.

Author(s)

Jean Morrison <jvmorr@umich.edu>


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