diff --git a/docs/404.html b/docs/404.html index 7e41807..8faea44 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/articles/SpatialFiltering.html b/docs/articles/SpatialFiltering.html index d2f66f1..484e162 100644 --- a/docs/articles/SpatialFiltering.html +++ b/docs/articles/SpatialFiltering.html @@ -33,7 +33,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/articles/index.html b/docs/articles/index.html index f5b6aed..2053313 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/articles/nb_igraph.html b/docs/articles/nb_igraph.html index 867c600..c560d81 100644 --- a/docs/articles/nb_igraph.html +++ b/docs/articles/nb_igraph.html @@ -33,7 +33,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -162,7 +162,7 @@

## Loading required package: spData
## Loading required package: Matrix
## Loading required package: sf
-
## Linking to GEOS 3.12.1, GDAL 3.8.0, PROJ 9.3.0; sf_use_s2() is TRUE
+
## Linking to GEOS 3.12.1, GDAL 3.8.3, PROJ 9.3.1; sf_use_s2() is TRUE

Getting some data @@ -181,9 +181,9 @@

Getting some datasf_extSoftVersion() }

##           GEOS           GDAL         proj.4 GDAL_with_GEOS     USE_PROJ_H 
-##       "3.12.1"        "3.8.0"        "9.3.0"         "true"         "true" 
+##       "3.12.1"        "3.8.3"        "9.3.1"         "true"         "true" 
 ##           PROJ 
-##        "9.3.0"
+## "9.3.1"
 library(sf)
 columbus <- st_read(system.file("shapes/columbus.shp", package="spData")[1])
@@ -554,10 +554,16 @@

Converting from sym ## ## union
-g1 <- graph.adjacency(B, mode="undirected")
-class(g1)
-
## [1] "igraph"
+g1 <- graph.adjacency(B, mode="undirected") +
## Warning: `graph.adjacency()` was deprecated in igraph 2.0.0.
+##  Please use `graph_from_adjacency_matrix()` instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
+## generated.
+class(g1)
+
## [1] "igraph"
+
 object.size(g1)
## 6544 bytes
@@ -568,23 +574,15 @@

Converting from gra get.adjacency chooses a particular class of sparse matrix to be returned, so that the conversion process typically leads many matrices to fewer graph types, and back to fewer matrix types:

-
+
 # Matrix 1.4-2 vulnerability work-around
 ow <- options("warn")$warn
 options("warn"=2L)
-B1 <- try(get.adjacency(g1), silent=TRUE)
-if (!inherits(B1, "try-error")) print(class(B1))
-
## [1] "dgCMatrix"
-## attr(,"package")
-## [1] "Matrix"
-
-if (!inherits(B1, "try-error")) print(object.size(B1))
-
## 10824 bytes
-
-if (!inherits(B1, "try-error")) print(all.equal(B, as(B1, "CsparseMatrix")))
-
## [1] TRUE
-
-options("warn"=ow)
+B1 <- try(get.adjacency(g1), silent=TRUE) +if (!inherits(B1, "try-error")) print(class(B1)) +if (!inherits(B1, "try-error")) print(object.size(B1)) +if (!inherits(B1, "try-error")) print(all.equal(B, as(B1, "CsparseMatrix"))) +options("warn"=ow)

Graph components in spdep @@ -594,7 +592,7 @@

Graph components in spdepn.comp.nb from the early days of the package. It is useful to know whether an nb object is divided up into separate subgraphs, and which entities are members of which such subgraph.

-
+
 res <- spdep::n.comp.nb(col2)
 table(res$comp.id)
## 
@@ -606,21 +604,27 @@ 

Graph components in igraph<

The same result can be obtained using the clusters function in igraph:

-
-c1 <- clusters(g1)
-c1$no == res$nc
+
+c1 <- clusters(g1)
+
## Warning: `clusters()` was deprecated in igraph 2.0.0.
+##  Please use `components()` instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
+## generated.
+
+c1$no == res$nc
## [1] TRUE
-
+
 all.equal(c1$membership, res$comp.id)
## [1] "names for target but not for current"
-
+
 all.equal(c1$csize, c(table(res$comp.id)), check.attributes=FALSE)
## [1] TRUE

The same holds for the row-standardised variant:

-
+
 W <- as(spdep::nb2listw(col2, style="W", zero.policy=TRUE), "CsparseMatrix")
-g1W <- graph.adjacency(W, mode="directed", weighted="W")
-c1W <- clusters(g1W)
+g1W <- graph.adjacency(W, mode="directed", weighted="W")
+c1W <- clusters(g1W)
 all.equal(c1W$membership, res$comp.id)
## [1] "names for target but not for current"
@@ -636,16 +640,27 @@

Shortest paths in weights mat above. The diameter measure is then the diameter of the largest component subgraph. Note that this generates an n x n matrix:

- + +
## Warning: `is.connected()` was deprecated in igraph 2.0.0.
+##  Please use `is_connected()` instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
+## generated.
## [1] FALSE
-
+
 dg1 <- diameter(g1)
 dg1
