mr.eo: MR-EO Algorithm to Adaptively Find the Optimal Z-score...

View source: R/functions.R

mr.eoR Documentation

MR-EO Algorithm to Adaptively Find the Optimal Z-score Threhold.

Description

MR-EO Algorithm to Adaptively Find the Optimal Z-score Threhold.

Usage

mr.eo(
  lambda.start,
  beta.exposure,
  beta.outcome,
  se.exposure,
  se.outcome,
  pval.selection,
  over.dispersion = FALSE,
  max_opt_iter = 5
)

Arguments

lambda.start

Initial value for lambda (the z-score threshold).

beta.exposure

A vector of SNP effects on the exposure vairable, usually obtained from a GWAS

beta.outcome

A vector of SNP effects on the outcome vairable, usually obtained from a GWAS

se.exposure

A vecor of standard errors of beta.exposure

se.outcome

A vector of standard errors of beta.outcome

pval.selection

A vector of p-values calculated based on the selection dataset that is used for IV selection

over.dispersion

Should the model consider balanced horizontal pleiotropy. Default is FALSE

max_opt_iter

Maximum number of iterations. Default is 5

Details

mr.eo is an adaptive algorithm that finds the optimal z-socre threshold that leads to the dIVW estimator with the smallest variance.

Value

A list

lambda.opt

Optimal z-socre threshold

n.iter

Number of iterations to find lambda.opt

References

Ting Ye, Jun Shao, Hyunseung Kang (2020). Debiased Inverse-Variance Weighted Estimator in Two-Sample Summary-Data Mendelian Randomization.https://arxiv.org/abs/1911.09802.

Examples


df<-data_gen_summary("case1")
attach(df)
lambda.opt<-mr.eo(0, beta.exposure, beta.outcome, se.exposure, se.outcome, pval.selection)$lambda.opt
mr.divw(beta.exposure, beta.outcome, se.exposure, se.outcome, pval.selection=pval.selection, lambda=lambda.opt)
detach(df)

data(bmi.cad)
attach(bmi.cad)
lambda.opt<-mr.eo(0, beta.exposure, beta.outcome, se.exposure, se.outcome, pval.selection)$lambda.opt
mr.divw(beta.exposure, beta.outcome, se.exposure, se.outcome, pval.selection=pval.selection, lambda=lambda.opt)
detach(bmi.cad)


tye27/mr.divw documentation built on Oct. 18, 2024, 12:06 a.m.