Learn R Programming

VGAM (version 0.9-1)

depvar: Response variable extracted

Description

A generic function that extracts the response/dependent variable from objects.

Usage

depvar(object, ...)

Arguments

object
An object that has some response/dependent variable.
...
Other arguments fed into the specific methods function of the model.

Value

  • The response/dependent variable, usually as a matrix or vector.

Details

This function is preferred to calling fit@y, say.

See Also

model.matrix, vglm.

Examples

Run this code
pneumo <- transform(pneumo, let = log(exposure.time))
(fit <- vglm(cbind(normal, mild, severe) ~ let, propodds, pneumo))
fit@y       # Sample proportions (not recommended)
depvar(fit) # Better than using fit@y; dependent variable (response)
weights(fit, type = "prior") # Number of observations

Run the code above in your browser using DataLab