## [1] 7
-
-sp_mat <- shortest.paths(g1)
-str(sp_mat)
+
+sp_mat <- shortest.paths(g1)
+
## Warning: `shortest.paths()` was deprecated in igraph 2.0.0.
+##  Please use `distances()` instead.
+## This warning is displayed once every 8 hours.
+## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
+## generated.
+
+str(sp_mat)
##  num [1:49, 1:49] 0 1 1 2 2 3 4 3 3 4 ...
 ##  - attr(*, "dimnames")=List of 2
 ##   ..$ : chr [1:49] "1" "2" "3" "4" ...
@@ -659,7 +674,7 @@ 

Shortest paths in weights matr in advance (the largest lag order for which the number of links is greater than zero), we run into the problem of how to represent missing neighbour information.

-
+
 nbl10 <- spdep::nblag(col2, maxlag=10)
 vals <- sapply(nbl10, function(x) sum(spdep::card(x)))
 zero <- which(vals == 0)
@@ -671,7 +686,7 @@ 

Shortest paths in weights matr produced by shortest.paths, we need to set all these non-structural zeros to infinity (the length of the path between unconnected nodes), and re-instate structural zeros on the diagonal:

-
+
 lmat <- lapply(nbl10[1:(zero[1]-1)], spdep::nb2mat, style="B", zero.policy=TRUE)
 mat <- matrix(0, n, n)
 for (i in seq(along=lmat)) mat = mat + i*lmat[[i]]
@@ -705,23 +720,23 @@ 

Smirnov/Anselin (2009) cyclical m this for each block/subgraph by testing the condition until it meets w[j,k] > 0, at which point it breaks. Smirnov and Anselin (2009) state that rook neighbours on a regular grid meet the condition:

-
+
 nb_r <- spdep::cell2nb(7, 7, type="rook")
 nb_rW <- spdep::nb2listw(nb_r, style="W")
 spdep:::find_q1_q2(nb_rW)
## [1] 1 1

One block/graph component is found, and this one meets the cyclical matrix condition, as also shown by the domain:

-
+
 
## [1] -1  1

This does not apply to the spatial weights we have been using above, with two non-singleton components, neither meeting the cyclical matrix condition:

-
+
 spdep:::find_q1_q2(nb_W)
## [1] 2 0
-
+
 
## [1] -1.544645  1.000000

By construction, all two-node connected graph components also meet diff --git a/docs/articles/sids_models.html b/docs/articles/sids_models.html index 0a8cecc..ce56078 100644 --- a/docs/articles/sids_models.html +++ b/docs/articles/sids_models.html @@ -33,7 +33,7 @@ spatialreg - 1.3-1 + 1.3-2

@@ -121,7 +121,7 @@

Getting the data into R

We will be using the spdep and spatialreg packages, here version: spdep, version -1.3-1, 2023-11-03, the sf package and the +1.3-2, 2024-01-17, the sf package and the tmap package. The data from the sources referred to above is documented in the help page for the nc.sids data set in diff --git a/docs/authors.html b/docs/authors.html index 89dfe06..8631e1f 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2

diff --git a/docs/index.html b/docs/index.html index 8dfd9b2..aa31d2b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,7 +33,7 @@ spatialreg - 1.3-1 + 1.3-2
diff --git a/docs/news/index.html b/docs/news/index.html index 870b0f3..0896f4c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2
@@ -64,7 +64,13 @@

Changelog

- + +
  • pass through SlX formula in call

  • +
  • re-corrected #19 because the fitted model weights component may be NULL

  • +
  • suppress warning from multcomp::glht as the test which throws the warning is discarded

  • +
+
+
  • move expm from Imports to Suggests #42

  • added zero.policy pass-through to spdep::mat2listw calls in predict.Sarlm and to spdep::sn2listw in sids_models.Rmd; set spdep requirement to 1.3-1

  • corrected #19 because the fitted model weights component is never NULL, but may have a single unique value

  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 5976ad2..25030c2 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -5,5 +5,5 @@ articles: SpatialFiltering: SpatialFiltering.html nb_igraph: nb_igraph.html sids_models: sids_models.html -last_built: 2023-11-23T10:35Z +last_built: 2024-02-06T11:49Z diff --git a/docs/reference/GMerrorsar.html b/docs/reference/GMerrorsar.html index 9b81b7a..447012a 100644 --- a/docs/reference/GMerrorsar.html +++ b/docs/reference/GMerrorsar.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2
diff --git a/docs/reference/MCMCsamp.html b/docs/reference/MCMCsamp.html index 20013ef..b34c604 100644 --- a/docs/reference/MCMCsamp.html +++ b/docs/reference/MCMCsamp.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2
@@ -179,21 +179,21 @@

Examples

