Announcement

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

  • Saving a distance spatial weight matrix in .dta format

    Hello everyone,

    I know this topic has already been discussed, but I'm having some difficulties completing this task.
    I've created a spatial weight matrix using the following command:

    spatwmat, name(W) xcoord(_CX) ycoord(_CY) band(0 5.125) binary

    Now I'd like to export it and save in a .dta format, so I will be able to apply a SARAR model, since I'm only able to apply SEM and SLM models using the distance matrix created with the command "spatwmat". Thanks to everyone that will help me and give advices for the procedure.

  • #2
    You examine the help for the built-in -svmat- command, which saves a matrix as a .dta file. I'd also note here that the excellent user-written -spatwmat- command is now 20 years old, and it's possible that one of the offical spatial commands available in recent versions of Stata might be better for what you want. (Just a guess; I have not used any of this in a long time.)

    Comment


    • #3
      Dear Mike,

      Thank you for your answer and the advice! Unfortunately I've been reading the "svmat" help page since yesterday and I've done many tries, but I'm still having some difficulties saving my "W" matrix in a .dta format.
      If I'm not asking too much, could you try to write the lines of code that you think would work for my specific problem? Thank you for your politeness.

      Comment


      • #4
        Dear Mike,

        Don't worry about answering, I've been able to solve all my problems, thank you anyway.

        Comment


        • #5
          Dear Massimo,

          I am facing the exact same problem. Could you kindly share how you solved it?

          Comment

          Working...
          X