Skip to content
Prev 17137 / 29559 Next

Poisson regression spatial residual plot

Dear Milan, 

El mar, 08-01-2013 a las 06:48 -0800, Milan Sharma escribi?:
TCE refers to a number of sites and they are just another layer on the
plot but has nothing to do on the GLM.
The R code in lat2.R (available from www.asdar-book.org) that need to
look at are:

#Fit GLM
nyGLMp <- glm(Cases~PEXPOSURE+PCTAGE65P+PCTOWNHOME+offset(log(POP8)),
data=NY8, family="poisson")

#Get residuals
NY8$lmpresid <- residuals(nyGLMp, type="deviance")

#Display residuals; REMOVE sp.layout=list(TCEpts)
spplot(NY8, "lmpresid", sp.layout=list(TCEpts),
col.regions=grey.colors(9, 0.95, 0.55, 2.2), at=seq(-3,5,length.out=9))


You will need to change the names of the variables in the model but you
should be able to plot the residuals by customizing these tree lines of
code.

Best,

Virgilio