Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# Re: st: Testing equality of odds ratios outside of logistic regression

 From Michael Norman Mitchell To statalist@hsphsun2.harvard.edu Subject Re: st: Testing equality of odds ratios outside of logistic regression Date Sun, 09 May 2010 17:13:07 -0700

```Dear Michael

```
I think the comment that you received is a good one. It is very likely that your conclusions are correct, but they will be more substantiated by including a direct test of the coefficients. Fortunately, Stata is very good at this using the -suest- command. Here is an example based on the -auto- dataset, where the question is asked "Is the coefficient for -smtrunk- (small trunk size)" the same as the coefficient for -smprice- (small price of car". The models are estimated separately, and -estimates store- is used to store the results of each. Then, -suest- is used to estimate the models together, and then -test- to compare the coefficients in the two models.
```

Best regards,

Michael N. Mitchell
See the Stata tidbit of the week at...
http://www.MichaelNormanMitchell.com

---snip---

* make fake data
. sysuse auto, clear
(1978 Automobile Data)

. gen himpg = mpg > 20

. gen smtrunk = trunk < 14

. gen smprice = price < 5000

.
. * run model 1, predicing himpg from smtrunk
. logit himpg smtrunk

Iteration 0:   log likelihood = -51.265861
Iteration 1:   log likelihood =  -35.88057
Iteration 2:   log likelihood = -35.860081
Iteration 3:   log likelihood = -35.860072
Iteration 4:   log likelihood = -35.860072

```
Logistic regression Number of obs = 74 LR chi2(1) = 30.81 Prob > chi2 = 0.0000 Log likelihood = -35.860072 Pseudo R2 = 0.3005
```
------------------------------------------------------------------------------
```
himpg | Coef. Std. Err. z P>|z| [95% Conf. Interval]
```-------------+----------------------------------------------------------------
```
smtrunk | 2.926739 .598858 4.89 0.000 1.752999 4.10048 _cons | -1.386294 .3952847 -3.51 0.000 -2.161038 -.6115506
```------------------------------------------------------------------------------

. estimates store m1

.
. * run model 2, predicting himpg from smprice
. logit himpg smprice

Iteration 0:   log likelihood = -51.265861
Iteration 1:   log likelihood = -48.528905
Iteration 2:   log likelihood = -48.527122
Iteration 3:   log likelihood = -48.527122

```
Logistic regression Number of obs = 74 LR chi2(1) = 5.48 Prob > chi2 = 0.0193 Log likelihood = -48.527122 Pseudo R2 = 0.0534
```
------------------------------------------------------------------------------
```
himpg | Coef. Std. Err. z P>|z| [95% Conf. Interval]
```-------------+----------------------------------------------------------------
```
smprice | 1.109541 .4832148 2.30 0.022 .1624577 2.056625 _cons | -.6131045 .3443686 -1.78 0.075 -1.288055 .0618456
```------------------------------------------------------------------------------

. estimates store m2

.
. * estimate the two models together
. suest m1 m2

Simultaneous results for m1, m2

```
Number of obs = 74
```
------------------------------------------------------------------------------
|               Robust
```
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
```-------------+----------------------------------------------------------------
m1_himpg     |
```
smtrunk | 2.926739 .6029459 4.85 0.000 1.744987 4.108492 _cons | -1.386294 .3979829 -3.48 0.000 -2.166327 -.6062622
```-------------+----------------------------------------------------------------
m2_himpg     |
```
smprice | 1.109541 .4865133 2.28 0.023 .1559929 2.06309 _cons | -.6131045 .3467193 -1.77 0.077 -1.292662 .0664528
```------------------------------------------------------------------------------

.
. * Is the coefficient for "smtrunk" equal to "smprice"
. test [m1_himpg]smtrunk = [m2_himpg]smprice

( 1)  [m1_himpg]smtrunk - [m2_himpg]smprice = 0

chi2(  1) =    7.68
Prob > chi2 =    0.0056

On 2010-05-09 4.49 PM, Michael I. Lichter wrote:
```
I'm assisting on a paper where we examine the relationship between each of four dichotomous predictors variables and one dichotomous outcome variable. Prediction is our primary objective. The predictors are all measures of more or less the same thing, and we want to know whether, *without controlling for any of the others*, they predict the outcome equally well. We want to be able to say, "If you could only pick one of these variables as a predictor of the outcome, it wouldn't make any difference which one you selected."
```
```
For each of the predictors we calculate a odds ratio and a corresponding confidence interval. The odds ratios are very similar in magnitude and have confidence intervals that overlap almost entirely. We did not do any formal tests, not knowing of any offhand, and, because this isn't a central point, we didn't think it was very important. When we reported that the odds ratios were essentially equal, a reviewer objected that we had not tested for equality. Any suggestions?
```
```
In logistic regression, by the way, two of the four variables emerged as significant predictors and two did not, controlling for the others. That is of interest, but it doesn't answer my initial question. At least, I don't think it does.
```*
*   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/
```