Announcement

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

  • remove extraneous portions of matrix row/column label

    I cannot figure out how to remove extraneous portions of matrix row/column label. For instance,

    use http://www.stata-press.com/data/r14/airline
    poisson injuries XYZowned

    matrix list e(b)
    matrix list e(V)

    I would like to remove the dependent variables from the row and column names.

    So, instead of row/column 1 label being
    injuries:XYZowned, I would like it only to be XYZowned

    I saw posts along these lines https://www.statalist.org/forums/for...n-using-esttab
    but those have to do with the estpost command and this is not something that I am using here.

    Any suggestions? Thanks. Richard


  • #2
    Use matrix coleq to set column names of the matrix. But in the code below, you must firstly define a new matrix from e(b).

    Code:
    . quietly poisson injuries XYZowned
    
    . matrix list e(b)
    
    e(b)[1,2]
          injuries:   injuries:
          XYZowned       _cons
    y1  -.24512246   2.0368819
    
    . 
    . matrix B=get(_b)
    
    . 
    . matrix list B
    
    B[1,2]
          injuries:   injuries:
          XYZowned       _cons
    y1  -.24512246   2.0368819
    
    . 
    . matrix coleq B= ""
    
    . 
    . matrix list B
    
    B[1,2]
          XYZowned       _cons
    y1  -.24512246   2.0368819
    
    .

    Comment


    • #3
      And for the matrix e(V), similar code is like:

      Code:
      . matrix list e(V)
      
      symmetric e(V)[2,2]
                           injuries:   injuries:
                           XYZowned       _cons
      injuries:XYZowned   .07729469
         injuries:_cons  -.02173913   .02173913
      
      . matrix V=get(VCE)
      
      . matrix list V
      
      symmetric V[2,2]
                           injuries:   injuries:
                           XYZowned       _cons
      injuries:XYZowned   .07729469
         injuries:_cons  -.02173913   .02173913
      
      . matrix coleq V=""
      
      . matrix roweq V=""
      
      . matrix list V
      
      symmetric V[2,2]
                  XYZowned       _cons
      XYZowned   .07729469
         _cons  -.02173913   .02173913

      Comment


      • #4
        Perfect! Thank you so much!

        Comment

        Working...
        X