Four related test statistics for comparing OLS and GWR models based on bapers by Brunsdon, Fotheringham and Charlton (1999) and Leung et al (2000), and a development from the GWR book (2002).

LMZ.F3GWR.test(go)
LMZ.F2GWR.test(x)
LMZ.F1GWR.test(x)
BFC99.gwr.test(x)
BFC02.gwr.test(x, approx=FALSE)
# S3 method for gwr
anova(object, ..., approx=FALSE)

Arguments

go, x, object

a gwr object returned by gwr()

...

arguments passed through (unused)

approx

default FALSE, if TRUE, use only (n - tr(S)) instead of (n - 2*tr(S) - tr(S'S)) as the GWR degrees of freedom

Details

The papers in the references give the background for the analyses of variance presented.

Value

BFC99.GWR.test, BFC02.gwr.test, LMZ.F1GWR.test and LMZ.F2GWR.test return "htest" objects, LMZ.F3GWR.test a matrix of test results.

References

Fotheringham, A.S., Brunsdon, C., and Charlton, M.E., 2002, Geographically Weighted Regression, Chichester: Wiley; http://gwr.nuim.ie/

Author

Roger Bivand Roger.Bivand@nhh.no and Danlin Yu

See also

Examples

data(columbus, package="spData")
col.bw <- gwr.sel(CRIME ~ INC + HOVAL, data=columbus,
  coords=cbind(columbus$X, columbus$Y))
#> Bandwidth: 12.65221 CV score: 7432.209 
#> Bandwidth: 20.45127 CV score: 7462.704 
#> Bandwidth: 7.83213 CV score: 7323.545 
#> Bandwidth: 4.853154 CV score: 7307.57 
#> Bandwidth: 5.125504 CV score: 7322.796 
#> Bandwidth: 3.012046 CV score: 6461.764 
#> Bandwidth: 1.874179 CV score: 6473.378 
#> Bandwidth: 2.475485 CV score: 6109.995 
#> Bandwidth: 2.447721 CV score: 6098.372 
#> Bandwidth: 2.228647 CV score: 6064.1 
#> Bandwidth: 2.264538 CV score: 6060.774 
#> Bandwidth: 2.280666 CV score: 6060.649 
#> Bandwidth: 2.274969 CV score: 6060.601 
#> Bandwidth: 2.2751 CV score: 6060.601 
#> Bandwidth: 2.27506 CV score: 6060.601 
#> Bandwidth: 2.275019 CV score: 6060.601 
#> Bandwidth: 2.27506 CV score: 6060.601 
col.gauss <- gwr(CRIME ~ INC + HOVAL, data=columbus,
  coords=cbind(columbus$X, columbus$Y), bandwidth=col.bw, hatmatrix=TRUE)
BFC99.gwr.test(col.gauss)
#> 
#> 	Brunsdon, Fotheringham & Charlton (1999) ANOVA
#> 
#> data:  col.gauss
#> F = 2.7786, df1 = 41.724, df2 = 26.867, p-value = 0.003244
#> alternative hypothesis: greater
#> sample estimates:
#> SS GWR improvement   SS GWR residuals 
#>           4765.792           1249.101 
#> 
BFC02.gwr.test(col.gauss)
#> 
#> 	Brunsdon, Fotheringham & Charlton (2002, pp. 91-2) ANOVA
#> 
#> data:  col.gauss
#> F = 4.8154, df1 = 46.000, df2 = 19.384, p-value = 0.0002152
#> alternative hypothesis: greater
#> sample estimates:
#> SS OLS residuals SS GWR residuals 
#>         6014.893         1249.101 
#> 
BFC02.gwr.test(col.gauss, approx=TRUE)
#> 
#> 	Brunsdon, Fotheringham & Charlton (2002, pp. 91-2) ANOVA (approximate
#> 	degrees of freedom - only tr(S))
#> 
#> data:  col.gauss
#> F = 4.8154, df1 = 46.000, df2 = 25.072, p-value = 3.876e-05
#> alternative hypothesis: greater
#> sample estimates:
#> SS OLS residuals SS GWR residuals 
#>         6014.893         1249.101 
#> 
anova(col.gauss)
#> Analysis of Variance Table 
#>                     Df Sum Sq Mean Sq F value
#> OLS Residuals    3.000 6014.9                
#> GWR Improvement 26.616 4765.8 179.055        
#> GWR Residuals   19.384 1249.1  64.441  2.7786
anova(col.gauss, approx=TRUE)
#> Analysis of Variance Table 
#> approximate degrees of freedom (only tr(S))
#>                     Df Sum Sq Mean Sq F value
#> OLS Residuals    3.000 6014.9                
#> GWR Improvement 20.928 4765.8  227.72        
#> GWR Residuals   25.072 1249.1   49.82  4.5709
if (FALSE) {
col.d <- gwr.sel(CRIME ~ INC + HOVAL, data=columbus,
  coords=cbind(columbus$X, columbus$Y), gweight=gwr.bisquare)
col.bisq <- gwr(CRIME ~ INC + HOVAL, data=columbus,
  coords=cbind(columbus$X, columbus$Y), bandwidth=col.d, 
  gweight=gwr.bisquare, hatmatrix=TRUE)
BFC99.gwr.test(col.bisq)
}