Announcement

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

  • Moran's I and spatial weights matrix

    Hello everybody,

    I wish to compute the Moran's I statistic and I'm following the code written by Pisani (https://www.stata.com/meeting/german...g12_pisati.pdf). I've created a binary spatial weights matrix for 20 Italian regions using GeoDa.

    However, when I put the command below:

    spatwmat using "weights.dta", name (Ws) standardize

    This is what I get:

    Matrix is not square

    Does anyone know how to fix this problem?

    Cheers,

    Simon


  • #2
    Welcome to Statalist.

    The output of help spatwmat tells us
    using filename requests that matrix weights_matrix be imported from filename, an external Stata datafile which includes exactly N cases and Nvariables containing the user-defined spatial weights (missing values are not allowed).
    So the error message you received suggests that the spatial weights matrix you created using GeoDa does not have the same number of cases and variables.

    Comment


    • #3
      Hi William, thanks for your help.

      Comment

      Working...
      X