Constrained maximum likelihood (cML) based Mendelian Randomization method robust to both correlated and uncorrelated pleiotropy.
mr_cML(
object,
MA = TRUE,
DP = TRUE,
K_vec = 0:(length(object@betaX) - 2),
random_start = 0,
num_pert = 200,
random_start_pert = 0,
maxit = 100,
random_seed = 314,
n,
Alpha = 0.05
)# S4 method for MRInput
mr_cML(
object,
MA = TRUE,
DP = TRUE,
K_vec = 0:(length(object@betaX) - 2),
random_start = 0,
num_pert = 200,
random_start_pert = 0,
maxit = 100,
random_seed = 314,
n,
Alpha = 0.05
)
The output from the function is an MRcML
object containing:
A character string giving the name given to the exposure.
A character string giving the name given to the outcome.
Estimate of theta.
Standard error of estimate.
p-value of estimate.
Set of selected invalid IVs if cML-BIC is performed, i.e. without MA or DP.
p-value of the first goodness-of-fit test.
p-value of the second goodness-of-fit test.
The number of SNPs that were used in the calculation.
Significance level for the confidence interval for estimate, default is 0.05.
Lower bound of the confidence interval for estimate.
Upper bound of the confidence interval for estimate.
Indicator of whether model average is applied.
Indicator of whether data perturbation is applied.
An MRInput
object.
Whether model average is applied or not. Default is TRUE.
Whether data perturbation is applied or not. Default is TRUE.
Set of candidate K's, the constraint parameter representing number of invalid IVs. Default is from 0 to (#IV - 2).
Number of random starting points for cML, default is 0.
Number of perturbation when DP is TRUE, default is 200.
Number of random start points for cML with data perturbation, default is 0.
Maximum number of iterations for each optimization. Default is 100.
Random seed, default is 314. When random_seed=NULL
, no random seed
will be used and the results may not be reproducible.
Sample size. When sample sizes of GWAS for exposure and outcome are different, and/or when sample sizes of different SNPs are different, the smallest sample size is recommended to get conservative result and avoid type-I error. See reference for more discussions.
Significance level for the confidence interval for estimate, default is 0.05.
The MRcML method selects invalid IVs with correlated
and/or uncorrelated peliotropic effects using constrained maximum
likelihood. cML-BIC
gives results of the selected model with
original data, while cML-MA-BIC
averages over all candidate models.
cML-BIC-DP
and cML-MA-BIC-DP
are the versions with
data-perturbation to account for selection uncertainty when
many invalid IVs have weak pleiotropic effects.
When DP is performed, two goodness-of-fit (GOF) tests are developed to check whether the model-based and DP- based variance estimates converge to the same estimate. Small p-values of GOF tests indicate selection uncertainty is not ignorable, and results from DP is more reliable. See reference for more details.
As the constrained maximum likelihood function is non-convex, multiple random starting points could be used to find a global minimum. For some starting points the algorithm may not converge and a warning message will be prompted, typically this will not affect the results.
Xue, H., Shen, X., & Pan, W. (2021). Constrained maximum likelihood-based Mendelian randomization robust to both correlated and uncorrelated pleiotropic effects. The American Journal of Human Genetics, 108(7), 1251-1269.
# Perform cML-MA-BIC-DP:
mr_cML(mr_input(bx = ldlc, bxse = ldlcse, by = chdlodds,
byse = chdloddsse), num_pert=5, MA = TRUE, DP = TRUE, n = 17723)
# num_pert is set to 5 to reduce computational time
# the default value of 200 is recommended in practice
# Perform cML-BIC-DP:
mr_cML(mr_input(bx = ldlc, bxse = ldlcse, by = chdlodds,
byse = chdloddsse), MA = TRUE, DP = FALSE,, n = 17723)
Run the code above in your browser using DataLab