MDC Procedure

Example 23.3 Correlated Choice Modeling

(View the complete code for this example.)

Often, it is not realistic to assume that the random components of utility for all choices are independent. This example shows the solution to the problem of correlated random components by using multinomial probit and nested logit.

To analyze correlated data, trinomial choice data (1,000 observations) are created using a pseudo-random number generator by using the following statements. The random utility function is

upper U Subscript i j Baseline equals upper V Subscript i j Baseline plus epsilon Subscript i j Baseline comma j equals 1 comma 2 comma 3

where

epsilon Subscript i j Baseline tilde upper N left-parenthesis 0 comma Start 3 By 3 Matrix 1st Row 1st Column 2 2nd Column .6 3rd Column 0 2nd Row 1st Column .6 2nd Column 1 3rd Column 0 3rd Row 1st Column 0 2nd Column 0 3rd Column 1 EndMatrix right-parenthesis

/*-- generate simulated series --*/
%let ndim = 3;
%let nobs = 1000;

data trichoice;
   array error{&ndim} e1-e3;
   array vtemp{&ndim} _temporary_;
   array lm{6} _temporary_ (1.4142136 0.4242641 1 0 0 1);
   retain nseed 345678;

   do id = 1 to &nobs;
      index = 0;
      /* generate independent normal variate */
      do i = 1 to &ndim;
         /* index of diagonal element */
         vtemp{i} = rannor(nseed);
      end;
      /* get multivariate normal variate */
      index = 0;
      do i = 1 to &ndim;
         error{i} = 0;
         do j = 1 to i;
            error{i} = error{i} + lm{index+j}*vtemp{j};
         end;
         index = index + i;
      end;
      x1 = 1.0 + 2.0 * ranuni(nseed);
      x2 = 1.2 + 2.0 * ranuni(nseed);
      x3 = 1.5 + 1.2 * ranuni(nseed);
      util1 = 2.0 * x1 + e1;
      util2 = 2.0 * x2 + e2;
      util3 = 2.0 * x3 + e3;
      do i = 1 to &ndim;
         vtemp{i} = 0;
      end;
      if ( util1 > util2 & util1 > util3 ) then
         vtemp{1} = 1;
      else if ( util2 > util1 & util2 > util3 ) then
         vtemp{2} = 1;
      else if ( util3 > util1 & util3 > util2 ) then
         vtemp{3} = 1;
      else continue;
      /*-- first choice --*/
      x = x1;
      mode = 1;
      decision = vtemp{1};
      output;
      /*-- second choice --*/
      x = x2;
      mode = 2;
      decision = vtemp{2};
      output;
      /*-- third choice --*/
      x = x3;
      mode = 3;
      decision = vtemp{3};
      output;
   end;
run;

First, the multinomial probit model is estimated (see the following statements). Results show that the standard deviation, correlation, and slope estimates are close to the parameter values. Note that rho 12 equals StartFraction sigma 12 Over StartRoot left-parenthesis sigma 1 squared right-parenthesis left-parenthesis sigma 2 squared right-parenthesis EndRoot EndFraction equals StartFraction 0.6 Over StartRoot left-parenthesis 2 right-parenthesis left-parenthesis 1 right-parenthesis EndRoot EndFraction equals 0.42, sigma 1 equals StartRoot 2 EndRoot equals 1.41, sigma 2 equals StartRoot 1 EndRoot equals 1, and the parameter value for the variable x is 2.0. (See Output 23.3.1.)

/*-- Trinomial Probit --*/
proc mdc data=trichoice randnum=halton nsimul=100;
   model decision = x /
            type=mprobit
            choice=(mode 1 2 3)
            covest=op
            optmethod=qn;
   id id;
run;

Output 23.3.1: Trinomial Probit Model Estimation

The MDC Procedure
 
Multinomial Probit Estimates

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
x11.76850.119114.85<.0001
STD_111.25140.14948.38<.0001
RHO_2110.39710.10873.650.0003


Figure 29 shows a two-level decision tree.

Figure 29: Nested Tree Structure

Nested Tree Structure


The following statements estimate the nested model shown in Figure 29:

/*-- Two-Level Nested Logit --*/
proc mdc data=trichoice;
   model decision = x /
            type=nlogit
            choice=(mode 1 2 3)
            covest=op
            optmethod=qn;
   id id;
   utility u(1,) = x;
   nest level(1) = (1 2 @ 1, 3 @ 2),
        level(2) = (1 2 @ 1);
run;

The estimated result (see Output 23.3.2) shows that the data support the nested tree model since the estimates of the inclusive value parameters are significant and are less than 1.

Output 23.3.2: Two-Level Nested Logit

The MDC Procedure
 
Nested Logit Estimates

Parameter Estimates
ParameterDFEstimateStandard
Error
t ValueApprox
Pr > |t|
x_L112.59070.195813.23<.0001
INC_L2G1C110.81030.08599.43<.0001
INC_L2G1C210.81890.09558.57<.0001


Last updated: June 19, 2025