mr.divw: Main function for dIVW

View source: R/functions.R

mr.divwR Documentation

Main function for dIVW

Description

Main function for dIVW

Usage

mr.divw(
  beta.exposure,
  beta.outcome,
  se.exposure,
  se.outcome,
  alpha = 0.05,
  pval.selection = NULL,
  lambda = 0,
  over.dispersion = FALSE,
  diagnostics = FALSE,
  overlap = FALSE,
  gen_cor = 0
)

Arguments

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

alpha

Confidence interval has level 1-alpha

pval.selection

A vector of p-values calculated based on the selection dataset that is used for IV selection. It is not required when lambda=0

lambda

The specified z-score threhold. Default is 0 (without thresholding)

over.dispersion

Should the model consider balanced horizontal pleiotropy. Default is FALSE

diagnostics

Should the function returns the q-q plot for assumption diagnosis. Default is FALSE

overlap

Should the model consider overlapping exposure and outcome datasets. Default is FALSE

gen_cor

If overlap = TRUE, provide an estimate of the correlation between the effect of the genetic variants on the exposure and the outcome. Default value is 0, meaning that the exposure and outcome datasets are non-overlapping.

Value

A list

beta.hat

Estimated causal effect

beta.se

Standard error of beta.hat

condition

A measure that needs to be large for reliable asymptotic approximation based on the dIVW estimator. It is recommended to be greater than 20

tau.square

Overdispersion parameter if over.dispersion=TRUE

n.IV

Number of IVs used in the dIVW estimator

IV

IVs that are used in the dIVW estimator

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


data(bmi.cad)
attach(bmi.cad)
mr.divw(beta.exposure, beta.outcome, se.exposure, se.outcome, diagnostics=TRUE)
detach(bmi.cad)


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