Skip to content

Commit 79262dd

Browse files
committedApr 10, 2025·
move Durbin factor functions to spdep
1 parent c4d6eaf commit 79262dd

File tree

4 files changed

+29
-52
lines changed

4 files changed

+29
-52
lines changed
 

‎DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: spatialreg
22
Version: 1.3-7
3-
Date: 2025-02-28
3+
Date: 2025-04-10
44
Title: Spatial Regression Analysis
55
Encoding: UTF-8
66
Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bivand@nhh.no", comment=c(ORCID="0000-0003-2392-6140")),
@@ -27,7 +27,7 @@ Authors@R: c(person("Roger", "Bivand", role = c("cre", "aut"), email = "Roger.Bi
2727
person(given = "JuanTomas", family = "Sayago", role = c("ctb"), email = "juantomas.sayago@gmail.com"),
2828
person("Michael", "Tiefelsdorf", role = "ctb"))
2929
Depends: R (>= 3.3.0), spData (>= 2.3.1), Matrix, sf
30-
Imports: spdep (>= 1.3-1), coda, methods, MASS, boot, splines, LearnBayes,
30+
Imports: spdep (>= 1.3-11), coda, methods, MASS, boot, splines, LearnBayes,
3131
nlme, multcomp
3232
Suggests: parallel, RSpectra, tmap, foreign, spam, knitr, lmtest, expm,
3333
sandwich, rmarkdown, igraph (>= 2.0.0), tinytest

‎NAMESPACE

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ importFrom("stats", "lm.fit", "as.formula", "coef", "lm", "model.extract",
1616
importFrom("spdep", "is.symmetric.glist", "lag.listw", "card",
1717
"nb2listw", "n.comp.nb", "listw2U", "listw2mat", "Szero", "listw2sn",
1818
"mat2listw", "is.symmetric.nb", "chkIDs", "get.spChkOption",
19-
"subset.listw", "spweights.constants")
19+
"subset.listw", "spweights.constants", "have_factor_preds_mf",
20+
"warn_factor_preds")
2021

2122
import(Matrix#, except=c("expm")
2223
)

‎R/cat_durbin.R

-24
This file was deleted.

‎inst/tinytest/test_Durbin_factor.R

+25-25
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@ library(spatialreg)
22
data(oldcol, package="spdep")
33
lw <- spdep::nb2listw(COL.nb)
44
COL.OLD$fEW <- factor(COL.OLD$EW)
5-
COL.OLD$fDISCBD <- cut(COL.OLD$DISCBD, c(0, 1.5, 3, 4.5, 6))
5+
COL.OLD$fDISCBD <- ordered(cut(COL.OLD$DISCBD, c(0, 1.5, 3, 4.5, 6)))
66
f <- formula(CRIME ~ INC + HOVAL + fDISCBD*fEW)
7-
expect_warning(COL.SLX <- lmSLX(f, data=COL.OLD, lw, Durbin=TRUE))
8-
expect_warning(COL.SLX <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
9-
expect_warning(COL.SLX <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fEW))
10-
expect_silent(COL.SLX <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
11-
expect_warning(COL.err <- errorsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
12-
expect_warning(COL.err <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
13-
expect_warning(COL.err <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
14-
expect_silent(COL.err <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
15-
expect_warning(COL.lag <- lagsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
16-
expect_warning(COL.lag <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
17-
expect_warning(COL.lag <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
18-
expect_silent(COL.lag <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
19-
expect_warning(COL.sac <- sacsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
20-
expect_warning(COL.sac <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
21-
expect_warning(COL.sac <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
22-
expect_silent(COL.sac <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
23-
expect_warning(COL.lag <- spBreg_lag(f, data=COL.OLD, lw, Durbin=TRUE))
24-
expect_warning(COL.lag <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
25-
expect_warning(COL.lag <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
26-
expect_silent(COL.lag <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
27-
expect_warning(COL.err <- spBreg_err(f, data=COL.OLD, lw, Durbin=TRUE))
28-
expect_warning(COL.err <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
29-
expect_warning(COL.err <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
30-
expect_silent(COL.err <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
7+
expect_warning(COL.SLX0 <- lmSLX(f, data=COL.OLD, lw, Durbin=TRUE))
8+
expect_warning(COL.SLX1 <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
9+
expect_warning(COL.SLX2 <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fEW))
10+
expect_silent(COL.SLX3 <- lmSLX(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
11+
expect_warning(COL.err0 <- errorsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
12+
expect_warning(COL.err1 <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
13+
expect_warning(COL.err2 <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
14+
expect_silent(COL.err3 <- errorsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
15+
expect_warning(COL.lag0 <- lagsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
16+
expect_warning(COL.lag1 <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
17+
expect_warning(COL.lag2 <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
18+
expect_silent(COL.lag3 <- lagsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
19+
expect_warning(COL.sac0 <- sacsarlm(f, data=COL.OLD, lw, Durbin=TRUE))
20+
expect_warning(COL.sac1 <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
21+
expect_warning(COL.sac2 <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
22+
expect_silent(COL.sac3 <- sacsarlm(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
23+
expect_warning(COL.lag0 <- spBreg_lag(f, data=COL.OLD, lw, Durbin=TRUE))
24+
expect_warning(COL.lag1 <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
25+
expect_warning(COL.lag2 <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
26+
expect_silent(COL.lag3 <- spBreg_lag(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
27+
expect_warning(COL.err0 <- spBreg_err(f, data=COL.OLD, lw, Durbin=TRUE))
28+
expect_warning(COL.err1 <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD*fEW))
29+
expect_warning(COL.err2 <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL + fDISCBD))
30+
expect_silent(COL.err3 <- spBreg_err(f, data=COL.OLD, lw, Durbin=~ INC + HOVAL))
3131

0 commit comments

Comments
 (0)
Please sign in to comment.