[Limdep Nlogit List] hausmantest
Caroline Johanna Biehl
Caroline-Johanna.Biehl at gmx.de
Wed May 7 07:00:44 EST 2008
Dear all,
The following hausman-test for my unbranded logit model leads to a negative difference matrix. Is there a way to change that?
Thank you very much,
caroline
?Hausman test
sample; all$
reject; cset=-999$
nlogit
;lhs= choice, cset, alti
;choices= a, b, c, other
;show
; model:
U(A) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest2 + p*p + p1*p1 + p2*p2 + inc*inc/
U(B) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest2 + p*p + p1*p1 + p2*p2 + inc*inc/
U(C) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest + p*p + p1*p1 + p2*p2 + inc*inc/
U(other)= 0$
matrix; j1=[1,0,0,0,0,0,0,0,0/
0,1,0,0,0,0,0,0,0/
0,0,1,0,0,0,0,0,0/
0,0,0,1,0,0,0,0,0/
0,0,0,0,1,0,0,0,0/
0,0,0,0,0,1,0,0,0/
0,0,0,0,0,0,1,0,0/
0,0,0,0,0,0,0,1,0]$
matrix; bu=j1*B; Vu=J1*VARB*j1'$
reject; alti=1$
reject; cs1=1$
create; csetnew=3$
create; if(alti=2)altinew=1$
create; if(alti=3)altinew=2$
create; if(alti=4)altinew=3$
?Exclude a
nlogit
;lhs= choice, csetnew, altinew
;choices= b, c, other
;show
; model:
? U(A) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest2 + p*p + p1*p1 + p2*p2 + inc*inc/
U(B) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest2 + p*p + p1*p1 + p2*p2 + inc*inc/
U(C) = Fre1*Fre1 + Fre2*fre2 + mo*mo + rest1*rest1+ rest2*rest + p*p + p1*p1 + p2*p2 + inc*inc/
U(other)= 0$
matrix; j2=[1,0,0,0,0,0,0,0,0/
0,1,0,0,0,0,0,0,0/
0,0,1,0,0,0,0,0,0/
0,0,0,1,0,0,0,0,0/
0,0,0,0,1,0,0,0,0/
0,0,0,0,0,1,0,0,0/
0,0,0,0,0,0,1,0,0/
0,0,0,0,0,0,0,1,0]$
matrix; br=j2*B; Vr=J2*VARB*j2'$
matrix; bd=bu-br; vd=Vu-Vr$
matrix; vindv=[vd]$
matrix; list;q=bd'*vindv*bd$
CALC;list;p=1-chi(q,8)$
Output:
Matrix Q has 1 rows and 1 columns.
1
+--------------
1| -8.69069
--> CALC;list;p=1-chi(q,8)$
Error 471: Cannot compute CHI; parameter 1 is < = 0
Error 116: CALC - Unable to compute result. Check earlier message.
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
More information about the Limdep
mailing list