This function will accept a log or logistic regression fit from glm or geeglm, and display the OR or RR for each variable on the appropriate log scale.
forestplot2(
model,
conf.level = 0.95,
orderByRisk = TRUE,
colours = "default",
showEst = TRUE,
rmRef = FALSE,
logScale = getOption("reportRmd.logScale", TRUE),
nxTicks = 5
)
a plot object
an object output from the glm or geeglm function, must be from a logistic regression
controls the width of the confidence interval
logical, should the plot be ordered by risk
can specify colours for risks less than, 1 and greater than 1.0. Default is red, black, green
logical, should the risks be displayed on the plot in text
logical, should the reference levels be removed for the plot?
logical, should OR/RR be shown on log scale, defaults to TRUE, or reportRmd.logScale if set. See https://doi.org/10.1093/aje/kwr156 for why you may prefer a linear scale.
Number of tick marks supplied to the log_breaks function to produce
data("pembrolizumab")
glm_fit = glm(orr~change_ctdna_group+sex+age+l_size,
data=pembrolizumab,family = 'binomial')
forestplot2(glm_fit)
Run the code above in your browser using DataLab