R/AICc.R

Defines functions AICc

Documented in AICc

AICc <- function(x)
{
# Really need to extend this to other common model types!

    if (class(x) == "lm") {
        p <- length(coef(x)) + 1
        Q <- length(fitted(x))
        AIC(x) - 2*p + 2*p*Q/(Q-p-1)
    } else if (class(x) == "nls") {
        p <- length(coef(x)) + 1
        Q <- length(fitted(x))
        AIC(x) - 2*p + 2*p*Q/(Q-p-1) + 2
    } else {
        cat("AICc is not implemented for objects of class",class(x),"\n")
#        NULL
    }
}
BruceKendall/PVA documentation built on Jan. 23, 2021, 2:56 a.m.