MR_het_test {iGasso} | R Documentation |
Test of Heterogeneity in MR using Principal Components
Description
MR_het_test
performs tests of heterogeneity in MR.
Usage
MR_het_test(x.b, y.b, x.se, y.se, b0, k = NULL, cum.prop = 0.8)
Arguments
x.b |
a vector of the estimated regression coefficients from the SNP-exposure GWAS |
y.b |
a vector of the estimated regression coefficients from the SNP-outcome GWAS |
x.se |
a vector of SEs for |
y.se |
a vector of SEs for |
b0 |
a value used for the common effect size. It is used for the weighting matrix |
k |
the number of principal components used. It is used by the |
cum.prop |
threshold for selecting |
Value
A list containing the following components:
* P_\text{min}(b_0)
statistic and its P
-value.
* \tilde Q_\text{min}(b_0)
statistic, its degrees of freedom, and its P
-value.
Author(s)
Kai Wang <kai-wang@uiowa.edu>
References
Wang, K, Alberding, Steven Y. (2024) Powerful test of heterogeneity in two-sample summary-data Mendelian randomization. Submitted.
Examples
p = 10
b = 0.5
gamma.true = runif(p, 0.34, 1.1)
x.se = runif(p, 0.06, 0.1)
y.se = runif(p, 0.015, 0.11)
x.b = rnorm(p, gamma.true, x.se)
y.b = rnorm(p, b*gamma.true, y.se)
b0 = 0.4
MR_het_test(x.b, y.b, x.se, y.se, b0)