extractAIC {base} | R Documentation |
Computes the (generalized) Akaike Information Criterion for a fitted parametric model.
extractAIC (fit, scale, k = 2, ...)
extractAIC.lm (fit, scale = 0, k = 2, ...)
extractAIC.glm(fit, scale = 0, k = 2, ...)
extractAIC.aov(fit, scale = 0, k = 2, ...)
extractAIC.coxph (fit, scale, k = 2, ...)
extractAIC.negbin (fit, scale, k = 2, ...)
extractAIC.survreg(fit, scale, k = 2, ...)
fit |
fitted model, usually the result of a fitter like
|
scale |
optional numeric specifying the scale parameter of the
model, see |
k |
numeric specifying the “weight” of the
equivalent degrees of freedom ( |
... |
further arguments (currently unused in base R). |
The criterion used is
AIC = - 2\log L + k \times \mbox{edf},
where L
is the likelihood
and edf
the equivalent degrees of freedom (i.e., the number of
parameters for usual parametric models) of fit
.
For generalized linear models (i.e., for lm
,
aov
, and glm
), -2\log L
is
the deviance, as computed by deviance(fit)
, plus
a constant.
k = 2
corresponds to the traditional AIC, using k =
log(n)
provides the BIC (Bayes IC) instead.
For further information, particularly about scale
, see
step
.
A numeric vector of length 2, giving
edf |
the “equivalent degrees of freedom”
of the fitted model |
AIC |
the (generalized) Akaike Information Criterion for |
These functions are used in add1
,
drop1
and step
and that may be their
main use.
B. D. Ripley
Venables, W. N. and Ripley, B. D. (1997) Modern Applied Statistics with S-PLUS. New York: Springer (2nd ed).
deviance
, add1
, step
example(glm)
extractAIC(glm.D93)#>> 5 15.129