In [30]:
##==============================================================
##                            ëÊ5èÕ
##==============================================================
 library(spdep)
library(maptools)


Checking rgeos availability: TRUE

Attaching package: ‘maptools’

The following object is masked from ‘package:sp’:

    nowrapSpatialLines


In [2]:
##==============================================================
 data(oldcol)
 names(COL.OLD)


Out[2]:
  1. 'AREA_PL'
  2. 'PERIMETER'
  3. 'COLUMBUS.'
  4. 'COLUMBUS.I'
  5. 'POLYID'
  6. 'NEIG'
  7. 'HOVAL'
  8. 'INC'
  9. 'CRIME'
  10. 'OPEN'
  11. 'PLUMB'
  12. 'DISCBD'
  13. 'X'
  14. 'Y'
  15. 'AREA_SS'
  16. 'NSA'
  17. 'NSB'
  18. 'EW'
  19. 'CP'
  20. 'THOUS'
  21. 'NEIGNO'
  22. 'PERIM'

In [4]:
##==============================================================
 COL.ols <- lm(CRIME ~ INC + HOVAL, data = COL.OLD)
 summary(COL.ols)


Out[4]:
Call:
lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)

Residuals:
    Min      1Q  Median      3Q     Max 
-34.418  -6.388  -1.580   9.052  28.649 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  68.6190     4.7355  14.490  < 2e-16 ***
INC          -1.5973     0.3341  -4.780 1.83e-05 ***
HOVAL        -0.2739     0.1032  -2.654   0.0109 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 11.43 on 46 degrees of freedom
Multiple R-squared:  0.5524,	Adjusted R-squared:  0.5329 
F-statistic: 28.39 on 2 and 46 DF,  p-value: 9.341e-09

In [5]:
##==============================================================
 W <- nb2listw(COL.nb, style = "W")
 lm.LMtests(COL.ols, listw = W, test = c("LMlag", "LMerr"))


Out[5]:
	Lagrange multiplier diagnostics for spatial dependence

data:  
model: lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)
weights: W

LMlag = 9.3637, df = 1, p-value = 0.002213


	Lagrange multiplier diagnostics for spatial dependence

data:  
model: lm(formula = CRIME ~ INC + HOVAL, data = COL.OLD)
weights: W

LMerr = 5.7231, df = 1, p-value = 0.01674

In [6]:
##==============================================================
 COL.ar <- lagsarlm(CRIME ~ 1, data = COL.OLD, listw = W, 
     method = "eigen")
 class(COL.ar)


Out[6]:
'sarlm'

In [7]:
##==============================================================
 summary(COL.ar)


Out[7]:
Call:lagsarlm(formula = CRIME ~ 1, data = COL.OLD, listw = W, method = "eigen")

Residuals:
     Min       1Q   Median       3Q      Max 
-44.7934  -6.8060  -1.7976   9.5373  24.6941 

Type: lag 
Coefficients: (asymptotic standard errors) 
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  11.6633     4.2948  2.7157 0.006614

Rho: 0.66981, LR test value: 21.748, p-value: 3.1088e-06
Asymptotic standard error: 0.11076
    z-value: 6.0475, p-value: 1.4711e-09
Wald statistic: 36.572, p-value: 1.4711e-09

Log likelihood: -196.1978 for lag model
ML residual variance (sigma squared): 153.84, (sigma: 12.403)
Number of observations: 49 
Number of parameters estimated: 3 
AIC: 398.4, (AIC for lm: 418.14)
LM test for residual autocorrelation
test value: 0.25176, p-value: 0.61584

In [8]:
##==============================================================
 op <- par(no.readonly = TRUE)
 par(mfrow = c(2, 1))
 plot(COL.OLD$CRIME, type = "l")
 lines(fitted(COL.ar), lty = 2)
 legend("topright", c("Actual", "Predicted"), lty = 1:2, 
     bty = "n")
 title(main = "Spatial AR Model   Actual vs. Predicted")
 plot(residuals(COL.ar), type = "l", xlab = "", ylab = "", 
     main = "Residuals")
 par(op)


Error in file(con, "rb"):  コネクションを開くことができません 

