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: odds ratios and confidence intervals after mlogit with a dummy X


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: odds ratios and confidence intervals after mlogit with a dummy X
Date   Wed, 6 Mar 2013 09:57:38 +0100

In the previous example the last digit of the last standard error
differed between -mlogit- and -lincom-. Though it would not worry me
as in a model using real data those last digits are random noice
anyhow, you can get exactly the same standard errors by creating your
variables as -double-s:

*------------------ begin example ------------------
sysuse auto, clear
recode rep78 1/2=3
gen double weightd = (weight -3000) / 2000
gen double priced = (price - 6000) / 1000

mlogit rep78 c.priced##i.foreign weightd, rrr
est store base

// OR of foreign for 1 unit increase in price
lincom _b[4:1.foreign] + _b[4:1.foreign#c.price], rrr

// reproduce those estimates with -mlogit-
// its the main effect of foreign
gen double price1 = priced - 1
mlogit rep78 c.price1##i.foreign weight, rrr

// OR of foreign for 2 unit increase in price
est restore base // return to our original -mlogit- model
lincom _b[4:1.foreign] + 2*_b[4:1.foreign#c.price], rrr
di 27.88998 *  1.788271^2 // same result as lincom 89.189734

// reproduce those estimates with -mlogit-
// its the main effect of foreign
gen double price2 = priced - 2
mlogit rep78 c.price2##i.foreign weight, rrr
 *------------------- end example -------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

> On Wed, Mar 6, 2013 at 2:48 AM, Jeremy Reynolds wrote:
>> If I want to get the odds ratio of foreign for values of price (rather
>> than the odds ratios of price for foreign cars) <snip>
>> I'm not sure, however, how to replicate these results (primarily the
>> first one)  with mlogit.

On Wed, Mar 6, 2013 at 9:43 AM, Maarten Buis wrote:
> *------------------ begin example ------------------
> sysuse auto, clear
> recode rep78 1/2=3
> replace weight = (weight -3000) / 2000
> replace price = (price - 6000) / 1000
>
> mlogit rep78 c.price##i.foreign weight, rrr
> est store base
>
> // OR of foreign for 1 unit increase in price
> lincom _b[4:1.foreign] + _b[4:1.foreign#c.price], rrr
>
> // reproduce those estimates with -mlogit-
> // it is the main effect of foreign
> gen price1 = price - 1
> mlogit rep78 c.price1##i.foreign weight, rrr
>
> // OR of foreign for 2 unit increase in price
> est restore base // return to our original -mlogit- model
> lincom _b[4:1.foreign] + 2*_b[4:1.foreign#c.price], rrr
> di 27.88998 *  1.788271^2 // same result as lincom 89.189734
>
> // reproduce those estimates with -mlogit-
> // it is the main effect of foreign
> gen price2 = price - 2
> mlogit rep78 c.price2##i.foreign weight, rrr
> *------------------- end example -------------------
> (For more on examples I sent to the Statalist see:
> http://www.maartenbuis.nl/example_faq )

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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/


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