Announcement

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

  • Local spatial autocorrelation graph

    Good morning,

    I am trying to plot the local autocorrelation coefficient (local Moran's I) using the command spatlsa from the package sg162 from http://www.stata.com/stb/stb60 by Prof. Pisani. I looked at the help file and I came with the following code
    Code:
    spatlsa Leave_Share, weights(W) id(nuts3) moran map(data_coord) xcoord(x_center) ycoord(y_center)
    where W is the name of the weight matrix, nuts3 is the variable containg the clusters of interest, data_coord is the file with the polygons coordinates and x_center, y_center are the coordinates in terms of latitude and longitude of the centroid of the polygons.

    The issue is that I get an error telling me that x_center and y_center do not exist when I am more than sure that they are contained in the dataset data_coord I put in the map option. Is this a problem of coding or could it be related to the nature of data?

  • #2
    If I remember correctly, the variables x_center and y_center in addition also need to be part of the master data set that is currently in Stata's memory.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Originally posted by Sebastian Kripfganz View Post
      If I remember correctly, the variables x_center and y_center in addition also need to be part of the master data set that is currently in Stata's memory.
      This works but now there is another issue. Which dataset am I supposed to include in the map option? From the help file, I understood it is the one with the full coordinates of each polygon but it does not work.

      Comment


      • #4
        What do you mean by "it does not work"? Please provide full Stata syntax and output.
        https://www.kripfganz.de/stata/

        Comment

        Working...
        X