In [9]:
##==============================================================
 COL.sar <- lagsarlm(CRIME ~ INC + HOVAL, data = COL.OLD, 
     listw = W, method = "eigen")
 class(COL.sar)


Out[9]:
'sarlm'

In [10]:
##==============================================================
 summary(COL.sar)


Out[10]:
Call:lagsarlm(formula = CRIME ~ INC + HOVAL, data = COL.OLD, listw = W, 
    method = "eigen")

Residuals:
      Min        1Q    Median        3Q       Max 
-37.68585  -5.35636   0.05421   6.02013  23.20555 

Type: lag 
Coefficients: (asymptotic standard errors) 
             Estimate Std. Error z value  Pr(>|z|)
(Intercept) 45.079251   7.177347  6.2808 3.369e-10
INC         -1.031616   0.305143 -3.3808 0.0007229
HOVAL       -0.265926   0.088499 -3.0049 0.0026570

Rho: 0.43102, LR test value: 9.9736, p-value: 0.001588
Asymptotic standard error: 0.11768
    z-value: 3.6626, p-value: 0.00024962
Wald statistic: 13.415, p-value: 0.00024962

Log likelihood: -182.3904 for lag model
ML residual variance (sigma squared): 95.494, (sigma: 9.7721)
Number of observations: 49 
Number of parameters estimated: 5 
AIC: 374.78, (AIC for lm: 382.75)
LM test for residual autocorrelation
test value: 0.31955, p-value: 0.57188

In [11]:
##==============================================================
 op <- par(no.readonly = TRUE)
 par(mfrow = c(2, 1))
 plot(COL.OLD$CRIME, type = "l", main = "SEM  Actual vs. Predicted")
 lines(fitted(COL.sar), lty = 2)
 legend("topright", c("Actual", "Predicted"), lty = 1:2, 
     bty = "n")
 plot(residuals(COL.sar), type = "l", xlab = "", ylab = "", 
     main = "Residuals")
 par(op)


Error in file(con, "rb"):  コネクションを開くことができません 

In [12]:
##==============================================================
 COL.sem <- errorsarlm(CRIME ~ INC + HOVAL, data = COL.OLD, 
     listw = W, method = "eigen")

In [13]:
##==============================================================
 summary(COL.sem)


Out[13]:
Call:errorsarlm(formula = CRIME ~ INC + HOVAL, data = COL.OLD, listw = W, 
    method = "eigen")

Residuals:
      Min        1Q    Median        3Q       Max 
-34.81174  -6.44031  -0.72142   7.61476  23.33626 

Type: error 
Coefficients: (asymptotic standard errors) 
             Estimate Std. Error z value  Pr(>|z|)
(Intercept) 59.893219   5.366163 11.1613 < 2.2e-16
INC         -0.941312   0.330569 -2.8476 0.0044057
HOVAL       -0.302250   0.090476 -3.3407 0.0008358

Lambda: 0.56179, LR test value: 7.9935, p-value: 0.0046945
Asymptotic standard error: 0.13387
    z-value: 4.1966, p-value: 2.7098e-05
Wald statistic: 17.611, p-value: 2.7098e-05

Log likelihood: -183.3805 for error model
ML residual variance (sigma squared): 95.575, (sigma: 9.7762)
Number of observations: 49 
Number of parameters estimated: 5 
AIC: 376.76, (AIC for lm: 382.75)

In [14]:
##==============================================================
 op <- par(no.readonly = TRUE)
 par(mfrow = c(2, 1))
 plot(COL.OLD$CRIME, type = "l", main = "SEM  Actual vs. Predicted")
 lines(fitted(COL.sem), lty = 2)
 legend("topright", c("Actual", "Predicted"), lty = 1:2, 
     bty = "n")
 plot(residuals(COL.sem), type = "l", xlab = "", ylab = "", 
     main = "Residuals")
 par(op)


Error in file(con, "rb"):  コネクションを開くことができません 

In [15]:
##==============================================================
 COL.sdm <- lagsarlm(CRIME ~ INC + HOVAL, data = COL.OLD, 
     listw = W, type = "mixed")
 class(COL.sdm)


Out[15]:
'sarlm'

In [16]:
##==============================================================
 summary(COL.sdm)


