format_parameters: Parameter names formatting

View source: R/format_parameters.R

format_parametersR Documentation

Parameter names formatting


This functions formats the names of model parameters (coefficients) to make them more human-readable.


format_parameters(model, ...)

## Default S3 method:
format_parameters(model, brackets = c("[", "]"), ...)



A statistical model.


Currently not used.


A character vector of length two, indicating the opening and closing brackets.


A (names) character vector with formatted parameter names. The value names refer to the original names of the coefficients.

Interpretation of Interaction Terms

Note that the interpretation of interaction terms depends on many characteristics of the model. The number of parameters, and overall performance of the model, can differ or not between a * b a : b, and a / b, suggesting that sometimes interaction terms give different parameterizations of the same model, but other times it gives completely different models (depending on a or b being factors of covariates, included as main effects or not, etc.). Their interpretation depends of the full context of the model, which should not be inferred from the parameters table alone - rather, we recommend to use packages that calculate estimated marginal means or marginal effects, such as modelbased, emmeans, ggeffects, or marginaleffects. To raise awareness for this issue, you may use print(...,show_formula=TRUE) to add the model-specification to the output of the print() method for model_parameters().


model <- lm(Sepal.Length ~ Species * Sepal.Width, data = iris)

model <- lm(Sepal.Length ~ Petal.Length + (Species / Sepal.Width), data = iris)

model <- lm(Sepal.Length ~ Species + poly(Sepal.Width, 2), data = iris)

model <- lm(Sepal.Length ~ Species + poly(Sepal.Width, 2, raw = TRUE), data = iris)

parameters documentation built on May 29, 2024, 8:49 a.m.