#> 1. Empirical mean and standard deviation for each variable, #> plus standard error of the mean: #> -#> Mean SD Naive SE Time-series SE -#> lambda 0.04501 0.01711 0.000541 0.002089 -#> (Intercept) -0.62524 0.18031 0.005702 0.022321 -#> PEXPOSURE 0.07085 0.04851 0.001534 0.006552 -#> PCTAGE65P 3.74204 0.60659 0.019182 0.068848 -#> PCTOWNHOME -0.39873 0.21332 0.006746 0.025439 +#> Mean SD Naive SE Time-series SE +#> lambda 0.04611 0.01498 0.0004736 0.001756 +#> (Intercept) -0.65331 0.19263 0.0060916 0.026540 +#> PEXPOSURE 0.08968 0.04897 0.0015486 0.006607 +#> PCTAGE65P 3.69656 0.52425 0.0165784 0.057839 +#> PCTOWNHOME -0.39485 0.23949 0.0075732 0.037397 #> #> 2. Quantiles for each variable: #> #> 2.5% 25% 50% 75% 97.5% -#> lambda 0.009947 0.03345 0.04621 0.05710 0.07604 -#> (Intercept) -0.975566 -0.74111 -0.62524 -0.49983 -0.28177 -#> PEXPOSURE -0.005411 0.03271 0.06415 0.09889 0.17297 -#> PCTAGE65P 2.728875 3.32066 3.64211 4.14748 4.94058 -#> PCTOWNHOME -0.816134 -0.52762 -0.40539 -0.25284 0.01614 +#> lambda 0.015004 0.03557 0.04640 0.05531 0.07351 +#> (Intercept) -1.089847 -0.77125 -0.63878 -0.51969 -0.34027 +#> PEXPOSURE -0.001914 0.05288 0.09113 0.12367 0.18519 +#> PCTAGE65P 2.672002 3.33982 3.67753 4.04290 4.74392 +#> PCTOWNHOME -0.845780 -0.56384 -0.41154 -0.21860 0.07637 #> if (FALSE) { esar1fw <- spautolm(Z ~ PEXPOSURE + PCTAGE65P + PCTOWNHOME, data=nydata, @@ -259,20 +259,20 @@

Examples

#> plus standard error of the mean: #> #> Mean SD Naive SE Time-series SE -#> lambda 0.04276 0.01673 0.0005291 0.002137 -#> (Intercept) -0.64231 0.19940 0.0063056 0.027545 -#> PEXPOSURE 0.08298 0.04821 0.0015246 0.007180 -#> PCTAGE65P 3.76613 0.59918 0.0189478 0.070409 -#> PCTOWNHOME -0.40409 0.19845 0.0062755 0.026634 +#> lambda 0.04086 0.01436 0.0004541 0.001639 +#> (Intercept) -0.62555 0.18275 0.0057791 0.024443 +#> PEXPOSURE 0.06900 0.04034 0.0012758 0.004965 +#> PCTAGE65P 3.68791 0.64881 0.0205172 0.077680 +#> PCTOWNHOME -0.38263 0.19769 0.0062513 0.025188 #> #> 2. Quantiles for each variable: #> -#> 2.5% 25% 50% 75% 97.5% -#> lambda 0.0141671 0.03110 0.04116 0.05429 0.07622 -#> (Intercept) -1.0578824 -0.77036 -0.61555 -0.49229 -0.28781 -#> PEXPOSURE 0.0007409 0.04776 0.07779 0.12221 0.17562 -#> PCTAGE65P 2.6714807 3.33132 3.75638 4.27260 4.92908 -#> PCTOWNHOME -0.8107680 -0.53926 -0.39020 -0.25915 -0.01036 +#> 2.5% 25% 50% 75% 97.5% +#> lambda 0.014717 0.03100 0.04103 0.05272 0.065715 +#> (Intercept) -0.972641 -0.75486 -0.63637 -0.50400 -0.198074 +#> PEXPOSURE -0.004903 0.03891 0.06820 0.09560 0.152374 +#> PCTAGE65P 2.382993 3.31371 3.67406 4.12972 4.919868 +#> PCTOWNHOME -0.779951 -0.49064 -0.38080 -0.25234 -0.003732 #> if (FALSE) { esar0w <- errorsarlm(Z ~ PEXPOSURE + PCTAGE65P + PCTOWNHOME, data=nydata, diff --git a/docs/reference/ME.html b/docs/reference/ME.html index 8f190b5..99540ec 100644 --- a/docs/reference/ME.html +++ b/docs/reference/ME.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2

@@ -168,7 +168,7 @@

Examples

#> eV[,1], I: 0.08290518 ZI: NA, pr(ZI): 0.04 #> eV[,9], I: 0.06426565 ZI: NA, pr(ZI): 0.14 #> user system elapsed -#> 1.335 0.006 1.352 +#> 1.300 0.006 1.315 glmME <- glm(c(hopkins_part) ~ 1 + fitted(MEbinom1), family="binomial") #anova(glmME, test="Chisq") coef(summary(glmME)) diff --git a/docs/reference/ML_models.html b/docs/reference/ML_models.html index b1b5c37..61c3403 100644 --- a/docs/reference/ML_models.html +++ b/docs/reference/ML_models.html @@ -29,7 +29,7 @@ spatialreg - 1.3-1 + 1.3-2
@@ -412,7 +412,7 @@