Out[16]:
Call:lagsarlm(formula = CRIME ~ INC + HOVAL, data = COL.OLD, listw = W, 
    type = "mixed")

Residuals:
      Min        1Q    Median        3Q       Max 
-37.47829  -6.46731  -0.33835   6.05200  22.62969 

Type: mixed 
Coefficients: (asymptotic standard errors) 
             Estimate Std. Error z value  Pr(>|z|)
(Intercept) 42.822415  12.667205  3.3806 0.0007233
INC         -0.914223   0.331094 -2.7612 0.0057586
HOVAL       -0.293738   0.089212 -3.2926 0.0009927
lag.INC     -0.520284   0.565129 -0.9206 0.3572355
lag.HOVAL    0.245640   0.178917  1.3729 0.1697756

Rho: 0.42634, LR test value: 5.3693, p-value: 0.020494
Asymptotic standard error: 0.15623
    z-value: 2.7288, p-value: 0.0063561
Wald statistic: 7.4465, p-value: 0.0063561

Log likelihood: -181.3935 for mixed model
ML residual variance (sigma squared): 91.791, (sigma: 9.5808)
Number of observations: 49 
Number of parameters estimated: 7 
AIC: 376.79, (AIC for lm: 380.16)
LM test for residual autocorrelation
test value: 0.28919, p-value: 0.59074

In [17]:
##==============================================================
 op <- par(no.readonly = TRUE)
 par(mfrow = c(2, 1))
 plot(COL.OLD$CRIME, type = "l", main = "SDM  Actual vs. Predicted")
 lines(fitted(COL.sdm), lty = 2)
 legend("topright", c("Actual", "Predicted"), lty = 1:2, 
     bty = "n")
 plot(residuals(COL.sdm), type = "l", xlab = "", ylab = "", 
     main = "Residuals")
 par(op)


Error in file(con, "rb"):  コネクションを開くことができません 

In [18]:
##==============================================================
 anova(COL.ar, COL.sar, COL.sem, COL.sdm, COL.ols)


Out[18]:
ModeldfAIClogLikTestL.Ratiop-value
COL.ar13398.3956-196.1978NANA
COL.sar25374.7809-182.39041 vs 227.614781.008154e-06
COL.sem35376.7609-183.3805NANA
COL.sdm47376.787-181.39353 vs 43.9739160.1371119
COL.ols54382.7545-187.37724 vs 511.967460.007495478

In [19]:
##==============================================================
 COL.car <- spautolm(CRIME ~ INC + HOVAL, data = COL.OLD, 
     family = "CAR", listw = W)
 class(COL.car)


