[Limdep Nlogit List] RE: Nlogit crosstab question

Iain Pardoe ipardoe at lcbmail.uoregon.edu
Wed May 16 06:47:57 EST 2007


Bill Greene kindly clarified the difference for me:

-----Original Message-----
From: William Greene [mailto:wgreene at stern.nyu.edu] 
Sent: Thursday, May 10, 2007 3:58 PM
To: Prof David Hensher
Cc: Iain Pardoe
Subject: Re: FW: Nlogit crosstab question

David and Iain:  The cross tab is computed as the summation:

TABLE  =  Sum(i=1,n)  p(i) * y(i)'

where p(i) is the column vector of fitted probabilities and y(i)' is the

row vector of actual ones and zeros for the choice.  Then, the table
has to be converted to integers, which is why the text box above it
reminds you that the column totals are subject to rounding error. The
predictions in the listing are obtained by choosing the outcome with
the largest predicted probability.  This will definitely give a
different
answer.  One could construct the crosstab by using the listed
predictions,
but this would cause a different problem.  When the model contains
ASCs, the model has been calibrated so that the fitted market shares 
match the actual ones.  It's a bedrock result.  It won't happen if you
use
the predictions produced by the listing.
All the best,
Bill

************************************************
Professor William Greene
Department of Economics
Stern School of Business
New York University
44 West 4th St., Rm. 7-78
New York, NY   10012
Ph. 212.998.0876
Fax. 212.995.4218
URL. http://www.stern.nyu.edu/~wgreene
Email. wgreene at stern.nyu.edu
************************************************ 

-----Original Message-----
From: Iain Pardoe 
Sent: Thursday, May 10, 2007 9:40 AM
To: 'limdep at limdep.itls.usyd.edu.au'
Subject: Nlogit crosstab question

(Apologies if this post appears twice - it didn't seem to go through the
first time I sent it.)

I'm getting some apparently anomalous results using the crosstab
command.  In particular, I'm obtaining crosstab results that don't
appear to match predicted probability results (obtained using list).
For example, on page N3-21 of the nlogit3 manual the numbers of correct
(within-sample) predictions for the transportation data are given along
the matrix crosstab diagonal as 34 air, 39 train, 17 bus, and 30 car
(for the invc, invt, gc, ttme, a_air, a_train, a_bus model).  But, if I
count up the */+ (actual/prediction) co-occurrences  from a listing of
the predicted probabilities, I get 39 air, 44 train, 23 bus, and 46 car.

Here's my code:

NLOGIT ; Lhs = MODE
       ; Choices = Air,Train,Bus,Car
       ; Rhs = INVC,INVT,GC,TTME
       ; Rh2 = ONE
       ; Crosstab
       ; List $

More than likely I'm misunderstanding something obvious, but I would be
grateful if someone could enlighten me.

Best wishes, Iain

Iain Pardoe <ipardoe at lcbmail.uoregon.edu>
Assistant Professor of Decision Sciences
Charles H. Lundquist College of Business
1208 University of Oregon
Eugene, OR 97403-1208, USA
Ph: 541-346-3250, Fax: 541-346-3341
http://lcb1.uoregon.edu/ipardoe



More information about the Limdep mailing list