Examples

#> ML residual variance (sigma squared): 95.494, (sigma: 9.7721) #> Number of observations: 49 #> Number of parameters estimated: 5 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 374.78, (AIC for lm: 382.75) #> LM test for residual autocorrelation #> test value: 0.31954, p-value: 0.57188 #> @@ -476,7 +476,7 @@

Examples

#> Computing eigenvalues ... #> #> user system elapsed -#> 0.145 0.001 0.146 +#> 0.180 0.000 0.182 summary(COL.lag.M) #> #> Call:lagsarlm(formula = CRIME ~ INC + HOVAL, data = COL.OLD, listw = listw, @@ -502,7 +502,7 @@

Examples

#> ML residual variance (sigma squared): 95.494, (sigma: 9.7721) #> Number of observations: 49 #> Number of parameters estimated: 5 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 374.78, (AIC for lm: 382.75) #> LM test for residual autocorrelation #> test value: 0.31954, p-value: 0.57188 #> @@ -827,7 +827,7 @@

Examples

#> ML residual variance (sigma squared): 95.604, (sigma: 9.7777) #> Number of observations: 49 #> Number of parameters estimated: 6 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 376.47, (AIC for lm: 382.75) #> set.seed(1) summary(impacts(COL.sacW.eig, tr=trMatc, R=2000), zstats=TRUE, short=TRUE) @@ -885,7 +885,7 @@

Examples

#> ML residual variance (sigma squared): 93.149, (sigma: 9.6514) #> Number of observations: 49 #> Number of parameters estimated: 8 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 378.68, (AIC for lm: 382.75) #> set.seed(1) summary(impacts(COL.msacW.eig, tr=trMatc, R=2000), zstats=TRUE, short=TRUE) @@ -943,7 +943,7 @@

Examples

#> ML residual variance (sigma squared): 93.149, (sigma: 9.6514) #> Number of observations: 49 #> Number of parameters estimated: 8 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 378.68, (AIC for lm: 382.75) #> set.seed(1) summary(impacts(COL.msacW1.eig, tr=trMatc, R=2000), zstats=TRUE, short=TRUE) @@ -1002,7 +1002,7 @@

Examples

#> ML residual variance (sigma squared): 85.135, (sigma: 9.2269) #> Number of observations: 49 #> Number of parameters estimated: 8 -#> AIC: NA (not available for weighted model), (AIC for lm: 369.42) +#> AIC: 373.93, (AIC for lm: 369.42) #> summary(impacts(COL.msacW2.eig, tr=trMatc, R=2000), zstats=TRUE, short=TRUE) #> Impact measures (sacmixed, trace): diff --git a/docs/reference/SET_MCMC.html b/docs/reference/SET_MCMC.html index c63be90..4f4e74a 100644 --- a/docs/reference/SET_MCMC.html +++ b/docs/reference/SET_MCMC.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2

diff --git a/docs/reference/SLX.html b/docs/reference/SLX.html index 698dc47..d6653d7 100644 --- a/docs/reference/SLX.html +++ b/docs/reference/SLX.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2

@@ -71,7 +71,13 @@

Spatial Durbin linear (SLX, spatially lagged X) model

lmSLX(formula, data = list(), listw, na.action, weights=NULL, Durbin=TRUE,
  zero.policy=NULL)
-create_WX(x, listw, zero.policy=NULL, prefix="")
+# S3 method for SlX
+print(x, digits = max(3L, getOption("digits") - 3L), ...)
+# S3 method for SlX
+summary(object, correlation = FALSE, symbolic.cor = FALSE, ...)
+# S3 method for summary.SlX
+print(x, digits = max(3L, getOption("digits") - 3L),
+ symbolic.cor = x$symbolic.cor, signif.stars = getOption("show.signif.stars"), ...)
 # S3 method for SlX
 impacts(obj, ...)
 # S3 method for WXimpact
@@ -79,7 +85,8 @@ 

Spatial Durbin linear (SLX, spatially lagged X) model

# S3 method for WXimpact summary(object, ..., adjust_k=(attr(object, "type") == "SDEM")) # S3 method for SlX -predict(object, newdata, listw, zero.policy=NULL, ...)
+predict(object, newdata, listw, zero.policy=NULL, ...) +create_WX(x, listw, zero.policy=NULL, prefix="")
@@ -108,6 +115,18 @@

Arguments

zero.policy

default NULL, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA

+
digits
+

the number of significant digits to use when printing

+ +
correlation
+

logical; if TRUE, the correlation matrix of the estimated parameters is returned and printed

+ +
symbolic.cor
+

logical. If TRUE, print the correlations in a symbolic form (see 'symnum') rather than as numbers

+ +
signif.stars
+

logical. If TRUE, 'significance stars' are printed for each coefficient

+
obj

A spatial regression object created by lmSLX

