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

# st: Re: FW: Question about polytomous/multinomial logistic regression

 From "Joseph Coveney" To Subject st: Re: FW: Question about polytomous/multinomial logistic regression Date Sun, 13 Oct 2013 12:22:07 +0900

```Mahboobeh Safaeian wrote:

I am doing an analysis using polytomous logistic regression using health related
data. My outcome variable has three categories with controls (reference
category) and 2 different disease categories (case group1 and case group2).
The results for my exposure variable of interest show that compared to the
reference category, case group1 has an odds ratio below one, and case group2 has
an odds ratio above one as in the following table.
Any ideas on whether stata can compute pvalues that tests whether the 0.75 is
different from the 1.38? is there an extra command?

Case 1: Odds ratio (95%CI)          	 Case 2: Odds ratio
(95%CI)
Exposure:            0.75 (1.00-1.68)                                 1.38
(1.1-1.98)

--------------------------------------------------------------------------------

It seems that you're doing two separate logistic regressions.  If that's the
case, then you could just fit a third that compares Cases 1 to 2, as illustrated
below.  An alterative would be to use Stata's -mlogit- command.  Then you could
use -test- or -lincom-.  Take a look at the official documentation for all
three to find out more.

Joseph Coveney

. clear *

. set more off

. set seed `=date("2013-10-13", "YMD")'

. quietly set obs 210

. generate byte outcome = mod(_n, 3)

. label define Cases 0 "Control" 1 "Case 1" 2 "Case 2"

. label values outcome Cases

. generate double xb = (outcome == 2) + ///
>     _pi / sqrt(3) * rnormal()

. generate byte exposure = xb > 0

.
. *
. * Apparent current
. *
. logistic outcome i.exposure if inlist(outcome, 0, 1), nolog

Logistic regression                               Number of obs   =        140
LR chi2(1)      =       4.86
Prob > chi2     =     0.0275
Log likelihood = -94.611736                       Pseudo R2       =     0.0250

------------------------------------------------------------------------------
outcome | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.exposure |   .4715447   .1622531    -2.18   0.029     .2402339    .9255746
_cons |   1.448276   .3496688     1.53   0.125      .902275    2.324682
------------------------------------------------------------------------------

. logistic outcome i.exposure if inlist(outcome, 0, 2), nolog

Logistic regression                               Number of obs   =        140
LR chi2(1)      =       1.10
Prob > chi2     =     0.2936
Log likelihood = -96.488975                       Pseudo R2       =     0.0057

------------------------------------------------------------------------------
outcome | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.exposure |   1.445387    .508209     1.05   0.295     .7255966    2.879208
_cons |   .7931035   .2214464    -0.83   0.406     .4588404    1.370876
------------------------------------------------------------------------------

.
. generate byte outcome2 = outcome == 2

. logistic outcome2 i.exposure if inlist(outcome, 1, 2), nolog

Logistic regression                               Number of obs   =        140
LR chi2(1)      =      10.50
Prob > chi2     =     0.0012
Log likelihood = -91.789627                       Pseudo R2       =     0.0541

------------------------------------------------------------------------------
outcome2 | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
1.exposure |   3.065217   1.080587     3.18   0.001      1.53598    6.116978
_cons |    .547619   .1420518    -2.32   0.020     .3293653    .9104986
------------------------------------------------------------------------------

.
. *
. * Suggested
. *
. mlogit outcome i.exposure, rrr nolog

Multinomial logistic regression                   Number of obs   =        210
LR chi2(2)      =      10.98
Prob > chi2     =     0.0041
Log likelihood = -225.22098                       Pseudo R2       =     0.0238

------------------------------------------------------------------------------
outcome |        RRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Control      |  (base outcome)
-------------+----------------------------------------------------------------
Case_1       |
1.exposure |   .4715447   .1622531    -2.18   0.029     .2402339    .9255747
_cons |   1.448276   .3496687     1.53   0.125      .902275    2.324682
-------------+----------------------------------------------------------------
Case_2       |
1.exposure |   1.445387    .508209     1.05   0.295     .7255967    2.879208
_cons |   .7931034   .2214464    -0.83   0.406     .4588403    1.370876
------------------------------------------------------------------------------

. test [Case_1]1.exposure = [Case_2]1.exposure

( 1)  [Case_1]1.exposure - [Case_2]1.exposure = 0

chi2(  1) =   10.10
Prob > chi2 =    0.0015

. lincom [Case_1]1.exposure - [Case_2]1.exposure, or

( 1)  [Case_1]1.exposure - [Case_2]1.exposure = 0

------------------------------------------------------------------------------
outcome | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) |   .3262411   .1150104    -3.18   0.001     .1634794      .65105
------------------------------------------------------------------------------

.
. exit

end of do-file

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