diff --git a/.Rbuildignore b/.Rbuildignore index 613562f..ebd26be 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,5 @@ ChangeLog ^\.travis\.yml$ ^docs$ .github +.git +_pkgdown.yml diff --git a/DESCRIPTION b/DESCRIPTION index b14db9d..8ccbf79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,6 +20,7 @@ Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bi person("Abhirup", "Mallik", role = c("ctb", "trl")), person("Giovanni", "Millo", role = "ctb"), person("Kelley", "Pace", role = "ctb"), + person("Josiah", "Parry", role = "ctb", comment = c(ORCID = "0000-0001-9910-865X")), person("Pedro", "Peres-Neto", role = "ctb"), person("Tobias", "Rüttenauer", role = "ctb"), person(given = "Mauricio", family = "Sarrias", role = c("ctb"), email = "mauricio.sarrias@ucn.cl"), @@ -30,7 +31,7 @@ Imports: spdep (>= 1.3-1), coda, methods, MASS, boot, splines, LearnBayes, nlme, multcomp Suggests: parallel, RSpectra, tmap, foreign, spam, knitr, lmtest, expm, sandwich, rmarkdown, igraph (>= 2.0.0), tinytest -Description: A collection of all the estimation functions for spatial cross-sectional models (on lattice/areal data using spatial weights matrices) contained up to now in 'spdep'. These model fitting functions include maximum likelihood methods for cross-sectional models proposed by 'Cliff' and 'Ord' (1973, ISBN:0850860369) and (1981, ISBN:0850860814), fitting methods initially described by 'Ord' (1975) . The models are further described by 'Anselin' (1988) . Spatial two stage least squares and spatial general method of moment models initially proposed by 'Kelejian' and 'Prucha' (1998) and (1999) are provided. Impact methods and MCMC fitting methods proposed by 'LeSage' and 'Pace' (2009) are implemented for the family of cross-sectional spatial regression models. Methods for fitting the log determinant term in maximum likelihood and MCMC fitting are compared by 'Bivand et al.' (2013) , and model fitting methods by 'Bivand' and 'Piras' (2015) ; both of these articles include extensive lists of references. A recent review is provided by 'Bivand', 'Millo' and 'Piras' (2021) . 'spatialreg' >= 1.1-* corresponded to 'spdep' >= 1.1-1, in which the model fitting functions were deprecated and passed through to 'spatialreg', but masked those in 'spatialreg'. From versions 1.2-*, the functions have been made defunct in 'spdep'. +Description: A collection of all the estimation functions for spatial cross-sectional models (on lattice/areal data using spatial weights matrices) contained up to now in 'spdep'. These model fitting functions include maximum likelihood methods for cross-sectional models proposed by 'Cliff' and 'Ord' (1973, ISBN:0850860369) and (1981, ISBN:0850860814), fitting methods initially described by 'Ord' (1975) . The models are further described by 'Anselin' (1988) . Spatial two stage least squares and spatial general method of moment models initially proposed by 'Kelejian' and 'Prucha' (1998) and (1999) are provided. Impact methods and MCMC fitting methods proposed by 'LeSage' and 'Pace' (2009) are implemented for the family of cross-sectional spatial regression models. Methods for fitting the log determinant term in maximum likelihood and MCMC fitting are compared by 'Bivand et al.' (2013) , and model fitting methods by 'Bivand' and 'Piras' (2015) ; both of these articles include extensive lists of references. A recent review is provided by 'Bivand', 'Millo' and 'Piras' (2021) . 'spatialreg' >= 1.1-* corresponded to 'spdep' >= 1.1-1, in which the model fitting functions were deprecated and passed through to 'spatialreg', but masked those in 'spatialreg'. From versions 1.2-*, the functions have been made defunct in 'spdep'. From version 1.3-6, add Anselin-Kelejian (1997) test to `stsls` for residual spatial autocorrelation . License: GPL-2 URL: https://github.com/r-spatial/spatialreg/, https://r-spatial.github.io/spatialreg/ BugReports: https://github.com/r-spatial/spatialreg/issues/ diff --git a/NEWS.md b/NEWS.md index 87577c0..fd189e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,10 @@ -# Version 1.3-5 (development) +# Version 1.3-6 (development) +* #56 add Anselin-Kelejian (1997) test to `stsls`, reported in its summary method, analogous to the reporting in the summary method of `lagsarlm` of the Lagrange multiplier test, both for residual spatial autocorrelation * adding missing man page anchors +# Version 1.3-5 (2024-08-19) + * conforming with STRICT_R_HEADERS=1 * Condition on forthcoming `tmap` 4 diff --git a/R/s2sls.R b/R/s2sls.R index 0f7ed10..1284a2b 100644 --- a/R/s2sls.R +++ b/R/s2sls.R @@ -156,9 +156,10 @@ print.summary.Stsls <- function(x, digits = max(5, .Options$digits - 3), else cat("Residual variance (sigma squared): ") cat(format(signif(x$sse/x$df, digits)), ", (sigma: ", format(signif(sqrt(x$sse/x$df), digits)), ")\n", sep="") - cat("Anselin-Kelejian (1997) test for residial autocorrelation: ") - cat(format(signif(x$AK, digits)), "\n p-value: ", - format.pval(pchisq(x$AK, 1, lower.tail=FALSE), digits), sep="") + cat("Anselin-Kelejian (1997) test for residual autocorrelation\n") + cat("test value: ", format(signif(x$AK, digits)), ", p-value: ", + format.pval(pchisq(x$AK, 1, lower.tail=FALSE), digits), + "\n", sep="") if (!is.null(correl)) { p <- NCOL(correl) @@ -299,6 +300,7 @@ htsls <- function(y,Z,Q,e) { # sebiv <- sqrt(diag(vi)) # tbiv <- biv / sebiv # pbiv <- pnorm(abs(tbiv),lower.tail=FALSE) * 2 + colnames(vi) <- rownames(vi) <- names(biv) result <- list(coefficients=biv, # se=sebiv,t=tbiv,p=pbiv, var=vi,sse=sse,residuals=c(e),df=df) @@ -364,7 +366,7 @@ tsls <- function(y,yend,X,Zinst,robust=FALSE, HC="HC0", legacy=FALSE, sig2n_k=FA else stop("invalid HC choice") ZoZ<-crossprod(Zp,(Zp*omega)) varb<-ZpZpi%*%ZoZ%*%ZpZpi - + colnames(varb) <- rownames(varb) <- names(biv) result <- list(coefficients=biv, var=varb, sse=sse, @@ -376,6 +378,7 @@ tsls <- function(y,yend,X,Zinst,robust=FALSE, HC="HC0", legacy=FALSE, sig2n_k=FA sse <- c(crossprod(e,e)) s2 <- sse / df varb <- ZpZpi * s2 + colnames(varb) <- rownames(varb) <- names(biv) # sebiv <- sqrt(diag(varb)) # tbiv <- biv / sebiv # pbiv <- pnorm(abs(tbiv),lower.tail=FALSE) * 2 diff --git a/README.md b/README.md index c60a1b6..17e0da2 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,6 @@ ### spatialreg: spatial models estimation and testing -A collection of all the estimation functions for spatial cross-sectional models (on lattice/areal data using spatial weights matrices) contained up to now in **spdep**. These model fitting functions include maximum likelihood methods for cross-sectional models proposed by Cliff and Ord (1973, ISBN: 0850860369) and (1981, ISBN: 0850860814), fitting methods initially described by Ord (1975) https://doi.org/10.1080/01621459.1975.10480272. The models are further described by Anselin (1988) https://doi.org/10.1007/978-94-015-7799-1. Spatial two stage least squares and spatial general method of moment models initially proposed by Kelejian and Prucha (1998) https://doi.org/10.1023/A:1007707430416 and (1999) https://doi.org/10.1111/1468-2354.00027 are provided. Impact methods and MCMC fitting methods proposed by LeSage and Pace (2009) https://doi.org/10.1201/9781420064254 are implemented for the family of cross-sectional spatial regression models. Methods for fitting the log determinant term in maximum likelihood and MCMC fitting are compared by Bivand et al. (2013) https://doi.org/10.1111/gean.12008, and model fitting methods by Bivand and Piras (2015) https://doi.org/10.18637/jss.v063.i18; both of these articles include extensive lists of references. A recent review is provided by Bivand, Millo and Piras (2021) https://doi.org/10.3390/math9111276. **spatialreg** >= 1.1-1 corresponds to **spdep** = 1.1-1, in which the model fitting functions are deprecated and pass through to **spatialreg**, but will mask those in **spatialreg**. From versions 1.2-1, the functions have been made defunct in **spdep**. +A collection of all the estimation functions for spatial cross-sectional models (on lattice/areal data using spatial weights matrices) contained up to now in **spdep**. These model fitting functions include maximum likelihood methods for cross-sectional models proposed by Cliff and Ord (1973, ISBN: 0850860369) and (1981, ISBN: 0850860814), fitting methods initially described by Ord (1975) https://doi.org/10.1080/01621459.1975.10480272. The models are further described by Anselin (1988) https://doi.org/10.1007/978-94-015-7799-1. Spatial two stage least squares and spatial general method of moment models initially proposed by Kelejian and Prucha (1998) https://doi.org/10.1023/A:1007707430416 and (1999) https://doi.org/10.1111/1468-2354.00027 are provided. Impact methods and MCMC fitting methods proposed by LeSage and Pace (2009) https://doi.org/10.1201/9781420064254 are implemented for the family of cross-sectional spatial regression models. Methods for fitting the log determinant term in maximum likelihood and MCMC fitting are compared by Bivand et al. (2013) https://doi.org/10.1111/gean.12008, and model fitting methods by Bivand and Piras (2015) https://doi.org/10.18637/jss.v063.i18; both of these articles include extensive lists of references. A recent review is provided by Bivand, Millo and Piras (2021) https://doi.org/10.3390/math9111276. **spatialreg** >= 1.1-1 corresponds to **spdep** = 1.1-1, in which the model fitting functions are deprecated and pass through to **spatialreg**, but will mask those in **spatialreg**. From versions 1.2-1, the functions have been made defunct in **spdep**. From version 1.3-6, add Anselin-Kelejian (1997) test to `stsls` for residual spatial autocorrelation https://doi.org/10.1177/016001769702000109. Default branch now `main`. diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..d709461 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,3 @@ +template: + bootstrap: 5 +url: https://r-spatial.github.io/spatialreg/ diff --git a/docs/404.html b/docs/404.html index 62e0300..37246c9 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,118 +4,80 @@ - + Page not found (404) • spatialreg - - - - - - - + + + + + - - - -
-
-
- +
+
+
Content not found. Please use links in the navbar. -
- - - +
- -
- - + diff --git a/docs/articles/SpatialFiltering.html b/docs/articles/SpatialFiltering.html index 07818e2..82009c5 100644 --- a/docs/articles/SpatialFiltering.html +++ b/docs/articles/SpatialFiltering.html @@ -4,100 +4,77 @@ - + Moran Eigenvectors • spatialreg - - - - - - - - + + + + + - - + + Skip to contents -
-
-
-