

   extractAIC {base}                            R Documentation

   EExxttrraacctt AAIICC ffrroomm aa FFiitttteedd MMooddeell

   DDeessccrriippttiioonn::

        Computes the (generalized) Akaike Information Criterion
        for a fitted parametric model.

   UUssaaggee::

        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, ...)

   AArrgguummeennttss::

        fit: fitted model, usually the result of a fitter like
             `lm'.

      scale: optional numeric specifying the scale parameter of
             the model, see `scale' in `step'.

          k: numeric specifying the ``weight'' of the equiva-
             lent degrees of freedom (=:`edf') part in the AIC
             formula.

        ...: further arguments (currently unused in base R).

   DDeettaaiillss::

        The criterion used is

                      AIC = - 2*log L +  k * 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'), -2log L is the deviance, as computed by
        `deviance(fit)'.

        `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'.

   VVaalluuee::

        A numeric vector of length 2, giving

        edf: the ``equivalent degrees of freedom'' of the fit-
             ted model `fit'.

        AIC: the (generalized) Akaike Information Criterion for
             `fit'.

   NNoottee::

        These functions are used in `add1', `drop1' and `step'
        and that may be their main use.

   AAuutthhoorr((ss))::

        B. D. Ripley

   RReeffeerreenncceess::

        Venables, W. N. and B. D. Ripley (1997).  Modern
        Applied Statistics with S-PLUS.  New York: Springer
        (2nd ed).

   SSeeee AAllssoo::

        `deviance', `add1', `step'

   EExxaammpplleess::

        example(glm)
        extractAIC(glm.D93)#>>  5  15.129

