6

I have a SpatialPolygonsDataFrame object in R with about 3000 polygons and associated data. I have columns of expected and observed cases. For the moment, I don't have any covariates.

I'd like to perform spatial smoothing. I have used functions such as empbaysmooth(), lognormalEB(), EBlocal() from the DCluster package but have not been happy with the results.

Therefore I would like to do a conditional autoregression using spautolm() - I would like to model a Poisson model of observed versus expected with neighbour weighting.

I cannot figure out how to specify such a model. How do I specify merely a Poisson model for the spautolm command with no covariates?

Or am I barking up the wrong tree altogether?

  • All models have an implicit (constant) covariate whose name is "1", which may be mentioned explicitly as in y ~ 1. An example appears near the bottom of p. 12 at cran.r-project.org/web/packages/spdep/vignettes/sids.pdf. Is this what you mean, or have I misinterpreted? – whuber Jul 3 '13 at 14:10
  • Honestly...I'm not sure. But I hadn't seen the link before and it looks interesting. Thanks I'll have a good read of it and come back here later – Geoconfused Jul 3 '13 at 16:11
  • hi @whuber, i was reading that file - a nice find. I think my problem is that I'm rather new to R and trying to do fancy stuff straight away and I'm not so used to the r notation for formula's. Taking a cue from your post, I did some searching and found this questions & answer to be very helpful: link Copying the example from your link I have used y~1 with spautolm to do CAR on my data. I then used fitted.values(y) to get smoothed values - is that correct? – Geoconfused Jul 3 '13 at 19:49
  • You might find chapter 11 of An Introduction to R to be helpful at this stage of your learning about R. – whuber Jul 3 '13 at 20:11
  • 2
    @whuber would you mind to add your comment as an answer to get this question off the unanswered list. – underdark Apr 26 '14 at 22:25
1

All models have an implicit (constant) covariate whose name is "1", which may be mentioned explicitly, as in y ~ 1. An example appears near the bottom of p. 12 at http://cran.r-project.org/web/packages/spdep/vignettes/sids.pdf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.