Required current contributed CRAN packages:

I am running R 3.6.1, with recent update.packages().

needed <- c("coda", "INLABMA", "INLA", "ggplot2", "R2BayesX", "colorspace", "BayesXsrc", "HSAR", "hglm", "MatrixModels", "lme4", "spdep", "sp", "tmap", "spData", "sf")

Script

Script and data at https://github.com/rsbivand/ECS530_h19/raw/master/ECS530_VIII.zip. Download to suitable location, unzip and use as basis.

Schedule

  • 2/12 (I) Spatial data representation, (II) Support+topology, input/output

  • 3/12 (III) Coordinate reference systems, (IV) Visualization

  • 4/12 (VI) Spatial autocorrelation, project surgery

  • 5/12 (VII) Spatial regression, (VIII) Spatial multilevel regression

  • 6/12 (IX) Interpolation, point processes, project surgery

  • 7/12 Presentations

Session VIII

  • 13:15-13:45 Introduction, Boston data set (II)

  • 13:45-14:30 Multilevel Boston

  • 14:30-15:00 Bayesian spatial econometrics

Multilevel Boston

Reading the shapefile

Functions in sf are prefixed with st_ meaning spatio-temporal (following PostGIS); sf::st_read uses GDAL vector drivers:

library(sf)
## Linking to GEOS 3.8.0, GDAL 3.0.2, PROJ 6.2.1
library(spData)
b506 <- st_read(system.file("shapes/boston_tracts.shp", package="spData")[1])
## Reading layer `boston_tracts' from data source `/home/rsb/lib/r_libs/spData/shapes/boston_tracts.shp' using driver `ESRI Shapefile'
## Simple feature collection with 506 features and 36 fields
## geometry type:  POLYGON
## dimension:      XY
## bbox:           xmin: -71.52311 ymin: 42.00305 xmax: -70.63823 ymax: 42.67307
## epsg (SRID):    4267
## proj4string:    +proj=longlat +datum=NAD27 +no_defs

Aggregating geometries to model output zones

After dropping the censored census tracts, we need to derive the model output zones. The aggregate method calls sf::st_union on each unique grouping value, but the function called internally is a trick, putting only the first value of each variable in the output; for this reason we only retain the ids:

b489 <- b506[b506$censored == "no",]
t0 <- aggregate(b489, list(ids = b489$NOX_ID), head, n = 1)
b94 <- t0[, c("ids", attr(t0, "sf_column"))]

Finding model output zones neighbours

We can find contiguous neighbours using sf::st_relate, but this does not yet scale to large numbers of geometries; we also find a no-neighbour model output zone:

st_queen <- function(a, b = a) st_relate(a, b, pattern = "F***T****")
qm1 <- st_queen(b94)
## although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar
any(sapply(qm1, length) == 0)
## [1] TRUE

Problem of no-neighbour zone

Both Bayesian multilevel spatial model fitting approaches fail on the no-neighbour case (the spatially structured random effect cannot be estimated), so we need to drop those census tracts and re-aggregate to model output zones with neighbours:

NOX_ID_no_neighs <- b94$ids[which(sapply(qm1, length) == 0)]
b487 <- b489[is.na(match(b489$NOX_ID, NOX_ID_no_neighs)),]
t0 <- aggregate(b487, list(ids = b487$NOX_ID), head, n = 1)
b93 <- t0[, c("ids", attr(t0, "sf_column"))]

and finally create the same kind of nb object as used in spdep:

qm_93 <- st_queen(b93)
## although coordinates are longitude/latitude, st_relate_pattern assumes that they are planar
class(qm_93) <- "nb"
attr(qm_93, "region.id") <- as.character(b93$ids)

NOX values (parts per 10 million)

library(tmap)
tm_shape(b487) + tm_fill("NOX", n=7, style="fisher")

Multilevel spatial models

The ZN, INDUS, NOX, RAD, TAX and PTRATIO variables show effectively no variability within the TASSIM zones, so in a multilevel model the random effect may absorb their influence. The model as a whole, before introducing random effects, is:

form <- formula(log(median) ~ CRIM + ZN + INDUS + CHAS + I((NOX*10)^2) + I(RM^2) +
  AGE + log(DIS) + log(RAD) + TAX + PTRATIO + I(BB/100) + log(I(LSTAT/100)))

Empirical approach

We will be using row-standardised contiguity neighbours derived from the map of census tracts, and from the map of merged census tracts constituting approximate TASSIM zones

q487 <- st_queen(lwgeom::st_make_valid(b487))
q487[which(sapply(q487, length) == 0)] <- 0L
class(q487) <- "nb"
suppressPackageStartupMessages(library(spdep))
lw487 <- nb2listw(q487, zero.policy=TRUE)

Model comparisons

This is not completed as a proper set of comparisons with this data set - (Bivand et al. 2017; Bivand 2017) contains comparisons for Beijing land parcels and a housing data set for SW Norway. The baseline tract level residual spatial autocorrelation is measured using a proper Moran test (b487 is an sf object):

