Announcement

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

  • How to use spmat command on panel data?

    Hello Statalist users,

    I am trying to create a spatial weighting-matrix based on the inverse distance with spmat command:

    "spmat idistance W x y, id(id) dfunction(dhaversine)normalize(spectral)"

    As a result I get the information: "Two or more observations have the same coordinates" (r498). The reason is probably the fact that my dataset contains data on the same country for various years.
    Is there any way around this problem? Or any other command that is working on panel data?

    Thank you for your help!


  • #2
    You can drop the duplicates in another file , and cal the martrix using spmat ,then merge this file with origin data.

    Comment


    • #3
      Thank you for your answer !

      Comment

      Working...
      X