Learn R Programming

rmdHelpers (version 1.3.1)

formatEffectTable: Format an effect table

Description

Performs general formatting of effect tables from `lm` suitable for basic printing. This includes merging estimates and confidence intervals, rounding, and optionally improving the display of factor and logical columns (using a colon and space, instead of just concatenating them).

Usage

formatEffectTable(object
                  , level = 0.95
                  , estDigits = 2
                  , pDigits = 4
                  , cleanFactors = TRUE)

Value

A data.frame formatted ready to be displayed (e.g. by `kable`)

Arguments

object

A fitted model object from `lm`

level

The confidence level to be returned

estDigits

The number of digits to be displayed for the estimate and confidence thresholds

pDigits

The number of digits to be displayed for the p-values

cleanFactors

Logical. Should the parameter names for factors be cleaned by separating the parameter from the value with a colon and a space, or not. (This option may lead to issues with merging if set to `TRUE`.)

Author

Mark Peterson

Examples

Run this code

irisMod <- lm(Sepal.Length ~ ., data = iris)
formatEffectTable(irisMod)

Run the code above in your browser using DataLab