[R-sig-Geo] Bug in surf.ls (spatial package)?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 10 16:19:56 CEST 2007


On Tue, 10 Apr 2007, ONKELINX, Thierry wrote:

> Dear listers,
>
> When fitting a trend surface I noticed that surf.ls() generates other
> values for the model parameters than an ordinary lm(). Since both fit,
> in my opinion, the same model to the same data. So I would suppect that
> both would generate the same parameter values. Or am I missing
> something?

You are missing a great deal, including the posting guide.  Who said the 
...$beta were the parameters of the least-squares surface in the raw 
coordinates?  Certainly not the help page, and this is explained in the 
book this software supports which the posting guide asked you to consult.


> Some sample code.
>
> library("gstat")
> data(jura)
> library("spatial")
> surface.surf <- surf.ls(np = 1, x = prediction.dat$Xloc, y =
> prediction.dat$Yloc, z = prediction.dat$Ni)
> surface.lm <- lm(Ni ~ Xloc + Yloc, data = prediction.dat)
> surface.surf$beta
>
> [1] 18.828803  4.823595 -2.375896
>
> surface.lm$coef
>
> (Intercept)        Xloc        Yloc
> 15.5140337   2.2466673  -0.9299007
>
> Thanks,
>
> Thierry
>
> ------------------------------------------------------------------------
> ----
> ir. Thierry Onkelinx
> Instituut voor natuur- en bosonderzoek / Reseach Institute for Nature
> and Forest
> Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
> methodology and quality assurance
> Gaverstraat 4
> 9500 Geraardsbergen
> Belgium
> tel. + 32 54/436 185
> Thierry.Onkelinx at inbo.be
> www.inbo.be
>
> Do not put your faith in what statistics say until you have carefully
> considered what they do not say.  ~William W. Watt
> A statistical analysis, properly conducted, is a delicate dissection of
> uncertainties, a surgery of suppositions. ~M.J.Moroney
>
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-sig-Geo mailing list