@@ -154,23 +173,13 @@

Examples

#> lm(formula = formula(paste("y ~ ", paste(colnames(x)[-1], collapse = "+"))), #> data = as.data.frame(x), weights = weights) #> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -36.536 -7.835 0.474 8.349 25.594 -#> #> Coefficients: -#> Estimate Std. Error t value Pr(>|t|) -#> (Intercept) 75.0287 6.6260 11.323 1.26e-14 *** -#> INC -1.1089 0.3738 -2.967 0.00485 ** -#> HOVAL -0.2897 0.1014 -2.858 0.00649 ** -#> lag.INC -1.3710 0.5613 -2.443 0.01867 * -#> lag.HOVAL 0.1918 0.2003 0.957 0.34369 -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 10.93 on 44 degrees of freedom -#> Multiple R-squared: 0.6088, Adjusted R-squared: 0.5732 -#> F-statistic: 17.12 on 4 and 44 DF, p-value: 1.553e-08 +#> Estimate Std. Error t value Pr(>|t|) +#> (Intercept) 7.503e+01 6.626e+00 1.132e+01 1.261e-14 +#> INC -1.109e+00 3.738e-01 -2.967e+00 4.854e-03 +#> HOVAL -2.897e-01 1.014e-01 -2.858e+00 6.486e-03 +#> lag.INC -1.371e+00 5.613e-01 -2.443e+00 1.867e-02 +#> lag.HOVAL 1.918e-01 2.003e-01 9.572e-01 3.437e-01 #> summary(impacts(COL.SLX)) #> Impact measures (SlX, glht, n-k): @@ -225,25 +234,15 @@

Examples

#> lm(formula = formula(paste("y ~ ", paste(colnames(x)[-1], collapse = "+"))), #> data = as.data.frame(x), weights = weights) #> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -33.974 -7.764 0.907 6.820 24.395 -#> #> Coefficients: -#> Estimate Std. Error t value Pr(>|t|) -#> (Intercept) 92.459835 19.278187 4.796 2.06e-05 *** -#> INC -0.947594 0.398833 -2.376 0.0221 * -#> HOVAL -0.777428 0.464457 -1.674 0.1016 -#> I.HOVAL.2. 0.004640 0.004226 1.098 0.2785 -#> lag.INC -1.275339 0.596874 -2.137 0.0385 * -#> lag.HOVAL -0.355048 0.982132 -0.362 0.7195 -#> lag.I.HOVAL.2. 0.005608 0.009084 0.617 0.5403 -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 10.99 on 42 degrees of freedom -#> Multiple R-squared: 0.6224, Adjusted R-squared: 0.5684 -#> F-statistic: 11.54 on 6 and 42 DF, p-value: 1.361e-07 +#> Estimate Std. Error t value Pr(>|t|) +#> (Intercept) 9.246e+01 1.928e+01 4.796e+00 2.058e-05 +#> INC -9.476e-01 3.988e-01 -2.376e+00 2.214e-02 +#> HOVAL -7.774e-01 4.645e-01 -1.674e+00 1.016e-01 +#> I.HOVAL.2. 4.640e-03 4.226e-03 1.098e+00 2.785e-01 +#> lag.INC -1.275e+00 5.969e-01 -2.137e+00 3.849e-02 +#> lag.HOVAL -3.550e-01 9.821e-01 -3.615e-01 7.195e-01 +#> lag.I.HOVAL.2. 5.608e-03 9.084e-03 6.174e-01 5.403e-01 #> COL.SLX <- lmSLX(CRIME ~ INC + HOVAL + I(HOVAL^2), data=COL.OLD, listw=lw, Durbin=~INC) summary(impacts(COL.SLX)) @@ -277,23 +276,13 @@

Examples

#> lm(formula = formula(paste("y ~ ", paste(colnames(x)[-1], collapse = "+"))), #> data = as.data.frame(x), weights = weights) #> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -35.908 -7.085 0.770 7.147 24.684 -#> #> Coefficients: -#> Estimate Std. Error t value Pr(>|t|) -#> (Intercept) 83.679968 9.264846 9.032 1.4e-11 *** -#> INC -1.079065 0.384711 -2.805 0.00747 ** -#> HOVAL -0.634519 0.447601 -1.418 0.16335 -#> I.HOVAL.2. 0.003455 0.004110 0.841 0.40510 -#> lag.INC -1.010896 0.455267 -2.220 0.03159 * -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 10.96 on 44 degrees of freedom -#> Multiple R-squared: 0.607, Adjusted R-squared: 0.5712 -#> F-statistic: 16.99 on 4 and 44 DF, p-value: 1.716e-08 +#> Estimate Std. Error t value Pr(>|t|) +#> (Intercept) 8.368e+01 9.265e+00 9.032e+00 1.401e-11 +#> INC -1.079e+00 3.847e-01 -2.805e+00 7.466e-03 +#> HOVAL -6.345e-01 4.476e-01 -1.418e+00 1.634e-01 +#> I.HOVAL.2. 3.455e-03 4.110e-03 8.406e-01 4.051e-01 +#> lag.INC -1.011e+00 4.553e-01 -2.220e+00 3.159e-02 #> COL.SLX <- lmSLX(CRIME ~ INC, data=COL.OLD, listw=lw) summary(COL.SLX) @@ -302,21 +291,11 @@

Examples

#> lm(formula = formula(paste("y ~ ", paste(colnames(x)[-1], collapse = "+"))), #> data = as.data.frame(x), weights = weights) #> -#> Residuals: -#> Min 1Q Median 3Q Max -#> -49.297 -6.658 0.669 7.315 29.826 -#> #> Coefficients: -#> Estimate Std. Error t value Pr(>|t|) -#> (Intercept) 73.9849 6.2081 11.918 1.16e-15 *** -#> INC -1.5889 0.3564 -4.458 5.28e-05 *** -#> lag.INC -1.0859 0.4812 -2.257 0.0288 * -#> --- -#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 -#> -#> Residual standard error: 11.65 on 46 degrees of freedom -#> Multiple R-squared: 0.5353, Adjusted R-squared: 0.5151 -#> F-statistic: 26.49 on 2 and 46 DF, p-value: 2.214e-08 +#> Estimate Std. Error t value Pr(>|t|) +#> (Intercept) 7.398e+01 6.208e+00 1.192e+01 1.155e-15 +#> INC -1.589e+00 3.564e-01 -4.458e+00 5.276e-05 +#> lag.INC -1.086e+00 4.812e-01 -2.257e+00 2.882e-02 #> summary(impacts(COL.SLX)) #> Impact measures (SlX, glht, n-k): diff --git a/docs/reference/SpatialFiltering.html b/docs/reference/SpatialFiltering.html index 0438ab7..8848dff 100644 --- a/docs/reference/SpatialFiltering.html +++ b/docs/reference/SpatialFiltering.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2
diff --git a/docs/reference/aple.html b/docs/reference/aple.html index 398ac03..a441c45 100644 --- a/docs/reference/aple.html +++ b/docs/reference/aple.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2

diff --git a/docs/reference/aple.mc.html b/docs/reference/aple.mc.html index ad8e8c8..2b8014c 100644 --- a/docs/reference/aple.mc.html +++ b/docs/reference/aple.mc.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/aple.plot.html b/docs/reference/aple.plot.html index f792cb2..1dd8e1e 100644 --- a/docs/reference/aple.plot.html +++ b/docs/reference/aple.plot.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/do_ldet.html b/docs/reference/do_ldet.html index 7d93dd2..c150a12 100644 --- a/docs/reference/do_ldet.html +++ b/docs/reference/do_ldet.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/eigenw.html b/docs/reference/eigenw.html index b29e22d..45d29c9 100644 --- a/docs/reference/eigenw.html +++ b/docs/reference/eigenw.html @@ -23,7 +23,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/gstsls.html b/docs/reference/gstsls.html index 57884b0..54147f6 100644 --- a/docs/reference/gstsls.html +++ b/docs/reference/gstsls.html @@ -18,7 +18,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/impacts.html b/docs/reference/impacts.html index 6a506b2..a78cbbe 100644 --- a/docs/reference/impacts.html +++ b/docs/reference/impacts.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -247,7 +247,7 @@

Examples

#> ML residual variance (sigma squared): 99.164, (sigma: 9.9581) #> Number of observations: 49 #> Number of parameters estimated: 5 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 376.34, (AIC for lm: 382.75) #> LM test for residual autocorrelation #> test value: 0.19184, p-value: 0.66139 #> @@ -280,7 +280,7 @@

Examples

#> ML residual variance (sigma squared): 95.051, (sigma: 9.7494) #> Number of observations: 49 #> Number of parameters estimated: 7 -#> AIC: NA (not available for weighted model), (AIC for lm: 380.2) +#> AIC: 378.03, (AIC for lm: 380.2) #> LM test for residual autocorrelation #> test value: 0.101, p-value: 0.75063 #> @@ -312,7 +312,7 @@

Examples

#> ML residual variance (sigma squared): 99.846, (sigma: 9.9923) #> Number of observations: 49 #> Number of parameters estimated: 6 -#> AIC: NA (not available for weighted model), (AIC for lm: 379.57) +#> AIC: 378.13, (AIC for lm: 379.57) #> LM test for residual autocorrelation #> test value: 2.5646, p-value: 0.10928 #> diff --git a/docs/reference/index.html b/docs/reference/index.html index 4e93c3e..edcf325 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -87,7 +87,7 @@

All functions

Bayesian MCMC spatial simultaneous autoregressive model estimation

-

lmSLX() create_WX() impacts(<SlX>) print(<WXimpact>) summary(<WXimpact>) predict(<SlX>)

+

lmSLX() print(<SlX>) summary(<SlX>) print(<summary.SlX>) impacts(<SlX>) print(<WXimpact>) summary(<WXimpact>) predict(<SlX>) create_WX()

