Announcement

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

  • Problem with a substitution matrix...It is non square ;(

    Hello!

    Trying to calculate distances in Sequence analysis using optimal matching.
    Data IS in Wide format.

    for that I need a substitution matrix. I've defined it as

    matrix rix =(0,1,1,1,3,3 ///
    1,0,1,1,3,3 ///
    1,1,0,1,3,3 ///
    1,1,1,0,3,3 ///
    3,3,3,3,0,3 ///
    3,3,3,3,3,0)
    and there is no problem running the matrix itself (no error)

    BUT when I try to move to

    oma Element1-Element48, subsmat(rix) pwd(omd) length(48) indel(1.5)

    THERE IS AN ERROR
    Error: non square substitution matrix

    Why?


    I've followed Halpin (2017) http://teaching.sociology.ul.ie/bhal...main-local.pdf
    pages 5-6, and I dont see any differences in logic




    Can anyone help, I'd be SO grateful!

    Riku Perhoniemi, Helsinki







  • #2
    Riku Perhoniemi The way you have written your matrix does that it is actually a row vector. Use \ for row-joining.

    Code:
    matrix rix =(0,1,1,1,3,3 \ ///
    1,0,1,1,3,3 \ ///
    1,1,0,1,3,3 \ ///
    1,1,1,0,3,3 \ ///
    3,3,3,3,0,3 \ ///
    3,3,3,3,3,0)

    Comment


    • #3
      Got it, thanks a lot Christophe!!!!!!

      Comment

      Working...
      X