n_parameters | R Documentation |
Returns the number of parameters (coefficients) of a model.
n_parameters(x, ...)
## Default S3 method:
n_parameters(x, remove_nonestimable = FALSE, ...)
## S3 method for class 'merMod'
n_parameters(
x,
effects = c("fixed", "random"),
remove_nonestimable = FALSE,
...
)
## S3 method for class 'glmmTMB'
n_parameters(
x,
effects = c("fixed", "random"),
component = c("all", "conditional", "zi", "zero_inflated"),
remove_nonestimable = FALSE,
...
)
## S3 method for class 'zeroinfl'
n_parameters(
x,
component = c("all", "conditional", "zi", "zero_inflated"),
remove_nonestimable = FALSE,
...
)
## S3 method for class 'gam'
n_parameters(
x,
component = c("all", "conditional", "smooth_terms"),
remove_nonestimable = FALSE,
...
)
## S3 method for class 'brmsfit'
n_parameters(x, effects = "all", component = "all", ...)
x |
A statistical model. |
... |
Arguments passed to or from other methods. |
remove_nonestimable |
Logical, if |
effects |
Should variables for fixed effects ( |
component |
Should total number of parameters, number parameters for the conditional model, the zero-inflated part of the model, the dispersion term or the instrumental variables be returned? Applies to models with zero-inflated and/or dispersion formula, or to models with instrumental variable (so called fixed-effects regressions). May be abbreviated. |
The number of parameters in the model.
This function returns the number of parameters for the fixed effects by
default, as returned by find_parameters(x, effects = "fixed")
. It does not
include all estimated model parameters, i.e. auxiliary parameters like
sigma or dispersion are not counted. To get the number of all estimated
parameters, use get_df(x, type = "model")
.
data(iris)
model <- lm(Sepal.Length ~ Sepal.Width * Species, data = iris)
n_parameters(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.