[R] Source code for "extractAIC"?

Spencer Graves spencer.graves at pdf.com
Wed Jan 26 18:14:01 CET 2005


      In R 2.0.1 under Windows 2000: 

 > methods("extractAIC")
[1] extractAIC.aov*     extractAIC.coxph*   extractAIC.glm*   
[4] extractAIC.lm*      extractAIC.negbin*  extractAIC.survreg*

    Non-visible functions are asterisked
 > getAnywhere("extractAIC.lm")
A single object matching 'extractAIC.lm' was found
It was found in the following places
  registered S3 method for extractAIC from namespace stats
  namespace:stats
with value

function (fit, scale = 0, k = 2, ...)
{
    n <- length(fit$residuals)
    edf <- n - fit$df.residual
    RSS <- deviance.lm(fit)
    dev <- if (scale > 0)
        RSS/scale - n
    else n * log(RSS/n)
    c(edf, dev + k * edf)
}
<environment: namespace:stats>
 >
      hope this helps.  spencer graves

Yu Shao wrote:

> Dear R users:
>
> I am looking for the source code for the R function extractAIC. Type 
> the function name doesn't help:
>
> > extractAIC
> function (fit, scale, k = 2, ...)
> UseMethod("extractAIC")
> <environment: namespace:stats>
>
> And when I search it in the R source code, the best I can find is in 
> (R source root)/library/stats/R/add.R:
>
> extractAIC <- function(fit, scale, k = 2, ...) UseMethod("extractAIC")
>
>
> Could anyone point out to me where I can its source code? And my R 
> version is:
>
> > version
>          _
> platform sparc-sun-solaris2.9
> arch     sparc
> os       solaris2.9
> system   sparc, solaris2.9
> status
> major    1
> minor    9.0
> year     2004
> month    04
> day      12
> language R
>
>
> Thanks,
>




More information about the R-help mailing list