Announcement

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

  • Variable labels and frmttable

    I am using frmttable to generate a summary table.
    As far as I can see the option varlabels should automatically add variable labels in the first column of the table. Am I doing this the wrong way? Code below.


    Code:
    cls
    clear all
    
    set obs 1000
    ge u = rnormal()
    label var u "Some label"
    
    su u
    mat a = r(mean),r(sd)
    
    frmttable, statmat(a) varlabels

  • #2
    frmttable is not
    automatically add variable labels
    do you write the label , Do you have the label in the regression
    look
    h frmttable
    my code
    cls
    clear all

    set obs 1000
    ge u = rnormal()
    label var u "Some label"

    su u
    mat a = r(mean),r(sd)

    frmttable, statmat(a) sdec(0) title("summary table") ctitle("","Means","SD") rtitle("Some label")

    Comment


    • #3
      The problem with the code in post #1 is that matrix has not been assigned a rowname, Consider the following example that shows the problem and how to fix it.
      Code:
      . su u
      
          Variable |        Obs        Mean    Std. Dev.       Min        Max
      -------------+---------------------------------------------------------
                 u |      1,000    .0220129    1.016991  -4.468302   3.533166
      
      . mat a = r(mean),r(sd)
      
      . matrix list a
      
      a[1,2]
                 c1         c2
      r1  .02201291  1.0169906
      
      . 
      . frmttable, statmat(a) varlabels
      
                                    --------------
                                      0.02  1.02 
                                    --------------
      
      
      . 
      . matrix rownames a = u
      
      . matrix list a
      
      a[1,2]
                c1         c2
      u  .02201291  1.0169906
      
      . 
      . frmttable, statmat(a) varlabels
      
                              --------------------------
                               Some label   0.02  1.02 
                              --------------------------

      Comment

      Working...
      X