gmte_plot: Forest plot individual and combined TWIST/GMTE estimates

View source: R/gmte_plot.R

gmte_plotR Documentation

Forest plot individual and combined TWIST/GMTE estimates

Description

Plot the individual and combined estimates from a Triangulation WIthin A STudy (TWIST) analysis. The gmte_plot function takes an object of class twistR_GMTE, containing effect estimates from the individual tests (such as RGMTE) and the results when combinations are performed (such as RGMTE+MR), and creates a forest plot, highlighting the individual and combined estimates, and indicating with a "*" when the combined estimate may be valid.

Usage

gmte_plot(
  x,
  plot_title = "",
  plot_cat = FALSE,
  cols = c("#f46036", "#2e294e", "#1b998b"),
  pchs = c(15, 16, 23)
)

Arguments

x

An object of class twistR_GMTE e.g., the output from gmte_continuous

plot_title

A string to print as the plot title

plot_cat

Logical. Plot the CAT estimates? (Default=FALSE)

cols

Three colours to indiciate the three model types (GMTE0, individual estimates, combined estimates)

pchs

Three point types to indiciate the three model types (GMTE0, individual estimates, combined estimates)

Author(s)

Jack Bowden; Luke Pilling.

References

Bowden, J., et al., The Triangulation WIthin A STudy (TWIST) framework for causal inference within Pharmacogenetic research. PLoS Genetics. https://doi.org/10.1371/journal.pgen.1009783

Examples

# Example using a continuous outcome (LDL), binary treatment (statins), and binary genotype (SLCO1B1*5 homozygotes) variables
Y="ldl"
T="statin"
G="slco1b1_5_hmz"
Z="age+PC1+PC2+PC3+PC4+PC5+PC6+PC7+PC8+PC9+PC10"
results=gmte_continuous(Y,T,G,Z,D)

gmte_plot(results, plot_title = "SLCO1B1*5 effect on LDL during statin treatment")

# If desired, remove CAT estimates for "cleaner" plot, as these are often orders of magnititude larger than the other estimates
gmte_plot(results, plot_title = "SLCO1B1*5 effect on LDL during statin treatment", plot_cat=FALSE)

lukepilling/twistR documentation built on Feb. 8, 2025, 7:22 p.m.