tabreg {tab}R Documentation

Create Regression Table from Betas and Standard Errors

Description

Useful for quickly creating a summary table.

Usage

tabreg(
  betas,
  ses = NULL,
  varcov = NULL,
  columns = c("beta.se", "p"),
  sep.char = ", ",
  decimals = NULL,
  formatp.list = NULL,
  labels = NULL
)

Arguments

betas

Numeric vector.

ses

Numeric vector.

varcov

Numeric matrix.

columns

Character vector specifying what columns to include. Choices are "beta", "se", "betaci", "beta.se", "beta.ci", "or", "orci", "or.ci", and "p".

sep.char

Character string with separator to place between lower and upper bound of confidence intervals. Typically "-" or ", ".

decimals

Numeric value specifying number of decimal places for numbers other than p-values.

formatp.list

List of arguments to pass to formatp.

labels

Character vector.

Value

kable.

Examples

# Create summary table for mtcars regression
fit <- lm(mpg ~ wt + hp + drat, data = mtcars)
tabreg(
  betas = fit$coef,
  varcov = vcov(fit),
  labels = c("Intercept", "Weight", "HP", "Rear axle ratio")
)



[Package tab version 5.1.1 Index]