Spatial Durbin linear (SLX, spatially lagged X) model

diff --git a/docs/reference/invIrM-1.png b/docs/reference/invIrM-1.png index f2caba2..708c8ff 100644 Binary files a/docs/reference/invIrM-1.png and b/docs/reference/invIrM-1.png differ diff --git a/docs/reference/invIrM.html b/docs/reference/invIrM.html index 79aba82..9b85742 100644 --- a/docs/reference/invIrM.html +++ b/docs/reference/invIrM.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/lagmess.html b/docs/reference/lagmess.html index 7a721cc..a9a2f18 100644 --- a/docs/reference/lagmess.html +++ b/docs/reference/lagmess.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -191,60 +191,66 @@

Examples

#> Observed Moran I Expectation Variance #> 0.245149959 -0.007853660 0.001148722 #> -spdep::lm.LMtests(obj1, lw, test="all") +spdep::lm.LMtests(obj1, lw, test="all") +#> Please update scripts to use lm.RStests in place of lm.LMtests #> -#> Lagrange multiplier diagnostics for spatial dependence +#> Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial +#> dependence #> #> data: #> model: lm(formula = log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data = #> baltimore) -#> weights: lw +#> test weights: listw #> -#> LMerr = 48.648, df = 1, p-value = 3.063e-12 +#> RSerr = 48.648, df = 1, p-value = 3.063e-12 #> #> -#> Lagrange multiplier diagnostics for spatial dependence +#> Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial +#> dependence #> #> data: #> model: lm(formula = log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data = #> baltimore) -#> weights: lw +#> test weights: listw #> -#> LMlag = 83.091, df = 1, p-value < 2.2e-16 +#> RSlag = 83.091, df = 1, p-value < 2.2e-16 #> #> -#> Lagrange multiplier diagnostics for spatial dependence +#> Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial +#> dependence #> #> data: #> model: lm(formula = log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data = #> baltimore) -#> weights: lw +#> test weights: listw #> -#> RLMerr = 1.2535, df = 1, p-value = 0.2629 +#> adjRSerr = 1.2535, df = 1, p-value = 0.2629 #> #> -#> Lagrange multiplier diagnostics for spatial dependence +#> Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial +#> dependence #> #> data: #> model: lm(formula = log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data = #> baltimore) -#> weights: lw +#> test weights: listw #> -#> RLMlag = 35.696, df = 1, p-value = 2.306e-09 +#> adjRSlag = 35.696, df = 1, p-value = 2.306e-09 #> #> -#> Lagrange multiplier diagnostics for spatial dependence +#> Rao's score (a.k.a Lagrange multiplier) diagnostics for spatial +#> dependence #> #> data: #> model: lm(formula = log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data = #> baltimore) -#> weights: lw +#> test weights: listw #> #> SARMA = 84.344, df = 2, p-value < 2.2e-16 #> system.time(obj2 <- lagmess(log(PRICE) ~ PATIO + log(AGE) + log(SQFT), data=baltimore, listw=lw)) #> user system elapsed -#> 0.034 0.000 0.035 +#> 0.034 0.000 0.034 (x <- summary(obj2)) #> Matrix exponential spatial lag model: #> @@ -344,7 +350,7 @@

Examples

#> ML residual variance (sigma squared): 0.1589, (sigma: 0.39862) #> Number of observations: 211 #> Number of parameters estimated: 6 -#> AIC: NA (not available for weighted model), (AIC for lm: 283.51) +#> AIC: 232.85, (AIC for lm: 283.51) #> LM test for residual autocorrelation #> test value: 8.7942, p-value: 0.0030219 #> @@ -391,7 +397,7 @@

Examples

#> ML residual variance (sigma squared): 0.019276, (sigma: 0.13884) #> Number of observations: 506 #> Number of parameters estimated: 16 -#> AIC: NA (not available for weighted model), (AIC for lm: -283.96) +#> AIC: -496.02, (AIC for lm: -283.96) #> LM test for residual autocorrelation #> test value: 10.74, p-value: 0.0010486 #> diff --git a/docs/reference/lextrB.html b/docs/reference/lextrB.html index 66dd4ea..3fa582a 100644 --- a/docs/reference/lextrB.html +++ b/docs/reference/lextrB.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/predict.sarlm.html b/docs/reference/predict.sarlm.html index 5769d17..589cad6 100644 --- a/docs/reference/predict.sarlm.html +++ b/docs/reference/predict.sarlm.html @@ -21,7 +21,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/sarlm_tests.html b/docs/reference/sarlm_tests.html index 17f50d2..b7d8598 100644 --- a/docs/reference/sarlm_tests.html +++ b/docs/reference/sarlm_tests.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/set.mcOption.html b/docs/reference/set.mcOption.html index e9c25d7..581b9ae 100644 --- a/docs/reference/set.mcOption.html +++ b/docs/reference/set.mcOption.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/set.spChkOption.html b/docs/reference/set.spChkOption.html index 889f6b5..a1d3df4 100644 --- a/docs/reference/set.spChkOption.html +++ b/docs/reference/set.spChkOption.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/similar.listw.html b/docs/reference/similar.listw.html index 7229b44..420111a 100644 --- a/docs/reference/similar.listw.html +++ b/docs/reference/similar.listw.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/sparse_mat.html b/docs/reference/sparse_mat.html index e31d897..7789c86 100644 --- a/docs/reference/sparse_mat.html +++ b/docs/reference/sparse_mat.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -158,11 +158,11 @@

