ggcmest
is used to plot results of cmest
nicely with plotting functions
in the ggplot2 package. Additional layers can be added to this plot using other
plotting functions in the ggplot2 package.
ggcmest( x, errorbar.width = 0.3, errorbar.size = 0.3, errorbar.colour = "black", point.size = 1, point.colour = "blue", refline = TRUE, refline.colour = "red", refline.size = 0.3 )
x | an object of class |
---|---|
errorbar.width | width of errorbars for confidence intervals. Default is |
errorbar.size | size of errorbars for confidence intervals. Default is |
errorbar.colour | colour of errorbars for confidence intervals. Default is |
point.size | size of points for point estimates. Default is |
point.colour | colour of points for point estimates. Default is |
refline | a logical value. If |
refline.colour | colour of the reference line. Default is |
refline.size | size of the reference line. Default is |
library(CMAverse) library(ggplot2) x <- cmest(data = cma2020, model = "rb", outcome = "contY", exposure = "A", mediator = "M2", basec = c("C1", "C2"), EMint = TRUE, mreg = list("multinomial"), yreg = "linear", astar = 0, a = 1, mval = list("M2_0"), estimation = "paramfunc", inference = "delta") ggcmest(x) + theme(axis.text.x = element_text(angle = 45))