Skip to contents

infer_reg() creates a small table summarizing a linear regression test. The traditional columns of t and p-value are removed by default but a full table can be accessed with simple = FALSE.

Usage

infer_reg(data, formula, digits = 3, caption = NULL, reduced = c("yes", "no"))

Arguments

data

A data frame (or tibble).

formula

The variables to run the test on, in formula syntax. Passed on to stats::lm().

digits

The number of digits to round table values to. Defaults to 3.

caption

An override to the table caption. A sensible default is provided.

reduced

Should a simple table be created (i.e., removal of the t and p-value columns)? Defaults to "yes".

Value

An object of class flextable. In an interactive session, results are viewable immediately.

Examples

infer_reg(mtcars, drat~wt)
infer_reg(mtcars, drat~wt, reduced = "no")
infer_reg(mtcars, drat~wt, digits = 4)
infer_reg(mtcars, drat~wt + qsec)