Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Stata module - variance for a ratio of two odds ratios

From   Maarten buis <>
Subject   Re: st: Stata module - variance for a ratio of two odds ratios
Date   Sun, 25 Feb 2007 11:49:46 +0000 (GMT)

--- wrote:
> I would like to obtain the ratio of two odds ratios as well as its
> variance (or SE... CI).

This is quite easy if the odds ratios come from a logistic regression,
and you are comparing the odds ratios of having a good versus bad
repair status for cars that are a thousand dollars appart in price of
two groups: domestic and foreign cars. You add and interaction term of
price with foreign. exp(-_b[forXprice]) is the ratio of these odds
ratios. You can see that in the equations below. p is the parameter for
price and i is the interaction term, so the odds ratio for domestic
cars is e^p and the odds ratio for foreign cars is e^(p + i).

e^p / e^(p + i)
e^p * e^-(p + i)
e^(p - p - i)

You can now use -nlcom- to compute the standard errors and confidence
intervals, like in the example below:

*---------- begin example ----------
sysuse auto, clear
gen goodrep = rep78 > 3
replace price = price / 1000
gen forXprice = foreign*price

logit goodrep foreign price forXprice

di "odds ratio for domestic cars = " exp(_b[price])
di "odds ratio for foreign cars = " exp(_b[price] + _b[forXprice])
di "ratio of odds ratios = " exp(_b[price]) / ///
                             exp(_b[price] + _b[forXprice])
di "simpler formula for this ratio " exp(-_b[forXprice])

nlcom exp(-_b[forXprice])
*------------- end example -------------

However, since Allison(1999) there has been a lot of fuss about that
these comparisons of odds ratios do not represent causal effects. A
recent and very usefull contribution to this debate is a working paper
by Richard Williams ``Using Heterogeneous Choice Models To Compare
Logit and Probit Coefficients Across Groups'' downloadable from his

My position is that on the one hand these authors are right in the
sense that these are not causal effects. But, on the other hand, these
authors are too quick in dismissing comparisions of these odds ratios. 
These comparisons of odds ratios do represent differences in odds
ratios controlled for everything that is in your model and not
controlled for everything that is not in your model. As such comparing
them makes at least describtive sense. 

Hope this helps,

Allison, Paul. 1999. ``Comparing Logit and Probit Coefficients Across
Groups.'' Sociological Methods and Research 28(2): 186-208.

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail.
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index