modal.plot: Modal plot to detect heterogeneity

View source: R/modal.R

modal.plotR Documentation

Modal plot to detect heterogeneity

Description

Modal plot to detect heterogeneity

Usage

modal.plot(
  b_exp = NULL,
  b_out = NULL,
  se_exp = NULL,
  se_out = NULL,
  data = NULL,
  k = 1.5,
  weight.option = c("MLE", "shrinkage"),
  beta.range = NULL
)

Arguments

b_exp

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

b_out

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

se_exp

A vector of standard errors of b_exp.

se_out

A vector of standard errors of b_out.

data

Alternatively, dataset can be passed by the argument data, which must be a data frame with columns beta.exposure, beta.outcome, se.exposure, se.outcome.

k

Locality of the robust likelihood (smaller k has more sensitivity for mode detection)

weight.option

Character. Choice of "MLE" or "shrinkage".

beta.range

range of beta in the plot

Examples

data(lipid.cad)
data <- subset(lipid.cad, lipid == "hdl" & restrict &
gwas.selection == "teslovich_2010" &
gwas.outcome == "cardiogramplusc4d_1000genome" &
pval.selection < 1e-5)

modal.plot(data$beta.exposure, data$beta.outcome, data$se.exposure, data$se.outcome, k = 1)

data <- subset(lipid.cad, lipid == "ldl" & restrict &
gwas.selection == "teslovich_2010" &
gwas.outcome == "cardiogramplusc4d_1000genome" &
pval.selection < 1e-5)

modal.plot(data$beta.exposure, data$beta.outcome, data$se.exposure, data$se.outcome)


qingyuanzhao/mr.raps documentation built on June 13, 2025, 12:38 p.m.