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/

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
col.d <- gwr.sel(CRIME ~ INC + HOVAL, data=columbus, coords=cbind(columbus$X, columbus$Y), gweight=gwr.bisquare)
#> Bandwidth: 12.65221 CV score: 8180.619 #> Bandwidth: 20.45127 CV score: 7552.85 #> Bandwidth: 25.27136 CV score: 7508.227 #> Bandwidth: 23.68132 CV score: 7519.864 #> Bandwidth: 28.25033 CV score: 7491.85 #> Bandwidth: 30.09144 CV score: 7486.673 #> Bandwidth: 31.69353 CV score: 7483.663 #> Bandwidth: 31.08159 CV score: 7484.706 #> Bandwidth: 32.21945 CV score: 7482.846 #> Bandwidth: 32.54449 CV score: 7482.371 #> Bandwidth: 32.74538 CV score: 7482.088 #> Bandwidth: 32.86953 CV score: 7481.916 #> Bandwidth: 32.94626 CV score: 7481.812 #> Bandwidth: 32.99368 CV score: 7481.748 #> Bandwidth: 33.02299 CV score: 7481.708 #> Bandwidth: 33.04111 CV score: 7481.684 #> Bandwidth: 33.0523 CV score: 7481.669 #> Bandwidth: 33.05922 CV score: 7481.659 #> Bandwidth: 33.0635 CV score: 7481.654 #> Bandwidth: 33.06614 CV score: 7481.65 #> Bandwidth: 33.06777 CV score: 7481.648 #> Bandwidth: 33.06878 CV score: 7481.647 #> Bandwidth: 33.06941 CV score: 7481.646 #> Bandwidth: 33.06979 CV score: 7481.645 #> Bandwidth: 33.07003 CV score: 7481.645 #> Bandwidth: 33.07018 CV score: 7481.645 #> Bandwidth: 33.07027 CV score: 7481.645 #> Bandwidth: 33.07032 CV score: 7481.645 #> Bandwidth: 33.07037 CV score: 7481.645 #> Bandwidth: 33.07037 CV score: 7481.645
#> Warning: Bandwidth converged to upper bound:33.0704149683672
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)
#> #> Brunsdon, Fotheringham & Charlton (1999) ANOVA #> #> data: col.bisq #> F = 1.2954, df1 = 14.042, df2 = 45.445, p-value = 0.2473 #> alternative hypothesis: greater #> sample estimates: #> SS GWR improvement SS GWR residuals #> 269.0627 5745.8301 #>