Announcement

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

  • tabstat table to latex, regarding decimal places..

    Hi Statalist,

    I want to change the tabstat results to latex table. and found the following method:

    sysuse auto
    tabstat price mpg length, s(mean p25 median p75 p90 p95 p99) save
    tabstatmat
    test esttab matrix(test) using c:\temp\test.tex, replace

    does anyone know how to control the decimal places of means? I looked for esttab for a long time... they do not have clear instructions/examples on how to control the decimal places of mean variables, I tried several options such as cells(r(fmt(a3))), but not working. Many thanks in advance!
    Last edited by lianlian; 12 Apr 2018, 07:37.

  • #2
    Address this before using esttab



    Code:
    forvalues i=1/3{
    
    matrix test[1 ,`i'] = round(test[1,`i'], .01)
    
    }


    Highlighted: The mean is in the first row of the matrix "test" and I am assuming that you have 3 columns. Displaying 2 decimal places (,.01), 3 decimal places (,.001), and so on.


    Last edited by Andrew Musau; 12 Apr 2018, 13:41.

    Comment


    • #3
      thank you very much!

      Comment

      Working...
      X