R/extractAIC.cca.R

`extractAIC.cca` <-
    function (fit, scale = 0, k = 2, ...)
{
   n <- nobs(fit)
   edf <- 1
   if (!is.null(fit$CCA$rank)) edf <- edf + fit$CCA$qrank
   if (!is.null(fit$pCCA$QR)) edf <- edf + fit$pCCA$QR$rank
   #edf <- n - fit$CA$rank
   RSS <- deviance(fit)
   dev <- if(scale > 0)
       RSS/scale - n
   else n * log(RSS/n)
   c(edf, dev + k*edf)
}

Try the vegan package in your browser

Any scripts or data that you put into this service are public.

vegan documentation built on Sept. 11, 2024, 7:57 p.m.