has.intercept: Has a Fitted VGLM Got an Intercept Term?

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Looks at the formula to see if it has an intercept term.

Usage

1
2
has.intercept(object, ...)
has.interceptvlm(object, form.number = 1, ...)

Arguments

object

A fitted model object.

form.number

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

...

Arguments that are might be passed from one function to another.

Details

This methods function is a simple way to determine whether a fitted vglm object etc. has an intercept term or not. It is not entirely foolproof because one might suppress the intercept from the formula and then add in a variable in the formula that has a constant value.

Value

Returns a single logical.

Author(s)

Thomas W. Yee

See Also

formulavlm, termsvlm.

Examples

1
2
3
4
5
6
7
8
9
# 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)
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)

Example output

Loading required package: stats4
Loading required package: splines
counts ~ outcome + treatment
[1] "(Intercept)" "outcome"     "treatment"  
[1] "counts"
[1] TRUE

VGAM documentation built on Jan. 16, 2021, 5:21 p.m.