tabler: Tabler

View source: R/utils2.R

tablerR Documentation

Tabler

Description

Extracts coefficients, standard errors, odds ratios, confidence intervals, p-values, etc. from model fits.

Usage

tabler(x, ...)

## Default S3 method:
tabler(x, ...)

## S3 method for class 'lm'
tabler(x, digits = 3L, add_reference, ...)

## S3 method for class 'glm'
tabler(x, digits = 3L, level = 0.95, exp = TRUE, add_reference = FALSE, ...)

## S3 method for class 'survfit'
tabler(x, add_reference, ...)

## S3 method for class 'coxph'
tabler(x, digits = 3L, level = 0.95, exp = TRUE, add_reference = FALSE, ...)

Arguments

x

an object of class lm, glm, survfit, coxph

...

additional arguments passed to or from other methods

digits

number of digits printed

add_reference

logical; if TRUE, adds row for each reference group if applicable

level

confidence level; default is 0.95

exp

logical; if TRUE, estimates and confidence intervals are exponentiated (for glm or coxph methods only)

See Also

surv_table

Other tabler: tabler_by(), tabler_resp(), tabler_stat2(), tabler_stat()

Examples

lmfit <- lm(mpg ~ hp + disp + wt, mtcars)
tabler(lmfit)

glmfit <- glm(vs ~ drat + factor(gear), mtcars, family = 'binomial')
tabler(glmfit)
tabler(glmfit, add_reference = TRUE)
tabler(glmfit, exp = FALSE)

library('survival')
sfit <- survfit(Surv(time, status) ~ 1, cancer, conf.int = 0.9)
tabler(sfit)

cphfit <- coxph(Surv(time, status) ~ factor(sex) + age, cancer)
tabler(cphfit)
tabler(cphfit, add_reference = TRUE)


raredd/rawr documentation built on April 29, 2024, 10:29 a.m.