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

# 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 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

Jenni Niku

Examples

# \donttest{
## 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)
#> Model  1 :  ~ Bare.ground + Shrub.cover 
#> Model  2 :  ~ Bare.ground + Shrub.cover + (Bare.ground + Shrub.cover):Webers.length 
#>   Resid.Df        D Df.diff    P.value
#> 1     1106  0.00000       0           
#> 2     1104 13.07395       2 0.00144886
# }