Hi all, I am interested in obtaining R code related to geographically weighted regression. In particular, I am interested in building geographically weighted Poisson GLMs. The model will contain categorical and continuous x independent variables, with interaction effects between categorical and continuous variables. Anybody have anything I can look at? thanks, Mark. -- _____________________________________ Mark Conrad, Ph.D. Research Associate Resource Planning and Analysis University of Guelph, Ontario, Canada m.conrad@exec.uoguelph.ca [[alternative HTML version deleted]]
On Fri, 24 Sep 2004, Mark Conrad wrote:> Hi all, > I am interested in obtaining R code related to geographically weighted > regression. > > In particular, I am interested in building geographically weighted > Poisson GLMs. The model will contain categorical and continuous x > independent variables, with interaction effects between categorical and > continuous variables. > > Anybody have anything I can look at?Look at draft packages sp and spgwr on: http://sourceforge.net/projects/r-spatial/ where spgwr contains gwr functions for linear models. These would need to be modified to suit glm, but as glm.fit accepts weights, this ought to be feasible. You need sp too, because spgwr depends on the S4 spatial classes defined there. These are packages in an unfinished state, but progress on sp (and back-fitting analysis packages onto sp) is (we hope) going to happen at a workshop in Lancaster, UK, 2-5 November (where interested people can join in online). YMMV with GWR, by the way. Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no
Mark Conrad wrote:>Hi all, >I am interested in obtaining R code related to geographically weighted >regression. > >In particular, I am interested in building geographically weighted >Poisson GLMs. The model will contain categorical and continuous x >independent variables, with interaction effects between categorical and >continuous variables. > >Anybody have anything I can look at? > > >thanks, >Mark. > > >Have a look at CRAN package geoRglm Kjetil -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra
> I am interested in obtaining R code related to geographically weighted > regression.- package mgcv's gam function allows you to fit `variable parameter models' which include geographically weighted regression as a special case. For example if you think `income' depends on `age', but expect this to vary with space (x,z), then you might fit a model something like: income = const + \beta(x,z)*age + error where \beta(x,z) is the geographically varying coefficient. `gam' could be used to fit this with a call something like: gam(income~age + s(x,z,by=age)) (the Poisson case is handled by using family=poisson, in the usual way). The degree of smoothness of the variation in \beta will be chosen automatically from the data (although you can over-ride this if you like). If you have more than a few thousand data, then you might need to use the efficiency tricks covered in ?gam. Simon _____________________________________________________________________> Simon Wood simon at stats.gla.ac.uk www.stats.gla.ac.uk/~simon/ >> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ >>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814