forest_plot | R Documentation |
Creates a forest plot of MR estimates from do_mr().
Will plot both the Wald ratios for all SNPs which form the instrument and
inverse variance weighted method. However, if you wish for only the "discovery"
results to be plotted (i.e. WR for single-SNP instruments and only IVW for
multi-SNP instruments), then setting 'plot_all_res' to FALSE
will achieve this.
If the plot is too crowded, subsetting the results before passing them to this plotter will help.
forest_plot( res, snp_col = "snp", beta_col = "b", se_col = "se", pval_col = NULL, or_col = "or", or_lci_col = "or_lci95", or_uci_col = "or_uci95", method_col = "method", exposure_col = "exposure", outcome_col = "outcome", plot_all_res = TRUE )
res |
A data.frame of MR results |
snp_col |
Column name for SNPs (Optional) |
beta_col |
Column name for beta (Optional) |
se_col |
Column name for standard error (Optional) |
pval_col |
Column name for P value (Optional, unused for now) |
or_col |
Column name for odds ratio (Optional) |
or_lci_col |
Column name for lower CI of OR (Optional) |
or_uci_col |
Column name for upper CI of OR (Optional) |
method_col |
Column name which contains the MR method (Optional) |
exposure_col |
Column name for exposure names (Optional) |
outcome_col |
Column name for outcome names (Optional) |
plot_all_res |
For multi-SNP instruments, also plot the Wald ratios for
all SNPs ( |
Plot
[do_mr()]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.