MRAPSS | R Documentation |
MR-APSS: a unified approach to Mendelian Randomization accounting for pleiotropy and sample structure using genome-wide summary statistics. MA-APSS uses a variantional EM algorithm for estimation of parameters. MR-APSS uses likelihood ratio test for inference.
MRAPSS(
MRdat = NULL,
exposure = "exposure",
outcome = "outcome",
pi0 = NULL,
sigma.sq = NULL,
tau.sq = NULL,
C = matrix(c(1, 0, 0, 1), 2, 2),
Omega = matrix(0, 2, 2),
Cor.SelectionBias = T,
tol = 1e-08,
ELBO = F
)
MRdat |
data frame at least contain the following varaibles: b.exp b.out se.exp se.out L2 Threshold. L2:LD score, Threshold: modified IV selection threshold for correction of selection bias |
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. |
C |
the estimated C matrix capturing the effects of sample structure. default 'diag(2)'. |
Omega |
the estimated variance-covariance matrix of polygenic effects. default 'matrix(0,2,2)'. |
Cor.SelectionBias |
Whether use the selection Threshold for correction of selection bias. If FALSE, the model won't correct for selection bias. |
tol |
tolerence, default '1e-08' |
ELBO |
Whether check the evidence lower bound or not, if 'FALSE', check the maximum likelihood instead. default 'FALSE'. |
a list with the following elements:
Input data frame
exposure of interest
outcome of interest
causal effect estimate
standard error
p-value
variance of forground exposure effect
variance of forground outcome effect
The probability of a SNP with forground signal after selection
Posterior estimates of latent varaibles
"MR-APSS"
library(MRAPSS)
exposure = "BMI"
outcome = "T2D"
Threshold = 5e-05 # IV selection Threshold
data(C)
data(Omega)
data(MRdat)
MRres = MRAPSS(MRdat,
exposure = "BMI",
outcome = "T2D",
C = C,
Omega = Omega ,
Cor.SelectionBias = T)
MRplot(MRres, exposure = "BMI", outcome = "T2D")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.