Announcement

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

  • Format: Fix the number of nonzero digits to be displayed

    Hi everyone,

    I am struggling with the format option when exporting my regression coefficients to Latex. What I'd like to have is the first two digits, starting with the first nonzero digit after the comma (all coefficients have leading zeros). That is, 0.537 should be displayed as 0.54 and 0.0342 as 0.034. I already had a look at the help file of the format command but couldn't find any adequate solution.

    Thanks a lot!

  • #2
    This depends on what command you are using to export the results, which you do not state. Are you using esttab (Stata Journal)? Also, show your command for anything specific.

    Comment


    • #3
      Hi,
      yes, I use the esttab coomand. My code looks like this:

      Code:
      esttab model1 model2 model3 model4 model5 ///
      using "$table\Modeldoc.tex", mtitles("1" "2" "3" "5" "9") ///
      se stats(r2_a N, fmt(%9.3f %9.0g) labels("\$R^{2}\$")) ///
      label nonumbers keep(wagevar1 wagevar2 wagevar3) replace

      Comment


      • #4
        That is, 0.537 should be displayed as 0.54 and 0.0342 as 0.034.
        Code:
        esttab model1 model2 model3 model4 model5 ///
        using "$table\Modeldoc.tex", mtitles("1" "2" "3" "5" "9") ///
        b(a2) se stats(r2_a N, fmt(%9.3f %9.0g) labels("\$R^{2}\$")) ///
        label nonumbers keep(wagevar1 wagevar2 wagevar3) replace

        Comment


        • #5
          Thank you, this is exactly what I was looking for!

          Comment

          Working...
          X