Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compatability error while creating a spatial lagged explanatory variable

    I am trying to create a spatially lagged X variable to run a SLX type model

    Issue: I get a compatibility error message when trying to generate the WX variable

    I have strongly balanced panel data with a width of 25. Consequently, my inverse distance matrix is a 25x25 matrix. So I don't quite understand why the matrices would be incompatible i.,e. W(25x25)*X(25x1).

    Code:

    spmat lag double wTemperatureLag10 ID2 TemperatureLag10

    where ID2 is my 25x25 inverse distance matrix and TemperatureLag10 is the X variable that I want to turn into a spatial lag WX variable.

    Output:

    . spmat lag float wInfectionRateLag10 ID2 InfectionRate
    *: 3200 conformability error
    SPMAT_lag(): - function returned error
    <istmt>: - function returned error

    thank you for your response.

  • #2
    spmat is part of the community-contributed sppack package. Please ensure you have the latest version and update the package, if necessary. If you have not installed the package from SSC but a different source, I recommend to obtain the latest version from SSC.

    If you are using Stata 15 or higher, I recommend to use the official spmatrix command instead of spmat.
    https://www.kripfganz.de/stata/

    Comment

    Working...
    X