[STATSGRASS] problem on trend surface calculation

Pierluigi De Rosa sisma66 at tiscali.it
Fri Mar 23 15:16:10 EDT 2007


Ok  It works!!

Thanks Roger :)


Alle 19:32, venerdì 23 marzo 2007, Roger Bivand ha scritto:
> On Fri, 23 Mar 2007, Pierluigi De Rosa wrote:
> > Dear all,
> >
> > I wont to try to define a trend surface, now I'm just tring with meude
> > dataset to learn it but I have an error. I do this:
> >
> >  gs<-gstat(id="zinc.uk",formula=zinc~x+y,location=meuse,degree=2)
>
> Try:
> > library(gstat)
>
> Loading required package: sp
>
> > data(meuse)
> > coordinates(meuse) <- c("x", "y")
> > data(meuse.grid)
> > coordinates(meuse.grid) <- c("x", "y")
> > gridded(meuse.grid) <- TRUE
> > gs <- gstat(id="zinc.uk", formula=zinc ~ 1, data=meuse, degree=2)
> > pgs <- predict.gstat(gs, newdata=meuse.grid)
>
> [ordinary or weighted least squares prediction]
>
> degree= and the coordinates x+y given explicity will lead to collinearity.
> It also seems that you cannot mix a trend surface and extra predictors.
>
> Roger
>
> > then
> >  pgs=predict.gstat(gs,newdata=meuse.grid)
> >
> > but I have this error:
> > polynomial degree only works when no other predictors are given
> >
> > It seems everythink  fine but I don't know where I wrong...
> > Can anyone help me??
> > Thaks
> > Pierluigi

-- 

Pierluigi De Rosa

Department of Enviromental & Civil engineering 
Faculty of Engineering 
Perugia (Italy)




More information about the grass-stats mailing list