Bookmark and Share

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: MIXLPRED: marginal effects after-MIXLOGIT-


From   Arne Risa Hole <arnehole@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: MIXLPRED: marginal effects after-MIXLOGIT-
Date   Fri, 2 Mar 2012 18:16:59 +0000

Dear Kayo,

Thanks for the additional information. In your code, try to replace
the following lines

quietly replace d1inc=d1inc+1
quietly replace d2inc=d2inc+1
quietly replace d3inc=d3inc+1
quietly replace d4inc=d4inc+1

by

quietly replace d1inc=d1inc+1 if alt==1
quietly replace d2inc=d2inc+1 if alt==2
quietly replace d3inc=d3inc+1 if alt==3
quietly replace d4inc=d4inc+1 if alt==4

Arne

2012/3/2 nagi kayo <kayonagi@hotmail.co.jp>:
> Dear Arne (if I may)
>
>
>
> Thank you very much for your quick reply and for your question and advice.
>
> I am really sorry that I did not provide you with enough information on my application.
>
>
>
> first, please let me explain the data I used.
>
> although the number of "id" used in my estimation is about 10,000,
>
> the following is the data on the first two "id."
>
>
>
> id alt  d  d1  d2  d3 d1inc  d2inc  d3inc  d4inc      p
>
> 1   1   1   1   0   0   665       0     0      0  0.214
>
> 1   2   0   0   1   0     0     665     0      0  0.186
>
> 1   3   0   0   0   1     0       0   665      0  0.381
>
> 1   4   0   0   0   0     0       0     0    665  0.219
>
> 2   1   0   1   0   0   779       0     0      0  0.553
>
> 2   2   1   0   1   0     0     779     0      0  0.301
>
> 2   3   0   0   0   1     0       0   779      0  0.107
>
> 2   4   0   0   0   0     0       0     0    779  0.039
>
>
>
> id:    households
>
> alt:   1=households are worried about their retirement life
>
>         because the pension benefit is NOT enough.
>
>       2=households are worried about their retirement life
>
>         for some reasons other than pension.
>
>       3=households are NOT worried about their retirement life
>
>         because the pension benefit is enough.
>
>       4=households are NOT worried about their retirement life
>
>         for some reasons other than pension.
>
> d:     dummy which equals one if households choose "alt" in the same row.
>
>       (id 1 chose alt 1, and id 2 chose alt 2.)
>
> d1-d3: intercepts
>
> d1inc-d4inc: real households income (units of 10,000yen)
>
>             Mean=531
>
>             Std.Dev.=413.4245
>
>             Min.=0
>
>             Max.=6079.027
>
> p:     an alternative specific variable
>
>
>
> using the above data, i did the estimation as follows:
>
>
>
> ************************************************
>
> mixlogit d d1 d2 d3 d1inc d2inc d3inc, group(id) rand(p)
> mixlpred pred_base
>
> preserve
> quietly replace d1inc=d1inc+1
> quietly replace d2inc=d2inc+1
> quietly replace d3inc=d3inc+1
> quietly replace d4inc=d4inc+1
> mixlpred pred_inc1
> gen dif_inc1=pred_inc1-pred_base
>
> sum dif_inc1 if alt==1
>
> sum dif_inc1 if alt==2
> sum dif_inc1 if alt==3
> sum dif_inc1 if alt==4
>
> restore
> ************************************************
>
>
> the results are
>
>  mean of dif_inc1 is -2.11e-12 if alt==1
>
>  mean of dif_inc1 is -1.05e-12 if alt==2
>
>  mean of dif_inc1 is  1.87e-12 if alt==3
>
>  mean of dif_inc1 is  1.29e-12 if alt==4
>
>
>
> i think these marginal effects are too small...
>
>
>
> so as you kindly advised me, i saw Richard Williams's reply to your earlier post
>
> on calculating marginal effects after -mixlogit- and increased by 0.001 and divided
>
> the difference by 0.001.
>
>
>
> ************************************************
>
> mixlogit d d1 d2 d3 d1inc d2inc d3inc, group(id) rand(p)
>
> mixlpred pred_base
>
> preserve
> quietly replace d1inc=d1inc+0.001
> quietly replace d2inc=d2inc+0.001
> quietly replace d3inc=d3inc+0.001
> quietly replace d4inc=d4inc+0.001
> mixlpred pred_inc2
> gen dif_inc2=(pred_inc2-pred_base)/0.001
>
> sum dif_inc2 if alt==1
>
> sum dif_inc2 if alt==2
> sum dif_inc2 if alt==3
> sum dif_inc2 if alt==4
>
> restore
>
> ************************************************
>
>
> the results are
>
>  mean of dif_inc1  7.83e-7 if alt==1
>
>  mean of dif_inc1  3.85e-7 if alt==2
>
>  mean of dif_inc1 -6.64e-7 if alt==3
>
>  mean of dif_inc1 -5.04e-7 if alt==4
>
>
> I think these marginal effects are still too small.
>
>
>
> finally, I increased the Std.Dev. of the regressor divided by 1,000
>
> and divided the difference by the Std.Dev. of the regressor divided by 1,000.
>
>
>
> ************************************************
>
> mixlogit d d1 d2 d3 d1inc d2inc d3inc, group(id) rand(p)
>
> mixlpred pred_base
>
> preserve
> quietly replace d1inc=d1inc+0.4134245
> quietly replace d2inc=d2inc+0.4134245
> quietly replace d3inc=d3inc+0.4134245
> quietly replace d4inc=d4inc+0.4134245
> mixlpred pred_inc3
> gen dif_inc3=(pred_inc3-pred_base)/0.4134245
>
> sum dif_inc3 if alt==1
>
> sum dif_inc3 if alt==2
> sum dif_inc3 if alt==3
> sum dif_inc3 if alt==4
>
> restore
>
> ************************************************
>
>
>
> the results are
>
>  mean of dif_inc1 -2.70e-9 if alt==1
>
>  mean of dif_inc1 -1.42e-9 if alt==2
>
>  mean of dif_inc1  2.24e-9 if alt==3
>
>  mean of dif_inc1  1.89e-9 if alt==4
>
>
>
> still, the marginal effects are so small.
>
>
>
> actually, i also controlled the other variables like age and wealth
>
> and calculated the marginal effects like above,
>
> but their marginal effects are too small, too.
>
> so I am wondering if there is something wrong with my calculation.
>
>
>
> I greatly appreciate it if you would advise me again.
>
>
>
> with best wishes,
>
> Kayo
>
>
>
>
>
>
>
> ---------------------------------------- > Date: Wed, 29 Feb 2012 11:01:57 +0000 > Subject: Re: st: MIXLPRED: marginal effects after-MIXLOGIT- > From: arnehole@gmail.com > To: statalist@hsphsun2.harvard.edu > > Dear Kayo, > > It's difficult to help without knowing more about your application. > Most importantly: what is the unit of measurement of the income > variable? If income is measured in dollars or euros (or yen), for > example, you would expect the marginal effect of a one unit increase > in income to be small. See Richard Williams' reply to my earlier post > on calculating marginal effects after -mixlogit-. > > Arne > > 2012/2/29 nagi kayo <kayonagi@hotmail.co.jp>: > > Dear Professor Arne Risa Hole and all > > > > > > > > I read the thread Professor Hole kindly wrote on "Mon, 6 Feb. 2012 13:18:34" about calculating marginal effects after -mixlogit- and tried to calculate marginal effects using the following commands. in my estimation model, the number of alternativ!
 es
>  is four, and "inc" is a demographic variable, and "price" is an alternative specific variable. > > > > > > > > mixlogit d d1inc d2inc d3inc, group(id) rand(price) > > mixlpred pred_base > > > > replace d1inc=d1inc+1 > > replace d2inc=d2inc+1 > > replace d3inc=d3inc+1 > > replace d4inc=d4inc+1 > > mixlpred pred_inc > > > > > > however, unexpectedly, "pred_inc" is quite similar to "pred_base," and thus the difference between the two is almost zero, which means that the marginal effect of income is almost zero. > > > > although i also tried the other explanatory variables, the results are not changed (in all cases, marginal effects are almost zero). > > > > is my calculation of predicted probabilities wrong? > > > > > > > > i greatly appreciate it if you would give me your advice. > > > > > > > > with best wishes, > > > > Kayo > > > > > > * > > * For searches and help try: > > * http://www.stata.com/help.cgi?search > > * http://www.stata.com/support/statalist/faq > > * http:!
 //!
>  ww
>  w.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/
> *
> *   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index