Error when running a Spatial Durbin Error Model without intercept

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when running a Spatial Durbin Error Model without intercept

Rolando Valdez
Dear list,

I am trying to run a Spatial Durbin Error Model without intercept, however,
I do get an error:

 In spatialreg::errorsarlm(formula = formula, data = data, listw = listw,  :
  model configuration issue: no total impacts

This is what I am doing:

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")

Thanks for any advice.
--
Rol~

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Error when running a Spatial Durbin Error Model without intercept

Roger Bivand
Administrator
On Fri, 9 Aug 2019, Rolando Valdez wrote:

> Dear list,
>
> I am trying to run a Spatial Durbin Error Model without intercept, however,
> I do get an error:
>
> In spatialreg::errorsarlm(formula = formula, data = data, listw = listw,  :
>  model configuration issue: no total impacts

I can reproduce the problem, with error messages:

> 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")

I think that the construction of the specification matrix for
gmodels::estimable() is faulty; will explore whether no-intercept is
supportable.

Roger

>
> This is what I am doing:
>
> 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")
>
> Thanks for any advice.
>

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway
Reply | Threaded
Open this post in threaded view
|

Re: Error when running a Spatial Durbin Error Model without intercept

Roger Bivand
Administrator
And for completeness (https://github.com/r-spatial/spatialreg/issues/7):

> 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)

Please follow up on github if you are present there.

Roger



--
Roger Bivand
Norwegian School of Economics
Helleveien 30, 5045 Bergen, Norway
[hidden email]


________________________________________
Fra: R-sig-Geo <[hidden email]> på vegne av Roger Bivand <[hidden email]>
Sendt: lørdag 10. august 2019 14.05
Til: Rolando Valdez
Kopi: [hidden email]
Emne: Re: [R-sig-Geo]  Error when running a Spatial Durbin Error Model without intercept

On Fri, 9 Aug 2019, Rolando Valdez wrote:

> Dear list,
>
> I am trying to run a Spatial Durbin Error Model without intercept, however,
> I do get an error:
>
> In spatialreg::errorsarlm(formula = formula, data = data, listw = listw,  :
>  model configuration issue: no total impacts

I can reproduce the problem, with error messages:

> 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")

I think that the construction of the specification matrix for
gmodels::estimable() is faulty; will explore whether no-intercept is
supportable.

Roger

>
> This is what I am doing:
>
> 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")
>
> Thanks for any advice.
>

--
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: [hidden email]
https://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Roger Bivand
Department of Economics
Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway