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.
Arguments
- x
An object of class
twistR_GMTE
e.g., the output fromgmte_continuous
- plot_title
A string to print as the plot title
- plot_cat
Logical. Plot the CAT estimates? (Default=TRUE)
- 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)
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)
#> TWIST (Triangulation WIthin A STudy) analysis in R - continuous outcome
#> Error in gmte_continuous(Y, T, G, Z, D): D needs to be a data.frame
gmte_plot(results, plot_title = "SLCO1B1*5 effect on LDL during statin treatment")
#> Error in eval(expr, envir, enclos): object 'results' not found
# 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)
#> Error in eval(expr, envir, enclos): object 'results' not found