Learn R Programming

VGAM (version 0.7-1)

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 = TRUE, ...)

Arguments

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. It 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
data(pneumo)
pneumo = transform(pneumo, let=log(exposure.time))
fit = vglm(cbind(normal, mild, severe) ~ let,
           cumulative(parallel=TRUE, reverse=TRUE), pneumo)
fit
fitted(fit)


# Nonparametric logistic regression example 2
data(hunua) 
fit = vgam(agaaus ~ s(altitude), binomialff, hunua)
fitted(fit, matrix=FALSE)[1:3]


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

Run the code above in your browser using DataLab