Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE:RE: st: Mlogit with constraints


From   Edlira Narazani <[email protected]>
To   [email protected]
Subject   RE:RE: st: Mlogit with constraints
Date   Tue, 13 Dec 2005 10:27:24 +0100

Dear Maarten and Richard,

I attach below the results got when constant is not constrained to be invariant
across alternatives. This time it works even for the predicted probabilities
which are very close to the observed ones. these constants are supposed to
capture fixed effects. You know how to capture random effect as well using the
same mlogit?

thank you a lot, you were really helpful
Edlira

cons drop _all

. cons 1 [2=3]: time cost1

. cons 2 [3=4]: time cost1

. cons 3 [4=5]: time cost1

. mlogit av20 time cost1  if (location>1|location<6|location>6)&purpose==1,
cons(1-3) basecat(1)

Iteration 0:   log likelihood = -238.27473
Iteration 1:   log likelihood = -233.96107
Iteration 2:   log likelihood = -233.76573
Iteration 3:   log likelihood = -233.76421
Iteration 4:   log likelihood = -233.76421

Multinomial logistic regression                   Number of obs   =        324
                                                  LR chi2(2)      =       9.02
                                                  Prob > chi2     =     0.0110
Log likelihood = -233.76421                       Pseudo R2       =     0.0189

 ( 1)  [2]time - [3]time = 0
 ( 2)  [2]cost1 - [3]cost1 = 0
 ( 3)  [3]time - [4]time = 0
 ( 4)  [3]cost1 - [4]cost1 = 0
 ( 5)  [4]time - [5]time = 0
 ( 6)  [4]cost1 - [5]cost1 = 0
------------------------------------------------------------------------------
        av20 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
2            |
        time |    .012926   .0085442     1.51   0.130    -.0038203    .0296724
       cost1 |  -.0028968   .0015177    -1.91   0.056    -.0058713    .0000778
       _cons |  -2.044154   .6947414    -2.94   0.003    -3.405822   -.6824861
-------------+----------------------------------------------------------------
3            |
        time |    .012926   .0085442     1.51   0.130    -.0038203    .0296724
       cost1 |  -.0028968   .0015177    -1.91   0.056    -.0058713    .0000778
       _cons |  -2.848527   .7177557    -3.97   0.000    -4.255302   -1.441752
-------------+----------------------------------------------------------------
4            |
        time |    .012926   .0085442     1.51   0.130    -.0038203    .0296724
       cost1 |  -.0028968   .0015177    -1.91   0.056    -.0058713    .0000778
       _cons |  -4.295446   .8404462    -5.11   0.000     -5.94269   -2.648202
-------------+----------------------------------------------------------------
5            |
        time |    .012926   .0085442     1.51   0.130    -.0038203    .0296724
       cost1 |  -.0028968   .0015177    -1.91   0.056    -.0058713    .0000778
       _cons |  -3.602299    .762463    -4.72   0.000    -5.096699   -2.107899
------------------------------------------------------------------------------
(av20==1 is the base outcome)

. predict p1 p2 p3 p4 p5  if e(sample)
(option pr assumed; predicted probabilities)
(69 missing values generated)


    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
          p1 |       324    .7932099    .0648332   .6414537   .9545749
          p2 |       324    .1172839    .0367711   .0257635   .2033546
          p3 |       324    .0524691    .0164502   .0115258   .0909744
          p4 |       324    .0123457    .0038706   .0027119   .0214057
          p5 |       324    .0246914    .0077413   .0054239   .0428115


observed probabilities
tab av20  if (location>1|location<6|location>6)&purpose==1

       av20 |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        262       78.92       78.92
          2 |         41       12.35       91.27
          3 |         17        5.12       96.39
          4 |          4        1.20       97.59
          5 |          8        2.41      100.00
------------+-----------------------------------
      Total |        332      100.00

.


Scrive Maarten buis <[email protected]>:

> At Mon 12/12/2005 10:30 AM, Richard Williams wrote:
> > Also, one thing I find peculiar here is that the equality
> > constraint on the constants isn't working, i.e. the constant in
> > the first 3 equations is 0 while in the last it is non-zero.  I
> > would have expected a non-zero and identical value for the
> > constant in all 4 equations.
>
> I agree with Richard that this is odd behaviour, I replicated it
> with the auto dataset. Also the results are close but not quite
> the same as the results from a logistic regression. Oh well, the
> main message from this should be that if you want to estimate a
> logistic regresion, you should use -logistic- and not -mlogit- with lots of
> constraints.
>
> *---------example---------------
> set more off
> sysuse auto, clear
> recode rep78 1=2
> constraint 1 [2=4]: price foreign _cons
> constraint 2 [4=5]: price foreign _cons
> mlogit rep78 price foreign, con(1 2)
> gen dum = rep78 == 3
> logit dum price foreign
> *-------end example-------------
>
> Cheers,
> Maarten
>
> -----------------------------------------
> Maarten L. Buis
> Department of Social Research Methodology
> Vrije Universiteit Amsterdam
> Boelelaan 1081
> 1081 HV Amsterdam
> The Netherlands
>
> visiting adress:
> Buitenveldertselaan 3 (Metropolitan), room Z214
>
> +31 20 5986715
>
> http://home.fsw.vu.nl/m.buis/
> -----------------------------------------
>
>
>
>
>
>
> ___________________________________________________________
> Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
> voicemail http://uk.messenger.yahoo.com
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>




----------------------------------------------------------------
This message was sent using IMP - Facolta' di Economia - Torino.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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