Learn R Programming

VGAM (version 0.8-7)

df.residual: Residual Degrees-of-Freedom

Description

Returns the residual degrees-of-freedom extracted from a fitted VGLM object.

Usage

df.residual_vlm(object, type = c("vlm", "lm"), ...)

Arguments

object
an object for which the degrees-of-freedom are desired, e.g., a vglm object.
type
the type of residual degrees-of-freedom wanted. In some applications the 'usual' LM-type value is requested. The default is the first choice.
...
additional optional arguments.

Value

  • The value of the residual degrees-of-freedom extracted from the object.

Details

When a VGLM is fitted, a large ordinary least squares (OLS) fit is performed. The number of rows is $M$ times the 'ordinary' number of rows of the LM-type model. Here, $M$ is the number of linear/additive predictors. The formula for the VLM-type residual degrees-of-freedom is $nM - p^{*}$ where $p^{*}$ is the number of columns of the 'big' VLM matrix. The formula for the LM-type residual degrees-of-freedom is $n - p$ where $p$ is the number of columns of the 'ordinary' LM matrix.

See Also

vglm, deviance, lm.

Examples

Run this code
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal,mild,severe) ~ let, propodds, pneumo))
model.matrix(fit)

df.residual(fit, type = "vlm")
nobs(fit, type = "vlm")
nvar(fit, type = "vlm")

df.residual(fit, type = "lm") # This is more usual to some people
nobs(fit, type = "lm")
nvar(fit, type = "lm")

Run the code above in your browser using DataLab