Description Usage Arguments Details Value Warning Note See Also Examples

Compute all the single terms in the `scope`

argument that
can be
added to or
dropped from the model, fit those models and compute a
table of the changes in fit.

1 2 3 4 |

`object` |
a fitted |

`scope, k` |
See |

`test` |
Same as |

`...` |
further arguments passed to or from other methods. |

These functions are a direct adaptation of
`add1.glm`

and
`drop1.glm`

for `vglm-class`

objects.
For `drop1`

methods, a missing `scope`

is taken to be all
terms in the model. The hierarchy is respected when considering terms
to be added or dropped: all main effects contained in a second-order
interaction must remain, and so on.
In a `scope`

formula `.`

means ‘what is already there’.

Compared to
`add1.glm`

and
`drop1.glm`

these functions are simpler, e.g., there is no
*Cp*, F and Rao (score) tests,
`x`

and `scale`

arguments.
Most models do not have a deviance, however twice the
log-likelihood differences are used to test the significance
of terms.

The default output table gives AIC, defined as minus twice log
likelihood plus *2p* where *p* is the rank of the model (the
number of effective parameters). This is only defined up to an
additive constant (like log-likelihoods).

An object of class `"anova"`

summarizing the differences in fit
between the models.

In general, the same warnings in
`add1.glm`

and
`drop1.glm`

apply here.
Furthermore, these functions have not been rigorously
tested for all models, so treat the results cautiously and
please report any bugs.

Care is needed to check that the constraint matrices of added
terms are correct.
Also, if `object`

is of the form
`vglm(..., constraints = list(x1 = cm1, x2 = cm2))`

then `add1.vglm`

may fail because the
`constraints`

argument needs to have the constaint
matrices for *all* terms.

Most VGAM family functions do not compute a deviance, but
instead the likelihood function is evaluated at the MLE.
Hence a column name `"Deviance"`

only appears for a few
models; and almost always there is a column labelled
`"logLik"`

.

`step4vglm`

,
`vglm`

,
`extractAIC.vglm`

,
`trim.constraints`

,
`anova.vglm`

,
`backPain2`

,
`update`

.

1 2 3 4 5 6 7 8 |

```
Loading required package: stats4
Loading required package: splines
x2 x3 x4 pain
1:39 1:21 1:64 worse : 5
2:62 2:52 2:37 same :14
3:28 slight.improvement :18
moderate.improvement:20
marked.improvement :28
complete.relief :16
(Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4 (Intercept):5
5.41024201 3.83654247 2.83868976 1.85978224 0.09680069
x22 x32 x33 x42
-1.46570383 -1.03178249 -1.10212111 -0.92407971
Single term additions
Model:
pain ~ x2 + x3 + x4
Df Deviance AIC LRT Pr(>Chi)
<none> 316.40 334.40
x2:x3 2 313.24 335.24 3.16009 0.2060
x2:x4 1 316.28 336.28 0.12455 0.7242
x3:x4 2 316.19 338.19 0.21529 0.8979
Single term deletions
Model:
pain ~ x2 + x3 + x4
Df Deviance AIC LRT Pr(>Chi)
<none> 316.40 334.40
x2 1 330.48 346.48 14.0793 0.0001753 ***
x3 2 321.53 335.53 5.1257 0.0770836 .
x4 1 322.58 338.58 6.1761 0.0129486 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Single term deletions
Model:
pain ~ x2 * x3 * x4
Df Deviance AIC
<none> 311.15 343.15
x2:x3:x4 2 312.44 340.44
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.