MRMix: Two-sample Mendelian randomization analysis using mixture...

Description Usage Arguments Details Value References Examples

View source: R/MRMix.R

Description

This function conducts Mendelian randomization analysis using an underlying mixture model incorporating a fraction of the genetic instruments to have direct effect on the outcome (horizontal pleiotropy). MRMix takes GWAS summary statistics as inputs to estimate causal effects of one trait on another. For stability of the method, we recommend using summary statistics in the standardized scale: 1) For both binary and continuous traits, summary-statistics should be standardized by genotypic variance; 2) In addition, for continuous phenotype, summary-statistics should be standardized by phenotypic variance. If the data are not in the standardized scale, users may use the standardize function to standardize their data. See Details and Examples for more information.

Usage

1
2
MRMix(betahat_x, betahat_y, sx, sy, theta_temp_vec = seq(-1, 1, by =
  0.01), pi_init = 0.6, sigma_init = 1e-05, profile = FALSE)

Arguments

betahat_x

GWAS effect estimates of the exposure, recommended to be in standardized scale. Vector of length K, where K is the number of instruments (SNPs).

betahat_y

GWAS effect estimates of the outcome, recommended to be in standardized scale. Vector of length K.

sx

Standard error of betahat_x, recommended to be in standardized scale. Vector of length K.

sy

Standard error of betahat_y, recommended to be in standardized scale. Vector of length K.

theta_temp_vec

A vector of the grid search values for the causal effect theta. Default to be seq(-1,1,by=0.01). Users may adjust the grid if larger effects are possible.

pi_init

Initial value of the probability mass at the null component of the mixture model corresponding to underlying valid instruments. Default to be 0.6. See Details.

sigma_init

Initial value of the variance of the non-null component of the mixture model which corresponds to underlying invalid instruments with pleiotropic effect. Default to be 1e-5. See Details.

profile

Whether to include the profile matrix. Default to be FALSE. If TRUE, include the profile matrix in the output. See Value profile_mat for details.

Details

The algorithm searches over a grid of possible values of the causal effect theta. For each fixed theta, it fits mixture model pi0*N(0,sy^2+theta^2*sx^2)+(1-pi0)*N(0,sigma2) on the residual betahat_y-theta*betahat_x. It then chooses the value of theta that leads to the maximum pi0 as the estimate of causal effect. Summary statistics can be standardized using the standardize() function if they are estimates from linear or logistic regression. Do not use Standardize() for other models.

Value

A list that contains

theta

Estimate of causal effect. Assuming the summary statistics are standardized, theta represents increase in mean value of Y in s.d. unit of Y (for continuous outcomes) or log-OR of Y (for binary outcomes) associated with per s.d. unit increase in values of X (for continuous exposures) or values of X changing from 0 to 1 (for binary exposures).

pi0

The probability mass of the null component corresponding to the estimated theta.

sigma2

The variance of the non-null component corresponding to the estimated theta.

SE_theta

Standard error of causal effect estimate.

zstat_theta

Z-statistic for test of the causal effect estimate.

pvalue_theta

P-value from the z test for the causal effect.

profile_mat

A matrix of 3 columns containing details of the grid search. The first column is theta_temp_vec. The second and third columns are the corresponding pi0 and sigma2 values. Only returned if profile=TRUE.

References

1. Qi, Guanghao, and Nilanjan Chatterjee. "Mendelian randomization analysis using mixture models for robust and efficient estimation of causal effects." Nature Communications 10.1 (2019): 1941.

2. Qi, Guanghao, and Nilanjan Chatterjee. "A Comprehensive Evaluation of Methods for Mendelian Randomization Using Realistic Simulations of Genome-wide Association Studies." bioRxiv (2019): 702787.

Examples

1
2
3
4
5
6
7
8
9
data("sumstats", package = "MRMix")
# Convert summary statistics to standardized scale
data_std = standardize(sumstats$betahat_x, sumstats$betahat_y, sumstats$sx, sumstats$sy, xtype = "continuous", ytype = "continuous", sumstats$nx, sumstats$ny, MAF = NULL)
# MRMix analysis
est = MRMix(data_std$betahat_x_std, data_std$betahat_y_std, data_std$sx_std, data_std$sy_std)
str(est) # True causal effect is 0.2.
# Include profile matrix
est = MRMix(data_std$betahat_x_std, data_std$betahat_y_std, data_std$sx_std, data_std$sy_std, profile = TRUE)
str(est)

gqi/MRMix documentation built on Jan. 30, 2020, 1:35 a.m.