Skip to content

Commit

Permalink
tidy; update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsbivand committed Nov 19, 2024
1 parent 1154e28 commit 8ec6804
Show file tree
Hide file tree
Showing 206 changed files with 25,596 additions and 4,149 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ ChangeLog
^\.travis\.yml$
^docs$
.github
.git
_pkgdown.yml
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]"),
Expand All @@ -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) <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'.
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>.
License: GPL-2
URL: https://github.com/r-spatial/spatialreg/, https://r-spatial.github.io/spatialreg/
BugReports: https://github.com/r-spatial/spatialreg/issues/
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 7 additions & 4 deletions R/s2sls.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
template:
bootstrap: 5
url: https://r-spatial.github.io/spatialreg/
134 changes: 48 additions & 86 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8ec6804

Please sign in to comment.