Learn R Programming

parameters (version 0.10.1)

print.parameters_model: Print model parameters

Description

A print()-method for objects from model_parameters().

Usage

# S3 method for parameters_model
print(
  x,
  pretty_names = TRUE,
  split_components = TRUE,
  select = NULL,
  digits = 2,
  ci_digits = 2,
  p_digits = 3,
  show_sigma = FALSE,
  show_formula = FALSE,
  ...
)

Arguments

x

An object returned by model_parameters().

pretty_names

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

split_components

Logical, if TRUE (default), For models with multiple components (zero-inflation, smooth terms, ...), each component is printed in a separate table. If FALSE, model parameters are printed in a single table and a Component column is added to the output.

select

Character vector (or numeric index) of column names that should be printed. If NULL (default), all columns are printed. The shortcut select = "minimal" prints coefficient, confidence intervals and p-values, while select = "short" prints coefficient, standard errors and p-values.

digits

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

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.

show_sigma

Logical, if TRUE, adds information about the residual standard deviation.

show_formula

Logical, if TRUE, adds the model formula to the output.

...

Arguments passed to or from other methods.

Value

Invisibly returns the original input object.

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 or ggeffects. 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().

Labeling the Degrees of Freedom

Throughout the parameters package, we decided to label the residual degrees of freedom df_error. The reason for this is that these degrees of freedom not always refer to the residuals. For certain models, they refer to the estimate error - in a linear model these are the same, but in - for instance - any mixed effects model, this isn't strictly true. Hence, we think that df_error is the most generic label for these degrees of freedom.

See Also

There is a dedicated method to use inside rmarkdown files, print_md().

Examples

Run this code
# NOT RUN {
library(parameters)
if (require("glmmTMB")) {
  model <- glmmTMB(
    count ~ spp + mined + (1 | site),
    ziformula = ~mined,
    family = poisson(),
    data = Salamanders
  )
  mp <- model_parameters(model)

  print(mp, pretty_names = FALSE)

  print(mp, split_components = FALSE)

  print(mp, select = c("Parameter", "Coefficient", "SE"))

  print(mp, select = "minimal")
}
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab