Learn R Programming

gllvm (version 1.0)

anova.gllvm: Analysis Of Deviance for gllvm

Description

Compute an analysis of deviance table for two or more generalized linear latent variable model fits.

Usage

# S3 method for gllvm
anova(object, ...)

Arguments

object

an object of class 'gllvm'.

...

one or more objects of class 'gllvm'

Details

Computes likelihood-ratio test for two or more gllvm models. Test results makes sense only for nested models. Notice also that this test was not designed for tests which have df difference larger than 20, so for those tests the P-value should be treated as very approximate.

Examples

Run this code
# NOT RUN {
## Load a dataset from the mvabund package
data(antTraits)
y <- antTraits$abund
X <- antTraits$env
TR <- antTraits$traits
# Fit gllvm model
fit1 <- gllvm(y, X, TR, formula = ~ Bare.ground+Shrub.cover
             +Webers.length, family = "poisson")
fit2 <- gllvm(y, X, TR, formula = ~ (Bare.ground+Shrub.cover)*
             Webers.length, family = "poisson")
# Let's test the need for fourth corner interaction terms using likelihood-ratio test:
anova(fit1, fit2)

# }

Run the code above in your browser using DataLab