This example revisits the trash can study that is described earlier in this chapter in the getting-started section A Logit Model with Random Effects.

If you want to create a random-effects-only model using the random walk Metropolis sampling as suggested in Rossi, Allenby, and McCulloch (2005), you can add the ALG=RWM option to the PROC BCHOICE statement to specify the random walk Metropolis sampling algorithm, add the REMEAN option to the RANDOM statement to request estimation of the nonzero mean of the random effects, and not specify any fixed effects in the MODEL statement as follows:

proc bchoice data=Trashcan outpost=Postsamp seed=123 nmc=40000 thin=4 alg=rwm nthreads=4; class ID Task; model Choice = / choiceset=(ID Task); random Touchless Steel AutoBag Price80 / sub=ID remean monitor=(1 to 5) type=un; run;

The NTHREADS option in the PROC BCHOICE statement specifies the number of threads to be used for analytic computations and sampling. Using four threads at the same time enhances the efficiency and reduces the run time by about four times. If you do not specify the NTHREADS option, the default number is 1. The maximum number of threads should not exceed the total number of CPUs on the host where the analytic computations execute.

Summary statistics for the mean of the random coefficients (), the covariance of the random coefficients (), and the random coefficients () for the first five individuals are shown in Output 27.4.1.

Output 27.4.1: Posterior Summary Statistics

The BCHOICE Procedure

Posterior Summaries and Intervals | ||||||
---|---|---|---|---|---|---|

Parameter | Subject | N | Mean | Standard Deviation |
95% HPD Interval | |

REMean Touchless | 10000 | 1.7124 | 0.2660 | 1.1859 | 2.2359 | |

REMean Steel | 10000 | 1.0504 | 0.2610 | 0.5677 | 1.5814 | |

REMean AutoBag | 10000 | 2.1839 | 0.3497 | 1.5420 | 2.9100 | |

REMean Price80 | 10000 | -4.6499 | 0.6400 | -5.9539 | -3.4282 | |

RECov Touchless, Touchless | 10000 | 3.0571 | 1.1503 | 1.3122 | 5.2392 | |

RECov Steel, Touchless | 10000 | -0.4706 | 1.0031 | -2.2026 | 1.1375 | |

RECov Steel, Steel | 10000 | 2.6142 | 1.0170 | 1.0026 | 4.5185 | |

RECov AutoBag, Touchless | 10000 | -0.7271 | 0.9559 | -2.6179 | 1.0821 | |

RECov AutoBag, Steel | 10000 | -0.00084 | 0.8108 | -1.5522 | 1.4319 | |

RECov AutoBag, AutoBag | 10000 | 3.6211 | 1.5239 | 1.2185 | 6.7463 | |

RECov Price80, Touchless | 10000 | -1.2188 | 1.1945 | -3.6437 | 0.8218 | |

RECov Price80, Steel | 10000 | -1.5669 | 1.2639 | -4.1530 | 0.7019 | |

RECov Price80, AutoBag | 10000 | -2.2400 | 1.6576 | -5.5705 | 0.6001 | |

RECov Price80, Price80 | 10000 | 7.6739 | 3.1808 | 2.3981 | 14.0942 | |

Touchless | ID 1 | 10000 | 2.1940 | 1.0468 | 0.2013 | 4.2928 |

Steel | ID 1 | 10000 | 0.7208 | 1.0666 | -1.2843 | 2.8607 |

AutoBag | ID 1 | 10000 | 3.7719 | 1.4263 | 1.1515 | 6.6288 |

Price80 | ID 1 | 10000 | -5.1558 | 2.2854 | -9.8578 | -1.0303 |

Touchless | ID 2 | 10000 | -0.0412 | 0.8572 | -1.6932 | 1.6535 |

Steel | ID 2 | 10000 | -0.3953 | 0.8200 | -2.0387 | 1.1833 |

AutoBag | ID 2 | 10000 | 2.7178 | 1.3321 | 0.1872 | 5.3265 |

Price80 | ID 2 | 10000 | 0.00135 | 1.3107 | -2.5173 | 2.6351 |

Touchless | ID 3 | 10000 | 1.1149 | 0.9607 | -0.6416 | 3.1861 |

Steel | ID 3 | 10000 | 1.6568 | 0.9606 | -0.1567 | 3.6094 |

AutoBag | ID 3 | 10000 | 0.3119 | 1.1598 | -2.0512 | 2.4132 |

Price80 | ID 3 | 10000 | -0.9705 | 1.5496 | -4.0250 | 2.0511 |

Touchless | ID 4 | 10000 | 1.1545 | 0.9697 | -0.7475 | 3.0413 |

Steel | ID 4 | 10000 | 1.3730 | 0.9891 | -0.5385 | 3.3589 |

AutoBag | ID 4 | 10000 | 3.1780 | 1.4497 | 0.5477 | 6.1348 |

Price80 | ID 4 | 10000 | -6.5924 | 2.4704 | -11.4607 | -1.8296 |

Touchless | ID 5 | 10000 | 0.4705 | 1.1716 | -1.7910 | 2.7956 |

Steel | ID 5 | 10000 | 2.6725 | 1.2193 | 0.5348 | 5.1762 |

AutoBag | ID 5 | 10000 | 3.4376 | 1.6172 | 0.5508 | 6.7088 |

Price80 | ID 5 | 10000 | -5.0509 | 2.5350 | -10.0811 | -0.1987 |

The average part-worths () for touchless opening, steel material, automatic trash bag replacement, and price, which are shown as “REMean Touchless,” “REMean Steel,” “REMean AutoBag,” and “REMean Price80,” are very similar to the estimates of the fixed effects in the previous model as shown in Figure 27.9, indicating the equivalence of these two setups. The covariance estimates of the random coefficients () are also very similar.

The next set of parameters show the estimates for the random effects for the first five respondents (see Output 27.4.1). However, these estimates are no longer the deviation from the overall means but are their own effects. The part-worth for touchless opening for the first respondent (ID 1) is 2.2, which is close to the part-worth that is estimated in the model as shown in Figure 27.9.

A caterpillar plot is a side-by-side bar plot of the 95% intervals for multiple variables. A caterpillar plot is usually used to visualize and compare random-effects parameters, which can exist in large numbers in certain models. You can use the %CATER autocall macro to create a caterpillar plot. The %CATER macro requires you to specify an input data set and a list of variables that you want to plot.

In this example, the output data set `Postsamp`

contains posterior draws for all the random-effects parameters. The following statements generate a caterpillar plot for
`Touchless`

:

ods graphics on; %CATER(data=Postsamp, var=Touchless_ID_:)

Output 27.4.2 is a caterpillar plot of the random effects of touchless opening for the 104 participants in this study. It displays the heterogeneity in preferences for touchless opening among the sample. As shown, the individuals have diverse preferences for the feature of touchless opening for a trash can. Heterogeneity of preferences is an important aspect of the model, and ignoring its presence can lead to incorrect inferences.

If you want to change the display of the caterpillar plot (for example, to use a different line pattern, color, or size of
the markers), you must first modify the `Stat.MCMC.Graphics.Caterpillar`

template and then call the %CATER macro again.