Warning message:
In spautolm(CRIME ~ INC + HOVAL, data = COL.OLD, family = "CAR", : Non-symmetric spatial weights in CAR model
Out[19]:
'spautolm'

In [20]:
##==============================================================
 summary(COL.car)


Out[20]:
Call: spautolm(formula = CRIME ~ INC + HOVAL, data = COL.OLD, listw = W, 
    family = "CAR")

Residuals:
      Min        1Q    Median        3Q       Max 
-34.77346  -6.30458  -0.49065   7.38151  20.90109 

Coefficients: 
             Estimate Std. Error z value  Pr(>|z|)
(Intercept) 56.461257   5.225510 10.8049 < 2.2e-16
INC         -0.603702   0.342146 -1.7645 0.0776551
HOVAL       -0.322913   0.094876 -3.4035 0.0006652

Lambda: 0.71767 LR test value: 5.428 p-value: 0.019817 
Numerical Hessian standard error of lambda: 0.45746 

Log likelihood: -184.6633 
ML residual variance (sigma squared): 101.38, (sigma: 10.069)
Number of observations: 49 
Number of parameters estimated: 5 
AIC: 379.33

In [21]:
##==============================================================
 op <- par(no.readonly = TRUE)
 par(mfrow = c(2, 1))
 plot(COL.OLD$CRIME, type = "o", main = "CAR  Actual vs. Predicted")
 lines(fitted(COL.car), lty = 2)
 legend("topright", c("Actual", "Predicted"), lty = 1:2, 
     bty = "n")
 plot(residuals(COL.car), type = "l", xlab = "", ylab = "", 
     main = "Residuals")
 par(op)


Error in file(con, "rb"):  コネクションを開くことができません 

In [31]:
##==============================================================
 library(spdep)
 columbus <- readShapeSpatial(system.file("etc/shapes/columbus.shp", 
     package = "spdep")[1])
 col.gal.nb <- read.gal(system.file("etc/weights/columbus.gal", 
     package = "spdep")[1])
 names(columbus)
 xy <- cbind(columbus$X, columbus$Y)


Out[31]:
  1. 'AREA'
  2. 'PERIMETER'
  3. 'COLUMBUS_'
  4. 'COLUMBUS_I'
  5. 'POLYID'
  6. 'NEIG'
  7. 'HOVAL'
  8. 'INC'
  9. 'CRIME'
  10. 'OPEN'
  11. 'PLUMB'
  12. 'DISCBD'
  13. 'X'
  14. 'Y'
  15. 'NSA'
  16. 'NSB'
  17. 'EW'
  18. 'CP'
  19. 'THOUS'
  20. 'NEIGNO'

In [32]:
##==============================================================
 ac1 <- autocov_dist(columbus$CRIME, xy, nbs = 10, style = "W", 
     type = "one")
 acinv <- autocov_dist(columbus$CRIME, xy, nbs = 10, style = "W", 
     type = "inverse")
 acinv2 <- autocov_dist(columbus$CRIME, xy, nbs = 10, 
     style = "W", type = "inverse.squared")

In [33]:
##==============================================================
 summary(columbus$CRIME)
 summary(ac1)


Out[33]:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.1783 20.0500 34.0000 35.1300 48.5900 68.8900 
Out[33]:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  17.80   37.69   40.28   37.86   41.14   45.31 

In [34]:
##==============================================================
 res1 <- glm(CRIME ~ HOVAL + ac1, data = columbus, family = "gaussian")
 res1


Out[34]:
Call:  glm(formula = CRIME ~ HOVAL + ac1, family = "gaussian", data = columbus)

Coefficients:
(Intercept)        HOVAL          ac1  
    13.9410      -0.4512       1.0177  

Degrees of Freedom: 48 Total (i.e. Null);  46 Residual
Null Deviance:	    13440 
Residual Deviance: 7305 	AIC: 392.3

In [35]:
##==============================================================
 AIC(glm(CRIME ~ HOVAL + acinv, data = columbus, family = "gaussian"))
 AIC(glm(CRIME ~ HOVAL + acinv2, data = columbus, family = "gaussian"))


Out[35]:
378.354623377269
Out[35]:
369.072873218303

In [38]:
##==============================================================
 library(spgwr)
 data(georgia)


NOTE: This package does not constitute approval of GWR
as a method of spatial analysis; see example(gwr)

In [39]:
##==============================================================
 summary(gSRDF["PctBach"])


Out[39]:
Object of class SpatialPolygonsDataFrame
Coordinates:
        min       max
x -85.60520 -80.84126
y  30.35541  35.00068
Is projected: FALSE 
proj4string : [+proj=longlat +datum=NAD27]
Data attributes:
    PctBach     
 Min.   : 4.20  
 1st Qu.: 7.60  
 Median : 9.40  
 Mean   :10.95  
 3rd Qu.:12.00  
 Max.   :37.50  

In [40]:
##==============================================================
 g.gauss <- gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + 
     PctFB + PctPov + PctBlack, gweight = gwr.Gauss, data = gSRDF)
 g.gauss


Bandwidth: 237.2562 CV score: 2006.329 
Bandwidth: 383.5054 CV score: 2055.108 
Bandwidth: 146.8693 CV score: 2003.056 
Bandwidth: 177.654 CV score: 1987.249 
Bandwidth: 190.0997 CV score: 1988.612 
Bandwidth: 180.0776 CV score: 1987.294 
Bandwidth: 177.837 CV score: 1987.248 
Bandwidth: 177.9842 CV score: 1987.248 
Bandwidth: 177.978 CV score: 1987.248 
Bandwidth: 177.9783 CV score: 1987.248 
Bandwidth: 177.9782 CV score: 1987.248 
Bandwidth: 177.9783 CV score: 1987.248 
Bandwidth: 177.9783 CV score: 1987.248 
Out[40]:
177.978254651455

