The BCHOICE Procedure

Example 27.5 Heterogeneity Affected by Individual Characteristics

(View the complete code for this example.)

Rossi, Allenby, and McCulloch (2005) studied a scanner panel data about purchases of margarine. The data were first analyzed in Allenby and Rossi (1991) and are about purchases of ten brands of margarine. This example considers a subset of data about six margarine brands: Parkay stick, Blue Bonnet stick, Fleischmann’s stick, a house brand stick, a generic stick, and Shedd’s Spread tub. There are 313 households, which made a total of 3,405 purchases. Information about a few demographic characteristics of these households (income and family size) is expected to have effects on the central location of the distribution of heterogeneity.

The data set, which is called Sashelp.Margarin, comes from the SASHELP library.

proc print data=Sashelp.Margarin (obs=24);
   by HouseID Set;
   id HouseID Set;
run;

The data for the first four choice sets are shown in Output 27.5.1.

Output 27.5.1: Data for the First Four Choice Sets

HouseIDSetChoiceBrandLogPriceLogIncFamSize
210001611PPk-0.415523.481242
0PBB-0.400483.481242
0PFl0.086183.481242
0PHse-0.562123.481242
0PGen-1.021653.481242
0PSS-0.162523.481242

HouseIDSetChoiceBrandLogPriceLogIncFamSize
210001621PPk-0.462043.481242
0PBB-0.400483.481242
0PFl-0.010053.481242
0PHse-0.562123.481242
0PGen-1.021653.481242
0PSS-0.162523.481242

HouseIDSetChoiceBrandLogPriceLogIncFamSize
210001631PPk-1.237873.481242
0PBB-0.693153.481242
0PFl-0.010053.481242
0PHse-0.562123.481242
0PGen-1.021653.481242
0PSS-0.235723.481242

HouseIDSetChoiceBrandLogPriceLogIncFamSize
210001641PPk-0.478043.481242
0PBB-0.494303.481242
0PFl-0.010053.481242
0PHse-0.562123.481242
0PGen-1.021653.481242
0PSS-0.162523.481242


The variable HouseID represents the household ID, and each household made at least five purchases, which are defined by Set. The variable Choice represents the choice made among the six margarine brands for each purchase or choice set. The variable Brand has the value PPK for Parkay stick, PBB for Blue Bonnet stick, PFL for Fleischmann’s stick, PHse for the house brand stick, PGen for the generic stick, and PSS for Shedd’s Spread tub. The variable LogPrice is the logarithm of the product price. The variables LogInc and variable FamSize provide information about household income and family size, respectively.

The following statements fit a random-effects-only logit model using Gamerman Metropolis sampling

proc bchoice data=Sashelp.Margarin seed=123 nmc=40000 thin=2
   nthreads=4 plots=none;
   class Brand(ref='PPk') HouseID Set;
   model Choice = / choiceset=(HouseID Set);
   random  Brand LogPrice / subject=HouseID remean=(LogInc FamSize)
           type=un monitor=(1);
run;

The REMEAN=(LOGINC FAMSIZE) option in the RANDOM statement requests estimation of the nonzero mean of the random effects, which is a function of household income and family size. No fixed effects are specified in the MODEL statement.

The NMC= option in the PROC BCHOICE statement requests to run the MCMC chain for 40,000 iterations, and the THIN=2 option keeps one of every two samples for analysis. If ODS Graphics is enabled and you do not specify the PLOTS option, then PROC BCHOICE produces, for each parameter, a panel that contains the trace plot, the autocorrelation function plot, and the kernel density plot by default. In models that have a large number of parameters, it will take a long time to display all the plots. So PLOTS=NONE is specified to stop producing the plots. If you want to see the plots for some parameters, you can save the posterior samples to a SAS data set using the OUTPOST= option and then generate the plots using the %TADPLOT macro as explained in the section Regenerating Diagnostics Plots.

Summary statistics for the mean matrix of the random coefficients (), the covariance of the random coefficients (), and the random coefficients () for the first household are shown in Output 27.5.2.

Output 27.5.2: Posterior Summary Statistics

The BCHOICE Procedure

