[R-sig-Geo] spgwr (georgia)

Roger Bivand Roger.Bivand at nhh.no
Sat Feb 9 17:24:32 CET 2013


YOU ARE STILL POSTING HTML! Please do follow the rules, which are quite 
clear.

The object you are interested in is res.adpt$SDF,

so in R (as is easy to establish by reading the introductory manual) you 
can say:

summary(res.adpt$SDF)

which tells you what it is, and what is inside it. Using str() fives more 
details on the contents.

You are plotting the local coefficients for the PctBlack covariate, the 
residuals are gwr.e. So:

res.adpt$SDF$ols.e <- residuals(lm(PctBach ~ TotPop90 + PctRural +
   PctEld + PctFB + PctPov + PctBlack, data=gSRDF))
spplot(res.adpt$SDF, c("ols.e", "gwr.e"))

plots both together on the same scale.

Roger


On Sat, 9 Feb 2013, Milan Sharma wrote:

> Dear all,
> #the following is gwr code for georgia data.
> #Can somebody point out what is plotted by this code?
> #I want to plot residual plot (gwr and ols both)?for this data.
> library(spgwr)
> data(georgia)
> g.adapt.gauss <- gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov + PctBlack, data=gSRDF, adapt=TRUE)
> res.adpt <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov + PctBlack, data=gSRDF, adapt=g.adapt.gauss)
> brks <- c(-0.25, 0, 0.01, 0.025, 0.075)
> cols <- grey(5:2/6)
> plot(res.adpt$SDF, col=cols[findInterval(res.adpt$SDF$PctBlack, brks, all.inside=TRUE)])
> #I want residual plot under GWR and OLS.
> 	[[alternative HTML version deleted]]
>
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list