Announcement

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

  • getting rid of certain rows in a matrix


    Hello All, Probably a fairly simple question but I still can't figure this out. Suppose you have the following: mat A = (2,1\3,2\-2,2) mat B = (1,1\3,4\5,0) mat C = A,B\B,A mat list C C[6,4] c1 c2 c1 c2 r1 2 1 1 1 r2 3 2 3 4 r3 -2 2 5 0 r1 1 1 2 1 r2 3 4 3 2 r3 5 0 -2 2 But what if I want to get rid of all of the 'r1' rows? How can I do this? Thanks for your help.

  • #2
    -help matrix extraction-

    Comment


    • #3
      My best tip is to work in Mata if you want matrix manipulation.

      Otherwise various community-contributed add-ons to Stata's matrix language were published around 25 years ago. .

      STB-56 dm79 . . . . . . . . . . . . . . . . . . Yet more new matrix commands
      (help matcorr, matewmf, matvsort, svmat2 if installed) . . N. J. Cox
      7/00 pp.4--8; STB Reprints Vol 10, pp.17--23
      commands to produce a correlation matrix, elementwise monadic
      function of another matrix, selected subsets of matrix rows
      and columns, vec or vech of a matrix, elements sorted within
      a vector, matrix from a vector, and commands to save matrices
      see mata matrix language incorporated into Stata 9.0


      STB-50 dm69 . . . . . . . . . . . . . . . . . . Further new matrix commands
      (help matdelrc, matewm, matmad, matpow if installed) . . . N. J. Cox
      7/99 pp.5--9; STB Reprints Vol 9, pp.29--34
      collection of new matrix commands providing additional matrix
      checking, management, element-wise operators, maximum absolute
      difference, and power

      STB-39 dm49 . . . . . . . . . . . . . . . . . . . . Some new matrix commands
      (help matfunc, varfunc if installed) . . . . . . . . . . . J. Weesie
      9/97 pp.17--20; STB Reprints Vol 7, pp.43--48
      collection of new matrix commands; several for explicit matrices
      and a few for implicit matrices (i.e., variables)
      see mata matrix language incorporated into Stata 9

      Comment

      Working...
      X