Announcement

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

  • Table creation using OR (Confidence Interval) and p values.

    esttab using "$path\Table1.csv", ///
    eform ///
    cells("b(fmt(3)) ci(fmt(3) par) p(fmt(2))")
    /// star(* 0.1 ** 0.05 *** 0.01)
    /// drop(_cons)
    /// nonotes nomtitles nogaps
    /// replace
    /// collabels("Odds Ratio (95% CI)" "p-value")
    /// compress

    I want to export a table where I want to report the odds ratios (estimated coefficients from a logistic regression) and with those odds ratios I want the confidence interval in the same column in brackets. For example, say coefficient (CI). then in another column I want the p-values. p values should be given to two significant figures, unless p<0ยท0001.

    So, basically I want.. Variable EstimatedCoeffciient (CI) p-value

    I used the above code, although things are getting generated but it is essentially not in the right format.

    Can any one help me with that?

    Also, how to drop the reference categories for the binary variables?

  • #2
    estout is from SSC, as you are asked to explain (FAQ Advice #12).

    Code:
    webuse lbw, clear
    logistic low age smoke i.race
    esttab, cells("b ci(par) p") label collab(Coef. CI P-value) ///
    nonumb mlab(none) nocons nobaselevels eform
    Res.:

    Code:
    . logistic low age smoke i.race
    
    Logistic regression                                     Number of obs =    189
                                                            LR chi2(4)    =  15.81
                                                            Prob > chi2   = 0.0033
    Log likelihood = -109.4311                              Pseudo R2     = 0.0674
    
    ------------------------------------------------------------------------------
             low | Odds ratio   Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             age |   .9657186   .0322573    -1.04   0.296     .9045206    1.031057
           smoke |    3.00582   1.118001     2.96   0.003     1.449982    6.231081
                 |
            race |
          Black  |   2.749483   1.356659     2.05   0.040     1.045318    7.231924
          Other  |   2.876948   1.167921     2.60   0.009     1.298314    6.375062
                 |
           _cons |    .365111   .3146026    -1.17   0.242     .0674491    1.976395
    ------------------------------------------------------------------------------
    Note: _cons estimates baseline odds.
    
    . esttab, cells("b ci(par) p") label collab(Coef. CI P-value) ///
    > nonumb mlab(none) nocons nobaselevels eform
    
    -----------------------------------------------------------
                                Coef.           CI      P-value
    -----------------------------------------------------------
    Birthweight<2500g                                          
    Age of mother            .9657186 [.9045206,1.031057]     .2963372
    Smoked during preg~y      3.00582 [1.449982,6.231081]     .0030874
    Black                    2.749483 [1.045318,7.231924]     .0403852
    Other                    2.876948 [1.298314,6.375062]     .0092398
    -----------------------------------------------------------
    Observations                  189                          
    -----------------------------------------------------------
    Exponentiated coefficients

    Comment

    Working...
    X