Estimate or extract residual or model-based degrees of freedom
from regression models.
Usage
get_df(x, ...)
# S3 method for default
get_df(x, type = "residual", verbose = TRUE, ...)
Arguments
x
A statistical model.
...
Currently not used.
type
Can be "residual" or "model". "residual"
tries to extract residual degrees of freedoms. If residual degrees of freedom
could not be extracted, returns n-k (number of observations minus
number of parameters). "model" returns model-based degrees of freedom,
i.e. the number of (estimated) parameters.
# 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")# }