
Plot MR Scatter Plot
plot_scatter.RdCreates 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)
Examples
if (FALSE) { # \dontrun{
results <- mr_care(exposure_data, outcome_data)
plot_scatter(results)
} # }