OLS <- lm(form, data=b487)
lm.morantest(OLS, lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Global Moran I for regression residuals
## 
## data:  
## model: lm(formula = form, data = b487)
## weights: lw487
## 
## Moran I statistic standard deviate = 15.898, p-value < 2.2e-16
## alternative hypothesis: two.sided
## sample estimates:
## Observed Moran I      Expectation         Variance 
##     0.4165620055    -0.0168821367     0.0007433579

Linear Mixed Effects

Here we fit air pollution model output zone unstructured random effects using lme4, and the residual spatial autocorrelation falls (indicative not proper test):

library(lme4)
## Loading required package: Matrix
MLM <- lmer(update(form, . ~ . + (1 | NOX_ID)), data=b487, REML=FALSE)
moran.test(residuals(MLM), lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  residuals(MLM)  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 2.0662, p-value = 0.03881
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.0555611072     -0.0020618557      0.0007777858
b93$MLM_re <- ranef(MLM)[[1]][,1]

Data setup

Both hglm and HSAR need sparse design matrices precomputed:

library(Matrix)
suppressMessages(library(MatrixModels))
Delta <- as(model.Matrix(~ -1 + as.factor(NOX_ID), data=b487, sparse=TRUE), "dgCMatrix")
M <- as(nb2listw(qm_93, style="B"), "CsparseMatrix")
## Registered S3 methods overwritten by 'spatialreg':
##   method                   from 
##   residuals.stsls          spdep
##   deviance.stsls           spdep
##   coef.stsls               spdep
##   print.stsls              spdep
##   summary.stsls            spdep
##   print.summary.stsls      spdep
##   residuals.gmsar          spdep
##   deviance.gmsar           spdep
##   coef.gmsar               spdep
##   fitted.gmsar             spdep
##   print.gmsar              spdep
##   summary.gmsar            spdep
##   print.summary.gmsar      spdep
##   print.lagmess            spdep
##   summary.lagmess          spdep
##   print.summary.lagmess    spdep
##   residuals.lagmess        spdep
##   deviance.lagmess         spdep
##   coef.lagmess             spdep
##   fitted.lagmess           spdep
##   logLik.lagmess           spdep
##   fitted.SFResult          spdep
##   print.SFResult           spdep
##   fitted.ME_res            spdep
##   print.ME_res             spdep
##   print.lagImpact          spdep
##   plot.lagImpact           spdep
##   summary.lagImpact        spdep
##   HPDinterval.lagImpact    spdep
##   print.summary.lagImpact  spdep
##   print.sarlm              spdep
##   summary.sarlm            spdep
##   residuals.sarlm          spdep
##   deviance.sarlm           spdep
##   coef.sarlm               spdep
##   vcov.sarlm               spdep
##   fitted.sarlm             spdep
##   logLik.sarlm             spdep
##   anova.sarlm              spdep
##   predict.sarlm            spdep
##   print.summary.sarlm      spdep
##   print.sarlm.pred         spdep
##   as.data.frame.sarlm.pred spdep
##   residuals.spautolm       spdep
##   deviance.spautolm        spdep
##   coef.spautolm            spdep
##   fitted.spautolm          spdep
##   print.spautolm           spdep
##   summary.spautolm         spdep
##   logLik.spautolm          spdep
##   print.summary.spautolm   spdep
##   print.WXImpact           spdep
##   summary.WXImpact         spdep
##   print.summary.WXImpact   spdep
##   predict.SLX              spdep

Using HGLM

Fitting the air pollution model output zone unstructured random effects using hierarchical GLM also works (indicative test):

library(hglm)
## Loading required package: MASS
## Loading required package: hglm.data
## 
## hglm: Hierarchical Generalized Linear Models
## Version 2.2-1 (2019-04-04) installed
## Authors: Moudud Alam, Lars Ronnegard, Xia Shen
## Maintainer: Xia Shen <xia.shen@ki.se>
## Use citation("hglm") to know how to cite our work.
## Discussion: https://r-forge.r-project.org/forum/?group_id=558
## BugReports: https://r-forge.r-project.org/tracker/?group_id=558
## VideoTutorials: http://www.youtube.com/playlist?list=PLn1OmZECD-n15vnYzvJDy5GxjNpVV5Jr8
y_hglm <- log(b487$median)
X_hglm <- model.matrix(OLS)
suppressWarnings(HGLM_iid <- hglm(y=y_hglm, X=X_hglm, Z=Delta))
moran.test(HGLM_iid$resid, lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  HGLM_iid$resid  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 1.9175, p-value = 0.05518
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.0514037549     -0.0020618557      0.0007774949

As does a Simultaneous Autoregressive (SAR) fitted with hglm, modelling with air pollution model output zone spatially structured random effects:

HGLM_sar <- hglm(y=y_hglm, X=X_hglm, Z=Delta, rand.family=SAR(D=M))
## Warning in hglm.default(y = y_hglm, X = X_hglm, Z = Delta, rand.family = SAR(D =
## M)): Residuals numerically 0 are replaced by 1e-8

## Warning in hglm.default(y = y_hglm, X = X_hglm, Z = Delta, rand.family = SAR(D =
## M)): Residuals numerically 0 are replaced by 1e-8
moran.test(HGLM_sar$resid, lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  HGLM_sar$resid  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 1.7161, p-value = 0.08614
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.0457782452     -0.0020618557      0.0007771106
b93$HGLM_re <- unname(HGLM_iid$ranef)
b93$HGLM_ss <- HGLM_sar$ranef[,1]

Unstructured random effects: TASSIM zones

brks <- seq(-0.6, 0.6, 0.15)
tm_shape(b93) + tm_fill(c("MLM_re", "HGLM_re"), breaks=brks)
## Variable "MLM_re" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Variable "HGLM_re" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.

Using HSAR

HSAR fits the model with air pollution model output zone spatially structured random effects using MCMC:

library(HSAR)
HSAR <- hsar(form, data=b487, W=NULL, M=M, Delta=Delta, 
             burnin=500, Nsim=5000, thinning=1)
## Warning: Function mcdet_setup moved to the spatialreg package
## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package

## Warning: Function do_ldet moved to the spatialreg package
b93$HSAR_ss <- HSAR$Mus[1,]

Spatially structured random effects: TASSIM zones

tm_shape(b93) + tm_fill(c("HGLM_ss", "HSAR_ss"), breaks=brks)
## Variable "HGLM_ss" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Variable "HSAR_ss" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.

Using R2BayesX

We can use R2BayesX for the same purposes, for both unstructured and spatially structured random effects by MCMC:

suppressPackageStartupMessages(library(R2BayesX))
BX_iid <- bayesx(update(form, . ~ . + sx(NOX_ID, bs="re")), family="gaussian",
data=b487, method="MCMC", iterations=12000, burnin=2000, step=2, seed=123)
moran.test(residuals(BX_iid), lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  residuals(BX_iid)  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 1.9259, p-value = 0.05411
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.0516469469     -0.0020618557      0.0007776892
b93$BX_re <- BX_iid$effects["sx(NOX_ID):re"][[1]]$Mean

The spatially structured random effects are modelled as an intrinsic Conditional Autoregressive (CAR), not a SAR with a parameter, but turn out very similar:

RBX_gra <- nb2gra(qm_93)
BX_mrf <- bayesx(update(form, . ~ . + sx(NOX_ID, bs="mrf", map=RBX_gra)), 
family="gaussian", data=b487, method="MCMC", iterations=12000, burnin=2000, 
step=2, seed=123)
moran.test(residuals(BX_mrf), lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  residuals(BX_mrf)  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 1.8493, p-value = 0.06442
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.0495021079     -0.0020618557      0.0007774822
b93$BX_ss <- BX_mrf$effects["sx(NOX_ID):mrf"][[1]]$Mean

BayesX separate model random effects

tm_shape(b93) +  tm_fill(c("BX_re", "BX_ss"), breaks=brks)
## Variable "BX_re" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Warning: Values have found that are higher than the highest break
## Variable "BX_ss" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.

BYM with BayesX

Combining the CAR and unstructured random effects in one model is the Besag, York, Mollie (BYM) model:

b487$d_id <- as.integer(as.factor(b487$NOX_ID))
BX_bym <- bayesx(update(form, . ~ . + sx(NOX_ID, bs="mrf", map=RBX_gra) + 
sx(d_id, bs="re")), family="gaussian", data=b487, method="MCMC", 
iterations=12000, burnin=2000, step=2, seed=123)
moran.test(residuals(BX_bym), lw487, alternative="two.sided", zero.policy=TRUE)
## 
##  Moran I test under randomisation
## 
## data:  residuals(BX_bym)  
## weights: lw487  n reduced by no-neighbour observations
##   
## 
## Moran I statistic standard deviate = 1.7971, p-value = 0.07231
## alternative hypothesis: two.sided
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.048050686      -0.002061856       0.000777544
b93$BX_ss_bym <- BX_bym$effects["sx(NOX_ID):mrf"][[1]]$Mean
b93$BX_re_bym <- BX_bym$effects["sx(d_id):re"][[1]]$Mean

BayesX BYM random effects

tm_shape(b93) + tm_fill(c("BX_re_bym", "BX_ss_bym"), breaks=brks)
## Variable "BX_re_bym" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.
## Warning: Values have found that are higher than the highest break
## Variable "BX_ss_bym" contains positive and negative values, so midpoint is set to 0. Set midpoint = NA to show the full spectrum of the color palette.

NOX coefficients

Looking at the NOX coefficients alone is disappointing, but recall that the upper level random effects do apply to NOX too so we could map their standard errors of which some are small compared to the effects:

library(ggplot2)
df_res <- as.data.frame(res)
names(df_res) <- c("mean", "sd")
limits <- aes(ymax = mean + qnorm(0.975)*sd, ymin=mean + qnorm(0.025)*sd)
df_res$model <- row.names(df_res)
p <- ggplot(df_res, aes(y=mean, x=model)) + geom_point() + geom_errorbar(limits) + geom_hline(yintercept = 0, col="#EB811B") + coord_flip()
p + ggtitle("NOX coefficients and error bars") + theme(plot.background = element_rect(fill = "transparent",colour = NA), legend.background = element_rect(colour = NA, fill = "transparent"))

Bayesian spatial econometrics

library(spdep)
# install INLA 
# install.packages("INLA", repos="https://inla.r-inla-download.org/R/stable")
library(INLA)
## This is INLA_18.07.12 built 2019-04-30 13:38:52 UTC.
## See www.r-inla.org/contact-us for how to get help.
## To enable PARDISO sparse library; see inla.pardiso()
library(INLABMA)
## Loading required package: parallel

Columbus toy data

data(oldcol)
lw <- nb2listw(COL.nb, style="W")
ev <- eigenw(similar.listw(lw))
## Warning: Function eigenw moved to the spatialreg package
## Registered S3 methods overwritten by 'spatialreg':
##   method                   from 
##   residuals.stsls          spdep
##   deviance.stsls           spdep
##   coef.stsls               spdep
##   print.stsls              spdep
##   summary.stsls            spdep
##   print.summary.stsls      spdep
##   residuals.gmsar          spdep
##   deviance.gmsar           spdep
##   coef.gmsar               spdep
##   fitted.gmsar             spdep
##   print.gmsar              spdep
##   summary.gmsar            spdep
##   print.summary.gmsar      spdep
##   print.lagmess            spdep
##   summary.lagmess          spdep
##   print.summary.lagmess    spdep
##   residuals.lagmess        spdep
##   deviance.lagmess         spdep
##   coef.lagmess             spdep
##   fitted.lagmess           spdep
##   logLik.lagmess           spdep
##   fitted.SFResult          spdep
##   print.SFResult           spdep
##   fitted.ME_res            spdep
##   print.ME_res             spdep
##   print.lagImpact          spdep
##   plot.lagImpact           spdep
##   summary.lagImpact        spdep
##   HPDinterval.lagImpact    spdep
##   print.summary.lagImpact  spdep
##   print.sarlm              spdep
##   summary.sarlm            spdep
##   residuals.sarlm          spdep
##   deviance.sarlm           spdep
##   coef.sarlm               spdep
##   vcov.sarlm               spdep
##   fitted.sarlm             spdep
##   logLik.sarlm             spdep
##   anova.sarlm              spdep
##   predict.sarlm            spdep
##   print.summary.sarlm      spdep
##   print.sarlm.pred         spdep
##   as.data.frame.sarlm.pred spdep
##   residuals.spautolm       spdep
##   deviance.spautolm        spdep
##   coef.spautolm            spdep
##   fitted.spautolm          spdep
##   print.spautolm           spdep
##   summary.spautolm         spdep
##   logLik.spautolm          spdep
##   print.summary.spautolm   spdep
##   print.WXImpact           spdep
##   summary.WXImpact         spdep
##   print.summary.WXImpact   spdep
##   predict.SLX              spdep
## Warning: Function similar.listw moved to the spatialreg package
W <- listw2mat(lw)
sW <- as(lw, "CsparseMatrix")
tr <- trW(sW)
## Warning: Function trW moved to the spatialreg package
m.form <-  CRIME ~ INC + HOVAL
COL.OLD$LAG_INC <- lag(lw, COL.OLD$INC)
COL.OLD$LAG_HOVAL <- lag(lw, COL.OLD$HOVAL)
COL.OLD$idx <- 1:nrow(COL.OLD)
dm.form <- CRIME ~ INC + HOVAL + LAG_INC + LAG_HOVAL

Simulation framework

titer <- 2000L
nomit <- 1000L
niter <- titer - nomit
thin <- 1L

Check Durbin

coefficients(lmSLX(m.form, data=COL.OLD, listw=lw))
## Warning: Function lmSLX moved to the spatialreg package
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL 
##  75.0287479  -1.1089293  -0.2897283  -1.3709725   0.1917608
coefficients(lm(dm.form, data=COL.OLD))
## (Intercept)         INC       HOVAL     LAG_INC   LAG_HOVAL 
##  75.0287479  -1.1089293  -0.2897283  -1.3709725   0.1917608

Try hglm

library(hglm)
suppressWarnings(sem.hglm <- hglm(fixed=m.form, random= ~ 1 | I(as.factor(idx)),
                data=COL.OLD, rand.family=SAR(D=sW), sparse=TRUE, verbose=FALSE))

HGLM SEM

summary(sem.hglm)
## Call: 
## hglm.formula(rand.family = SAR(D = sW), fixed = m.form, random = ~1 | 
##     I(as.factor(idx)), data = COL.OLD, sparse = TRUE, verbose = FALSE)
## 
## ----------
## MEAN MODEL
## ----------
## 
## Summary of the fixed effects estimates:
## 
##             Estimate Std. Error t-value Pr(>|t|)    
## (Intercept) 62.50869    6.21608  10.056 6.99e-07 ***
## INC         -0.93132    0.33604  -2.771  0.01818 *  
## HOVAL       -0.31695    0.09674  -3.276  0.00738 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Note: P-values are based on 11 degrees of freedom
## 
## Summary of the random effects estimates:
## 
##      Estimate Std. Error
## [1,]  -9.8292    32.5390
## [2,] -12.7254     5.7258
## [3,]  -1.8897     7.0867
## ...
## NOTE: to show all the random effects, use print(summary(hglm.object), print.ranef = TRUE).
## 
## ----------------
## DISPERSION MODEL
## ----------------
## 
## NOTE: h-likelihood estimates through EQL can be biased.
## 
## Dispersion parameter for the mean model:
## [1] 22.30184
## 
## Model estimates for the dispersion term:
## 
## Link = log 
## 
## Effects:
##   Estimate Std. Error 
##     3.1047     0.4182 
## 
## Dispersion = 1 is used in Gamma model on deviances to calculate the standard error(s).
## 
## Dispersion parameter for the random effects:
## [1] 1.119
## 
## Dispersion model for the random effects:
## 
## Link = log
## 
## Effects:
## .|Random1 
##                        Estimate Std. Error
## 1/sqrt(SAR.tau)          0.1120     0.0144
## -SAR.rho/sqrt(SAR.tau)  -0.0813     0.0202
## SAR.tau (estimated spatial variance component): 79.67263 
## SAR.rho (estimated spatial correlation): 0.7254112 
## 
## Dispersion = 1 is used in Gamma model on deviances to calculate the standard error(s).
## 
## EQL estimation converged in 49 iterations.

ML SEM

sem.ml <- errorsarlm(m.form, data = COL.OLD, listw=lw, control=list(pre_eig=ev))
## Warning: Function errorsarlm moved to the spatialreg package
summary(sem.ml)
## 
## Call:spatialreg::errorsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, etype = etype, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -34.81174  -6.44031  -0.72142   7.61476  23.33626 
## 
## Type: error 
## Coefficients: (asymptotic standard errors) 
##              Estimate Std. Error z value  Pr(>|z|)
## (Intercept) 59.893219   5.366163 11.1613 < 2.2e-16
## INC         -0.941312   0.330569 -2.8476 0.0044057
## HOVAL       -0.302250   0.090476 -3.3407 0.0008358
## 
## Lambda: 0.56179, LR test value: 7.9935, p-value: 0.0046945
## Asymptotic standard error: 0.13387
##     z-value: 4.1966, p-value: 2.7098e-05
## Wald statistic: 17.611, p-value: 2.7098e-05
## 
## Log likelihood: -183.3805 for error model
## ML residual variance (sigma squared): 95.575, (sigma: 9.7762)
## Number of observations: 49 
## Number of parameters estimated: 5 
## AIC: 376.76, (AIC for lm: 382.75)

SET SEM (griddy Gibbs I)

sem.SET0 <- spBreg_err(m.form, data = COL.OLD, listw=lw,
              control=list(ndraw=titer, nomit=nomit, prior=list(gG_sige=TRUE)))
## Warning: Function spBreg_err moved to the spatialreg package
summary(sem.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean       SD Naive SE Time-series SE
## (Intercept)  59.7340  7.11046 0.224852       0.199053
## INC          -0.9378  0.40192 0.012710       0.012710
## HOVAL        -0.3044  0.09766 0.003088       0.003088
## lambda        0.5651  0.15423 0.004877       0.004877
## sige        114.6937 26.72112 0.844996       0.913386
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%    97.5%
## (Intercept) 46.8682 55.4334  60.0295  64.4015  72.5018
## INC         -1.7806 -1.1908  -0.9168  -0.6665  -0.1894
## HOVAL       -0.4949 -0.3665  -0.3056  -0.2381  -0.1147
## lambda       0.2114  0.4737   0.5768   0.6751   0.8189
## sige        72.9442 96.6686 110.7353 129.9439 178.8313
library(coda)
raftery.diag(sem.SET0, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        893   937          0.953     
##  INC         2        893   937          0.953     
##  HOVAL       2        893   937          0.953     
##  lambda      2        969   937          1.030     
##  sige        2        893   937          0.953
geweke.diag(sem.SET0)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL      lambda        sige 
##   -0.470677   -0.009002   -0.129720    0.468858   -0.030048

SET SEM (griddy Gibbs II)

sem.SET1 <- spBreg_err(m.form, data = COL.OLD, listw=lw,
              control=list(ndraw=titer, nomit=nomit, prior=list(gG_sige=FALSE)))
## Warning: Function spBreg_err moved to the spatialreg package
summary(sem.SET1)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean      SD Naive SE Time-series SE
## (Intercept)  59.5182  7.3438 0.232233       0.232233
## INC          -0.9578  0.3958 0.012516       0.012516
## HOVAL        -0.2941  0.1006 0.003181       0.003181
## lambda        0.5664  0.1555 0.004918       0.004918
## sige        116.5078 27.1101 0.857295       0.925868
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%    97.5%
## (Intercept) 42.3692 55.7763  60.1676  64.3236  72.3282
## INC         -1.7740 -1.2189  -0.9501  -0.7084  -0.1718
## HOVAL       -0.4928 -0.3597  -0.2932  -0.2223  -0.1082
## lambda       0.2465  0.4627   0.5743   0.6771   0.8389
## sige        76.6677 97.2156 112.2240 130.3088 181.2825
raftery.diag(sem.SET1, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        969   937          1.030     
##  INC         2        893   937          0.953     
##  HOVAL       2        969   937          1.030     
##  lambda      2        893   937          0.953     
##  sige        2        893   937          0.953
geweke.diag(sem.SET1)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL      lambda        sige 
##     -2.1563      2.3775     -0.3098      0.4866      1.7668

SET SEM (MH)

sem.SET2 <- spBreg_err(m.form, data = COL.OLD, listw=lw,
              control=list(ndraw=titer, nomit=nomit, prior=list(lambdaMH=TRUE)))
## Warning: Function spBreg_err moved to the spatialreg package
summary(sem.SET2)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean      SD Naive SE Time-series SE
## (Intercept)  59.5461 25.5326 0.807410       0.427653
## INC          -0.9096  0.3980 0.012587       0.017280
## HOVAL        -0.3031  0.1000 0.003162       0.003162
## lambda        0.6043  0.1469 0.004645       0.013175
## sige        116.8077 26.9728 0.852955       1.099196
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%    97.5%
## (Intercept) 44.1809 55.3499  59.4243  63.8802  72.4793
## INC         -1.7093 -1.1407  -0.8972  -0.6518  -0.1255
## HOVAL       -0.5033 -0.3714  -0.3010  -0.2390  -0.1152
## lambda       0.2464  0.5262   0.6212   0.6991   0.8553
## sige        74.7953 96.7201 112.5818 132.3254 179.8625
raftery.diag(sem.SET2, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 3        1053  937          1.12      
##  INC         3        1143  937          1.22      
##  HOVAL       2        969   937          1.03      
##  lambda      16       4666  937          4.98      
##  sige        2        969   937          1.03
geweke.diag(sem.SET2)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL      lambda        sige 
##     -0.8547      0.7904     -0.9949      0.4025      0.5908

INLA setup

n <- nrow(COL.OLD)
rho.max <- 1/max(Re(ev))
rho.min <- 1/min(Re(ev))
rho <- mean(c(rho.min, rho.max))

INLA_slm SEM setup

zero.variance = list(prec=list(initial = 25, fixed=TRUE))
args.slm <- list(rho.min = rho.min, rho.max = rho.max, W = sW,
              X = matrix(0, nrow=n, ncol=0), Q.beta = matrix(1,0,0))
hyper.slm <- list(prec = list(prior = "loggamma", param = c(0.01, 0.01)),
              rho = list(initial=rho, prior = "logitbeta", param = c(1,1)))

INLA_slm SEM

system.time(sem.inla_slm <- inla(update(m.form, . ~ . + f(idx, model="slm",
                  args.slm=args.slm, hyper=hyper.slm)), data = COL.OLD,
                  family="gaussian", control.family = list(hyper=zero.variance),
                  control.compute=list(dic=TRUE, cpo=TRUE)))
## Warning in inla.model.properties.generic(inla.trim.family(model), (mm[names(mm) == : Model 'slm' in section 'latent' is marked as 'experimental'; changes may appear at any time.
##   Use this model with extra care!!! Further warnings are disabled.
print(summary(sem.inla_slm))
## 
## Call:
## c("inla(formula = update(m.form, . ~ . + f(idx, model = \"slm\", args.slm = args.slm, ",  "    hyper = hyper.slm)), family = \"gaussian\", data = COL.OLD, ",  "    control.compute = list(dic = TRUE, cpo = TRUE), control.family = list(hyper = zero.variance))" )
## 
## Time used:
##  Pre-processing    Running inla Post-processing           Total 
##          0.1607          1.0015          0.0336          1.1958 
## 
## Fixed effects:
##                mean     sd 0.025quant 0.5quant 0.975quant    mode kld
## (Intercept) 59.8873 6.9552    45.2955  60.1809    72.7865 60.7290   0
## INC         -0.9516 0.4006    -1.7657  -0.9413    -0.1903 -0.9175   0
## HOVAL       -0.3006 0.0955    -0.4883  -0.3008    -0.1118 -0.3012   0
## 
## Random effects:
## Name   Model
##  idx   SLM model 
## 
## Model hyperparameters:
##                     mean     sd 0.025quant 0.5quant 0.975quant   mode
## Precision for idx 0.0099 0.0017     0.0070   0.0097     0.0138 0.0094
## Rho for idx       0.8319 0.0235     0.7821   0.8332     0.8742 0.8357
## 
## Expected number of effective parameters(std dev): 49.00(0.00)
## Number of equivalent replicates : 1.00 
## 
## Deviance Information Criterion (DIC) ...............: -1036.94
## Deviance Information Criterion (DIC, saturated) ....: 98.00
## Effective number of parameters .....................: 49.00
## 
## Marginal log-Likelihood:  -199.56 
## CPO and PIT are computed
## 
## Posterior marginals for linear predictor and fitted values computed
ff<- function(z){z*(rho.max-rho.min)+rho.min}
semmarg <- inla.tmarginal(ff, sem.inla_slm$marginals.hyperpar[[2]]) 
c(mean=mean(semmarg[, "x"]), se=sd(semmarg[, "x"]))
##      mean        se 
## 0.5735414 0.0593399

SEM coefficients and SEs

sem_res
##             sem_ml_coefs sem_hglm_coefs sem_SET0_coefs sem_SET1_coefs
## (Intercept)  59.89321925    62.50869055    59.73400690     59.5182107
##               5.36616252     6.21608063     7.11045586      7.3438418
## INC          -0.94131196    -0.93132065    -0.93779570     -0.9578264
##               0.33056857     0.33603590     0.40192460      0.3958049
## HOVAL        -0.30225021    -0.31694784    -0.30439237     -0.2940770
##               0.09047605     0.09674369     0.09766375      0.1005883
## lambda        0.56179027     0.72541120     0.56505353      0.5663672
##               0.13386868             NA     0.15422740      0.1555314
## s2           95.57450122             NA   114.69370268    116.5078019
##                       NA             NA    26.72111898     27.1100573
##             sem_SET2_coefs sem_inla_slm_coefs
## (Intercept)     59.5460729         59.8873000
##                 25.5325535          6.9552000
## INC             -0.9096225         -0.9516000
##                  0.3980359          0.4006000
## HOVAL           -0.3031350         -0.3006000
##                  0.0999971          0.0955000
## lambda           0.6042894          0.5735414
##                  0.1469017          0.0593399
## s2             116.8076769                 NA
##                 26.9728151                 NA

SDEM ML

sdem.ml <- errorsarlm(m.form, data = COL.OLD, listw=lw, Durbin=TRUE, 
            control=list(pre_eig=ev))
## Warning: Function errorsarlm moved to the spatialreg package
summary(sdem.ml)
## 
## Call:spatialreg::errorsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, etype = etype, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -37.31635  -6.54376  -0.22212   6.44591  23.15801 
## 
## Type: error 
## Coefficients: (asymptotic standard errors) 
##              Estimate Std. Error z value  Pr(>|z|)
## (Intercept) 73.545133   8.783543  8.3731 < 2.2e-16
## INC         -1.051673   0.319514 -3.2915 0.0009966
## HOVAL       -0.275608   0.091151 -3.0236 0.0024976
## lag.INC     -1.156711   0.578629 -1.9991 0.0456024
## lag.HOVAL    0.111691   0.198993  0.5613 0.5746048
## 
## Lambda: 0.4254, LR test value: 4.9871, p-value: 0.025537
## Asymptotic standard error: 0.15842
##     z-value: 2.6852, p-value: 0.0072485
## Wald statistic: 7.2103, p-value: 0.0072485
## 
## Log likelihood: -181.5846 for error model
## ML residual variance (sigma squared): 92.531, (sigma: 9.6193)
## Number of observations: 49 
## Number of parameters estimated: 7 
## AIC: 377.17, (AIC for lm: 380.16)
sdem.ml_imps <- summary(spdep::impacts(sdem.ml), zstats=TRUE, short=TRUE)
## Warning: Method impacts.sarlm moved to the spatialreg package
a1 <- expand.grid(colnames(sdem.ml_imps$mat), rownames(sdem.ml_imps$mat))
imp_nms <- c(t(cbind(paste(as.character(a1$Var1), as.character(a1$Var2), sep="_"), 
            c(" ", "  ", "   ", "    ", "     ", "      "))))
print(sdem.ml_imps)
## Impact measures (SDEM, estimable, n):
##           Direct   Indirect      Total
## INC   -1.0516727 -1.1567109 -2.2083836
## HOVAL -0.2756084  0.1116912 -0.1639172
## ========================================================
## Standard errors:
##           Direct  Indirect     Total
## INC   0.31951388 0.5786287 0.6478636
## HOVAL 0.09115142 0.1989927 0.2346288
## ========================================================
## Z-values:
##          Direct   Indirect      Total
## INC   -3.291477 -1.9990554 -3.4087171
## HOVAL -3.023633  0.5612828 -0.6986236
## 
## p-values:
##       Direct     Indirect Total     
## INC   0.00099663 0.045602 0.00065269
## HOVAL 0.00249759 0.574605 0.48478731

SDEM SET (griddy Gibbs I)

system.time(sdem.SET0 <- spBreg_err(m.form, data = COL.OLD, listw=lw,
              Durbin=TRUE, control=list(ndraw=titer, nomit=nomit,
              prior=list(gG_sige=TRUE))))
## Warning: Function spBreg_err moved to the spatialreg package
##    user  system elapsed 
##   1.068   0.000   1.076
summary(sdem.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                  Mean      SD Naive SE Time-series SE
## (Intercept)  72.87049 11.4777 0.362956       0.362956
## INC          -1.02459  0.3721 0.011767       0.011767
## HOVAL        -0.28009  0.1006 0.003180       0.003180
## lag.INC      -1.06515  0.7267 0.022981       0.022981
## lag.HOVAL     0.09095  0.2377 0.007516       0.007516
## lambda        0.47520  0.1796 0.005681       0.005681
## sige        113.52076 26.4255 0.835648       0.928459
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%     97.5%
## (Intercept) 47.6531 66.1485  72.7147  80.3753  95.07897
## INC         -1.7451 -1.2800  -1.0285  -0.7670  -0.30478
## HOVAL       -0.4762 -0.3443  -0.2806  -0.2137  -0.08723
## lag.INC     -2.4277 -1.5662  -1.1158  -0.5627   0.39970
## lag.HOVAL   -0.4133 -0.0581   0.1007   0.2579   0.52749
## lambda       0.0975  0.3577   0.4857   0.6078   0.79590
## sige        73.1513 94.4992 110.6367 129.0171 172.73801
sdem.SET0_imps <- summary(spdep::impacts(sdem.SET0), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sem_g moved to the spatialreg package
print(sdem.SET0_imps)
## Impact measures (SDEM, MCMC, n):
##           Direct    Indirect      Total
## INC   -1.0245883 -1.06515408 -2.0897424
## HOVAL -0.2800881  0.09095049 -0.1891376
## ========================================================
## Standard errors:
##           Direct  Indirect     Total
## INC   0.35261233 0.6886563 0.8088179
## HOVAL 0.09529034 0.2252301 0.2657293
## ========================================================
## Z-values:
##          Direct   Indirect     Total
## INC   -2.905708 -1.5467136 -2.583699
## HOVAL -2.939312  0.4038115 -0.711768
## 
## p-values:
##       Direct    Indirect Total    
## INC   0.0036642 0.12193  0.0097747
## HOVAL 0.0032894 0.68635  0.4766084
raftery.diag(sdem.SET0, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        969   937          1.030     
##  INC         2        893   937          0.953     
##  HOVAL       2        893   937          0.953     
##  lag.INC     2        969   937          1.030     
##  lag.HOVAL   2        893   937          0.953     
##  lambda      2        893   937          0.953     
##  sige        2        893   937          0.953
geweke.diag(sdem.SET0)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL      lambda 
##     0.80470     0.77056    -0.56980    -0.81012    -0.26223    -0.06455 
##        sige 
##     0.57215

SDEM SET (griddy Gibbs II)

sdem.SET1 <- spBreg_err(m.form, data = COL.OLD, listw=lw, Durbin=TRUE,
              control=list(ndraw=titer, nomit=nomit, prior=list(gG_sige=FALSE)))
## Warning: Function spBreg_err moved to the spatialreg package
summary(sdem.SET1)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean      SD Naive SE Time-series SE
## (Intercept)  72.5361 11.3992 0.360474       0.360474
## INC          -1.0268  0.3825 0.012096       0.012096
## HOVAL        -0.2799  0.1064 0.003364       0.003364
## lag.INC      -1.0918  0.7455 0.023576       0.023576
## lag.HOVAL     0.1097  0.2324 0.007350       0.007510
## lambda        0.4957  0.1697 0.005365       0.005365
## sige        115.6351 26.4974 0.837921       0.967797
## 
## 2. Quantiles for each variable:
## 
##                2.5%      25%      50%      75%     97.5%
## (Intercept) 49.3037 66.00242  73.1523  79.7247  93.39035
## INC         -1.7483 -1.29412  -1.0284  -0.7620  -0.27914
## HOVAL       -0.4826 -0.35307  -0.2826  -0.2049  -0.06686
## lag.INC     -2.4637 -1.58978  -1.1035  -0.6197   0.42155
## lag.HOVAL   -0.3330 -0.03377   0.1057   0.2556   0.55573
## lambda       0.1324  0.38669   0.5068   0.6141   0.79295
## sige        75.0010 96.32843 112.1690 130.3769 178.67623
sdem.SET1_imps <- summary(spdep::impacts(sdem.SET1), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sem_g moved to the spatialreg package
print(sdem.SET1_imps)
## Impact measures (SDEM, MCMC, n):
##           Direct   Indirect     Total
## INC   -1.0268266 -1.0918457 -2.118672
## HOVAL -0.2798893  0.1097153 -0.170174
## ========================================================
## Standard errors:
##          Direct  Indirect     Total
## INC   0.3624562 0.7064650 0.8359926
## HOVAL 0.1008089 0.2202565 0.2664718
## ========================================================
## Z-values:
##          Direct   Indirect      Total
## INC   -2.832967 -1.5455056 -2.5343196
## HOVAL -2.776436  0.4981252 -0.6386192
## 
## p-values:
##       Direct    Indirect Total   
## INC   0.0046118 0.12222  0.011267
## HOVAL 0.0054958 0.61840  0.523071
raftery.diag(sdem.SET1, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        969   937          1.030     
##  INC         3        1053  937          1.120     
##  HOVAL       2        969   937          1.030     
##  lag.INC     3        1053  937          1.120     
##  lag.HOVAL   2        893   937          0.953     
##  lambda      2        893   937          0.953     
##  sige        2        969   937          1.030
geweke.diag(sdem.SET1)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL      lambda 
##     -0.4041      0.4260      0.0260     -1.9911      2.6291      1.0747 
##        sige 
##      0.1180

SDEM SET (MH)

sdem.SET2 <- spBreg_err(m.form, data = COL.OLD, listw=lw, Durbin=TRUE,
              control=list(ndraw=titer, nomit=nomit, prior=list(lambdaMH=TRUE)))
## Warning: Function spBreg_err moved to the spatialreg package
summary(sdem.SET2)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                  Mean      SD Naive SE Time-series SE
## (Intercept)  71.72094 38.8367 1.228123       0.419762
## INC          -0.97670  0.4076 0.012891       0.012891
## HOVAL        -0.28201  0.1091 0.003450       0.003450
## lag.INC      -0.94663  0.8221 0.025997       0.033775
## lag.HOVAL     0.06785  0.2519 0.007965       0.007965
## lambda        0.58151  0.1792 0.005667       0.015774
## sige        119.33992 28.6341 0.905491       1.179147
## 
## 2. Quantiles for each variable:
## 
##                2.5%      25%       50%      75%     97.5%
## (Intercept) 39.1215 64.15223  72.01677  79.7210  98.63408
## INC         -1.7748 -1.25137  -0.98037  -0.7310  -0.12403
## HOVAL       -0.4794 -0.35947  -0.28311  -0.2094  -0.07012
## lag.INC     -2.4896 -1.46210  -0.98818  -0.4615   0.75294
## lag.HOVAL   -0.4733 -0.08283   0.07876   0.2240   0.55664
## lambda       0.2339  0.45869   0.58133   0.7149   0.94558
## sige        77.0693 99.06131 115.60308 135.0176 187.11432
sdem.SET2_imps <- summary(spdep::impacts(sdem.SET2), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sem_g moved to the spatialreg package
print(sdem.SET2_imps)
## Impact measures (SDEM, MCMC, n):
##           Direct    Indirect      Total
## INC   -0.9767006 -0.94662677 -1.9233274
## HOVAL -0.2820124  0.06784539 -0.2141671
## ========================================================
## Standard errors:
##          Direct  Indirect     Total
## INC   0.3862857 0.7790105 0.9482351
## HOVAL 0.1033869 0.2386792 0.2937294
## ========================================================
## Z-values:
##          Direct   Indirect      Total
## INC   -2.528441 -1.2151656 -2.0283233
## HOVAL -2.727739  0.2842535 -0.7291305
## 
## p-values:
##       Direct   Indirect Total   
## INC   0.011457 0.22430  0.042527
## HOVAL 0.006377 0.77622  0.465922
raftery.diag(sdem.SET2, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 5        1353  937          1.44      
##  INC         2        969   937          1.03      
##  HOVAL       2        969   937          1.03      
##  lag.INC     3        1053  937          1.12      
##  lag.HOVAL   3        1143  937          1.22      
##  lambda      20       5817  937          6.21      
##  sige        2        973   937          1.04
geweke.diag(sdem.SET2)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL      lambda 
##      0.8612      0.6975     -0.8419     -0.5862     -1.2972     -1.5244 
##        sige 
##     -3.3143

SDEM INLA_slm

lc1 <- with(COL.OLD, inla.make.lincomb(INC=+1, LAG_INC=+1))
names(lc1) <- "TOT_INC"
lc2 <- with(COL.OLD, inla.make.lincomb(HOVAL=+1, LAG_HOVAL=+1))
names(lc2) <- "TOT_HOVAL"
system.time(sdem.inla_slm <- inla(update(dm.form, . ~ . + f(idx, model="slm",
                  args.slm=args.slm, hyper=hyper.slm)), data = COL.OLD,
                  lincomb = c(lc1, lc2),
                  family="gaussian", control.family = list(hyper=zero.variance),
                  control.compute=list(dic=TRUE, cpo=TRUE, config=TRUE)))
## Warning in inla.model.properties.generic(inla.trim.family(model), (mm[names(mm) == : Model 'slm' in section 'latent' is marked as 'experimental'; changes may appear at any time.
##   Use this model with extra care!!! Further warnings are disabled.
print(summary(sdem.inla_slm))
## 
## Call:
## c("inla(formula = update(dm.form, . ~ . + f(idx, model = \"slm\", ",  "    args.slm = args.slm, hyper = hyper.slm)), family = \"gaussian\", ",  "    data = COL.OLD, lincomb = c(lc1, lc2), control.compute = list(dic = TRUE, ",  "        cpo = TRUE, config = TRUE), control.family = list(hyper = zero.variance))" )
## 
## Time used:
##  Pre-processing    Running inla Post-processing           Total 
##          0.1683          6.2483          2.2345          8.6511 
## 
## Fixed effects:
##                mean      sd 0.025quant 0.5quant 0.975quant    mode   kld
## (Intercept) 71.9776 12.3454    46.4774  72.2951    95.7297 72.8688 3e-04
## INC         -0.9984  0.3746    -1.7323  -0.9999    -0.2562 -1.0024 0e+00
## HOVAL       -0.2799  0.1058    -0.4888  -0.2797    -0.0719 -0.2795 0e+00
## LAG_INC     -1.0093  0.7494    -2.4416  -1.0260     0.5211 -1.0568 1e-04
## LAG_HOVAL    0.0785  0.2391    -0.3984   0.0803     0.5445  0.0839 0e+00
## 
## Linear combinations (derived):
##           ID    mean     sd 0.025quant 0.5quant 0.975quant    mode kld
## TOT_INC    1 -2.0077 0.9033    -3.7035  -2.0435    -0.1157 -2.1144   0
## TOT_HOVAL  2 -0.2014 0.2924    -0.7900  -0.1975     0.3656 -0.1898   0
## 
## Random effects:
## Name   Model
##  idx   SLM model 
## 
## Model hyperparameters:
##                     mean     sd 0.025quant 0.5quant 0.975quant   mode
## Precision for idx 0.0079 0.0007     0.0067   0.0078     0.0095 0.0076
## Rho for idx       0.9535 0.0034     0.9463   0.9536     0.9598 0.9539
## 
## Expected number of effective parameters(std dev): 49.00(0.00)
## Number of equivalent replicates : 1.00 
## 
## Deviance Information Criterion (DIC) ...............: -1036.94
## Deviance Information Criterion (DIC, saturated) ....: 98.00
## Effective number of parameters .....................: 49.00
## 
## Marginal log-Likelihood:  -213.06 
## CPO and PIT are computed
## 
## Posterior marginals for linear predictor and fitted values computed
sdemmarg <- inla.tmarginal(ff, sdem.inla_slm$marginals.hyperpar[[2]]) 
c(mean=mean(sdemmarg[, "x"]), se=sd(sdemmarg[, "x"]))
##        mean          se 
## 0.882004901 0.008689039
system.time(mc.samples <- inla.posterior.sample(niter, sdem.inla_slm))
##    user  system elapsed 
##   5.457   1.947   7.878
smple0 <- t(sapply(mc.samples, function(x) x$latent[100:103]))
colnames(smple0) <- c("Direct_LAG", "Direct_HOVAL", "Indirect_LAG", "Indirect_HOVAL")
smple <- cbind(smple0, Total_LAG=smple0[,1]+smple0[,3], Total_HOVAL=smple0[,2]+smple0[,4])
(sdem.inla_mc_imps1 <- apply(smple, 2, mean)[c(1,3,5,2,4,6)])
##     Direct_LAG   Indirect_LAG      Total_LAG   Direct_HOVAL Indirect_HOVAL 
##    -0.97568776    -0.96248685    -1.93817461    -0.28105884     0.07031822 
##    Total_HOVAL 
##    -0.21074062
(sdem.inla_mc_imps2 <- apply(smple, 2, sd)[c(1,3,5,2,4,6)])
##     Direct_LAG   Indirect_LAG      Total_LAG   Direct_HOVAL Indirect_HOVAL 
##      0.3724843      0.7401691      0.9125361      0.1064599      0.2470628 
##    Total_HOVAL 
##      0.3051565

SDEM coefficients

sdem_res
##             sdem_ml_coefs sdem_SET0_coefs sdem_SET1_coefs sdem_SET2_coefs
## (Intercept)   73.54513284     72.87049271      72.5361116     71.72094170
##                8.78354327     11.47768882      11.3991959     38.83665617
## INC           -1.05167269     -1.02458832      -1.0268266     -0.97670058
##                0.31951388      0.37210816       0.3824963      0.40764335
## HOVAL         -0.27560842     -0.28008808      -0.2798893     -0.28201245
##                0.09115142      0.10055891       0.1063826      0.10910312
## lag.INC       -1.15671090     -1.06515408      -1.0918457     -0.94662677
##                0.57862875      0.72673193       0.7455253      0.82208176
## lag.HOVAL      0.11169118      0.09095049       0.1097153      0.06784539
##                0.19899272      0.23768298       0.2324344      0.25187570
## lambda         0.42539901      0.47519760       0.4956958      0.58150855
##                0.15842312      0.17963891       0.1696504      0.17919716
## s2            92.53089974    113.52076153     115.6350684    119.33991553
##                        NA     26.42551838      26.4973739     28.63413400
##             sdem_inla_slm_coefs
## (Intercept)        71.977600000
##                    12.345400000
## INC                -0.998400000
##                     0.374600000
## HOVAL              -0.279900000
##                     0.105800000
## lag.INC            -1.009300000
##                     0.749400000
## lag.HOVAL           0.078500000
##                     0.239100000
## lambda              0.882004901
##                     0.008689039
## s2                           NA
##                              NA

SDEM impacts

print(sdem_imp_res)
##                    sdem.ml   sdem.SET0  sdem.SET1   sdem.SET2 sdem.inla_slm_lc
## Direct_INC     -1.05167269 -1.02458832 -1.0268266 -0.97670058       -0.9984000
##                 0.31951388  0.35261233  0.3624562  0.38628573        0.3746000
## Indirect_INC   -1.15671090 -1.06515408 -1.0918457 -0.94662677       -1.0093000
##                 0.57862875  0.68865632  0.7064650  0.77901050        0.7494000
## Total_INC      -2.20838359 -2.08974240 -2.1186723 -1.92332736       -2.0077025
##                 0.64786356  0.80881794  0.8359926  0.94823509        0.9033046
## Direct_HOVAL   -0.27560842 -0.28008808 -0.2798893 -0.28201245       -0.2799000
##                 0.09115142  0.09529034  0.1008089  0.10338689        0.1058000
## Indirect_HOVAL  0.11169118  0.09095049  0.1097153  0.06784539        0.0785000
##                 0.19899272  0.22523008  0.2202565  0.23867920        0.2391000
## Total_HOVAL    -0.16391724 -0.18913760 -0.1701740 -0.21416705       -0.2013663
##                 0.23462885  0.26572927  0.2664718  0.29372938        0.2924087
##                sdem.inla_mc
## Direct_INC      -0.97568776
##                  0.37248431
## Indirect_INC    -0.96248685
##                  0.74016911
## Total_INC       -1.93817461
##                  0.91253611
## Direct_HOVAL    -0.28105884
##                  0.10645995
## Indirect_HOVAL   0.07031822
##                  0.24706282
## Total_HOVAL     -0.21074062
##                  0.30515648

SLM ML

slm.ml <- lagsarlm(m.form, data = COL.OLD, listw=lw, control=list(pre_eig=ev))
## Warning: Function lagsarlm moved to the spatialreg package
summary(slm.ml)
## 
## Call:spatialreg::lagsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, type = type, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -37.68585  -5.35636   0.05421   6.02013  23.20555 
## 
## Type: lag 
## Coefficients: (asymptotic standard errors) 
##              Estimate Std. Error z value  Pr(>|z|)
## (Intercept) 45.079251   7.177347  6.2808 3.369e-10
## INC         -1.031616   0.305143 -3.3808 0.0007229
## HOVAL       -0.265926   0.088499 -3.0049 0.0026570
## 
## Rho: 0.43102, LR test value: 9.9736, p-value: 0.001588
## Asymptotic standard error: 0.11768
##     z-value: 3.6626, p-value: 0.00024962
## Wald statistic: 13.415, p-value: 0.00024962
## 
## Log likelihood: -182.3904 for lag model
## ML residual variance (sigma squared): 95.494, (sigma: 9.7721)
## Number of observations: 49 
## Number of parameters estimated: 5 
## AIC: 374.78, (AIC for lm: 382.75)
## LM test for residual autocorrelation
## test value: 0.31955, p-value: 0.57188
slm.ml_imps <- summary(spdep::impacts(slm.ml, tr=tr, R=1000), zstats=TRUE, short=TRUE)
## Warning: Method impacts.sarlm moved to the spatialreg package
print(slm.ml_imps)
## Impact measures (lag, trace):
##           Direct   Indirect      Total
## INC   -1.0860220 -0.7270848 -1.8131068
## HOVAL -0.2799509 -0.1874253 -0.4673763
## ========================================================
## Simulation results (asymptotic variance matrix):
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.30408582 0.3819289 0.5742068
## HOVAL 0.09324809 0.1279834 0.1996578
## 
## Simulated z-values:
##          Direct  Indirect     Total
## INC   -3.550081 -2.029485 -3.229931
## HOVAL -3.007986 -1.633836 -2.452160
## 
## Simulated p-values:
##       Direct     Indirect Total    
## INC   0.00038511 0.042409 0.0012382
## HOVAL 0.00262985 0.102293 0.0142002

SLM SET (griddy Gibbs)

system.time(slm.SET0 <- spBreg_lag(m.form, data = COL.OLD, listw=lw,
              control=list(ndraw=titer, nomit=nomit)))
## Warning: Function spBreg_lag moved to the spatialreg package
##    user  system elapsed 
##   0.964   0.020   1.012
summary(slm.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean       SD Naive SE Time-series SE
## (Intercept)  45.9513  8.21847 0.259891       0.259891
## INC          -1.0446  0.35489 0.011223       0.011830
## HOVAL        -0.2708  0.09506 0.003006       0.002875
## rho           0.4190  0.12485 0.003948       0.003948
## sige        108.2042 23.22985 0.734592       0.734592
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%     97.5%
## (Intercept) 29.5740 40.6805  46.0764  51.3809  62.97186
## INC         -1.7634 -1.2650  -1.0399  -0.8126  -0.35595
## HOVAL       -0.4512 -0.3344  -0.2711  -0.2096  -0.07707
## rho          0.1726  0.3332   0.4167   0.5020   0.65293
## sige        69.8201 91.4958 105.6078 122.1207 161.08720
slm.SET0_imps <- summary(spdep::impacts(slm.SET0, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(slm.SET0_imps)
## Impact measures (lag, trace):
##           Direct   Indirect     Total
## INC   -1.0960751 -0.7019340 -1.798009
## HOVAL -0.2841813 -0.1819917 -0.466173
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##          Direct  Indirect     Total
## INC   0.3812014 0.5768808 0.8640558
## HOVAL 0.1011586 0.1345378 0.2122445
## 
## Simulated z-values:
##          Direct  Indirect     Total
## INC   -2.902353 -1.371441 -2.196084
## HOVAL -2.834461 -1.514476 -2.310941
## 
## Simulated p-values:
##       Direct    Indirect Total   
## INC   0.0037037 0.17024  0.028086
## HOVAL 0.0045903 0.12991  0.020836
raftery.diag(slm.SET0, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        893   937          0.953     
##  INC         2        969   937          1.030     
##  HOVAL       2        893   937          0.953     
##  rho         2        969   937          1.030     
##  sige        2        893   937          0.953
geweke.diag(slm.SET0)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL         rho        sige 
##     -1.3172      0.6931     -0.3379      1.8762      1.6313

SLM SET (MH)

system.time(slm.SET1 <- spBreg_lag(m.form, data = COL.OLD, listw=lw,
              control=list(ndraw=titer, nomit=nomit, prior=list(rhoMH=TRUE))))
## Warning: Function spBreg_lag moved to the spatialreg package
##    user  system elapsed 
##   0.921   0.027   0.964
summary(slm.SET1)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean      SD Naive SE Time-series SE
## (Intercept)  47.2025  7.8376 0.247846       1.434626
## INC          -1.0959  0.3344 0.010575       0.035322
## HOVAL        -0.2646  0.0948 0.002998       0.002998
## rho           0.3955  0.1285 0.004062       0.034231
## sige        107.7207 23.6838 0.748949       1.002416
## 
## 2. Quantiles for each variable:
## 
##                2.5%     25%      50%      75%     97.5%
## (Intercept) 33.2802 41.1165  46.7474  52.5611  62.13334
## INC         -1.8021 -1.3263  -1.0939  -0.8577  -0.47117
## HOVAL       -0.4488 -0.3260  -0.2634  -0.2002  -0.07499
## rho          0.1674  0.2942   0.4049   0.4902   0.60540
## sige        69.8590 90.6742 104.4606 122.6846 162.13097
slm.SET1_imps <- summary(spdep::impacts(slm.SET1, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(slm.SET1_imps)
## Impact measures (lag, trace):
##           Direct   Indirect      Total
## INC   -1.1430262 -0.6698049 -1.8128310
## HOVAL -0.2759683 -0.1617154 -0.4376836
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##         Direct  Indirect     Total
## INC   0.337755 0.3565279 0.5559432
## HOVAL 0.100065 0.1147501 0.1940163
## 
## Simulated z-values:
##          Direct  Indirect     Total
## INC   -3.398347 -1.955419 -3.318631
## HOVAL -2.780923 -1.568556 -2.361992
## 
## Simulated p-values:
##       Direct     Indirect Total    
## INC   0.00067794 0.050534 0.0009046
## HOVAL 0.00542046 0.116751 0.0181770
raftery.diag(slm.SET1, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 6        1757  937           1.880    
##  INC         3        1053  937           1.120    
##  HOVAL       2        969   937           1.030    
##  rho         39       10525 937          11.200    
##  sige        2        893   937           0.953
geweke.diag(slm.SET1)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL         rho        sige 
##     -5.9411      4.3304      0.2539      4.5931     -2.2022

SLM INLA_slm

mm <- model.matrix(m.form, data=COL.OLD)
betaprec <- .0001
Q.beta = Diagonal(n=ncol(mm), betaprec)
args.slm <- list(rho.min = rho.min, rho.max = rho.max, W = sW, X = mm, Q.beta = Q.beta)
system.time(slm.inla_slm <- inla(CRIME ~ 0 + f(idx, model="slm",
                  args.slm=args.slm, hyper=hyper.slm), data = COL.OLD,
                  family="gaussian", control.family = list(hyper=zero.variance),
                  control.compute=list(dic=TRUE, cpo=TRUE, config=TRUE)))
print(summary(slm.inla_slm))
## 
## Call:
## c("inla(formula = CRIME ~ 0 + f(idx, model = \"slm\", args.slm = args.slm, ",  "    hyper = hyper.slm), family = \"gaussian\", data = COL.OLD, ",  "    control.compute = list(dic = TRUE, cpo = TRUE, config = TRUE), ",  "    control.family = list(hyper = zero.variance))")
## 
## Time used:
##  Pre-processing    Running inla Post-processing           Total 
##          0.1070          0.4777          0.1261          0.7109 
## 
## The model has no fixed effects
## 
## Random effects:
## Name   Model
##  idx   SLM model 
## 
## Model hyperparameters:
##                     mean     sd 0.025quant 0.5quant 0.975quant   mode
## Precision for idx 0.0092 0.0015     0.0066   0.0091     0.0126 0.0088
## Rho for idx       0.7556 0.0390     0.6785   0.7555     0.8310 0.7526
## 
## Expected number of effective parameters(std dev): 49.00(0.00)
## Number of equivalent replicates : 1.00 
## 
## Deviance Information Criterion (DIC) ...............: -1036.94
## Deviance Information Criterion (DIC, saturated) ....: 98.00
## Effective number of parameters .....................: 49.00
## 
## Marginal log-Likelihood:  -207.03 
## CPO and PIT are computed
## 
## Posterior marginals for linear predictor and fitted values computed
slmmarg <- inla.tmarginal(ff, slm.inla_slm$marginals.hyperpar[[2]]) 
c(mean=mean(slmmarg[, "x"]), se=sd(slmmarg[, "x"]))
##       mean         se 
## 0.37977390 0.09862545
slm.inla_slm$summary.random$idx[n+1:ncol(mm),]
##    ID       mean         sd 0.025quant   0.5quant  0.975quant       mode
## 50 50 45.5473191 7.97615170 29.6036594 45.5287390 61.09760752 45.2027073
## 51 51 -1.0413816 0.34042443 -1.7187281 -1.0392222 -0.37481973 -1.0337296
## 52 52 -0.2655206 0.09251068 -0.4481932 -0.2654987 -0.08318482 -0.2654463
##             kld
## 50 2.920580e-04
## 51 5.554576e-05
## 52 8.132145e-06
system.time(mc.samples <- inla.posterior.sample(niter, slm.inla_slm))
##    user  system elapsed 
##   1.129   0.405   1.547
smples0 <- t(sapply(mc.samples, function(x) c(x$latent[99:101], 
                                              ff(x$hyperpar[2]), 0)))
colnames(smples0) <- c("(Intercept)", "INC", "HOVAL", "rho", "sige")
smples <- as.mcmc(smples0)
attr(smples, "listw_style") <- "W"
attr(smples, "control")$interval <- c(rho.min, rho.max)
attr(smples, "type") <- "lag"
slm.inla_slm_imps <- summary(spdep:::impacts.MCMC_sar_g(smples, tr=tr),
                             zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(slm.inla_slm_imps)
## Impact measures (lag, trace):
##           Direct   Indirect      Total
## INC   -1.0996070 -0.6819009 -1.7815079
## HOVAL -0.2764643 -0.1714442 -0.4479085
## ========================================================
## Simulation results ( variance matrix):
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.34440006 0.3360922 0.5502568
## HOVAL 0.09902574 0.1270196 0.2026494
## 
## Simulated z-values:
##          Direct  Indirect     Total
## INC   -3.201241 -2.076981 -3.272227
## HOVAL -2.814151 -1.497321 -2.313664
## 
## Simulated p-values:
##       Direct    Indirect Total   
## INC   0.0013684 0.037803 0.001067
## HOVAL 0.0048906 0.134310 0.020686

SLM coefficients

slm_res
##             slm_ml_coefs slm_SET0_coefs slm_SET1_coefs slm_inla_slm_coefs
## (Intercept)  45.07925051    45.95132340    47.20251985        45.54731908
##               7.17734654     8.21846775     7.83757923         7.97615170
## INC          -1.03161570    -1.04457038    -1.09587386        -1.04138165
##               0.30514297     0.35489398     0.33439659         0.34042443
## HOVAL        -0.26592625    -0.27082760    -0.26458399        -0.26552063
##               0.08849862     0.09505996     0.09480491         0.09251068
## rho           0.43102320     0.41904052     0.39549035         0.37977390
##               0.11768073     0.12484950     0.12846362         0.09862545
## s2           95.49449671   108.20424293   107.72069789                 NA
##                       NA    23.22984843    23.68384672                 NA

SLM impacts

print(slm_imp_res)
##                     slm.ml   slm.SET0 slm.SET1_impv slm.inla_slm
## Direct_INC     -1.08602200 -1.0960751    -1.1430262  -1.09960698
##                 0.30408582  0.3812014     0.3377550   0.34440006
## Indirect_INC   -0.72708479 -0.7019340    -0.6698049  -0.68190089
##                 0.38192893  0.5768808     0.3565279   0.33609219
## Total_INC      -1.81310679 -1.7980090    -1.8128310  -1.78150787
##                 0.57420677  0.8640558     0.5559432   0.55025677
## Direct_HOVAL   -0.27995092 -0.2841813    -0.2759683  -0.27646431
##                 0.09324809  0.1011586     0.1000650   0.09902574
## Indirect_HOVAL -0.18742535 -0.1819917    -0.1617154  -0.17144422
##                 0.12798340  0.1345378     0.1147501   0.12701964
## Total_HOVAL    -0.46737627 -0.4661730    -0.4376836  -0.44790853
##                 0.19965781  0.2122445     0.1940163   0.20264935

SDM ML

sdm.ml <- lagsarlm(m.form, data = COL.OLD, listw=lw, Durbin=TRUE, 
            control=list(pre_eig=ev))
## Warning: Function lagsarlm moved to the spatialreg package
summary(sdm.ml)
## 
## Call:spatialreg::lagsarlm(formula = formula, data = data, listw = listw, 
##     na.action = na.action, Durbin = Durbin, type = type, method = method, 
##     quiet = quiet, zero.policy = zero.policy, interval = interval, 
##     tol.solve = tol.solve, trs = trs, control = control)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -37.47829  -6.46731  -0.33835   6.05200  22.62969 
## 
## Type: mixed 
## Coefficients: (asymptotic standard errors) 
##              Estimate Std. Error z value  Pr(>|z|)
## (Intercept) 42.822415  12.667205  3.3806 0.0007233
## INC         -0.914223   0.331094 -2.7612 0.0057586
## HOVAL       -0.293738   0.089212 -3.2926 0.0009927
## lag.INC     -0.520284   0.565129 -0.9206 0.3572355
## lag.HOVAL    0.245640   0.178917  1.3729 0.1697756
## 
## Rho: 0.42634, LR test value: 5.3693, p-value: 0.020494
## Asymptotic standard error: 0.15623
##     z-value: 2.7288, p-value: 0.0063561
## Wald statistic: 7.4465, p-value: 0.0063561
## 
## Log likelihood: -181.3935 for mixed model
## ML residual variance (sigma squared): 91.791, (sigma: 9.5808)
## Number of observations: 49 
## Number of parameters estimated: 7 
## AIC: 376.79, (AIC for lm: 380.16)
## LM test for residual autocorrelation
## test value: 0.28919, p-value: 0.59074
sdm.ml_imps <- summary(spdep::impacts(sdm.ml, tr=tr, R=1000), zstats=TRUE, short=TRUE)
## Warning: Method impacts.sarlm moved to the spatialreg package
print(sdm.ml_imps)
## Impact measures (mixed, trace):
##           Direct  Indirect       Total
## INC   -1.0238910 -1.476711 -2.50060224
## HOVAL -0.2792275  0.195385 -0.08384256
## ========================================================
## Simulation results (asymptotic variance matrix):
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.32490015 0.8824283 0.9537683
## HOVAL 0.09444866 0.3517141 0.3940938
## 
## Simulated z-values:
##          Direct   Indirect      Total
## INC   -3.144315 -1.7411550 -2.6820277
## HOVAL -2.908989  0.6270857 -0.1375187
## 
## Simulated p-values:
##       Direct    Indirect Total    
## INC   0.0016648 0.081656 0.0073177
## HOVAL 0.0036260 0.530603 0.8906208

SDM SET (griddy Gibbs)

system.time(sdm.SET0 <- spBreg_lag(m.form, data = COL.OLD, listw=lw, Durbin=TRUE,
              control=list(ndraw=titer, nomit=nomit)))
## Warning: Function spBreg_lag moved to the spatialreg package
##    user  system elapsed 
##   1.013   0.004   1.033
summary(sdm.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean       SD Naive SE Time-series SE
## (Intercept)  46.7453 14.30730 0.452437       0.452437
## INC          -0.9409  0.35770 0.011311       0.011311
## HOVAL        -0.2889  0.09406 0.002975       0.002975
## lag.INC      -0.6039  0.63371 0.020040       0.020040
## lag.HOVAL     0.2254  0.18767 0.005935       0.005935
## rho           0.3771  0.17296 0.005469       0.005469
## sige        108.5475 24.63375 0.778988       0.852279
## 
## 2. Quantiles for each variable:
## 
##                 2.5%      25%      50%      75%     97.5%
## (Intercept) 19.47472 36.47200  46.5096  56.7654  73.80649
## INC         -1.64344 -1.18509  -0.9428  -0.7012  -0.21176
## HOVAL       -0.47892 -0.35021  -0.2875  -0.2279  -0.09876
## lag.INC     -1.83559 -1.01368  -0.6191  -0.1710   0.59125
## lag.HOVAL   -0.16646  0.09288   0.2269   0.3460   0.58374
## rho          0.04847  0.25763   0.3777   0.5010   0.70190
## sige        71.02011 91.11481 104.9386 122.6799 163.44771
sdm.SET0_imps <- summary(spdep::impacts(sdm.SET0, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(sdm.SET0_imps)
## Impact measures (mixed, trace):
##           Direct   Indirect      Total
## INC   -1.0388777 -1.4412152 -2.4800929
## HOVAL -0.2769627  0.1751108 -0.1018519
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.36414836 1.3383085 1.4533848
## HOVAL 0.09842927 0.3193599 0.3581126
## 
## Simulated z-values:
##          Direct   Indirect      Total
## INC   -2.914631 -1.2322076 -1.8649100
## HOVAL -2.834324  0.5208927 -0.3145048
## 
## Simulated p-values:
##       Direct    Indirect Total   
## INC   0.0035611 0.21787  0.062194
## HOVAL 0.0045923 0.60244  0.753138
raftery.diag(sdm.SET0, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 2        893   937          0.953     
##  INC         2        969   937          1.030     
##  HOVAL       2        969   937          1.030     
##  lag.INC     2        893   937          0.953     
##  lag.HOVAL   2        893   937          0.953     
##  rho         2        969   937          1.030     
##  sige        2        893   937          0.953
geweke.diag(sdm.SET0)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL         rho 
##    -0.50210    -0.12057    -1.05344     0.76241     0.06601     1.34872 
##        sige 
##     1.69588

SDM SET (MH)

system.time(sdm.SET1 <- spBreg_lag(m.form, data = COL.OLD, listw=lw, Durbin=TRUE,
              control=list(ndraw=titer, nomit=nomit, prior=list(rhoMH=TRUE))))
## Warning: Function spBreg_lag moved to the spatialreg package
##    user  system elapsed 
##   0.932   0.003   0.951
summary(sdm.SET1)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean       SD Naive SE Time-series SE
## (Intercept)  49.1027 12.04205 0.380803       2.372421
## INC          -0.9459  0.36187 0.011443       0.012014
## HOVAL        -0.2928  0.09504 0.003006       0.002603
## lag.INC      -0.6824  0.60344 0.019083       0.072340
## lag.HOVAL     0.2322  0.18912 0.005980       0.005980
## rho           0.3434  0.13640 0.004313       0.034736
## sige        110.3875 24.69453 0.780909       0.938780
## 
## 2. Quantiles for each variable:
## 
##                 2.5%     25%      50%      75%    97.5%
## (Intercept) 27.06156 41.0126  48.5154  56.8018  73.3093
## INC         -1.63549 -1.1878  -0.9441  -0.7085  -0.2233
## HOVAL       -0.49169 -0.3525  -0.2915  -0.2300  -0.1073
## lag.INC     -1.92102 -1.0714  -0.6553  -0.2871   0.4262
## lag.HOVAL   -0.12211  0.1064   0.2331   0.3558   0.5968
## rho          0.05823  0.2468   0.3499   0.4345   0.5874
## sige        71.52947 94.0072 107.3882 121.9713 173.3564
sdm.SET1_imps <- summary(spdep::impacts(sdm.SET1, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(sdm.SET1_imps)
## Impact measures (mixed, trace):
##           Direct   Indirect       Total
## INC   -1.0371593 -1.4426636 -2.47982292
## HOVAL -0.2809069  0.1885223 -0.09238453
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.35003168 0.7354079 0.7718973
## HOVAL 0.09742211 0.2851892 0.3193615
## 
## Simulated z-values:
##          Direct   Indirect      Total
## INC   -2.955063 -1.9638912 -3.2110835
## HOVAL -2.889050  0.6613214 -0.2907541
## 
## Simulated p-values:
##       Direct    Indirect Total    
## INC   0.0031261 0.049543 0.0013224
## HOVAL 0.0038641 0.508406 0.7712394
raftery.diag(sdm.SET1, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 16       5020  937          5.360     
##  INC         2        893   937          0.953     
##  HOVAL       2        969   937          1.030     
##  lag.INC     5        1353  937          1.440     
##  lag.HOVAL   2        892   937          0.952     
##  rho         30       8231  937          8.780     
##  sige        2        893   937          0.953
geweke.diag(sdm.SET1)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL         rho 
##    -0.06522     1.37534    -0.85919     0.05635    -1.27193     0.17310 
##        sige 
##    -1.39075

SDM INLA_slm

mm <- model.matrix(dm.form, data=COL.OLD)
betaprec <- .0001
Q.beta = Diagonal(n=ncol(mm), betaprec)
args.slm <- list(rho.min = rho.min, rho.max = rho.max, W = sW, X = mm, Q.beta = Q.beta)
system.time(sdm.inla_slm <- inla(CRIME ~ 0 + f(idx, model="slm",
                  args.slm=args.slm, hyper=hyper.slm), data = COL.OLD,
                  family="gaussian", control.family = list(hyper=zero.variance),
                  control.compute=list(dic=TRUE, cpo=TRUE, config=TRUE)))
print(summary(sdm.inla_slm))
## 
## Call:
## c("inla(formula = CRIME ~ 0 + f(idx, model = \"slm\", args.slm = args.slm, ",  "    hyper = hyper.slm), family = \"gaussian\", data = COL.OLD, ",  "    control.compute = list(dic = TRUE, cpo = TRUE, config = TRUE), ",  "    control.family = list(hyper = zero.variance))")
## 
## Time used:
##  Pre-processing    Running inla Post-processing           Total 
##          0.1003          3.9650          1.2595          5.3248 
## 
## The model has no fixed effects
## 
## Random effects:
## Name   Model
##  idx   SLM model 
## 
## Model hyperparameters:
##                     mean     sd 0.025quant 0.5quant 0.975quant   mode
## Precision for idx 0.0096 0.0016     0.0070   0.0095     0.0131 0.0092
## Rho for idx       0.9428 0.0064     0.9297   0.9430     0.9548 0.9431
## 
## Expected number of effective parameters(std dev): 49.00(0.00)
## Number of equivalent replicates : 1.00 
## 
## Deviance Information Criterion (DIC) ...............: -1036.94
## Deviance Information Criterion (DIC, saturated) ....: 98.00
## Effective number of parameters .....................: 49.00
## 
## Marginal log-Likelihood:  -225.37 
## CPO and PIT are computed
## 
## Posterior marginals for linear predictor and fitted values computed
sdmmarg <- inla.tmarginal(ff, sdm.inla_slm$marginals.hyperpar[[2]]) 
c(mean=mean(sdmmarg[, "x"]), se=sd(sdmmarg[, "x"]))
##       mean         se 
## 0.85492110 0.01618875
sdm.inla_slm$summary.random$idx[n+1:ncol(mm),]
##    ID       mean          sd 0.025quant   0.5quant 0.975quant       mode
## 50 50 44.5940545 14.29925342 19.0582008 44.0379197 74.5431329 45.3211051
## 51 51 -0.9246871  0.36286662 -1.6430942 -0.9236310 -0.2127936 -0.9215726
## 52 52 -0.2932086  0.09613852 -0.4826449 -0.2932382 -0.1038304 -0.2932871
## 53 53 -0.5683994  0.63146220 -1.8364221 -0.5602420  0.6506647 -0.5459076
## 54 54  0.2446756  0.19104380 -0.1325526  0.2448902  0.6203301  0.2453321
##             kld
## 50 7.647891e-04
## 51 1.109261e-05
## 52 2.943316e-06
## 53 1.280437e-04
## 54 4.611316e-06
system.time(mc.samples <- inla.posterior.sample(niter, sdm.inla_slm))
##    user  system elapsed 
##   3.382   1.312   4.912
smples0 <- t(sapply(mc.samples, function(x) c(x$latent[99:103], 
                                              ff(x$hyperpar[2]), 0)))
colnames(smples0) <- c("(Intercept)", "INC", "HOVAL", "LAG_INC", "LAG_HOVAL", "rho", "sige")
smples <- as.mcmc(smples0)
attr(smples, "listw_style") <- "W"
attr(smples, "control")$interval <- c(rho.min, rho.max)
attr(smples, "type") <- "Durbin"
sdm.inla_slm_imps <- summary(spdep:::impacts.MCMC_sar_g(smples, tr=tr),
                             zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sar_g moved to the spatialreg package
print(sdm.inla_slm_imps)
## Impact measures (mixed, trace):
##           Direct   Indirect       Total
## INC   -1.0394017 -1.4830912 -2.52249289
## HOVAL -0.2767955  0.1990073 -0.07778825
## ========================================================
## Simulation results ( variance matrix):
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.36513079 0.8424838 0.9040549
## HOVAL 0.09904375 0.3272653 0.3637580
## 
## Simulated z-values:
##          Direct   Indirect      Total
## INC   -2.837384 -1.7764161 -2.8013984
## HOVAL -2.802839  0.6070695 -0.2169874
## 
## Simulated p-values:
##       Direct    Indirect Total    
## INC   0.0045485 0.075664 0.0050882
## HOVAL 0.0050655 0.543805 0.8282182

SDM coefficients

sdm_res
##             sdm_ml_coefs sdm_SET0_coefs sdm_inla_slm_coefs
## (Intercept)  42.82241459     46.7452813        44.59405449
##              12.66720458     14.3072994        14.29925342
## INC          -0.91422319     -0.9409313        -0.92468709
##               0.33109401      0.3576995         0.36286662
## HOVAL        -0.29373778     -0.2888633        -0.29320857
##               0.08921192      0.0940633         0.09613852
## lag.INC      -0.52028354     -0.6039172        -0.56839945
##               0.56512898      0.6337083         0.63146220
## lag.HOVAL     0.24564028      0.2254199         0.24467564
##               0.17891745      0.1876687         0.19104380
## rho           0.15623439      0.3771006         0.85492110
##               0.15623439      0.1729582         0.01618875
## s2           91.79121719    108.5474956                 NA
##                       NA     24.6337534                 NA

SDM impacts

print(sdm_imp_res)
##                     sdm.ml    sdm.SET0 sdm.SET1_impv
## Direct_INC     -1.02389096 -1.03887766   -1.03715929
##                 0.32490015  0.36414836    0.35003168
## Indirect_INC   -1.47671128 -1.44121522   -1.44266363
##                 0.88242832  1.33830848    0.73540787
## Total_INC      -2.50060224 -2.48009287   -2.47982292
##                 0.95376826  1.45338484    0.77189730
## Direct_HOVAL   -0.27922754 -0.27696265   -0.28090687
##                 0.09444866  0.09842927    0.09742211
## Indirect_HOVAL  0.19538498  0.17511077    0.18852233
##                 0.35171411  0.31935993    0.28518917
## Total_HOVAL    -0.08384256 -0.10185188   -0.09238453
##                 0.39409378  0.35811262    0.31936153

SAC ML

sac.ml <- sacsarlm(m.form, data = COL.OLD, listw=lw, Durbin=FALSE, 
            control=list(pre_eig1=ev, pre_eig2=ev))
## Warning: Function sacsarlm moved to the spatialreg package
summary(sac.ml)
## 
## Call:spatialreg::sacsarlm(formula = formula, data = data, listw = listw, 
##     listw2 = listw2, na.action = na.action, Durbin = Durbin, 
##     type = type, method = method, quiet = quiet, zero.policy = zero.policy, 
##     tol.solve = tol.solve, llprof = llprof, interval1 = interval1, 
##     interval2 = interval2, trs1 = trs1, trs2 = trs2, control = control)
## 
## Residuals:
##       Min        1Q    Median        3Q       Max 
## -37.32081  -5.33662  -0.20219   6.59672  23.25604 
## 
## Type: sac 
## Coefficients: (asymptotic standard errors) 
##              Estimate Std. Error z value  Pr(>|z|)
## (Intercept) 47.783766   9.902659  4.8253 1.398e-06
## INC         -1.025894   0.326326 -3.1438  0.001668
## HOVAL       -0.281651   0.090033 -3.1283  0.001758
## 
## Rho: 0.36807
## Asymptotic standard error: 0.19668
##     z-value: 1.8714, p-value: 0.061285
## Lambda: 0.16668
## Asymptotic standard error: 0.29661
##     z-value: 0.56196, p-value: 0.57415
## 
## LR test value: 10.285, p-value: 0.0058432
## 
## Log likelihood: -182.2348 for sac model
## ML residual variance (sigma squared): 95.604, (sigma: 9.7777)
## Number of observations: 49 
## Number of parameters estimated: 6 
## AIC: 376.47, (AIC for lm: 382.75)
sac.ml_imps <- summary(spdep::impacts(sac.ml, tr=tr, R=1000), zstats=TRUE, short=TRUE)
## Warning: Method impacts.sarlm moved to the spatialreg package
print(sac.ml_imps)
## Impact measures (sac, trace):
##           Direct   Indirect      Total
## INC   -1.0632723 -0.5601501 -1.6234223
## HOVAL -0.2919129 -0.1537847 -0.4456977
## ========================================================
## Simulation results (asymptotic variance matrix):
## ========================================================
## Simulated standard errors
##          Direct  Indirect     Total
## INC   0.3224949 0.7309656 0.8555514
## HOVAL 0.1002928 0.2414433 0.2960112
## 
## Simulated z-values:
##          Direct   Indirect     Total
## INC   -3.337318 -0.9511862 -2.070656
## HOVAL -2.963090 -0.8453521 -1.693453
## 
## Simulated p-values:
##       Direct     Indirect Total   
## INC   0.00084591 0.34151  0.038391
## HOVAL 0.00304568 0.39791  0.090369

SAC SET (MH)

system.time(sac.SET0 <- spBreg_sac(m.form, data = COL.OLD, listw=lw, Durbin=FALSE,
              control=list(ndraw=titer, nomit=nomit)))
## Warning: Function spBreg_sac moved to the spatialreg package
## Warning in max(which(detval21 <= (lambda2 - gsize2))): no non-missing arguments
## to max; returning -Inf
##    user  system elapsed 
##   1.744   0.019   1.789
summary(sac.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean       SD Naive SE Time-series SE
## (Intercept)  49.0562  8.99262 0.284372       0.815499
## INC          -1.0053  0.36197 0.011447       0.012494
## HOVAL        -0.2841  0.09812 0.003103       0.003103
## rho           0.3285  0.16869 0.005334       0.018111
## lambda        0.1851  0.25366 0.008022       0.022640
## sige        106.1709 23.50976 0.743444       0.780688
## 
## 2. Quantiles for each variable:
## 
##                 2.5%       25%      50%      75%     97.5%
## (Intercept) 31.58212 42.859070  48.9421  55.1230  66.38515
## INC         -1.74049 -1.237375  -1.0020  -0.7769  -0.23339
## HOVAL       -0.48057 -0.347875  -0.2846  -0.2147  -0.09967
## rho         -0.02002  0.212295   0.3335   0.4518   0.62906
## lambda      -0.37389  0.002739   0.2203   0.3576   0.64378
## sige        69.82529 88.823298 103.5368 119.5461 157.29192
sac.SET0_imps <- summary(spdep::impacts(sac.SET0, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sac_g moved to the spatialreg package
print(sac.SET0_imps)
## Impact measures (sac, trace):
##           Direct   Indirect      Total
## INC   -1.0335735 -0.4635398 -1.4971133
## HOVAL -0.2921314 -0.1310159 -0.4231473
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##          Direct  Indirect     Total
## INC   0.3717600 0.4273200 0.6681644
## HOVAL 0.1021324 0.1303633 0.1994683
## 
## Simulated z-values:
##          Direct  Indirect     Total
## INC   -2.808561 -1.251672 -2.363154
## HOVAL -2.892592 -1.183123 -2.254310
## 
## Simulated p-values:
##       Direct    Indirect Total   
## INC   0.0049764 0.21069  0.018120
## HOVAL 0.0038208 0.23676  0.024177

SAC coefficients

sac_res
##             sac_ml_coefs sac_SET0_coefs
## (Intercept)  47.78376647    49.05618894
##               9.90265886     8.99262035
## INC          -1.02589358    -1.00525916
##               0.32632614     0.36197472
## HOVAL        -0.28165091    -0.28412856
##               0.09003346     0.09811959
## rho           0.36806734     0.32853503
##               0.19667646     0.16868689
## lambda        0.16667932     0.18513407
##               0.29660547     0.25366471
## s2           95.60419515   106.17094176
##                       NA    23.50975625

SAC impacts

print(sac_imp_res)
##                    sac.ml   sac.SET0
## Direct_INC     -1.0632723 -1.0335735
##                 0.3224949  0.3717600
## Indirect_INC   -0.5601501 -0.4635398
##                 0.7309656  0.4273200
## Total_INC      -1.6234223 -1.4971133
##                 0.8555514  0.6681644
## Direct_HOVAL   -0.2919129 -0.2921314
##                 0.1002928  0.1021324
## Indirect_HOVAL -0.1537847 -0.1310159
##                 0.2414433  0.1303633
## Total_HOVAL    -0.4456977 -0.4231473
##                 0.2960112  0.1994683

SDAC ML

system.time(sdac.ml <- sacsarlm(m.form, data = COL.OLD, listw=lw, Durbin=TRUE, 
            control=list(pre_eig1=ev, pre_eig2=ev)))
## Warning: Function sacsarlm moved to the spatialreg package
##    user  system elapsed 
##   0.252   0.001   0.257
summary(sdac.ml)
## 
## Call:spatialreg::sacsarlm(formula = formula, data = data, listw = listw, 
##     listw2 = listw2, na.action = na.action, Durbin = Durbin, 
##     type = type, method = method, quiet = quiet, zero.policy = zero.policy, 
##     tol.solve = tol.solve, llprof = llprof, interval1 = interval1, 
##     interval2 = interval2, trs1 = trs1, trs2 = trs2, control = control)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -37.8045  -6.5244  -0.2207   5.9944  22.8691 
## 
## Type: sacmixed 
## Coefficients: (asymptotic standard errors) 
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept) 50.92025   68.25721  0.7460 0.455664
## INC         -0.95072    0.44033 -2.1591 0.030841
## HOVAL       -0.28650    0.09994 -2.8667 0.004148
## lag.INC     -0.69261    1.69113 -0.4096 0.682132
## lag.HOVAL    0.20852    0.28702  0.7265 0.467546
## 
## Rho: 0.31557
## Asymptotic standard error: 0.9458
##     z-value: 0.33365, p-value: 0.73864
## Lambda: 0.15415
## Asymptotic standard error: 1.0643
##     z-value: 0.14484, p-value: 0.88484
## 
## LR test value: 12.07, p-value: 0.016837
## 
## Log likelihood: -181.3422 for sacmixed model
## ML residual variance (sigma squared): 93.149, (sigma: 9.6514)
## Number of observations: 49 
## Number of parameters estimated: 8 
## AIC: 378.68, (AIC for lm: 382.75)
sdac.ml_imps <- summary(spdep::impacts(sdac.ml, tr=tr, R=1000), zstats=TRUE, short=TRUE)
## Warning: Method impacts.sarlm moved to the spatialreg package
print(sac.ml_imps)
## Impact measures (sac, trace):
##           Direct   Indirect      Total
## INC   -1.0632723 -0.5601501 -1.6234223
## HOVAL -0.2919129 -0.1537847 -0.4456977
## ========================================================
## Simulation results (asymptotic variance matrix):
## ========================================================
## Simulated standard errors
##          Direct  Indirect     Total
## INC   0.3224949 0.7309656 0.8555514
## HOVAL 0.1002928 0.2414433 0.2960112
## 
## Simulated z-values:
##          Direct   Indirect     Total
## INC   -3.337318 -0.9511862 -2.070656
## HOVAL -2.963090 -0.8453521 -1.693453
## 
## Simulated p-values:
##       Direct     Indirect Total   
## INC   0.00084591 0.34151  0.038391
## HOVAL 0.00304568 0.39791  0.090369

SDAC SET (MH)

system.time(sdac.SET0 <- spBreg_sac(m.form, data = COL.OLD, listw=lw, Durbin=TRUE,
              control=list(ndraw=titer, nomit=nomit)))
## Warning: Function spBreg_sac moved to the spatialreg package
##    user  system elapsed 
##   1.989   0.006   2.032
summary(sdac.SET0)
## 
## Iterations = 1001:2000
## Thinning interval = 1 
## Number of chains = 1 
## Sample size per chain = 1000 
## 
## 1. Empirical mean and standard deviation for each variable,
##    plus standard error of the mean:
## 
##                 Mean      SD Naive SE Time-series SE
## (Intercept) 51.19455 21.5843 0.682555       2.936953
## INC         -0.94581  0.3624 0.011460       0.014009
## HOVAL       -0.28667  0.0944 0.002985       0.003127
## lag.INC     -0.66507  0.7029 0.022226       0.052525
## lag.HOVAL    0.19445  0.2083 0.006588       0.013344
## rho          0.30837  0.2834 0.008962       0.036971
## lambda       0.09736  0.3207 0.010140       0.039754
## sige        99.57039 22.8463 0.722464       0.796724
## 
## 2. Quantiles for each variable:
## 
##                2.5%      25%      50%      75%    97.5%
## (Intercept) 16.7931 35.38709 48.93512  63.7566 101.5679
## INC         -1.6843 -1.18708 -0.95074  -0.7013  -0.2286
## HOVAL       -0.4735 -0.34952 -0.28887  -0.2244  -0.1055
## lag.INC     -2.1269 -1.11367 -0.62820  -0.1930   0.6346
## lag.HOVAL   -0.2491  0.05456  0.20473   0.3331   0.5909
## rho         -0.3840  0.14232  0.34056   0.5106   0.7421
## lambda      -0.5716 -0.11352  0.08664   0.3284   0.7086
## sige        64.8961 83.17979 95.84782 112.3483 149.7044
sdac.SET0_imps <- summary(spdep::impacts(sdac.SET0, tr=tr), zstats=TRUE, short=TRUE)
## Warning: Method impacts.MCMC_sac_g moved to the spatialreg package
print(sdac.SET0_imps)
## Impact measures (sacmixed, trace):
##           Direct   Indirect      Total
## INC   -1.0216983 -1.3073971 -2.3290955
## HOVAL -0.2782552  0.1449249 -0.1333304
## ========================================================
## MCMC sample impact results:
## ========================================================
## Simulated standard errors
##           Direct  Indirect     Total
## INC   0.36012375 0.9761489 1.0848492
## HOVAL 0.09699283 0.3228436 0.3616269
## 
## Simulated z-values:
##          Direct   Indirect      Total
## INC   -2.852968 -1.4631704 -2.2636269
## HOVAL -2.860113  0.4856165 -0.3335821
## 
## Simulated p-values:
##       Direct    Indirect Total   
## INC   0.0043313 0.14342  0.023597
## HOVAL 0.0042349 0.62724  0.738695
raftery.diag(sdac.SET0, r=0.01)
## 
## Quantile (q) = 0.025
## Accuracy (r) = +/- 0.01
## Probability (s) = 0.95 
##                                                    
##              Burn-in  Total Lower bound  Dependence
##              (M)      (N)   (Nmin)       factor (I)
##  (Intercept) 6        1757  937          1.880     
##  INC         2        893   937          0.953     
##  HOVAL       2        893   937          0.953     
##  lag.INC     3        1053  937          1.120     
##  lag.HOVAL   3        1053  937          1.120     
##  rho         21       5611  937          5.990     
##  lambda      15       4155  937          4.430     
##  sige        2        893   937          0.953
geweke.diag(sdac.SET0)
## 
## Fraction in 1st window = 0.1
## Fraction in 2nd window = 0.5 
## 
## (Intercept)         INC       HOVAL     lag.INC   lag.HOVAL         rho 
##    -0.14050    -1.36739     0.21958     1.03819    -0.66493     0.06171 
##      lambda        sige 
##     0.52540     0.73626

SDAC coefficients

sdac_res
##             sdac_ml_coefs sdac_SET0_coefs
## (Intercept)   50.92025501     51.19455372
##               68.25720777     21.58427083
## INC           -0.95071665     -0.94581033
##                0.44032512      0.36239261
## HOVAL         -0.28649657     -0.28666740
##                0.09994037      0.09439702
## lag.INC       -0.69261107     -0.66506633
##                1.69112639      0.70286282
## lag.HOVAL      0.20851641      0.19445188
##                0.28702413      0.20831625
## rho            0.31556940      0.30836812
##                0.94580491      0.28340160
## lambda         0.15415430      0.09735511
##                1.06432263      0.32066473
## s2            93.14860278     99.57038590
##                        NA     22.84632332

SDAC impacts

print(sdac_imp_res)
##                   sdac.ml   sdac.SET0
## Direct_INC     -1.0317003 -1.02169833
##                 0.3683353  0.36012375
## Indirect_INC   -1.3693141 -1.30739713
##                 1.9887228  0.97614889
## Total_INC      -2.4010144 -2.32909545
##                 2.1225670  1.08484918
## Direct_HOVAL   -0.2768608 -0.27825523
##                 0.1123283  0.09699283
## Indirect_HOVAL  0.1629265  0.14492487
##                 0.7494412  0.32284360
## Total_HOVAL    -0.1139344 -0.13333035
##                 0.8131504  0.36162689

Bivand, Roger. 2017. “Revisiting the Boston Data Set — Changing the Units of Observation Affects Estimated Willingness to Pay for Clean Air.” REGION 4 (1): 109–27. https://doi.org/10.18335/region.v4i1.107.

Bivand, Roger, Zhe Sha, Liv Osland, and Ingrid Sandvig Thorsen. 2017. “A Comparison of Estimation Methods for Multilevel Models of Spatially Structured Data.” Spatial Statistics. https://doi.org/10.1016/j.spasta.2017.01.002.