[Limdep Nlogit List] Small-Hsiao test

William Greene wgreene at stern.nyu.edu
Fri Nov 21 12:40:36 EST 2008


Here is a LIMDEP or NLOGIT routine that does that test.  I would note, though,
two reservations about this test.
(1) It does not handle choice specific constants in the model. You can't fit
the model with the restricted choice set with the same number of choice 
specific constants as the unrestricted one. It's not clear how to deal with this.
(2) I am skeptical of the distribution theory - the chi squared distribution 
of the difference in the log likelihoods. The reason is that the Log likelihood
computed at the weighted average of the A and B vectors is based on half
of the sample.  The recomputed log likelihood function based on the restricted
choice set is necessarily based on a smaller sample because not only is the
designated choice removed from the choice set, but the individuals that chose
that alternative must be removed from the sample.  Therefore, I doubt that 
the statistic really has the claimed chi squared distribution.  Moreover, even
if it does, I suspect the degrees of freedom is not correct.  I do not have
the original paper at hand.  I may have this wrong.  Anyone?????
On balance, for testing IIA, I would think that the Hausman statistic is 
probably superior. Beyond that, I would guess that basing the test on some
specific alternative, nore general model, such as a mixed logit model, or
an HEV model, might have even more power.
/Bill Greene


?==========================================================================
? A program to carry out the Small-Hsiao test
? This is written specifically for the CLOGIT test data set
? distributed with the program, but can easily be adapted to a
? user's own data set.
? (1) Data requirements.  The test does not appear to be designed to deal 
? with choice sets that vary by indvidual, so we assume it is fixed.
? (2) The choice set consists of C1,C2,C3,...,CJ.  One of the choices will
? be eliminated from the choice set for purposes of the test.  This can be
? done automatically.
? (3) In order to sample the two partitions of the data set randomly, we
? need to create a variable to keep track of the sample.  See below.
?===========================================================================
Load    ; File = ...\clogit.lpj $
? Preparation for the estimation.
Create  ; PartA = 0 $
? Randomly draw half the sample and mark it as Part A
Draw    ; N = 105 ; pds = 4 $  (4 is the number of choices)
Create  ; PartA = 1 $  NA and NB are exactly equal to N/2
Sample  ; All $
Create  ; PartB = 1 - PartA $
? Fit the model with the A part of the sample and keep the parameters
Include ; New ; PartA = 1 $ 
CLogit  ; Lhs = Mode ; Choices = Air,Train,Bus,Car
        ; Rhs = GC,TTME,INVC,INVT $
Matrix  ; BA = B $
? Now fit the model with the B part of the sample and keep estimates
Include ; New ; PartB = 1 $ 
CLogit  ; Lhs = Mode ; Choices = Air,Train,Bus,Car
        ; Rhs = GC,TTME,INVC,INVT $
Matrix  ; BB = B $
? Compute Bab = (1/sqr(2))*Ba + (1-1/sqr(2))*Bb
Matrix  ; BAB = .70711*BA + .29289*BB $
? Fit the model once more with the B sample, but eliminating a choice from
? the choice set using ;IAS.  I eliminated Air.  (Note that this produces
? a hausman statistic, but it could be ignored since it is based only on
? the B sample.
CLogit  ; Lhs = Mode ; Choices = Air,Train,Bus,Car
        ; Rhs = GC,TTME,INVC,INVT ; IAS = Air $
Calc    ; Lb1 = logl $
? Compute the log likelihood using BAB by "fitting the model" with these
? as starting values, but not allowing it to iterate.
CLogit  ; Lhs = Mode ; Choices = Air,Train,Bus,Car
        ; Rhs = GC,TTME,INVC,INVT ; Start = BAB ; Maxit=0 $
Calc    ; Lab1 = logl $
? Compute the chi squared statistic and the P value.
Calc    ; List ; delta = -2*(lab1 - lb1) 
               ; Pvalue = 1 - chi(delta,(2*row(bab)))$


----- Original Message -----
From: "Caroline Johanna Biehl" <Caroline-Johanna.Biehl at gmx.de>
To: limdep at limdep.itls.usyd.edu.au
Sent: Thursday, November 20, 2008 10:59:59 AM GMT -05:00 Columbia
Subject: [Limdep Nlogit List] Small-Hsiao test

Dear all!
I would like to do a Small-Hsiao test for the IIA assumption in order to compare it with results of the Hausman-test. Is there any command for that?

Thank you, 
Caroline
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
_______________________________________________
Limdep site list
Limdep at limdep.itls.usyd.edu.au
http://limdep.itls.usyd.edu.au



More information about the Limdep mailing list