MRAPSS: A function for implementing MR-APSS.

Description Usage Arguments Value Examples

View source: R/MRAPSS.R

Description

MR-APSS: a unified approach to Mendelian Randomization accounting for pleiotropy, sample overlap and selection bias using genome wide summary statistics. MA-APSS uses a variantional EM algorithm for estimation of parameters. The algorithm defaultly uses estimates based on strong associations (p<genome_Threshold) to initialize nuisance parameters. Users can specify the genome_Threshold by themselves. Users can also specify the initial values for nuisance parameters. MR-APSS uses likelihood ratio test for inference.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
MRAPSS(
  MRdat = NULL,
  exposure = "exposure",
  outcome = "outcome",
  pi0 = NULL,
  sigma.sq = NULL,
  tau.sq = NULL,
  Sigma_err = matrix(c(1, 0, 0, 1), 2, 2),
  Omega = matrix(0, 2, 2),
  tol = 1e-08,
  Threshold = 1,
  genome_Threshold = 5e-08,
  ELBO = F
)

Arguments

MRdat

data frame at least contain the following varaibles: b.exp b.out se.exp se.out L2. L2:LD score

exposure

exposure name

outcome

outcome name

pi0

initial value for pi0, default 'NULL' will use the default initialize procedure.

sigma.sq

initial value for sigma.sq , default 'NULL'will use the default initialize procedure.

tau.sq

initial value for tau.sq , default 'NULL' will use the default initialize procedure.

Sigma_err

the error term correlation matrix. default 'diag(2)'.

Omega

the background varaince component. default 'matrix(0,2,2)'.

tol

tolerence, default '1e-08'

Threshold

The selection Threshold for correction of selection bias. If Threshold=1, the model won't correct for selection bias.

genome_Threshold

Genome threshold suggesting strong association , which will be used in the default initialize procedure. default '5e-08'.

ELBO

Whether check the evidence lower bound or not, if 'FALSE', check the maximum likelihood instead. default 'FALSE'.

Value

a list with the following elements:

MRdat

Input data frame

beta

causal effect estimate

beta.se

standard error

pval

p-value

sigma.sq

variance of forground exposure effect

tau.sq

variance of forground outcome effect

pi0

The probability of a SNP with forground signal after selection

post

Posterior estimates of latent varaibles

method

"MRAPSS"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(MRAPSS)
exposure = "LDL-C"
outcome = "CAD"
Threshold = 5e-05  # IV selection Threshold
data(Sigma_err)
data(Omega)
data(MRdat)
MRres = MRAPSS(MRdat,
               exposure="LDl-C",
               outcome= "CAD",
               Sigma_err = Sigma_err,
               Omega =  Omega ,
               Threshold =  Threshold)
MRplot(MRres, exposure="LDL-C", outcome="CAD")

hxh0504/MRAPSS documentation built on July 9, 2020, 8:07 a.m.