tabreg: Create Regression Table from Betas and Standard Errors

Description Usage Arguments Value Examples

View source: R/archived/tabreg-2020-03-28.R View source: R/tabreg.R

Description

Useful for quickly creating a summary table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
# 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")
)

tab documentation built on Aug. 2, 2021, 9:06 a.m.