[R-sig-Geo] Predict

Smit, M.J. martijn.smit at vu.nl
Fri Mar 30 16:23:40 CEST 2012


Dear list members,

I want to do a scenario analysis: run a regression on the real data, then make some changes to that, and do a prediction based on the changed data. There is a predict command under sarlm for this, and it works. However, I have two questions.

- predict(model,newdata=NULL,weights) uses not only trend (the non-spatial terms) and signal (the spatial "smooth") but also noise (the residuals from the original regression). Is it true I can avoid this by explicitly inserting my old dataset into newdata=? The predictions differ, so something has happened.
- predict then gives me a list object, and I'm at a loss how to get the results from this. I've named the objects pred1 and pred2, and vainly tried pred1$trend and pred1[[1]], which gives the first observation from the $trend subvariable, but doesn't allow access to the other subvariables. Is there a way to get this into as.data.frame?

Best regards,
Martijn



More information about the R-sig-Geo mailing list