logistic_forestplot: logistic_forestplot

View source: R/knitr_utils.R

logistic_forestplotR Documentation

logistic_forestplot

Description

logistic_forestplot

Usage

logistic_forestplot(
  ...,
  modelnames = NULL,
  varnames = NULL,
  stats = NULL,
  odds.ratio = F,
  breaks = NULL,
  intercept = T,
  sig = 3
)

Arguments

...

One or more logistic regression model objects.

modelnames

A character vector of names to label each plot and table column.

varnames

A named character vector. Each element is a human friendly version of the variable name, and each name is the original variable name.

stats

A named list of numeric vectors. The names are the names of the stats; the vectors are the stats to include in the table.

odds.ratio

If TRUE, apply exponential transform to coefficients and omit intercept.

breaks

An optional vector of breaks for the plot x-axis.

intercept

If TRUE, include the intercept in the table and plot; otherwise omit.

sig

The number of significant digits for the table.

Value

A named list. $plot has the plot. $table has the data frame of coefficients and stats.

Examples

data(mtcars)
m1 <- glm(am ~ hp, family=binomial, mtcars)
m2 <- glm(mpg ~ wt, family=binomial, mtcars)
mnms <- c('AM vs HP', 'AM vs Weight')
vnms <- c(mpg='Miles per gallon', hp='Horsepower', wt='Weight')
out <- logistic_forestplot(m1, m2, modelsnames=mnms, varnames=vnms)

grasshoppermouse/hagenutils documentation built on Dec. 6, 2024, 8:31 p.m.