Learn R Programming

VGAM (version 0.9-0)

fittedvlm: 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

fittedvlm(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 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.

Note that the fitted value is output from the @linkinv slot of the VGAM family function, where the eta argument is the $n \times M$ matrix of linear predictors.

References

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

See Also

fitted, predictvglm, 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 = bmi.nz, trace = TRUE)
head(predict(fit, type = "response"))  # The following three are equal
head(fitted(fit))
predict(fit, type = "response", newdata = head(bmi.nz))

Run the code above in your browser using DataLab