Skip to content

Commit 8ec6804

Browse files
committed
tidy; update docs
1 parent 1154e28 commit 8ec6804

File tree

206 files changed

+25596
-4149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+25596
-4149
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ ChangeLog
33
^\.travis\.yml$
44
^docs$
55
.github
6+
.git
7+
_pkgdown.yml

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bi
2020
person("Abhirup", "Mallik", role = c("ctb", "trl")),
2121
person("Giovanni", "Millo", role = "ctb"),
2222
person("Kelley", "Pace", role = "ctb"),
23+
person("Josiah", "Parry", role = "ctb", comment = c(ORCID = "0000-0001-9910-865X")),
2324
person("Pedro", "Peres-Neto", role = "ctb"),
2425
person("Tobias", "Rüttenauer", role = "ctb"),
2526
person(given = "Mauricio", family = "Sarrias", role = c("ctb"), email = "[email protected]"),
@@ -30,7 +31,7 @@ Imports: spdep (>= 1.3-1), coda, methods, MASS, boot, splines, LearnBayes,
3031
nlme, multcomp
3132
Suggests: parallel, RSpectra, tmap, foreign, spam, knitr, lmtest, expm,
3233
sandwich, rmarkdown, igraph (>= 2.0.0), tinytest
33-
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) <doi:10.1080/01621459.1975.10480272>. The models are further described by 'Anselin' (1988) <doi: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) <doi:10.1023/A:1007707430416> and (1999) <doi:10.1111/1468-2354.00027> are provided. Impact methods and MCMC fitting methods proposed by 'LeSage' and 'Pace' (2009) <doi: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) <doi:10.1111/gean.12008>, and model fitting methods by 'Bivand' and 'Piras' (2015) <doi: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) <doi:10.3390/math9111276>. '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'.
34+
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) <doi:10.1080/01621459.1975.10480272>. The models are further described by 'Anselin' (1988) <doi: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) <doi:10.1023/A:1007707430416> and (1999) <doi:10.1111/1468-2354.00027> are provided. Impact methods and MCMC fitting methods proposed by 'LeSage' and 'Pace' (2009) <doi: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) <doi:10.1111/gean.12008>, and model fitting methods by 'Bivand' and 'Piras' (2015) <doi: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) <doi:10.3390/math9111276>. '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 <doi:10.1177/016001769702000109>.
3435
License: GPL-2
3536
URL: https://github.com/r-spatial/spatialreg/, https://r-spatial.github.io/spatialreg/
3637
BugReports: https://github.com/r-spatial/spatialreg/issues/

NEWS.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# Version 1.3-5 (development)
1+
# Version 1.3-6 (development)
22

3+
* #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
34
* adding missing man page anchors
45

6+
# Version 1.3-5 (2024-08-19)
7+
58
* conforming with STRICT_R_HEADERS=1
69

710
* Condition on forthcoming `tmap` 4

R/s2sls.R

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,10 @@ print.summary.Stsls <- function(x, digits = max(5, .Options$digits - 3),
156156
else cat("Residual variance (sigma squared): ")
157157
cat(format(signif(x$sse/x$df, digits)), ", (sigma: ",
158158
format(signif(sqrt(x$sse/x$df), digits)), ")\n", sep="")
159-
cat("Anselin-Kelejian (1997) test for residial autocorrelation: ")
160-
cat(format(signif(x$AK, digits)), "\n p-value: ",
161-
format.pval(pchisq(x$AK, 1, lower.tail=FALSE), digits), sep="")
159+
cat("Anselin-Kelejian (1997) test for residual autocorrelation\n")
160+
cat("test value: ", format(signif(x$AK, digits)), ", p-value: ",
161+
format.pval(pchisq(x$AK, 1, lower.tail=FALSE), digits),
162+
"\n", sep="")
162163

163164
if (!is.null(correl)) {
164165
p <- NCOL(correl)
@@ -299,6 +300,7 @@ htsls <- function(y,Z,Q,e) {
299300
# sebiv <- sqrt(diag(vi))
300301
# tbiv <- biv / sebiv
301302
# pbiv <- pnorm(abs(tbiv),lower.tail=FALSE) * 2
303+
colnames(vi) <- rownames(vi) <- names(biv)
302304
result <- list(coefficients=biv,
303305
# se=sebiv,t=tbiv,p=pbiv,
304306
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
364366
else stop("invalid HC choice")
365367
ZoZ<-crossprod(Zp,(Zp*omega))
366368
varb<-ZpZpi%*%ZoZ%*%ZpZpi
367-
369+
colnames(varb) <- rownames(varb) <- names(biv)
368370
result <- list(coefficients=biv,
369371
var=varb,
370372
sse=sse,
@@ -376,6 +378,7 @@ tsls <- function(y,yend,X,Zinst,robust=FALSE, HC="HC0", legacy=FALSE, sig2n_k=FA
376378
sse <- c(crossprod(e,e))
377379
s2 <- sse / df
378380
varb <- ZpZpi * s2
381+
colnames(varb) <- rownames(varb) <- names(biv)
379382
# sebiv <- sqrt(diag(varb))
380383
# tbiv <- biv / sebiv
381384
# pbiv <- pnorm(abs(tbiv),lower.tail=FALSE) * 2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
### spatialreg: spatial models estimation and testing
77

8-
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**.
8+
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.
99

1010
Default branch now `main`.

_pkgdown.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
template:
2+
bootstrap: 5
3+
url: https://r-spatial.github.io/spatialreg/

docs/404.html

Lines changed: 48 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)