deviance.cca {vegan}R Documentation

Statistics Resembling Deviance and AIC for Constrained Ordination

Description

The functions extract statistics that resemble deviance and AIC from the result of constrained correspondence analysis cca or redundancy analysis rda. These functions are rarely needed directly, but they are called by step in automatic model building. Actually, cca and rda do not have AIC and these functions are certainly wrong.

Usage

## S3 method for class 'cca':
deviance(object, ...)
## S3 method for class 'cca':
extractAIC(fit, scale = 0, k = 2, ...)

Arguments

object the result of a constrained ordination (cca or rda).
fit fitted model from constrained ordination.
scale optional numeric specifying the scale parameter of the model, see scale in step.
k numeric specifying the "weight" of the equivalent degrees of freedom (=:edf) part in the AIC formula.
... further arguments.

Details

The functions find statistics that resemble deviance and AIC in constrained ordination. Actually, constrained ordination methods do not have log-Likelihood, which means that they cannot have AIC and deviance. Therefore you should not use these functions, and if you use them, you should not trust them. If you use these functions, it remains as your responsibility to check the adequacy of the result.

The deviance of cca is equal to Chi-square of the residual data matrix after fitting the constraints. The deviance of rda is defined as the residual sum of squares. The deviance of capscale is NA. Function extractAIC mimics extractAIC.lm in translating deviance to AIC.

There is little need to call these functions directly. However, they are called implicitly in step function used in automatic selection of constraining variables. You should check the resulting model with some other criteria, because the statistics used here are unfounded. In particular, the penalty k is not properly defined, and the default k = 2 is not justified theoretically. If you have only continuous covariates, the step function will base the model building on magnitude of eigenvalues, and the value of k only influences the stopping point (but variable with highest eigenvalues is not necessarily the most significant one in permutation tests in anova.cca). If you also have multi-class factors, the value of k will have a capricious effect in model building.

Value

The deviance functions return ``deviance'', and extractAIC returns effective degrees of freedom and ``AIC''.

Note

These functions are unfounded and untested and they should not be used directly or implicitly. Moreover, usual caveats in using step are very valid.

Author(s)

Jari Oksanen

References

I do not know any publication using these functions. However, their derivation is so obvious that somebody may have published them, or somebody probably will publish them some day.

See Also

cca, rda, anova.cca, step, extractAIC.

Examples

# The deviance of correspondence analysis equals Chi-square
data(dune)
data(dune.env)
chisq.test(dune)
deviance(cca(dune))
# Backward elimination from a complete model "dune ~ ."
ord <- cca(dune ~ ., dune.env)
ord
step(ord)
# Stepwise selection (forward from an empty model "dune ~ 1")
step(cca(dune ~ 1, dune.env), scope = formula(ord))
# ANOVA for the added variable
anova(cca(dune ~ Moisture, dune.env))
# ANOVA for the next candidate variable that was not added
anova(cca(dune ~ Condition(Moisture) + Management, dune.env), perm.max=1000)

[Package Contents]