Learn R Programming

VGAM (version 1.1-14)

depvar: Dependent (Response) Variable Extracted

Description

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

Usage

depvar(object, ...)

Arguments

Value

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

Details

By default this function is preferred to calling object@y, say.

See Also

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
weights(fit, type = "prior")  # Number of observations
# This is new:
fit@family@infos()$muxypw  # Proportion or count?
fit@family@infos()$Mux4vglmnet  # vglmnet needs counts?
fit@family@infos()$roundmux  # Product is integer-valued?
depvar(fit, muxypw = TRUE, roundmux = TRUE)  # Counts

Run the code above in your browser using DataLab