r-spatial / spatialreg

spatialreg: spatial models estimation and testing
https://r-spatial.github.io/spatialreg/
43 stars 11 forks source link

SDEM and SLX no-intercept impacts problem: #7

Closed rsbivand closed 1 year ago

rsbivand commented 5 years ago

library(spatialreg)
library(spdep)
data(oldcol, package = "spdep")
W <- spdep::nb2listw(COL.nb, style = "W")
eq <- CRIME ~ 0 + INC + HOVAL
sdem <- errorsarlm(eq, data = COL.OLD, listw = W, etype = "emixed", method = "eigen")

in https://stat.ethz.ch/pipermail/r-sig-geo/2019-August/027557.html.

> sdem <- errorsarlm(eq, data = COL.OLD, listw = W, etype = "emixed",
+                    method = "eigen")
Error in estimable.default(lm.target, cm) :
   `cm' argument must be of type vector, list, or matrix.
In addition: Warning messages:
1: Function errorsarlm moved to the spatialreg package
2: In spatialreg::errorsarlm(formula = formula, data = data, listw =
listw,  :
   model configuration issue: no total impacts
> traceback()
6: stop("`cm' argument must be of type vector, list, or matrix.")
5: estimable.default(lm.target, cm)
4: estimable(lm.target, cm)
3: as.matrix(estimable(lm.target, cm)[, 1:2, drop = FALSE])
2: 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)
1: errorsarlm(eq, data = COL.OLD, listw = W, etype = "emixed", method =
"eigen")
> dem <- lmSLX(eq, data = COL.OLD, listw = W)
Error in lmSLX(eq, data = COL.OLD, listw = W) : 
  object 'dirImps' not found
In addition: Warning message:
In lmSLX(eq, data = COL.OLD, listw = W) :
  model configuration issue: no total impacts
> traceback()
1: lmSLX(eq, data = COL.OLD, listw = W)