Learn R Programming

VGAM (version 0.8-3)

fitted.vlm: Fitted Values of a VLM object

Description

Extractor function for the fitted values of a model object that inherits from a vector linear model (VLM), e.g., a model of class "vglm".

Usage

fitted.vlm(object, matrix.arg = TRUE, ...)

Arguments

object
a model object that inherits from a VLM.
matrix.arg
Logical. Return the answer as a matrix? If FALSE then it will be a vector.
...
Currently unused.

Value

  • The fitted values as returned by the inverse slot of the VGAM family function, evaluated at the final IRLS iteration.

Details

The ``fitted values'' usually corresponds to the mean response, however, because the VGAM package fits so many models, this sometimes refers to quantities such as quantiles. The mean may even not exist, e.g., for a Cauchy distribution.

References

Chambers, J. M. and T. J. Hastie (eds) (1992) Statistical Models in S. Wadsworth & Brooks/Cole.

See Also

fitted, predict.vglm, vglmff-class.

Examples

Run this code
# Categorical regression example 1
pneumo = transform(pneumo, let = log(exposure.time))
(fit = vglm(cbind(normal, mild, severe) ~ let, propodds, pneumo))
fitted(fit)

# LMS quantile regression example 2
fit = vgam(BMI ~ s(age, df = c(4,2)), 
           fam = lms.bcn(zero = 1), data = bminz, trace = TRUE)
head(predict(fit, type = "r"))  # The following three are equal
head(fitted(fit))
predict(fit, type = "r", newdata = head(bminz))

Run the code above in your browser using DataLab