standardize: Standardize summary statistics for MRMix analysis

Description Usage Arguments Details Value References

View source: R/standardize.R

Description

1) For both binary and continuous traits, this function standardizes GWAS summary statistics by genotypic variance; 2) In addition, for continuous phenotype, this function standardizes summary statistics by phenotypic variance. This function is designed for GWAS estimates from linear or logistic regression. Do not use for other models.

Usage

1
standardize(betahat_x, betahat_y, sx, sy, xtype, ytype, nx, ny, MAF)

Arguments

betahat_x

GWAS effect estimates of the exposure. Vector of length K, where K is the number of instruments (SNPs).

betahat_y

GWAS effect estimates of the outcome. Vector of length K.

sx

Standard error of betahat_x. Vector of length K.

sy

Standard error of betahat_y. Vector of length K.

xtype

Is the exposure a continuous or binary trait? Set to xtype="continuous" or xtype="binary". Or set to xtype="n" if exposure summary statistics do not need to be standardized.

ytype

Is the outcome a continuous or binary trait? Set to ytype="continuous" or ytype="binary". Or set to ytype="n" if outcome summary statistics do not need to be standardized.

nx

SNP-specific sample size (recommended) or total sample size of the study associated with the exposure. Vector of length K or a single number. Set to NULL if trait is binary. Summary statistics for binary traits are standardized by the genotypic variance which can be calculated using the minor allele frequency (MAF) under Hardy-Weinberg equilibrium. Hence sample size is not needed for binary traits.

ny

SNP-specific sample size (recommended) or total sample size of the study associated with the outcome. Vector of length K or a single number. Set to NULL if trait is binary for the same reason as for nx.

MAF

Minor allele frequency. Vector of length K. Set to NULL if both traits are continuous. Summary statistics for continuous traits are standardized as z statistics rescaled by sample size, hence MAF is not needed.

Details

Using the exposure X as an example: 1) For continuous phenotypes analyzed with linear regression, data are standardized by betahat_x_std=betahat_x/(sx*sqrt(nx)); sx_std=1/sqrt(nx). Note that this standardization assumes that GWAS was conducted without covariate adjustment or the covariates do not have strong effects on Y. If the covariates have strong effects on Y, set nx equal to the effective sample size, which can be approximated by N/(1-R2), where N is the sample size associated with the study for X and R2 is the R-squared for the covariates. 2) For binary phenotypes analyzed with logistic regression, data are standardized by betahat_x_std=betahat_x*sqrt(2*MAF*(1-MAF)); sx_std=sx*sqrt(2*MAF*(1-MAF)). Same formulas apply to the outcome Y.

Value

A list that contains

betahat_x_std

Standardized betahat for the exposure.

betahat_y_std

Standardized betahat for the outcome.

sx_std

Standard error of betahat_x_std.

sy_std

Standard error of betahat_y_std.

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.


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