Dear Team,

Help me out here. I have managed to run a Geographically Weighted
Regression in R with all results coming up. The problem now comes in
mapping the parameter estimates and the t values that are significant in
the model. My data is like this:
 Stn Area X Y Easting Northing Distance Depth Chambo Depth99 Chambo99 Mdepth
CP07 CP99  1 B 34.97806 -14.0963 713560.7 8440731 4746 51 2.1 52.5 0 51.75 1
0  3 B 35.19347 -14.2031 736716.3 8428704 5133 31 1.5 33.5 0 32.25 1 0  6 A
35.17778 -14.2776 734945.1 8420466 4661 38.5 18 40 150 39.25 1 1  7 A
35.14653 -14.2933 731556.3 8418761 971 19 136 31.5 11.4 25.25 1 1  8 B
35.19347 -14.2031 736716.3 8428704 3526 26.5 0.08 24.5 14 25.5 1 1  9 B
35.17694 -14.2028 734931.9 8428752 4353 41.5 0.3 43.5 0.1 42.5 1 0  10 A
35.26472 -14.33 744272 8414582 1663 20.5 15.2 22.5 0 21.5 1 0
just the head of it and a logistic GWR is run for CP07 against Depth and
Distance. It is coming from three different areas A, B and C. The
coordinates in this case are from within these areas and the boundary
points which are more than the data points above and presented as part of
the head as below:

 X Y Area  35.1037 -14.2757 A  35.2324 -14.2591 A  35.2329 -14.26 A  35.2336
-14.2608 A  35.2335 -14.2616 A  35.2337 -14.2622 A  35.2346 -14.2627 A
35.2355 -14.2625 A  35.2367 -14.2631 A

Below is part of the cord that is failing to map the results. The best that
is being produced are the same points with different colours instead of
being a shade of colours, filling the inside of the map available. A
shapefile of the map to be used for mapping the results is not even coming
up together with the results, just the points in an ordinary square with
Longitude, Latitude labels and no legend for the quartiles.

## MAP RESULTS
# parameters plots
plotvar <- Depth.coefs
nclr    <-5
plotclr <-brewer.pal(nclr,"YlOrBr")
class  <-classIntervals(plotvar, nclr, style= "quantile")  ####
classnterval??? not loading
colour.catg<-findInterval(Depth.coefs1,
              c(-0.0240,-0.0181,-0.0122,-0.0063,-0.0004),all.inside=T)
pallete  <-brewer.pal(5,'Set1')  ## Other shades: RdGy, BrBG, OrRd, PuBuGn,
...
depth.colour<-pallete[colour.catg]
par(mfrow=c(1,1),pty="s")
plot(cord,col=depth.colour,map=smap, pch=17,main="",
     xlab="Longitude",ylab="Latitude")

## t values plot ## not showing different colours for significance
Depth_t.coefs <- gwr.model0$SDF$Depth_t
round(4)
summary(Depth_t.coefs)
fivenum(Depth_t.coefs,4)
min(Depth_t.coefs)
max(Depth_t.coefs)
nclr <- 5
colour.catg<-findInterval(Depth,c(-4.0,-3.2,-2.4,-1.612,-0.816,0.02),all.inside=T)
pallete<-brewer.pal(5,"Reds")  ## Other shades: RdGy, OrRd, Set1, PuBuGn,
...
depth.colour<-pallete[colour.catg]
par(mfrow=c(1,1),pty="s")
plot(cord,col=depth.colour,pch=17,smap,main="",
     xlab="Longitude",ylab="Latitude")


Thank you,

Patrick

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to