Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Output logistic regression results using outreg


From   Maria Cecilia Vieira da Silva <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Output logistic regression results using outreg
Date   Thu, 9 Feb 2012 16:02:48 +0000

Thank you very much.
The following worked:

Logistic exa_dif1 absch_total
outreg using results, stats(b ci p) varlabels replace

                    --------------------------------------------
                     exa_dif1  absch_tot          0.008        
                                            (-0.013 - 0.029)   
                                                 [0.44]        
                               Constant          -1.454        
                                           (-1.738 - -1.169)** 
                                                 [0.00]        
                     N                             342         
                    --------------------------------------------
                                * p<0.05; ** p<0.01


In order to get OR instead of beta:

. outreg using results, stats(e_b e_ci p) varlabels replace

                      ----------------------------------------
                       exa_dif1  absch_tot        1.008      
                                             (0.987 - 1.030) 
                                                 [0.44]      
                       N                           342       
                      ----------------------------------------
                                * p<0.05; ** p<0.01

In order to append results, the following worked:

Logistic exa_dif1 absch_total treat

outreg using results, stats(e_b e_ci p) varlabels merge replace



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Alberto R Osella
Sent: Thursday, February 09, 2012 10:10 AM
To: [email protected]
Subject: Re: st: Output logistic regression results using outreg

Hi,
It may be :

outreg, or stat(ci)
Hope this help


Alberto R. Osella, MD, PhD
Laboratorio di Epidemiologia e Biostatistica IRCCS Saverio de Bellis Via Turi, 27
70013 Castellana Grotte (BA)
Italia
Tel:    +39 0804994655
Fax:    +39 0804994650
e-mail: [email protected]


Il 09/02/2012 15:09, Maria Cecilia Vieira da Silva ha scritto:
> Hello,
> Here are the details.
> I run a logistic that gives me the ORs (not the betas).
> When I try to get the conf interval and p-value, they do not appear. I also tried running an OLS regression and the results are the same. I am stuck in the syntax.
> I am using the latest version of outreg and I read the help file - realizing that a lot is possible using outreg. However, I am not getting the basic syntax. Maybe someone has used this version of outreg and has some hints about how to get the output with OR, p-value and conf interval? I also would like to report the value of the constant.
>
> Thanks.
>
> logistic exa bsval_tot if analymth==12&  trtn==90
>
> Logistic regression                               Number of obs   =        390
>                                                    LR chi2(1)      =      10.41
>                                                    Prob>  chi2     =     0.0013
> Log likelihood = -243.03366                       Pseudo R2       =     0.0210
>
> ------------------------------------------------------------------------------
>           exa | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
> -------------+--------------------------------------------------------
> -------------+--------
>     bsval_tot |   1.019068   .0060469     3.18   0.001     1.007285    1.030989
>         _cons |   .2106637   .0627635    -5.23   0.000     .1174869    .3777375
> ----------------------------------------------------------------------
> --------
>
> . outreg, b ci p replace
> option b not allowed
> r(198);
>
> end of do-file
>
> r(198);
>
> . outreg, or ci p replace
> option ci not allowed
> r(198);
>
> . outreg, or e_ci p replace
> option e_ci not allowed
> r(198);
>
> . outreg, or replace
>
>                              ----------------------------
>                               exa  bsval_tot    1.019
>                                                (3.18)**
>                               N                  390
>                              ----------------------------
>                                  * p<0.05; ** p<0.01
>
>
> . outreg, or p replace
>
>                              ----------------------------
>                               exa  bsval_tot    1.019
>                                                (3.18)**
>                               N                  390
>                              ----------------------------
>                                  * p<0.05; ** p<0.01
>
>
> . outreg, e_b e_se replace
> option e_b not allowed
> r(198);
>
> . outreg, replace
>
>                              ----------------------------
>                               exa  bsval_tot    1.019
>                                                (3.18)**
>                               N                  390
>                              ----------------------------
>                                  * p<0.05; ** p<0.01
>
>
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Phil 
> Clayton
> Sent: Thursday, February 09, 2012 12:32 AM
> To: [email protected]
> Subject: Re: st: Output logistic regression results using outreg
>
> At 09:14 PM 2/8/2012, Maria Cecilia Vieira da Silva wrote:
>>> I tried:
>>>
>>> outreg using results, b ci p replace ///
>>>
>>> it did not work.
> On 09/02/2012, at 4:18 PM, Richard Williams wrote:
>> It may be you have a syntax error, but -outreg- has a zillion options so if so it isn't obvious to me. In any event, could you be more specific? What do you mean, "it did not work?" Are you getting an error message, or are you just not getting things printed out that you would like, or what? It would help to show the command you typed before outreg, along with the message or output you got immediately afterwards. I might also drop the "using results" temporarily so the output is printed to your screen.
> ... and if you're running exactly this from a do-file:
> outreg using results, b ci p replace ///
>
> Then it may not work because of the /// at the end of the line (which tells Stata that the command continues on the next line - so either the /// shouldn't be there or you haven't shown us the entire command).
>
> Also, -outreg- is not part of Stata - it's a user-written command from 
> SSC. You should mention this in your post and tell us which version 
> you're running (-which outreg-)
>
> Phil
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index