Posterior Summaries and Intervals
ParameterSubjectNMeanStandard
Deviation
95% HPD Interval
REMean Brand PBB 20000-1.20790.6384-2.42930.0686
REMean Brand PFl 20000-3.24841.9276-7.03510.5201
REMean Brand PGen 20000-5.11301.2332-7.6390-2.8030
REMean Brand PHse 20000-3.25950.9194-5.0725-1.4761
REMean Brand PSS 200000.09151.2127-2.30152.4981
REMean LogPrice 20000-3.41480.8359-5.0397-1.7620
REMean Brand PBB LogInc 200000.05290.2114-0.34850.4811
REMean Brand PFl LogInc 200000.75960.6208-0.47261.9749
REMean Brand PGen LogInc 20000-0.50790.4019-1.29770.2698
REMean Brand PHse LogInc 200000.03150.3029-0.59490.5931
REMean Brand PSS LogInc 20000-0.63150.4131-1.46450.1555
REMean LogPrice LogInc 20000-0.28370.2817-0.84340.2631
REMean Brand PBB FamSize 20000-0.02740.0959-0.21800.1572
REMean Brand PFl FamSize 20000-0.73570.3059-1.3283-0.1267
REMean Brand PGen FamSize 200000.57750.18240.22690.9428
REMean Brand PHse FamSize 200000.23650.1357-0.02910.4997
REMean Brand PSS FamSize 200000.05280.1974-0.33470.4425
REMean LogPrice FamSize 200000.10100.1273-0.15420.3424
RECov Brand PBB, Brand PBB 200002.20810.37301.52612.9615
RECov Brand PFl, Brand PBB 200001.85980.91060.13743.6776
RECov Brand PFl, Brand PFl 2000012.08943.90505.554420.0864
RECov Brand PGen, Brand PBB 200001.98420.56970.85633.0829
RECov Brand PGen, Brand PFl 200001.33001.9065-2.46225.1401
RECov Brand PGen, Brand PGen 200008.38971.48355.592411.3433
RECov Brand PHse, Brand PBB 200001.51480.44020.67992.3928
RECov Brand PHse, Brand PFl 200002.15541.3869-0.57974.9030
RECov Brand PHse, Brand PGen 200005.75760.95703.87997.6015
RECov Brand PHse, Brand PHse 200005.48340.84413.93557.1970
RECov Brand PSS, Brand PBB 200001.18600.6287-0.04122.4223
RECov Brand PSS, Brand PFl 200000.60961.9471-3.07094.6460
RECov Brand PSS, Brand PGen 200004.81891.17382.59607.1020
RECov Brand PSS, Brand PHse 200003.44840.88051.70685.1649
RECov Brand PSS, Brand PSS 200008.70981.80475.422212.2276
RECov LogPrice, Brand PBB 20000-0.22600.3462-0.87640.4813
RECov LogPrice, Brand PFl 200002.19090.90100.52204.0796
RECov LogPrice, Brand PGen 20000-0.99890.6371-2.21750.2793
RECov LogPrice, Brand PHse 20000-0.42540.5043-1.37510.6150
RECov LogPrice, Brand PSS 200000.17340.6757-1.18971.4765
RECov LogPrice, LogPrice 200002.12790.53731.16973.2261
Brand PBBHouseID 210001620000-2.35461.0548-4.4528-0.3948
Brand PFlHouseID 210001620000-3.97922.7840-9.44910.9694
Brand PGenHouseID 210001620000-6.59841.6472-9.8601-3.4056
Brand PHseHouseID 210001620000-2.97221.2014-5.5148-0.8522
Brand PSSHouseID 210001620000-3.38072.1701-7.45770.7600
LogPriceHouseID 210001620000-4.61291.2361-6.9996-2.1437


Table 27.11 collects the posterior means and standard deviations of that are shown in Output 27.5.2. The first column corresponds to the parameters that are specified in the model, namely the brands and price. The second column shows the average part-worths of each brand (versus the brand, Parkay stick) and the price at LogInc=0 and FamSize=0. The LogInc and FamSize columns list the modifying effects on the preference for each brand and price by household income and family size, respectively. Larger families show more interest in the generic and house brands and tend to stay away from the Fleischmann’s brand. For example, consider the part-worth estimates for Fleischmann’s. The posterior mean for REMean Brand PFI FamSize (the Fleischmann’s row and the Famsize column) is –0.74 with a standard deviation of 0.31, meaning that an additional unit increase in family size is associated with a reduction of 0.74 in the estimated part-worth for Fleischmann’s. In general, the demographics of households are only weakly associated with preference for brand and price. These results are in good agreement with those of Rossi, Allenby, and McCulloch (2005).

Table 27.11: Posterior Mean and Standard Deviation of

Parameter

 

Intercept

LogInc

FamSize

Blue

 

REMean Brand PBB

REMean Brand PBB LogInc

REMean Brand PBB FamSize

Bonnet

 

–1.21

0.05

–0.03

  

0.64

0.21

0.10

Fleisch-

 

REMean Brand PFI

REMean Brand PFI LogInc

REMean Brand PFI FamSize

mann’s

 

–3.25

0.76

–0.74

  

1.93

0.62

0.31

  

REMean Brand PGen

REMean Brand PGen LogInc

REMean Brand PGen FamSize

Generic

 

–5.11

–0.51

0.58

  

1.23

0.40

0.18

  

REMean Brand PHse

REMean Brand PHse LogInc

REMean Brand PHse FamSize

House

 

–3.26

0.03

0.24

  

0.92

0.30

0.14

Shedd’s

 

REMean Brand PSS

REMean Brand PSS LogInc

REMean Brand PSS FamSize

Spread

 

0.09

–0.63

–0.05

  

1.21

0.41

0.20

  

REMean LogPrice

REMean LogPrice LogInc

REMean LogPrice FamSize

LogPrice

 

–3.41

–0.28

0.10

  

0.84

0.28

0.13


Because the demographic variables are not zero-centered, the Intercept column shows the average part-worths of each brand and price for households with LogInc=0 and FamSize=0, which are not very meaningful. It is better to center demographic variables by their means, so that the posterior means listed in the Intercept column can be interpreted as the part-worths of a household that has an average income and average size.

Nevertheless, you can obtain the utilities of households that have any income levels and sizes. For example, the average part-worth of the Fleischmann’s brand for a household with average income (LogInc=3.1) and family size (FamSize=3) would be as follows, because the estimated LogInc coefficient is 0.76 and the estimated FamSize coefficient is –0.74 for Fleischmann’s:

You can obtain part-worths for all other brands and compare their popularity among average households.

The posterior means and standard deviations of the covariance matrix of the random coefficients () are displayed by parameters that are labeled "RECov Brand PBB, Brand PBB," "RECov Brand PFI, Brand PBB," and so on. Some of the diagonal terms are fairly large, indicating that there is quite a bit of heterogeneity between households in margarine brand preference and price sensitivity. The covariance between the generic and house brands, "RECov Brand PHse, Brand PGen," is fairly large, suggesting that household preferences for these two brands are highly correlated.

The next set of parameters, which are displayed in Output 27.5.2, contain the estimates for the random effects for the first household.