Announcement

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

  • Decimal place with "estpost" & "esttab"?

    Hi,

    I have a hard time to set the decimal place to 3. Here is the code that I have:
    Code:
    estpost summ var1-var15, detail
    esttab, cells("count mean sd min p50 max") noobs
    I have tried, uncsuccessfully:
    Code:
    esttab, cells(a3)
    Can anyone help? Thanks!

  • #2
    Have you played about with the "fmt(fmtlist)" suboption for setting the display format(s)? It's described in the esttab help file. (Also, one can use estout options, since esttab is essentially a wrapper for estout.)

    Comment


    • #3
      Hi Stephen,

      I have tried the fmt suboption but I'm not sure where to put it.

      Here is what I have tried:
      Code:
      sysuse auto.dta, clear
      
      estpost summ make price mpg rep78 headroom trunk, detail  fmt(2)
      esttab using Test.csv ,  replace cells("count mean sd min p50 max") noobs label ///
      title(Panel A: Summary Statistics) ///
      nonumbers ///
      addnote("Note: Long Time Series: 1972:Q2-2012:Q4")
      I am getting:
      option fmt() not allowed

      I have seen in the help file it is used with a matrix form. Is there any way to go around that?
      http://repec.org/bocode/e/estout/hlp_estout.html#exa

      Code:
       
               . set seed 123                  . matrix A = matuniform(3,2)                  . matrix list A          A[3,2]                 c1         c2         r1  .91204397   .0075452 r2  .28085881  .46027868 r3  .56010592  .67319061    
        estout matrix(A, fmt(2 3))
      Any idea? Thanks!

      Comment


      • #4
        I guess the call should be inside the "cells()" part. E.g. I have used the following in the past
        Code:
        cells(b(star fmt(%9.4f))
        This was in the context of an estimation command, however, so may not be appropriate here. I'm sure it's possible to do what you want, but right now I can't quickly see the answer. I would scour the webpage I referred to, and also the help for estout, not only for esttab.

        Comment


        • #5
          Stephen,

          I have read the "help", still can't get it to work. I have tried a few combinations with "cells" but nothing worked out:
          Code:
          cells(* fmt(%9.4f))
          
          cells(fmt(%9.4f))
          I get the same error:
          HTML Code:
          option cells() not allowed
          Any other idea?

          Comment


          • #6
            Hi! This is two years later but in case someone is looking for an answer, in this case, this would work:

            esttab, cells("count(fmt(3)) mean(fmt(3)) sd(fmt(3)) min(fmt(3)) p50(fmt(3)) max(fmt(3))") noobs You just need to add the number of decimlas needed for each type of estimation in your "cells" option!

            Comment


            • #7
              Even 2 years later, this is really useful! Thanks Tamara!

              Comment

              Working...
              X