Examples

W <- as(lw, "CsparseMatrix") system.time(e <- invIrM(nb7rt, rho=0.98, method="solve", feasible=NULL) %*% x) #> user system elapsed -#> 0.003 0.000 0.003 +#> 0.003 0.000 0.002 system.time(ee <- powerWeights(W, rho=0.98, X=x)) #> Warning: not converged within order iterations #> user system elapsed -#> 0.185 0.004 0.189 +#> 0.182 0.004 0.186 str(attr(ee, "internal")) #> List of 5 #> $ series: num [1:250] 0.286 0.233 0.199 0.175 0.157 ... diff --git a/docs/reference/spautolm.html b/docs/reference/spautolm.html index c2b0db3..f61e39c 100644 --- a/docs/reference/spautolm.html +++ b/docs/reference/spautolm.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 diff --git a/docs/reference/stsls.html b/docs/reference/stsls.html index ed6230a..eed1125 100644 --- a/docs/reference/stsls.html +++ b/docs/reference/stsls.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -209,7 +209,7 @@

Examples

#> ML residual variance (sigma squared): 95.494, (sigma: 9.7721) #> Number of observations: 49 #> Number of parameters estimated: 5 -#> AIC: NA (not available for weighted model), (AIC for lm: 382.75) +#> AIC: 374.78, (AIC for lm: 382.75) #> LM test for residual autocorrelation #> test value: 0.31954, p-value: 0.57188 #> diff --git a/docs/reference/trW.html b/docs/reference/trW.html index fae3239..86baebb 100644 --- a/docs/reference/trW.html +++ b/docs/reference/trW.html @@ -17,7 +17,7 @@ spatialreg - 1.3-1 + 1.3-2 @@ -150,11 +150,11 @@

Examples

set.seed(1100) system.time(trMC <- trW(W, type="MC")) #> user system elapsed -#> 0.006 0.000 0.006 +#> 0.005 0.001 0.005 str(trMC) #> num [1:30] 0 10.91 3.69 5.36 3.64 ... #> - attr(*, "sd")= num [1:30] NA NA 0.598 0.495 0.489 ... -#> - attr(*, "timings")= Named num [1:2] 0.006 0.006 +#> - attr(*, "timings")= Named num [1:2] 0.005 0.005 #> ..- attr(*, "names")= chr [1:2] "user.self" "elapsed" #> - attr(*, "type")= chr "MC" #> - attr(*, "n")= int 49 @@ -169,10 +169,10 @@

Examples

W <- forceSymmetric(as(listwS, "CsparseMatrix")) system.time(trmom <- trW(listw=listwS, m=24, type="moments")) #> user system elapsed -#> 0.002 0.000 0.002 +#> 0.001 0.000 0.002 str(trmom) #> num [1:24] 0 10.91 3.65 5.62 3.66 ... -#> - attr(*, "timings")= Named num [1:2] 0.002 0.002 +#> - attr(*, "timings")= Named num [1:2] 0.001 0.002 #> ..- attr(*, "names")= chr [1:2] "user.self" "elapsed" #> - attr(*, "type")= chr "moments" #> - attr(*, "n")= int 49 @@ -180,10 +180,10 @@

Examples

#> [1] TRUE system.time(trMat <- trW(W, m=24, type="mult")) #> user system elapsed -#> 0.002 0.000 0.003 +#> 0.004 0.000 0.004 str(trMat) #> num [1:24] 0 10.91 3.65 5.62 3.66 ... -#> - attr(*, "timings")= Named num [1:2] 0.002 0.003 +#> - attr(*, "timings")= Named num [1:2] 0.003 0.004 #> ..- attr(*, "names")= chr [1:2] "user.self" "elapsed" #> - attr(*, "type")= chr "mult" #> - attr(*, "n")= int 49 @@ -192,11 +192,11 @@

Examples

set.seed(1) system.time(trMC <- trW(W, m=24, type="MC")) #> user system elapsed -#> 0.007 0.000 0.007 +#> 0.006 0.000 0.006 str(trMC) #> num [1:24] 0 10.91 2.44 4.97 2.82 ... #> - attr(*, "sd")= num [1:24] NA NA 0.618 0.501 0.451 ... -#> - attr(*, "timings")= Named num [1:2] 0.007 0.007 +#> - attr(*, "timings")= Named num [1:2] 0.006 0.006 #> ..- attr(*, "names")= chr [1:2] "user.self" "elapsed" #> - attr(*, "type")= chr "MC" #> - attr(*, "n")= int 49