# The BCHOICE Procedure (Experimental)

### Example 27.2 Nested Logit Modeling

The standard logit model imposes the restriction of the independence from irrelevant alternatives (IIA) property, which implies proportional substitution across alternatives. When the IIA assumption does not hold, models with more flexibility are needed.

One of the most widely used models is called the nested logit. In a nested logit model, all the alternatives in a choice set can be partitioned into nests in such a way that the following conditions are true:

• The ratio of any two alternatives that are in the same nest is independent of the existence of all other alternatives. Hence, the IIA assumption holds within each nest.

• The ratio of any two alternatives that are in different nests is not independent of the existence of other alternatives in the two nests. Hence, the IIA assumption does not hold between different nests.

For more information about nested logit models, see the section Nested Logit.

In the previous example of travel demand data, people are asked to choose among travel by auto, plane, or public transit. It seems that auto and public transit are more similar to each other than either of them are to plane, because the probability of choosing auto and public transit might rise by about the same proportion whenever the option of taking a plane is unavailable. A nested logit model that places auto and public transit in one nest and plane in another nest might seem more reasonable than the standard logit model.

You specify a nested logit model by using the TYPE=NLOGIT option, and you allocate the nests by using the NEST= option. In the following code, NEST=(1 2 1) implies that travel alternatives 1 (auto) and 3 (public transit) are in the first nest and travel alternative 2 (plane) is in the second nest. There are two nests in total.

The deviance information criterion (DIC) is used to select the model. The Deviance Information Criterion table (ODS table name DIC) contains the DIC of the model. The table is not displayed by default, but you can request it by specifying the DIC option in the PROC BCHOICE statement. For more information about the calculations, see the section Deviance Information Criterion (DIC). The DIC option requests the calculation of DIC.

proc bchoice data=Travel2 seed=124 dic;
class Mode Subject / param=ref order=data;
model Choice = Mode TravTime / choiceset=(Subject) type=nlogit nest=(1 2 1);
run;


Output 27.2.1: PROC BCHOICE Posterior Summary Statistics and DIC

The BCHOICE Procedure

Posterior Summaries and Intervals
Parameter N Mean Standard
Deviation
95% HPD Interval
Mode Auto 5000 -0.2283 0.6911 -1.6005 1.1456
Mode Plane 5000 -2.0001 1.1697 -4.1169 0.3449
TravTime 5000 -0.5568 0.1979 -0.9243 -0.1872
Lambda 1 5000 0.8867 0.3557 0.2407 1.5001

Deviance Information Criterion
Dbar (Posterior Mean of Deviance) 32.925
Dmean (Deviance Evaluated at Posterior Mean) 30.289
pD (Effective Number of Parameters) 2.636
DIC (Smaller is Better) 35.561

There are two alternatives in the first nest and one alternative in the second nest. A nest that has only one alternative is degenerate; therefore its is not estimable. This explains why there is only one estimate in the output.

The following statements revisit the standard logit model (the default type) that is discussed in the previous example and request that the calculation of DIC be displayed:

proc bchoice data=Travel2 seed=124 dic;
class Mode Subject / param=ref order=data;
model Choice = Mode TravTime / choiceset=(Subject);
run;


Output 27.2.2: PROC BCHOICE Posterior Summary Statistics and DIC

The BCHOICE Procedure

Posterior Summaries and Intervals
Parameter N Mean Standard
Deviation
95% HPD Interval
Mode Auto 5000 -0.1678 0.7440 -1.7017 1.2396
Mode Plane 5000 -1.8794 1.2683 -4.6055 0.3801
TravTime 5000 -0.5695 0.2047 -0.9943 -0.2328

Deviance Information Criterion
Dbar (Posterior Mean of Deviance) 33.217
Dmean (Deviance Evaluated at Posterior Mean) 30.440
pD (Effective Number of Parameters) 2.777
DIC (Smaller is Better) 35.994

The DIC values are very close. A smaller DIC value indicates a better fit to the data; hence, the nested logit model might be a little better.