R/forest-package.R

#' Forest plots
#'
#' Create forest plots from common \code{R} objects.
#' 
#' Currently supported objects:
#' 
#' \tabular{rlll}{
#' \tab \code{\link[survival]{coxph}} \tab Cox proportional hazards regression
#'   from the \pkg{survival} package \cr
#' \tab \code{\link[coxphf]{coxphf}} \tab Cox regression with Firth's penalized
#'   likelihood from the \pkg{coxphf} package \cr
#' \tab \code{\link[cmprsk]{crr}} \tab Competing risks regression from the
#'   \pkg{cmprsk} package \cr
#' \tab \code{\link[cmprsk2]{crr2}} \tab Competing risks regression from the
#'   \pkg{cmprsk2} package \cr
#' \tab \code{\link{glm}} \tab Logistic regression, i.e., models fit with
#'   \code{family = binomial(link)} \cr
#' \tab \code{\link{glm}} \tab \pkg{brglm2} regression, i.e., models fit with
#'   \code{family = binomial(link)}, \code{method = 'brglmFit'}, and
#'   \code{type = ...}; see \code{\link[brglm2]{brglmFit}} \cr
#' \tab \code{\link[logistf]{logistf}} \tab Logistic regression with Firth's
#'   penalized likelihood from the \pkg{logistf} package \cr
#' \tab \code{\link{lm}} \tab Linear regression \cr
#' \tab \code{\link{formula}} \tab Odds ratios and Fisher's exact tests via
#'   \code{\link{fisher.test}} \cr
#' }
#' 
#' @seealso
#' \code{\link{forest}}
#' 
#' @examples
#' twos <- mtcars
#' twos[] <- lapply(twos, function(x) +grepl('1|4', x))
#' forest(mpg ~ ., twos)
#' forest(mpg ~ ., twos, plotArgs = list(xlim = c(0, 20), show_conf = TRUE))
#' 
#' forest(glm(vs ~ wt + mpg + factor(gear), mtcars, family = 'binomial'))
#' 
#' ## see ?forest for more examples
#' 
#' @import graphics grDevices stats utils
#' @name forest-package
#' @docType package
NULL
raredd/forest documentation built on Feb. 19, 2024, 9:22 p.m.