Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: RE: Question about how inclusive values are calculated in nested logit

 From elleries@cmu.edu To statalist@hsphsun2.harvard.edu Subject Re: st: RE: Question about how inclusive values are calculated in nested logit Date Thu, 17 Jun 2010 16:45:26 -0400

```Thanks for the answer, it works now.  It's funny though, because there
are links online to demonstrations of where it works without dividing
by the log-sum parameter.  See these ppt notes, for instance:

psfaculty.ucdavis.edu/bsjjones/nestedlogit.pdf

On slide 21 (the slide that starts with "OK. Now what about the
"inclusive value parameters.""), the writer seems to get the equality
between log( sum (e(XB)) ), without dividing through by rho.  Does
that seem strange to you?
Ellerie

On Wed, Jun 16, 2010 at 2:24 PM, Nitin Dua <nd05d@fsu.edu> wrote:
> Hi Ellerie,
>
> I think it is because you forgot to divide xb term inside the exp() with
> rho_k for the nest.
>
> Nitin
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Ellerie Weber
> Sent: Wednesday, June 16, 2010 11:49 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Question about how inclusive values are calculated in nested
> logit
>
> Hello,
> I am running a nested logit and trying to understand what is happening
> behind the inclusive values Stata calculates with the command "predict iv".
>
> I thought that the inclusive value for nest j,  IV_j, is calculated
> according to the following formula:
>
>  IV_j  = log ( sum_k (exp(xb_k)))
>
> where xb is the linear predicted values for the bottom level choices and the
> summation is over all choices k=1,...,K in nest j.
>
> However,  the IV calculated by Stata doesn't seem to match this algebraic
> formula.
>
> Here is an example of what I mean: This is my data for person 1  (each row
> is a different choice in that person's choice set).  Column xb1
> gives the linear predicted value for the upper level (nest 1 versus nest 2).
> Column xb2 gives the linear predicted value for the lower level (one
> for each row).
>
> .list person_id nest xb1 xb2 iv if person_id==1
>
>
> person_id nest       xb1             xb2           iv
> 1          1          0           -9.553713          -4.453681
> 1          1          0           -8.438002          -4.453681
> 1          1          0           -5.484814          -4.453681
> 1          1          0           -7.626926          -4.453681
> 1          1          0           -6.155082          -4.453681
> 1          1          0           -6.608621          -4.453681
> 1          1          0           -4.274272          -4.453681
> 1          1          0           -7.114683          -4.453681
> 1          1          0           -4.6119          -4.453681
> 1          1          0           -8.375203          -4.453681
> 1          1          0           -8.188745          -4.453681
> 1          2          1.942574          -8.349099          -6.250056
> 1          2          1.942574          -5.643903          -6.250056
> 1          2          1.942574          -6.285707          -6.250056
> 1          2          1.942574          -4.820613          -6.250056
> 1          2          1.942574          -8.289648          -6.250056
> 1          2          1.942574          -8.586944          -6.250056
> I thought iv for nest 2 should be
> log(exp(-8.349099)+exp(5.643903)+exp(-6.285707)+exp(-4.820613)+exp(-8.289648
> )+exp(-8.58694)),
> ie, the logged sum of exp(xb2) over rows=12,...,17.  However,
> calculating this yields:
>
> .
> di log(exp(-8.349099)+exp(5.643903)+exp(-6.285707)+exp(-4.820613)+exp(-8.289
> 648)+exp(-8.58694))
> -4.258899714
>
> which is not = to -6.250056, as Stata calculated in the row "iv".
>
> Am I not understanding correctly, or making a mechanical error? Or is it
> possible that the fact that the iv doesn't equal what I think it should
> imply there is a specification error with my model?
>
> Any responses would be greatly appreciated
>
> *
> *   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/
```