In [41]:
##==============================================================
 gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
     PctPov + PctBlack, gweight = gwr.gauss, data = gSRDF)
 gwr.sel(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
     PctPov + PctBlack, gweight = gwr.tricube, data = gSRDF)


Error:  オブジェクト 'gwr.gauss' がありません 
Bandwidth: 237.2562 CV score: 2352.467 
Bandwidth: 383.5054 CV score: 1982.02 
Bandwidth: 473.8923 CV score: 1987.23 
Bandwidth: 426.066 CV score: 1976.629 
Bandwidth: 421.2188 CV score: 1976.225 
Bandwidth: 416.1481 CV score: 1976.014 
Bandwidth: 413.7793 CV score: 1975.999 
Bandwidth: 414.3136 CV score: 1975.998 
Bandwidth: 414.3558 CV score: 1975.998 
Bandwidth: 414.3506 CV score: 1975.998 
Bandwidth: 414.3507 CV score: 1975.998 
Bandwidth: 414.3507 CV score: 1975.998 
Bandwidth: 414.3507 CV score: 1975.998 
Out[41]:
414.350690613526

In [42]:
##==============================================================
 res <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
     PctPov + PctBlack, data = gSRDF, bandwidth = g.gauss)
 res


Out[42]:
Call:
gwr(formula = PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
    PctPov + PctBlack, data = gSRDF, bandwidth = g.gauss)
Kernel function: gwr.Gauss 
Fixed bandwidth: 177.9783 
Summary of GWR coefficient estimates at data points:
                   Min.    1st Qu.     Median    3rd Qu.       Max.  Global
X.Intercept.  1.167e+01  1.407e+01  1.529e+01  1.593e+01  1.615e+01 14.7766
TotPop90      1.583e-05  1.954e-05  2.270e-05  2.542e-05  2.857e-05  0.0000
PctRural     -6.207e-02 -4.933e-02 -4.155e-02 -3.534e-02 -2.243e-02 -0.0439
PctEld       -1.631e-01 -1.417e-01 -1.329e-01 -1.098e-01 -4.695e-02 -0.0619
PctFB         5.205e-01  8.823e-01  1.371e+00  1.873e+00  2.362e+00  1.2562
PctPov       -2.023e-01 -1.664e-01 -1.217e-01 -7.883e-02 -2.067e-02 -0.1554
PctBlack     -2.058e-02 -3.984e-03  9.015e-03  3.211e-02  6.687e-02  0.0219

In [43]:
##==============================================================
 str(res, max.level = 1)
 str(res$SDF@data)


List of 12
 $ SDF      :Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots
 $ lhat     : logi NA
 $ lm       :List of 11
 $ results  : NULL
 $ bandwidth: num 178
 $ adapt    : NULL
 $ hatmatrix: logi FALSE
 $ gweight  : chr "gwr.Gauss"
 $ gTSS     : num 5128
 $ this.call: language gwr(formula = PctBach ~ TotPop90 + PctRural + PctEld + PctFB + PctPov +      PctBlack, data = gSRDF, bandwidth = g.gauss)
 $ fp.given : logi FALSE
 $ timings  : num [1:4, 1:2] 0.006 0.061 0.025 0.017 0.008 ...
  ..- attr(*, "dimnames")=List of 2
 - attr(*, "class")= chr "gwr"
'data.frame':	159 obs. of  11 variables:
 $ sum.w       : num  82.9 81 81.9 76 106.8 ...
 $ X.Intercept.: num  16 16.1 16.1 15.9 15.1 ...
 $ TotPop90    : num  2.53e-05 2.68e-05 2.59e-05 2.70e-05 2.11e-05 ...
 $ PctRural    : num  -0.055 -0.0537 -0.055 -0.0441 -0.0422 ...
 $ PctEld      : num  -0.0807 -0.0925 -0.0822 -0.1482 -0.1337 ...
 $ PctFB       : num  0.886 0.702 0.803 0.665 1.536 ...
 $ PctPov      : num  -0.167 -0.185 -0.174 -0.188 -0.106 ...
 $ PctBlack    : num  0.028376 0.044648 0.034752 0.053567 0.000432 ...
 $ gwr.e       : num  -1.0017 -0.8666 -1.9533 1.5492 -0.0531 ...
 $ pred        : num  9.2 7.27 8.55 7.85 13.35 ...
 $ localR2     : num  0.671 0.672 0.671 0.691 0.698 ...

