anova.gllvm: Analysis Of Deviance for gllvm

View source: R/anova.gllvm.R

anova.gllvmR Documentation

Analysis Of Deviance for gllvm

Description

Computes an analysis of deviance table for two generalized linear latent variable model fits.

Usage

## S3 method for class '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 is not designed for testing models which have degrees of freedom difference larger than 20. For such models the P-value should be treated as very approximate.

Author(s)

Jenni Niku

Examples


## 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, family = poisson())
fit2 <- gllvm(y, X, TR, formula = ~ Bare.ground + Shrub.cover +
             (Bare.ground + Shrub.cover) : Webers.length, family = poisson())
# Test if the model with fourth corner interaction terms is significantly
# better using likelihood-ratio test:
anova(fit1, fit2)


gllvm documentation built on Sept. 18, 2023, 5:22 p.m.