Announcement

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

  • Forcing or format margins output table to show 6 decimal places including trailing zeros

    Hi,
    I have this code:
    Code:
    regress PositiveAffect i.Message_rec##i.Relevance_rec
    margins Message_rec##Relevance_rec
    which gives me this:

    I want to have 6 dec places shown in column Margin and t, even with trailing zeros. How do I do it, please ?

  • #2
    Code:
    help margins##display_options

    Comment


    • #3
      I have done:
      Code:
      margins Message_rec##Relevance_rec, cformat(%12.6f)
      but no difference, how to force trailing zeros ?

      Comment


      • #4
        You will have to present a reproducible example. This works:

        Code:
        di %12.6f 8.056
        di %12.6f 24
        di %12.6f 36.6
        Res.:

        Code:
        . di %12.6f 8.056
            8.056000
        
        . 
        . di %12.6f 24
           24.000000
        
        . 
        . di %12.6f 36.6
           36.600000

        Comment


        • #5
          Please try export your results to Excel, e.g.:

          sysuse auto
          reg price i.foreign##i.rep78
          margins foreign##rep78, post

          matrix list r(table)
          matrix b = r(table)
          matrix list b

          cd "/Users/maciej_koniewski/Downloads/"
          putexcel set myresults.xlsx, sheet(margins) replace
          putexcel B2 = matrix(b), names

          Comment

          Working...
          X