?--------------------------------------------------------------------------------- ? Basic MNL formulation ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas $ ?--------------------------------------------------------------------------------- ? Random parameters with two lognormal coefficients ?--------------------------------------------------------------------------------- CREATE ; mseas = -seas ; mtod = -tod $ NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, mtod, mseas ; RPL ; Pds = ntask ; Halton ; Pts = 50 ; Parameters ; Fcn = cntlngth(n), local(n), known(n), mtod(l), mseas(l) $ CALC ; List ; exp ( b(4) + .5*b(10)^2) $ (This is for the coefficient on TOD) CALC ; List ; exp ( b(5) + .5*b(11)^2) $ (This is for the coefficient on SEAS) MATRIX ; bi_L = beta_i $ ?--------------------------------------------------------------------------------- ? Random parameters with two one sided triangular coefficients ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, mtod, mseas ; RPL ; Pds = ntask ; Halton ; Pts = 50 ; Parameters ; Fcn = cntlngth(n), local(n), known(n), mtod(o), mseas(o) $ MATRIX ; bi_T = beta_i $ ?--------------------------------------------------------------------------------- ? Kernel Estimators to look at conditional means of coefficients ?--------------------------------------------------------------------------------- MATRIX ; bltod = bi_l(1:361,4:4) $ Lognormal TOD coefficients MATRIX ; bttod = bi_t(1:361,4:4) $ Triangular coefficients SAMPLE ; 1-361$ Move coefficients to data area CREATE ; bL = bltod $ by moving vector into a variable CREATE ; bt = bttod $ KERNEL ; rhs = bl,bt ; Title=Conditional Means of Random Coefficients on TOD $ SAMPLE ; all $ (Restore full sample) ?--------------------------------------------------------------------------------- ? Laatent Class Models ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 2 $ NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 3 $ NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 4 $ ?--------------------------------------------------------------------------------- ? Two different classes, one with nonattendance to rate structure ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 2 ; RST = b1,b2,b3,b4,b5,b6, c1,c2,c3,c4,0,0 $ ?--------------------------------------------------------------------------------- ? Formal attribute nonattendance ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 2 ; RST = b1,b2,b3,b4,b5,b6, b1,b2,b3,b4,0,0 $ ?--------------------------------------------------------------------------------- ? Full attribute nonattendance. 2^K model ?--------------------------------------------------------------------------------- NLOGIT ; Lhs = choice ; Choices = Firm1, Firm2, Firm3, Firm4 ; Rhs = price, cntlngth, local, known, tod, seas ; LCM ; Pds = ntask ; Pts = 4 ; RST = b1,b2,b3,b4,b5,b6, b1,b2,b3,b4,0, 0, b1,b2,b3,b4,b5, 0, b1,b2,b3,b4, 0,b6 $