
Last chance! 50% off unlimited learning
Sale ends in
Estimate or extract residual or model-based degrees of freedom from regression models.
get_df(x, ...)# S3 method for default
get_df(x, type = "residual", verbose = TRUE, ...)
A statistical model.
Currently not used.
Can be "residual"
, "model"
or "analytical"
. "residual"
tries to extract residual degrees of freedoms. If residual degrees of freedom
could not be extracted, returns analytical degrees of freedom, i.e. n-k
(number of observations minus number of parameters). "model"
returns
model-based degrees of freedom, i.e. the number of (estimated) parameters.
Toggle warnings.
# NOT RUN {
model <- lm(Sepal.Length ~ Petal.Length * Species, data = iris)
get_df(model) # same as df.residual(model)
get_df(model, type = "model") # same as attr(logLik(model), "df")
# }
Run the code above in your browser using DataLab