Skip to contents

Creates a scatter plot of genetic associations with exposure and outcome, with causal effect estimate lines for BIC and RIVW methods

Usage

plot_scatter(
  care_results,
  highlight_invalid = TRUE,
  xlab = "Genetic association with exposure",
  ylab = "Genetic association with outcome",
  title = "MR Scatter Plot",
  colors = NULL
)

Arguments

care_results

Results object from mr_care function

highlight_invalid

Whether to highlight invalid instruments. Default is TRUE

xlab

X-axis label. Default is "Genetic association with exposure"

ylab

Y-axis label. Default is "Genetic association with outcome"

title

Plot title. Default is "MR Scatter Plot"

colors

Vector of colors for valid and invalid instruments. Default is NULL (uses preset colors)

Value

A ggplot2 object

Examples

if (FALSE) { # \dontrun{
results <- mr_care(exposure_data, outcome_data)
plot_scatter(results)
} # }