
Funnel Plot for MR Analysis
plot_funnel.RdCreates a funnel plot to visualize potential pleiotropy in MR analysis
Usage
plot_funnel(
care_results,
highlight_invalid = TRUE,
xlab = "MR estimate",
ylab = "Precision (1/SE)",
title = "MR Funnel 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 "MR estimate"
- ylab
Y-axis label. Default is "Precision (1/SE)"
- title
Plot title. Default is "MR Funnel 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_funnel(results)
} # }