Skip to contents

Anova function for comparing different GALAMMs fitted on the same data.

Usage

# S3 method for class 'galamm'
anova(object, ...)

Arguments

object

An object of class galamm returned from galamm.

...

Other fitted models of class galamm. Currently, if no models are provided in this argument, no table will be returned.

Value

A table with model comparison metric.

References

batesFittingLinearMixedEffects2015galamm

See also

summary.galamm() for the summary method and anova() for the generic function.

Other summary functions: plot.galamm(), plot_smooth.galamm(), print.galamm(), print.summary.galamm(), summary.galamm()

Author

Some of the source code for this function is adapted from lme4:::anova.merMod, with authors Douglas M. Bates, Martin Maechler, Ben Bolker, and Steve Walker.

Examples

# Poisson GLMM
count_mod <- galamm(
  formula = y ~ lbas * treat + lage + v4 + (1 | subj),
  data = epilep, family = poisson
)

# Model without interaction
count_mod0 <- galamm(
  formula = y ~ lbas + treat + lage + v4 + (1 | subj),
  data = epilep, family = poisson
)

# Model comparison
anova(count_mod, count_mod0)
#> Data: epilep
#> Models:
#> count_mod0: y ~ lbas + treat + lage + v4 + (1 | subj)
#> count_mod: y ~ lbas * treat + lage + v4 + (1 | subj)
#>            npar    AIC    BIC  logLik deviance  Chisq Df Pr(>Chisq)  
#> count_mod0    6 1345.4 1366.2 -666.72   407.01                       
#> count_mod     7 1344.7 1369.0 -665.36   407.01 2.7208  1    0.09905 .
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1