Announcement

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

  • Error "command spmatrix is unrecognized" when I was using "spmatrix spfrommata"

    Dear all,

    I'm generating a spatial weighting matrix from mata and would like to create an Sp spatial matrix. I explored that " spmatrix spfrommata Wnew= W v" could copy a matrix from Mata to an Sp spatial weighting matrix.

    But then an error shows: command spmatrix is unrecognized .

    Then I tried "spmat spfrommata Wnew= W v" , an error shows again: spfrommata unknown subcommand

    I tried to install this command but could not find the installation package. Does anyone know anything about this command? I'm using STATA 14. Thank you very much!

  • #2
    Welcome to Statalist.

    When I try your first command the result is as I would expect, since I have no matrices defined.
    Code:
    . clear all
    
    . spmatrix spfrommata Wnew= W v
    matrix W not found
    r(498);
    So Stata clearly recognized the command, and seems likely to have recognized the subcommand as well. What version of Stata are you running? The spmatrix command was introduced in Version 15.0.
    Code:
    . about
    
    Stata/SE 15.1 for Mac (64-bit Intel)
    Revision 21 Mar 2019
    Copyright 1985-2017 StataCorp LLC
    When I install spmat, part of the st0292 user-written package from the Stata Journal, and try your second command, I get the same result as you - not surprising, since the output of help spmat does not document spmat spfrommata as a possible subcommand. Perhaps if you review the output of help spmat you will find a subcommand that will do what you need.

    Comment

    Working...
    X