In [44]:
##==============================================================
 brks <- c(-0.25, 0, 0.01, 0.025, 0.075)
 cols <- grey(5:2/6)
 plot(res$SDF, col = cols[findInterval(res$SDF$PctBlack, 
     brks, all.inside = TRUE)])
 legend("bottomleft", leglabs(brks), fill = cols, bty = "n")


Error in file(con, "rb"):  コネクションを開くことができません 

In [45]:
##==============================================================
 res$lm$coefficients["PctBlack"]


Out[45]:
PctBlack: 0.0219036670461049

In [46]:
##==============================================================
 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)
 res.adpt


Adaptive q: 0.381966 CV score: 2048.736 
Adaptive q: 0.618034 CV score: 2028.616 
Adaptive q: 0.763932 CV score: 2041.588 
Adaptive q: 0.5934745 CV score: 2027.578 
Adaptive q: 0.5284474 CV score: 2026.646 
Adaptive q: 0.537984 CV score: 2026.588 
Adaptive q: 0.5414424 CV score: 2026.575 
Adaptive q: 0.5613169 CV score: 2026.795 
Adaptive q: 0.5507625 CV score: 2026.522 
Adaptive q: 0.5547939 CV score: 2026.587 
Adaptive q: 0.5478453 CV score: 2026.5 
Adaptive q: 0.5474828 CV score: 2026.5 
Adaptive q: 0.5474097 CV score: 2026.5 
Adaptive q: 0.547369 CV score: 2026.5 
Adaptive q: 0.5474097 CV score: 2026.5 
Out[46]:
Call:
gwr(formula = PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
    PctPov + PctBlack, data = gSRDF, adapt = g.adapt.gauss)
Kernel function: gwr.Gauss 
Adaptive quantile: 0.5474097 (about 87 of 159 data points)
Summary of GWR coefficient estimates at data points:
                   Min.    1st Qu.     Median    3rd Qu.       Max.  Global
X.Intercept.  1.358e+01  1.409e+01  1.522e+01  1.570e+01  1.597e+01 14.7766
TotPop90      1.870e-05  2.053e-05  2.279e-05  2.482e-05  2.586e-05  0.0000
PctRural     -5.253e-02 -4.829e-02 -4.191e-02 -3.600e-02 -3.206e-02 -0.0439
PctEld       -1.586e-01 -1.335e-01 -1.146e-01 -9.678e-02 -5.908e-02 -0.0619
PctFB         8.164e-01  9.940e-01  1.354e+00  1.742e+00  1.958e+00  1.2562
PctPov       -1.838e-01 -1.643e-01 -1.256e-01 -9.503e-02 -6.538e-02 -0.1554
PctBlack     -1.194e-02 -1.639e-04  1.160e-02  2.760e-02  3.895e-02  0.0219

In [47]:
##==============================================================
 res <- gwr(PctBach ~ TotPop90 + PctRural + PctEld + PctFB + 
     PctPov + PctBlack, data = gSRDF, bandwidth = g.gauss, 
     hatmatrix = TRUE)
 LMZ.F3GWR.test(res)


Leung et al. (2000) F(3) test

            F statistic Numerator d.f. Denominator d.f.     Pr(>)    
(Intercept)  1.5314e+08     2.7897e+01           148.32 < 2.2e-16 ***
TotPop90     3.6887e+08     2.3887e+01           148.32 < 2.2e-16 ***
PctRural     1.5001e+08     3.0426e+01           148.32 < 2.2e-16 ***
PctEld       1.3335e+07     2.6830e+01           148.32 < 2.2e-16 ***
PctFB        1.0515e+09     1.6772e+01           148.32 < 2.2e-16 ***
PctPov       2.4619e+08     3.8218e+01           148.32 < 2.2e-16 ***
PctBlack     3.4101e+08     4.5524e+01           148.32 < 2.2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

In [ ]: