genius_mulA: MR GENIUS under multiplicative exposure model

Description Usage Arguments Details Value References Examples

View source: R/MAIN.R

Description

Implements MR GENIUS under a multiplicative exposure model.

Usage

1
genius_mulA(Y, A, G, alpha = 0.05, lower = -10, upper = 10)

Arguments

Y

A numeric vector of outcomes.

A

A numeric vector of exposures (binary values should be coded in 0/1).

G

A numeric matrix of instruments; each column stores values for one instrument (a numeric vector if only a single instrument is available).

alpha

Significance level for confidence interval (default value=0.05).

lower

The lower end point of the causal effect interval to be searched (default value=-10).

upper

The upper end point of the causal effect interval to be searched (default value=10).

Details

This function implements the estimator given in Lemma 3 of Tchetgen Tchetgen et al (2017), under a multiplicative exposure model. By default, the log ratio term in equation (9) is modelled as a linear combination of the main effects of all available instruments.

Value

A "genius" object containing the following items:

beta.est

The point estimate of the causal effect (on the additive scale) of the exposure on the outcome.

beta.var

The corresponding estimated variance.

ci

The corresponding Wald-type confidence interval at specified significance level.

pval

The p-value for two-sided Wald test of null causal effect (on the additive scale) of the exposure on the outcome.

References

Tchetgen Tchetgen, E., Sun, B. and Walter, S. (2017). The GENIUS Approach to Robust Mendelian Randomization Inference. arXiv e-prints.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#the following package is needed to simulate data
library("MASS")
nIV=10; N=2000; beta=0.5; 
gamma=rep(0.5,nIV); alpha=rep(0.5,nIV);phi=rep(0.05,nIV);
Gn = mvrnorm(N,rep(0,nIV),diag(rep(1,nIV)))
G  = (Gn>0)*1;
U = as.vector(phi%*%t(G))+rnorm(N);
#exposure generated from negative binomial distribution
A = rnbinom(N,size=10,mu = exp(as.vector(gamma%*%t(G)) +0.1*U)) 
Y = as.vector(alpha%*%t(G)) + beta*A + U + rnorm(N);

genius_mulA(Y,A,G);

bluosun/MR-GENIUS documentation built on May 28, 2019, 7:12 p.m.