[R] extractAIC using surf.ls

From: Yan Wong <h.y.wong_at_leeds.ac.uk>
Date: Mon 07 Aug 2006 - 04:10:52 EST

Although the 'spatial' documentation doesn't mention that extractAIC works, it does seem to give an output.
I may have misunderstood, but shouldn't the following give at least the same d.f.?

> library(spatial)
> data(topo, package="MASS")
> extractAIC(surf.ls(2, topo))

[1] 46.0000 437.5059
> extractAIC(lm(z ~ x+I(x^2)+y+I(y^2)+x:y, topo))
[1] 6.0000 357.5059

# and if the AIC values differ, shouldn't they do so by an additive constant?

> (extractAIC(surf.ls(2, topo))-extractAIC(lm(z ~ x+I(x^2)+y+I(y^2)
+x:y, topo)))[2]
[1] 80
> (extractAIC(surf.ls(1, topo))-extractAIC(lm(z ~ x+y, topo)))[2]
[1] 92

# Using R 2.3.1 (OS X), spatial version 7.2-27.1



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon Aug 07 09:26:25 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 10 Aug 2006 - 18:23:20 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.