Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

formulavlm

Model Formulae and Term Names for VGLMs


Description

The methods function for formula to extract the formula from a fitted object, as well as a methods function to return the names of the terms in the formula.

Usage

## S3 method for class 'vlm'
formula(x, ...)
formulavlm(x, form.number = 1, ...)
term.names(model, ...)
term.namesvlm(model, form.number = 1, ...)

Arguments

x, model

A fitted model object.

form.number

Formula number, is 1 or 2. which correspond to the arguments formula and form2 respectively.

...

Same as formula.

Details

The formula methods function is based on formula.

Value

The formula methods function should return something similar to formula. The term.names methods function should return a character string with the terms in the formula; this includes any intercept (which is denoted by "(Intercept)" as the first element.)

Author(s)

Thomas W. Yee

See Also

Examples

# Example: this is based on a glm example
counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3, 1, 9); treatment <- gl(3, 3)
vglm.D93 <- vglm(counts ~ outcome + treatment, family = poissonff)
formula(vglm.D93)
pdata <- data.frame(counts, outcome, treatment)  # Better style
vglm.D93 <- vglm(counts ~ outcome + treatment, poissonff, data = pdata)
formula(vglm.D93)
term.names(vglm.D93)
responseName(vglm.D93)
has.intercept(vglm.D93)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.