Announcement

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

  • %e format

    Hi,

    I'm confused with the definition of %e format.

    I'm doing IV regression for panel data.
    I used xtreg for model a, xtivreg for model b and ivreg2 (with liml) for model c.

    My initial regression results were-
    HTML Code:
    . esttab a b c, star (* 0.1 ** 0.05 *** 0.01) compress nogaps mtitles, using myfile1.csv
    
    -------------------------------------------------
                     (1)          (2)          (3)  
                       a            b            c  
    -------------------------------------------------
    ln_SDric~d   0.00273      0.00363       -0.171***
                  (0.99)       (0.71)      (-5.19)  
    ln_SDwhe~d  -0.00433***  -0.00532***   -0.0301***
                 (-3.01)      (-2.96)      (-5.43)  
    stpop      0.0000180*   0.0000196*   0.0000334*  
                  (1.79)       (1.94)       (1.93)  
    scpop      -0.0000358*** -0.0000341*** -0.0000697***
                 (-2.74)      (-2.62)      (-2.93)  
    totallit   0.00000704*   0.00000629*   -0.0000310***
                  (1.90)       (1.66)      (-3.47)  
    totalagri   0.000115***  0.000115***  0.000305***
                  (7.42)       (6.94)       (6.65)  
    _cons          0.180***     0.180***     1.329***
                  (9.89)       (5.49)       (6.28)  
    -------------------------------------------------
    N                870          861          861  
    -------------------------------------------------
    t statistics in parentheses
    * p<0.1, ** p<0.05, *** p<0.01
    Then I thought of changing the format-
    HTML Code:
    . esttab a b c, se(3) r2(3) b(3) star (* 0.1 ** 0.05 *** 0.01) compress nogaps mtitles, using myfile2.csv
    
    -------------------------------------------------
                     (1)          (2)          (3)  
                       a            b            c  
    -------------------------------------------------
    ln_SDric~d     0.003        0.004       -0.171***
                 (0.003)      (0.005)      (0.033)  
    ln_SDwhe~d    -0.004***    -0.005***    -0.030***
                 (0.001)      (0.002)      (0.006)  
    stpop          0.000*       0.000*       0.000*  
                 (0.000)      (0.000)      (0.000)  
    scpop         -0.000***    -0.000***    -0.000***
                 (0.000)      (0.000)      (0.000)  
    totallit       0.000*       0.000*      -0.000***
                 (0.000)      (0.000)      (0.000)  
    totalagri      0.000***     0.000***     0.000***
                 (0.000)      (0.000)      (0.000)  
    _cons          0.180***     0.180***     1.329***
                 (0.018)      (0.033)      (0.212)  
    -------------------------------------------------
    N                870          861          861  
    R-sq                                    -2.911  
    -------------------------------------------------
    Standard errors in parentheses
    * p<0.1, ** p<0.05, *** p<0.01
    Then to overcome zeros, I used-
    HTML Code:
    . esttab a b c, se(%10.7e) r2(3) b(3 3 %10.7e %10.7e %10.7e %10.7e 3) star (* 0.1 ** 0.05 *** 0.01) compress nogaps mtitles, using myfile3.csv
    
    -------------------------------------------------
                     (1)          (2)          (3)  
                       a            b            c  
    -------------------------------------------------
    ln_SDric~d     0.003        0.004       -0.171***
               (2.748e-03)    (5.076e-03)    (3.286e-02)  
    ln_SDwhe~d    -0.004***    -0.005***    -0.030***
               (1.437e-03)    (1.797e-03)    (5.545e-03)  
    stpop      1.802e-05*   1.959e-05*   3.339e-05*  
               (1.009e-05)    (1.008e-05)    (1.734e-05)  
    scpop      -3.578e-05*** -3.409e-05*** -6.974e-05***
               (1.307e-05)    (1.303e-05)    (2.381e-05)  
    totallit   7.037e-06*   6.294e-06*   -3.096e-05***
               (3.706e-06)    (3.790e-06)    (8.920e-06)  
    totalagri  1.153e-04*** 1.148e-04*** 3.052e-04***
               (1.553e-05)    (1.655e-05)    (4.590e-05)  
    _cons          0.180***     0.180***     1.329***
               (1.821e-02)    (3.276e-02)    (2.118e-01)  
    -------------------------------------------------
    N                870          861          861  
    R-sq                                    -2.911  
    -------------------------------------------------
    Standard errors in parentheses
    * p<0.1, ** p<0.05, *** p<0.01
    Then again-
    HTML Code:
    . esttab a b c, se(%8.7e) r2(3) b(3 3 %8.7e %8.7e %8.7e %8.7e 3) star (* 0.1 ** 0.05 *** 0.01) compress nogaps mtitles, using myfile4.csv
    
    -------------------------------------------------
                     (1)          (2)          (3)  
                       a            b            c  
    -------------------------------------------------
    ln_SDric~d     0.003        0.004       -0.171***
               (2.7e-03)    (5.1e-03)    (3.3e-02)  
    ln_SDwhe~d    -0.004***    -0.005***    -0.030***
               (1.4e-03)    (1.8e-03)    (5.5e-03)  
    stpop        1.8e-05*     2.0e-05*     3.3e-05*  
               (1.0e-05)    (1.0e-05)    (1.7e-05)  
    scpop       -3.6e-05***  -3.4e-05***  -7.0e-05***
               (1.3e-05)    (1.3e-05)    (2.4e-05)  
    totallit     7.0e-06*     6.3e-06*    -3.1e-05***
               (3.7e-06)    (3.8e-06)    (8.9e-06)  
    totalagri    1.2e-04***   1.1e-04***   3.1e-04***
               (1.6e-05)    (1.7e-05)    (4.6e-05)  
    _cons          0.180***     0.180***     1.329***
               (1.8e-02)    (3.3e-02)    (2.1e-01)  
    -------------------------------------------------
    N                870          861          861  
    R-sq                                    -2.911  
    -------------------------------------------------
    Standard errors in parentheses
    * p<0.1, ** p<0.05, *** p<0.01
    I needed journal-styled tables compatible with Excel/Word.

    So here, what is the exact work of %w.de?
    That's-
    %w.de displays numeric values in exponential format.
    w records the width of the format.
    d records the number of digits to be shown after the decimal place.
    Here I didn't quite understand how it works.
    Say results from %8.7e & %7.6e the same?

    Thanks,
    Last edited by Souryabrata Mohapatra; 05 Aug 2022, 19:26.

  • #2
    No to the last question, as %6.7e isn't even legal.

    That at least can be explained.

    Historically, at least in my version of history, display formats were based on y.x where y indicated the total number of characters needed and x the number of characters after a decimal point, so y > x and woe betide you if you got the format wrong for the need.

    In Stata, as in some other software, the code for formats isn't public and likely would defy easy summary if it were, as Stata tries moderately hard to catch what you want even if you don't spell it out. So, here are some examples where Stata quietly forgives or overrules a silly request

    .
    Code:
     di %3.2f 1000
    1000.00
    
    . di %2.1f 1000
    1000.0
    Although it's not the question, and perhaps you are just exploring, but I'd call your first table the easiest to read and find the others very off-putting. But the underlying problem appears to be twofold

    1. You may have some very weak dependencies that likely qualify as significant because of an enormous sample size. That is what it is.

    2. Slope coefficients necessarily are in composite units of measurement (units of outcome) / (units of predictor) and changing either or both so that ideally coefficients are of order 1 or close to it is often a good idea. That's often a counsel of perfection as for example a variable and its square may both be predictors and whatever you do about units is likely to produce coefficients of different sizes

    I am not trying to hard to answer your main question, as these formats aren't easy to read even if you know what they mean, and so I tend to avoid them like the plague following #2 above, and am also being wary of overfitting.
    Last edited by Nick Cox; 06 Aug 2022, 03:59.

    Comment

    Working...
    X