[R] extractAIC using surf.ls

Yan Wong h.y.wong at leeds.ac.uk
Sun Aug 6 20:10:52 CEST 2006


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

Thanks

Yan



More information about the R-help mailing list