Announcement

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

  • Can anyone explain to me what the meaning of %9.0g is?

    I'm confused about Stata formats. I try to see Stata help format file, but I'm still confused.

    The current format is %9.0g, which is the default format for numeric data in the Data Editor. This format instructs Stata to try to print numbers within nine columns.
    (From: A Gentle Introduction to Stata)

  • #2
    See
    Code:
    help format##gformat
    Red Owl
    Stata/IC 16 (Windows 10, 64-bit)

    Comment


    • #3
      As a sidelight I often like to use the cformat option on estimation commands, e,g.

      Code:
      use https://www3.nd.edu/~rwilliam/statafiles/shuttle2.dta, clear
      ologit distress date temp, nolog
      ologit distress date temp, nolog cformat(%9.3f)
      Code:
      . use https://www3.nd.edu/~rwilliam/statafiles/shuttle2.dta, clear
      (First 25 space shuttle flights)
      
      . ologit distress date temp, nolog
      
      Ordered logistic regression                     Number of obs     =         23
                                                      LR chi2(2)        =      12.32
                                                      Prob > chi2       =     0.0021
      Log likelihood =  -18.79706                     Pseudo R2         =     0.2468
      
      ------------------------------------------------------------------------------
          distress |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
              date |    .003286   .0012662     2.60   0.009     .0008043    .0057677
              temp |  -.1733752   .0834475    -2.08   0.038    -.3369293   -.0098212
      -------------+----------------------------------------------------------------
             /cut1 |   16.42813   9.554822                     -2.298978    35.15524
             /cut2 |   18.12227   9.722302                      -.933092    37.17763
      ------------------------------------------------------------------------------
      
      . ologit distress date temp, nolog cformat(%9.3f)
      
      Ordered logistic regression                     Number of obs     =         23
                                                      LR chi2(2)        =      12.32
                                                      Prob > chi2       =     0.0021
      Log likelihood =  -18.79706                     Pseudo R2         =     0.2468
      
      ------------------------------------------------------------------------------
          distress |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
              date |      0.003      0.001     2.60   0.009        0.001       0.006
              temp |     -0.173      0.083    -2.08   0.038       -0.337      -0.010
      -------------+----------------------------------------------------------------
             /cut1 |     16.428      9.555                        -2.299      35.155
             /cut2 |     18.122      9.722                        -0.933      37.178
      ------------------------------------------------------------------------------
      
      .
      If 3 decimal place accuracy isn't good enough for you you might want to consider rescaling variables anyway so the output is easier to read.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment

      Working...
      X