insight (version 0.11.0)

parameters_table: Parameter table formatting

Description

This functions takes a data frame with model parameters as input and formats certain columns into a more readable layout (like collapsing separate columns for lower and upper confidence interval values). Furthermore, column names are formatted as well.

Usage

parameters_table(
  x,
  pretty_names = TRUE,
  stars = FALSE,
  digits = 2,
  ci_width = "auto",
  ci_brackets = TRUE,
  ci_digits = 2,
  p_digits = 3,
  preserve_attributes = FALSE,
  ...
)

Arguments

x

A data frame of model's parameters, as returned by various functions of the easystats-packages. May also be a result from broom::tidy().

pretty_names

Return "pretty" (i.e. more human readable) parameter names.

stars

Add significance stars (e.g., p < .001***).

digits

Number of decimal places for numeric values (except confidence intervals and p-values).

ci_width

Minimum width of the returned string for confidence intervals. If not NULL and width is larger than the string's length, leading whitespaces are added to the string. If width="auto", width will be set to the length of the longest string.

ci_brackets

Logical, if TRUE (default), CI-values are encompassed in square brackets (else in parentheses).

ci_digits

Number of decimal places for confidence intervals.

p_digits

Number of decimal places for p-values. May also be "scientific" for scientific notation of p-values.

preserve_attributes

Logical, if TRUE, preserves all attributes from the input data frame.

...

Arguments passed to or from other methods.

Value

A data frame.

Examples

Run this code
# NOT RUN {
if (require("parameters")) {
  x <- model_parameters(lm(Sepal.Length ~ Species * Sepal.Width, data = iris))
  as.data.frame(parameters_table(x))
  as.data.frame(parameters_table(x, p_digits = "scientific"))
}
# }
# NOT RUN {
if (require("rstanarm") && require("parameters")) {
  model <- stan_glm(Sepal.Length ~ Species, data = iris, refresh = 0, seed = 123)
  x <- model_parameters(model, ci = c(0.69, 0.89, 0.95))
  as.data.frame(parameters_table(x))
}
# }

Run the code above in your browser using DataLab