June 25, 2017

Module objective

In this module, we will build and estimate a multinomial logit model using Stan.

This will allow us to:
- Start to learn the Stan model syntax.
- Go through the Bayesian inference process more carefully and completely.

Think of Module 1 as the "Quick Start Guide," while Module 2 is a more comprehensive "How-To Guide".

Stan model syntax basics

Required Stan model components

data{
  // declarations of data go here
}
parameters{
  // declarations of parameters go here
}
model{
  // distributions for observables and 
  //parameters (priors) are specified here
}

There are a few other types of blocks in a Stan model; the Stan Language User's Guide and Reference Manual is a complete and relatively friendly guide.

Stan types: scalars and arrays

Every variable in a Stan model must have a declared type. Common types are:

Scalars (single variable)

real myvar1;
int myvar2;

Arrays

real myarray1[2, 3]; # 2 x 3 array of reals
int myarray2[5, 6, myvar1];  # dims may be other declared variables

Stan types: vectors and matrices

Specific vector and matrix types must be used when you want to do matrix operations or use multivariate probability distributions.

Vectors and Matrices

vector[25] myvector;  // column vector of length 25
row_vector[10] myrowvector; // row vector of length 25
matrix[10, 25] mymatrix; 
  • You can multiply a vector by a matrix or a matrix by a matrix (assuming dimenions match).
  • You can not use multiplication with an array.
  • Elements of a vector or matrix are always real.

Stan types: array of vectors or matrices

You are also allowed to declare an array of vectors or an array of matricies.

Combining matrices or vectors with arrays

matrix[25, 3] myarrayofmatrices[1000];
  • This produces an array of 1000 matrices that each have 25 rows and 3 columns.

Constraints

Any declaration can include a constraint, which applies to all elements in the variable.

real<lower=0> myarray2[10, 20];
  • For data, the constraint provides some data checking.
  • For parameters, it constrains the posterior of the parameter.
  • Note the model must have support (non-zero density) at every value of the parameters that meets their declared constraints. If the declared parameter constraints are less strict than the support, the samplers and optimizers may have any of a number of pathologies including just getting stuck, failure to initialize, etc.

Summary of basic Stan types

Scalars

int<lower=c1, upper=c2> varname;
real<lower=c1, upper=c2> varname;

Arrays

int<lower=c1, upper=c2> varname[dim1, dim2, ...];
real<lower=c1, upper=c2> varname[dim1, dim2, ...];

Vectors and Matrices

vector<lower=c1, upper=c2>[length] varname[dim1, dim2, ...];
row_vector<lower=c1, upper=c2>[length] varname[dim1, dim2, ...];
matrix<lower=c1, upper=c2>[rows, cols] varname[dim1, dim2, ...]; 

Stan data types: others

  • While these are the main data types we use regularly, there are many other data types that Stan provides.
  • We'll leave it to you to discover those in the context of specific examples where they are useful.

Specifying probability distributions

The core of any Stan model is the model block, where you define probability distributions for the observables. For instance, in our linear model, we defined y as normally distributed.

y ~ normal(beta0 + X*beta, sigma);

This sort of declaration of the distribution of an observable is called a sampling statement.

Stan probability distributions

Stan provides many, many distributions so that you can flexibly define the model.

y ~ normal(mu, sigma);
y ~ student_t(nu, mu, sigma);
y ~ cauchy(mu, sigma);
y ~ lognormal(mu, sigma);  
y ~ exponential(beta);
theta ~ beta(alpha, beta);
n ~ poisson(lambda);
y ~ categorical_logit(beta);

Referring to data and parameters

To pull out an element of an array or matrix you can use [ ]:

matrix[25, 3] myarrayofmatrices[1000];  # declared in data
...
myarrayofmatrices[1]; // first matrix in array of 1000
myarrayofmatrices[1, 2, 3]; // element in second row and third column 
                            // in the first matrix in array of 1000
  • When indexing the array of matrices, array dimensions come first, then the row and column.
    • myarrayofmatrices[1] is the first matrix in the array
    • myarrayofmatrices[1,2,3] is the element in the second row and third column

Priors

  • If you don't specify a distribution for a parameter, Stan will assume a uniform prior on that parameter.
    • We used uniform priors in our linear model.
  • You specify a prior for a parameter by defining a distribution for the parameter in the model block.
  • Since the NUTS algorithm used by default in Stan is gradient-based, there is no benefit to sticking to conjugate priors (as in Gibbs sampling).

Parameters

  • All parameters in a Stan model must be continuous, i.e. you can't have an int type parameter.
  • This means you can't use models with latent discrete variables.
    • For instance you can't estimate membership variables in a mixture model.
  • This is due to the fact that the MCMC algorithm that Stan uses to generate draws from the posterior relies on gradients.
  • Discrete observables (like we have in the mnl) are fine!

Learning more about Stan syntax

  • The best way to learn about the Stan language is to read the Stan Modeling Language: User’s Guide and Reference Manual, which is fairly easy to read and introduces much of the syntax in the context of specific examples.
  • If you want to learn about how to use Stan from R, the rstan vignette will walk you through a typical analysis with rstan, very similar to this tutorial.
  • There is a very active Stan forum board, but since Stan does change over time, make sure the post you are looking at is recent.

Stan code for mnl

Stan model files

  • As projects get more complicated, it is a good idea to keep the Stan code in separate file with the .stan extension.
  • One advantage is that R Studio will color code the syntax in a .stan file.
  • Our Stan model is in mnl.stan. You can check it out by opening it in RStudio or any text editor.

Data

data {
    int<lower=2> C; // # of alternatives (choices) in each scenario
    int<lower=1> N; // # of observations
    int<lower=1> K; // # of covariates
    int<lower=1,upper=C> Y[N]; // # observed choices
    matrix[C,K] X[N]; // # matrix of attributes for each obs
}

Parameters

parameters {
    vector[K] beta;
}

Model

model {
  # priors
    // beta ~ normal(0,3); // often used in mcmc
    beta ~ cauchy(0, 2.5);  // better
    # model
    for (i in 1:N)
        Y[i] ~ categorical_logit(X[i]*beta);
}

Note that the scale of the prior on beta assumes that the predictors are standardized. See Gelman (2008) and Gelman(2009) for more details.

Testing with synthetic data

Bayesian statistical inference

Testing with synthetic data

  • When you are building any statistical estimation routine, it is a good idea to test it out with data that you generated synthetically.
  • By running the model with data where you know the parameters, you can compare to confirm that the estimation routine is is working properly.
    • In Bayesian inference, we are looking for a posterior that "covers" the true parameter values.
  • This also allows you to build the analysis before you've got the data.
    • We've never been stuck waiting for data, but maybe you have ;)

Libraries and options

Now it is time to start working in R. Open up mnl.R and begin by loading a few libraries and setting a few options.

library(rstan)
library(shinystan)

# writes a compiled Stan program to the disk to avoid recompiling
rstan_options(auto_write=TRUE) 
# allows Stan chains to run in parallel on multiprocessor machines
options(mc.cores = parallel::detectCores())

Generating synthetic data

R function for generating choice data from the multinomial logit model:

generate_mnl_data <- function(N=1000, C=3, beta=c(1, -2)){
  K <- length(beta)
  Y <- rep(NA, N)
  X <- list(NULL) 
  for (i in 1:N) {
    X[[i]] <- matrix(rnorm(C*K), ncol=K) # normal covariates  
    Y[i] <- sample(x=C, size=1, prob=exp(X[[i]]%*%beta)) # logit
  }
  list(N=N, C=C, K=K, Y=Y, X=X)
}

Our function returns data as a list of objects of the same names and dimensions as the declared data in mnl.stan. This is the format that stan() requires.

Synthetic data

Use the function to generate synthetic data. Remember the true value of beta is 1, -2.

d1 <- generate_mnl_data(N=1000, C=3, beta=c(1, -2))
str(d1)
## List of 5
##  $ N: num 1000
##  $ C: num 3
##  $ K: int 2
##  $ Y: int [1:1000] 3 1 2 3 3 2 2 3 2 2 ...
##  $ X:List of 1000
##   ..$ : num [1:3, 1:2] 1.476 1.266 -0.585 2.075 1.476 ...
##   ..$ : num [1:3, 1:2] 0.7565 -0.0714 -1.0242 -0.938 -0.6688 ...
##   ..$ : num [1:3, 1:2] 1.5626 -0.6154 -0.0138 0.3703 -0.7095 ...
##   ..$ : num [1:3, 1:2] -1.509 0.787 0.136 -0.558 0.221 ...
##   ..$ : num [1:3, 1:2] 0.122 -0.646 0.889 0.757 0.513 ...
##   ..$ : num [1:3, 1:2] -0.136 1.391 -1.122 -0.223 1.534 ...
##   ..$ : num [1:3, 1:2] -0.649 0.483 -1.399 1.219 0.185 ...
##   ..$ : num [1:3, 1:2] 0.0301 -0.7972 -0.4895 0.0758 1.4247 ...
##   ..$ : num [1:3, 1:2] 0.0539 0.5944 -1.409 -0.7943 -1.2936 ...
##   ..$ : num [1:3, 1:2] -0.312 -1.571 -0.514 0.502 -1.714 ...
##   ..$ : num [1:3, 1:2] -0.395 -0.509 -2.598 -0.149 0.887 ...
##   ..$ : num [1:3, 1:2] -0.0348 0.399 0.42 -0.0339 0.335 ...
##   ..$ : num [1:3, 1:2] 0.314 0.705 -1.116 -1.669 -0.608 ...
##   ..$ : num [1:3, 1:2] 0.51644 -0.38299 -0.25789 1.13296 -0.00628 ...
##   ..$ : num [1:3, 1:2] 1.18 2.244 -0.579 0.856 -1.164 ...
##   ..$ : num [1:3, 1:2] -1.675 -0.54 -0.143 -0.566 0.882 ...
##   ..$ : num [1:3, 1:2] -0.385 0.565 -0.341 3.475 1.703 ...
##   ..$ : num [1:3, 1:2] 1.049 -0.578 -0.434 0.41 1.898 ...
##   ..$ : num [1:3, 1:2] -0.155 -0.384 0.527 0.721 -2.145 ...
##   ..$ : num [1:3, 1:2] 0.844 0.367 1.062 1.655 -1.542 ...
##   ..$ : num [1:3, 1:2] -0.7375 0.0345 -1.0635 0.7047 1.4523 ...
##   ..$ : num [1:3, 1:2] -0.506 1.626 1.066 0.277 -0.396 ...
##   ..$ : num [1:3, 1:2] -0.312 0.482 -0.679 -0.671 -0.29 ...
##   ..$ : num [1:3, 1:2] 0.4501 1.5258 0.0951 -1.4752 1.6054 ...
##   ..$ : num [1:3, 1:2] 0.8584 1.4151 -0.2499 0.4787 0.0154 ...
##   ..$ : num [1:3, 1:2] -0.8848 0.0652 0.8595 -1.5006 -1.6786 ...
##   ..$ : num [1:3, 1:2] -1.777 0.374 0.918 -1.123 0.117 ...
##   ..$ : num [1:3, 1:2] 1.5849 0.9147 1.1072 -1.2475 -0.0971 ...
##   ..$ : num [1:3, 1:2] -0.892 1.554 0.245 -0.157 -1.404 ...
##   ..$ : num [1:3, 1:2] 0.592 0.351 0.937 -0.256 0.824 ...
##   ..$ : num [1:3, 1:2] -0.656 0.575 -1.159 0.169 0.179 ...
##   ..$ : num [1:3, 1:2] -1.1462 0.4719 -0.5269 0.0799 -0.8771 ...
##   ..$ : num [1:3, 1:2] -1.382 -0.299 -0.452 -1.486 -0.299 ...
##   ..$ : num [1:3, 1:2] 0.145 -0.149 -0.238 -2.838 -0.552 ...
##   ..$ : num [1:3, 1:2] 1.089 1.734 -2.109 -0.747 -1.135 ...
##   ..$ : num [1:3, 1:2] -0.0077 0.3298 1.1998 0.2715 0.1837 ...
##   ..$ : num [1:3, 1:2] -1.4453 -0.0958 0.5886 -0.5701 -0.1119 ...
##   ..$ : num [1:3, 1:2] -1.0759 0.0802 -1.2082 0.1082 -0.6817 ...
##   ..$ : num [1:3, 1:2] -1.388 0.251 -0.17 0.359 -1.281 ...
##   ..$ : num [1:3, 1:2] -1.203 -0.165 2.049 -0.518 -0.106 ...
##   ..$ : num [1:3, 1:2] 0.3903 0.7161 0.0301 0.1028 -0.2105 ...
##   ..$ : num [1:3, 1:2] 0.979 0.415 -1.03 -0.833 0.674 ...
##   ..$ : num [1:3, 1:2] 0.587 0.946 0.263 -1.706 0.421 ...
##   ..$ : num [1:3, 1:2] -0.631 -0.287 0.627 0.207 0.963 ...
##   ..$ : num [1:3, 1:2] 0.0521 -1.22902 -0.67484 -0.00842 -0.08975 ...
##   ..$ : num [1:3, 1:2] 0.538 -1.53 -0.517 -0.781 -1.51 ...
##   ..$ : num [1:3, 1:2] -0.423 0.917 0.979 0.255 0.358 ...
##   ..$ : num [1:3, 1:2] 2.6611 2.5709 0.0102 0.3449 0.6383 ...
##   ..$ : num [1:3, 1:2] -0.494 0.108 -0.486 -0.493 -1.125 ...
##   ..$ : num [1:3, 1:2] -0.04456 -0.74377 -0.00883 -0.36934 -0.34625 ...
##   ..$ : num [1:3, 1:2] 0.399 2.355 0.601 0.247 0.133 ...
##   ..$ : num [1:3, 1:2] 0.996 0.226 0.285 -1.933 0.448 ...
##   ..$ : num [1:3, 1:2] -0.182 0.637 0.796 0.149 -1.255 ...
##   ..$ : num [1:3, 1:2] -1.76328 -0.08138 -0.61513 -0.91525 -0.00449 ...
##   ..$ : num [1:3, 1:2] 0.502 -0.141 1.135 -0.104 0.448 ...
##   ..$ : num [1:3, 1:2] -0.813 -0.318 -1.125 -0.833 -0.401 ...
##   ..$ : num [1:3, 1:2] -1.2845 -0.0383 -1.5942 -0.6202 0.4299 ...
##   ..$ : num [1:3, 1:2] -0.861 -0.855 1.58 -0.465 -0.845 ...
##   ..$ : num [1:3, 1:2] 0.00909 1.5579 0.58868 0.37868 1.79074 ...
##   ..$ : num [1:3, 1:2] 1.66838 -0.27784 0.00601 1.89856 -0.59906 ...
##   ..$ : num [1:3, 1:2] 0.971 0.407 -1.907 -0.203 -0.847 ...
##   ..$ : num [1:3, 1:2] 0.728 1.353 -0.209 0.367 -2.336 ...
##   ..$ : num [1:3, 1:2] 0.206 0.284 -0.704 0.858 -1.103 ...
##   ..$ : num [1:3, 1:2] 1.9582 1.4419 0.0879 -1.4801 -2.6115 ...
##   ..$ : num [1:3, 1:2] -0.631 0.681 -0.516 0.942 0.243 ...
##   ..$ : num [1:3, 1:2] 0.174 -1.434 0.348 1.167 -1.936 ...
##   ..$ : num [1:3, 1:2] 0.746 2.445 -0.641 -0.78 -1.426 ...
##   ..$ : num [1:3, 1:2] 1.9207 -0.0718 -1.137 -0.0937 1.1511 ...
##   ..$ : num [1:3, 1:2] 2.639 -0.802 0.343 0.575 -1.045 ...
##   ..$ : num [1:3, 1:2] 0.652 0.62 -0.568 2.265 -1.12 ...
##   ..$ : num [1:3, 1:2] 0.0349 0.6092 -0.5593 -0.5424 1.6092 ...
##   ..$ : num [1:3, 1:2] -1.471 1.189 0.655 -0.941 1.108 ...
##   ..$ : num [1:3, 1:2] 0.113 -2.185 0.552 -1.487 1.208 ...
##   ..$ : num [1:3, 1:2] 0.2021 -0.8618 -2.8301 -0.5219 -0.0195 ...
##   ..$ : num [1:3, 1:2] -0.2579 0.2422 -0.1437 -0.0534 0.9763 ...
##   ..$ : num [1:3, 1:2] 1.14 -0.305 -0.652 -0.623 -1.991 ...
##   ..$ : num [1:3, 1:2] -1.3346 -0.1558 0.2392 0.0956 -0.059 ...
##   ..$ : num [1:3, 1:2] 0.9118 0.9275 -0.0126 0.1395 1.3928 ...
##   ..$ : num [1:3, 1:2] 0.554 -1.023 1.002 1.259 0.327 ...
##   ..$ : num [1:3, 1:2] 1.2335 0.7826 0.17325 0.43419 0.00582 ...
##   ..$ : num [1:3, 1:2] 0.361 1.49 -0.401 1.493 -1.38 ...
##   ..$ : num [1:3, 1:2] 1.51 -0.141 1.255 0.562 0.454 ...
##   ..$ : num [1:3, 1:2] -1.973 1.329 0.701 0.362 1.045 ...
##   ..$ : num [1:3, 1:2] 0.236 -0.585 0.931 -0.776 0.765 ...
##   ..$ : num [1:3, 1:2] -1.4954 1.6419 -0.3058 -0.312 0.0179 ...
##   ..$ : num [1:3, 1:2] -1.46 -1.038 0.247 1.295 0.991 ...
##   ..$ : num [1:3, 1:2] -0.84 0.257 -0.78 -0.206 -0.289 ...
##   ..$ : num [1:3, 1:2] -0.1 0.88 0.428 0.328 -1.333 ...
##   ..$ : num [1:3, 1:2] 0.685 1.183 0.163 0.147 0.341 ...
##   ..$ : num [1:3, 1:2] 0.0566 0.0977 -0.7719 0.4936 2.4513 ...
##   ..$ : num [1:3, 1:2] 1.986 1.263 0.234 -0.117 1.074 ...
##   ..$ : num [1:3, 1:2] -2.063 2.121 1.097 -0.803 0.44 ...
##   ..$ : num [1:3, 1:2] -1.4164 0.7286 -0.0412 0.7794 0.9844 ...
##   ..$ : num [1:3, 1:2] -0.242 0.383 0.54 0.753 -1.793 ...
##   ..$ : num [1:3, 1:2] -0.688 -0.484 1.619 0.017 1.758 ...
##   ..$ : num [1:3, 1:2] 0.586 0.704 -2.669 -0.172 -0.39 ...
##   ..$ : num [1:3, 1:2] -0.902 -1.103 0.682 -0.074 -0.677 ...
##   ..$ : num [1:3, 1:2] -0.631 -0.114 1.503 0.137 -0.764 ...
##   ..$ : num [1:3, 1:2] 0.247 1.27 0.732 1.316 1.618 ...
##   .. [list output truncated]

Run Stan model on synthetic data

To run the model, we call the stan() function. Note that we pass filename mnl.stan to the stan function. Make sure that file is in the working directory (or provide a full path)!

test.stan <- stan(file="mnl.stan", data=d1, iter=1000, chains=4) 
## In file included from file77df41e4101d.cpp:8:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core.hpp:12:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core/var.hpp:7:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/math/tools/config.hpp:13:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/config.hpp:39:
## /Users/emf75/Library/R/3.3/library/BH/include/boost/config/compiler/clang.hpp:196:11: warning: 'BOOST_NO_CXX11_RVALUE_REFERENCES' macro redefined [-Wmacro-redefined]
## #  define BOOST_NO_CXX11_RVALUE_REFERENCES
##           ^
## <command line>:6:9: note: previous definition is here
## #define BOOST_NO_CXX11_RVALUE_REFERENCES 1
##         ^
## In file included from file77df41e4101d.cpp:8:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core.hpp:42:
## /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:17: warning: unused function 'set_zero_all_adjoints' [-Wunused-function]
##     static void set_zero_all_adjoints() {
##                 ^
## In file included from file77df41e4101d.cpp:8:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core.hpp:43:
## /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints_nested.hpp:17:17: warning: 'static' function 'set_zero_all_adjoints_nested' declared in header file should be declared 'static inline' [-Wunneeded-internal-declaration]
##     static void set_zero_all_adjoints_nested() {
##                 ^
## In file included from file77df41e4101d.cpp:8:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/mat.hpp:11:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/prim/mat.hpp:59:
## /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/prim/mat/fun/autocorrelation.hpp:17:14: warning: function 'fft_next_good_size' is not needed and will not be emitted [-Wunneeded-internal-declaration]
##       size_t fft_next_good_size(size_t N) {
##              ^
## In file included from file77df41e4101d.cpp:8:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/rev/mat.hpp:11:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/prim/mat.hpp:298:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/prim/arr.hpp:39:
## In file included from /Users/emf75/Library/R/3.3/library/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:13:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/numeric/odeint.hpp:61:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/numeric/odeint/util/multi_array_adaption.hpp:29:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array.hpp:21:
## In file included from /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array/base.hpp:28:
## /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array/concept_checks.hpp:42:43: warning: unused typedef 'index_range' [-Wunused-local-typedef]
##       typedef typename Array::index_range index_range;
##                                           ^
## /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array/concept_checks.hpp:43:37: warning: unused typedef 'index' [-Wunused-local-typedef]
##       typedef typename Array::index index;
##                                     ^
## /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array/concept_checks.hpp:53:43: warning: unused typedef 'index_range' [-Wunused-local-typedef]
##       typedef typename Array::index_range index_range;
##                                           ^
## /Users/emf75/Library/R/3.3/library/BH/include/boost/multi_array/concept_checks.hpp:54:37: warning: unused typedef 'index' [-Wunused-local-typedef]
##       typedef typename Array::index index;
##                                     ^
## 8 warnings generated.
summary(test.stan)$summary
##                mean     se_mean         sd         2.5%          25%
## beta[1]    1.041335 0.002546267 0.07429361    0.9044762    0.9888139
## beta[2]   -2.007274 0.003727126 0.10818843   -2.2246054   -2.0807554
## lp__    -556.928851 0.037175199 1.04044186 -559.6418540 -557.3567913
##                 50%         75%       97.5%    n_eff     Rhat
## beta[1]    1.040808    1.091239    1.190926 851.3247 1.003204
## beta[2]   -2.003657   -1.934146   -1.797382 842.5846 1.005261
## lp__    -556.621284 -556.182743 -555.876639 783.3016 1.000488

Running multiple chains

When we called Stan, we asked it to run the NUTS algorithm four times (independantly). This is a good practice as it allows you to assess the convergence of the algorithm! We can can access the summary for indivdual chains with the command:

summary(test.stan)$c_summary
## , , chains = chain:1
## 
##          stats
## parameter        mean         sd         2.5%          25%         50%
##   beta[1]    1.034599 0.07185552    0.8987929    0.9884449    1.035035
##   beta[2]   -1.994386 0.10577831   -2.2091617   -2.0618042   -1.991311
##   lp__    -556.881538 1.04369659 -559.5079884 -557.2822286 -556.606582
##          stats
## parameter         75%       97.5%
##   beta[1]    1.084107    1.175557
##   beta[2]   -1.922259   -1.781583
##   lp__    -556.173676 -555.893737
## 
## , , chains = chain:2
## 
##          stats
## parameter        mean        sd         2.5%          25%         50%
##   beta[1]    1.047242 0.0761273    0.9060115    0.9919768    1.043199
##   beta[2]   -2.014769 0.1059891   -2.2200981   -2.0863261   -2.010815
##   lp__    -556.953805 1.0112386 -559.5850729 -557.4385239 -556.640219
##          stats
## parameter         75%       97.5%
##   beta[1]    1.095719    1.198057
##   beta[2]   -1.940493   -1.805969
##   lp__    -556.191411 -555.877419
## 
## , , chains = chain:3
## 
##          stats
## parameter        mean         sd         2.5%          25%         50%
##   beta[1]    1.038211 0.07353037    0.9100884    0.9831259    1.033752
##   beta[2]   -2.006817 0.11698088   -2.2363856   -2.0830552   -2.003059
##   lp__    -556.960472 1.11962697 -559.8166915 -557.4583584 -556.553484
##          stats
## parameter         75%       97.5%
##   beta[1]    1.083578    1.193861
##   beta[2]   -1.926006   -1.780142
##   lp__    -556.176105 -555.870005
## 
## , , chains = chain:4
## 
##          stats
## parameter        mean         sd         2.5%          25%         50%
##   beta[1]    1.045290 0.07510099    0.9007815    0.9908118    1.049703
##   beta[2]   -2.013125 0.10259051   -2.2213149   -2.0844836   -2.009035
##   lp__    -556.919588 0.98344279 -559.5904476 -557.2650028 -556.644282
##          stats
## parameter         75%       97.5%
##   beta[1]    1.102953    1.183581
##   beta[2]   -1.946181   -1.823310
##   lp__    -556.204696 -555.873785

Rhat and n_eff

  • The summary reports two statistics that allow us to evaluate whether the algorithm is working properly.
    • Rhat compares the variation within chains to the variation between chains and should be close to 1 (also called the potential scale reduction factor)
    • n_eff is a crude approximation of the effective number of independent draws from the posterior
summary(test.stan)$summary
##                mean     se_mean         sd         2.5%          25%
## beta[1]    1.041335 0.002546267 0.07429361    0.9044762    0.9888139
## beta[2]   -2.007274 0.003727126 0.10818843   -2.2246054   -2.0807554
## lp__    -556.928851 0.037175199 1.04044186 -559.6418540 -557.3567913
##                 50%         75%       97.5%    n_eff     Rhat
## beta[1]    1.040808    1.091239    1.190926 851.3247 1.003204
## beta[2]   -2.003657   -1.934146   -1.797382 842.5846 1.005261
## lp__    -556.621284 -556.182743 -555.876639 783.3016 1.000488

Rules of thumb for Rhat and n_eff

  • Rhat should be less than 1.1 for all parameters (and not too much less than 1)
  • n_eff should be greater than 400 for all parameters (although we sometimes go with n_eff around 100, for long-running models)

If these conditions are not met, then
1. Inspect the traceplots to see what is happening
2. Run the model longer
3. (Pro tip) Consider re-parameterizing to improve computation

Traceplots look fine

plot(test.stan, plotfun="trace")

Plot of the parameter estimates

plot(test.stan)

Histograms of the posteriors

plot(test.stan, plotfun="hist")

Density plots of the posteriors

plot(test.stan, plotfun="dens") 

Model confirmed

  1. Convergence is good.
  2. Estimated posteriors of beta include support for the true values.

This synthetic data test confirmes that Stan seems to be working well with this model. Now we can apply it to some real data.

Choice-Based Conjoint Data for Chocolate Bars

Choice-based conjoint data for chocolate bars

  • Fourteen respondents each answered 25 choice tasks where they selected from among three chocolate bars.
  • Three attributes
    • Brand: Hersheys, Dove, Lindt, Godiva, Ghirardelli
    • Type: Milk, Milk with nuts, Dark, Dark with nuts, White
  • Data was generously shared by Betty Kim-Viechnicki and Joe Cable.
    • Originally described in Kim-Viechnicki, B.E., Burla, Y., Feit, E., Plassmann, H., & Kable, J.W. (2013). Decisions about chocolate are processed differently than decisions on gambles: Evidence from eye-tracking.

Read in the chocolate data

choc.df <- read.csv("cbc_chocolate.csv")
choc.df
##         X  Ind Trial Alt       Brand        Type Price Chosen
## 1       1 2401     1   1        Dove        Milk   0.6      1
## 2       2 2401     1   2      Godiva        Dark   0.7      0
## 3       3 2401     1   3        Dove       White   3.6      0
## 4       4 2401     2   1      Godiva Milk w Nuts   2.7      0
## 5       5 2401     2   2      Godiva        Dark   3.9      1
## 6       6 2401     2   3    Hersheys Milk w Nuts   0.7      0
## 7       7 2401     3   1    Hersheys Dark w Nuts   1.7      0
## 8       8 2401     3   2      Godiva        Dark   3.7      1
## 9       9 2401     3   3    Hersheys        Dark   3.0      0
## 10     10 2401     4   1       Lindt        Milk   1.0      1
## 11     11 2401     4   2       Lindt Milk w Nuts   3.6      0
## 12     12 2401     4   3 Ghirardelli Dark w Nuts   0.5      0
## 13     13 2401     5   1    Hersheys Milk w Nuts   0.8      0
## 14     14 2401     5   2      Godiva        Dark   1.5      1
## 15     15 2401     5   3    Hersheys       White   3.3      0
## 16     16 2401     6   1       Lindt        Milk   3.1      0
## 17     17 2401     6   2        Dove       White   2.5      0
## 18     18 2401     6   3      Godiva        Dark   2.6      1
## 19     19 2401     7   1      Godiva       White   3.1      0
## 20     20 2401     7   2        Dove Dark w Nuts   4.0      0
## 21     21 2401     7   3      Godiva        Milk   2.1      1
## 22     22 2401     8   1    Hersheys Dark w Nuts   0.8      0
## 23     23 2401     8   2      Godiva       White   3.2      0
## 24     24 2401     8   3      Godiva        Dark   1.1      1
## 25     25 2401     9   1       Lindt        Dark   2.3      0
## 26     26 2401     9   2      Godiva        Dark   1.7      1
## 27     27 2401     9   3      Godiva       White   3.8      0
## 28     28 2401    10   1       Lindt Milk w Nuts   0.6      0
## 29     29 2401    10   2      Godiva Milk w Nuts   0.8      1
## 30     30 2401    10   3    Hersheys        Dark   3.7      0
## 31     31 2401    11   1      Godiva        Milk   1.6      1
## 32     32 2401    11   2        Dove       White   0.7      0
## 33     33 2401    11   3    Hersheys Dark w Nuts   1.2      0
## 34     34 2401    12   1      Godiva Dark w Nuts   1.1      0
## 35     35 2401    12   2        Dove Dark w Nuts   0.8      0
## 36     36 2401    12   3       Lindt        Dark   3.7      1
## 37     37 2401    13   1        Dove        Milk   3.0      1
## 38     38 2401    13   2       Lindt       White   0.8      0
## 39     39 2401    13   3      Godiva       White   1.9      0
## 40     40 2401    14   1       Lindt Dark w Nuts   0.6      0
## 41     41 2401    14   2        Dove        Milk   3.5      1
## 42     42 2401    14   3        Dove Milk w Nuts   1.9      0
## 43     43 2401    15   1      Godiva        Dark   3.7      1
## 44     44 2401    15   2 Ghirardelli        Dark   1.5      0
## 45     45 2401    15   3        Dove        Dark   1.6      0
## 46     46 2401    16   1    Hersheys Milk w Nuts   0.5      0
## 47     47 2401    16   2        Dove        Milk   3.8      1
## 48     48 2401    16   3        Dove Dark w Nuts   3.7      0
## 49     49 2401    17   1        Dove        Milk   3.9      1
## 50     50 2401    17   2        Dove Milk w Nuts   1.2      0
## 51     51 2401    17   3       Lindt Milk w Nuts   0.5      0
## 52     52 2401    18   1      Godiva Milk w Nuts   2.8      1
## 53     53 2401    18   2       Lindt        Milk   2.7      0
## 54     54 2401    18   3      Godiva       White   2.6      0
## 55     55 2401    19   1    Hersheys        Milk   3.7      1
## 56     56 2401    19   2        Dove Dark w Nuts   4.0      0
## 57     57 2401    19   3        Dove        Dark   2.8      0
## 58     58 2401    20   1        Dove        Dark   0.7      0
## 59     59 2401    20   2      Godiva       White   0.8      0
## 60     60 2401    20   3    Hersheys        Dark   1.9      1
## 61     61 2401    21   1 Ghirardelli Milk w Nuts   0.8      0
## 62     62 2401    21   2    Hersheys        Milk   3.0      1
## 63     63 2401    21   3      Godiva Milk w Nuts   2.4      0
## 64     64 2401    22   1      Godiva        Dark   0.9      1
## 65     65 2401    22   2        Dove Milk w Nuts   3.4      0
## 66     66 2401    22   3    Hersheys Dark w Nuts   3.4      0
## 67     67 2401    23   1      Godiva Dark w Nuts   0.6      1
## 68     68 2401    23   2        Dove       White   1.8      0
## 69     69 2401    23   3        Dove        Dark   3.4      0
## 70     70 2401    24   1    Hersheys Dark w Nuts   3.6      0
## 71     71 2401    24   2      Godiva Milk w Nuts   3.2      1
## 72     72 2401    24   3 Ghirardelli Milk w Nuts   1.4      0
## 73     73 2401    25   1       Lindt       White   1.1      0
## 74     74 2401    25   2 Ghirardelli       White   0.8      0
## 75     75 2401    25   3       Lindt        Milk   2.0      1
## 76     76 2402     1   1    Hersheys        Milk   2.2      0
## 77     77 2402     1   2      Godiva Dark w Nuts   2.1      1
## 78     78 2402     1   3        Dove        Milk   3.5      0
## 79     79 2402     2   1 Ghirardelli Milk w Nuts   1.3      0
## 80     80 2402     2   2    Hersheys       White   1.7      0
## 81     81 2402     2   3    Hersheys        Milk   3.5      1
## 82     82 2402     3   1 Ghirardelli Milk w Nuts   1.6      0
## 83     83 2402     3   2        Dove Milk w Nuts   2.0      0
## 84     84 2402     3   3       Lindt Dark w Nuts   1.8      1
## 85     85 2402     4   1       Lindt Milk w Nuts   3.2      0
## 86     86 2402     4   2        Dove Dark w Nuts   2.5      1
## 87     87 2402     4   3       Lindt        Milk   0.8      0
## 88     88 2402     5   1      Godiva Dark w Nuts   1.3      1
## 89     89 2402     5   2      Godiva        Milk   1.1      0
## 90     90 2402     5   3    Hersheys Milk w Nuts   2.7      0
## 91     91 2402     6   1       Lindt        Dark   0.7      1
## 92     92 2402     6   2    Hersheys       White   0.6      0
## 93     93 2402     6   3       Lindt Milk w Nuts   3.3      0
## 94     94 2402     7   1       Lindt        Dark   0.9      1
## 95     95 2402     7   2       Lindt       White   2.9      0
## 96     96 2402     7   3 Ghirardelli        Milk   0.8      0
## 97     97 2402     8   1       Lindt Milk w Nuts   2.0      0
## 98     98 2402     8   2 Ghirardelli Dark w Nuts   1.3      1
## 99     99 2402     8   3       Lindt Dark w Nuts   1.2      0
## 100   100 2402     9   1       Lindt Dark w Nuts   3.4      1
## 101   101 2402     9   2        Dove        Dark   1.8      0
## 102   102 2402     9   3        Dove Dark w Nuts   3.1      0
## 103   103 2402    10   1       Lindt        Dark   1.1      1
## 104   104 2402    10   2    Hersheys       White   1.6      0
## 105   105 2402    10   3    Hersheys Milk w Nuts   3.8      0
## 106   106 2402    11   1    Hersheys Dark w Nuts   2.1      0
## 107   107 2402    11   2        Dove        Dark   2.9      1
## 108   108 2402    11   3      Godiva       White   1.4      0
## 109   109 2402    12   1    Hersheys       White   1.0      0
## 110   110 2402    12   2    Hersheys Milk w Nuts   0.6      0
## 111   111 2402    12   3        Dove Milk w Nuts   2.8      1
## 112   112 2402    13   1 Ghirardelli       White   0.9      0
## 113   113 2402    13   2        Dove        Dark   2.5      1
## 114   114 2402    13   3    Hersheys       White   1.9      0
## 115   115 2402    14   1    Hersheys        Milk   1.8      0
## 116   116 2402    14   2      Godiva        Dark   3.4      1
## 117   117 2402    14   3      Godiva Dark w Nuts   3.2      0
## 118   118 2402    15   1      Godiva        Milk   0.7      1
## 119   119 2402    15   2    Hersheys       White   0.6      0
## 120   120 2402    15   3    Hersheys Dark w Nuts   2.9      0
## 121   121 2402    16   1    Hersheys Milk w Nuts   2.3      0
## 122   122 2402    16   2 Ghirardelli Milk w Nuts   0.6      1
## 123   123 2402    16   3    Hersheys       White   0.8      0
## 124   124 2402    17   1        Dove        Dark   4.0      1
## 125   125 2402    17   2 Ghirardelli        Milk   2.7      0
## 126   126 2402    17   3        Dove       White   1.3      0
## 127   127 2402    18   1        Dove Milk w Nuts   2.1      0
## 128   128 2402    18   2 Ghirardelli       White   1.1      0
## 129   129 2402    18   3 Ghirardelli        Milk   2.5      1
## 130   130 2402    19   1    Hersheys Dark w Nuts   1.2      0
## 131   131 2402    19   2        Dove        Milk   2.9      1
## 132   132 2402    19   3 Ghirardelli       White   1.5      0
## 133   133 2402    20   1      Godiva Milk w Nuts   1.8      0
## 134   134 2402    20   2    Hersheys        Dark   3.2      0
## 135   135 2402    20   3       Lindt        Dark   0.9      1
## 136   136 2402    21   1 Ghirardelli       White   1.5      0
## 137   137 2402    21   2      Godiva Milk w Nuts   2.1      0
## 138   138 2402    21   3       Lindt        Dark   0.6      1
## 139   139 2402    22   1      Godiva Dark w Nuts   2.8      1
## 140   140 2402    22   2      Godiva Milk w Nuts   3.7      0
## 141   141 2402    22   3 Ghirardelli       White   2.2      0
## 142   142 2402    23   1      Godiva Milk w Nuts   3.2      1
## 143   143 2402    23   2    Hersheys Dark w Nuts   4.0      0
## 144   144 2402    23   3 Ghirardelli       White   2.4      0
## 145   145 2402    24   1      Godiva       White   0.9      0
## 146   146 2402    24   2      Godiva Dark w Nuts   3.8      1
## 147   147 2402    24   3 Ghirardelli Milk w Nuts   1.8      0
## 148   148 2402    25   1      Godiva Milk w Nuts   2.3      1
## 149   149 2402    25   2       Lindt Milk w Nuts   1.3      0
## 150   150 2402    25   3        Dove        Milk   2.5      0
## 151   151 2403     1   1        Dove       White   1.4      0
## 152   152 2403     1   2        Dove        Milk   1.0      1
## 153   153 2403     1   3       Lindt Milk w Nuts   2.0      0
## 154   154 2403     2   1      Godiva        Milk   3.5      0
## 155   155 2403     2   2 Ghirardelli        Milk   2.2      1
## 156   156 2403     2   3      Godiva        Dark   2.2      0
## 157   157 2403     3   1 Ghirardelli Dark w Nuts   3.9      0
## 158   158 2403     3   2    Hersheys        Milk   1.2      1
## 159   159 2403     3   3      Godiva Dark w Nuts   2.2      0
## 160   160 2403     4   1      Godiva        Milk   1.3      1
## 161   161 2403     4   2       Lindt Dark w Nuts   0.7      0
## 162   162 2403     4   3    Hersheys        Dark   3.3      0
## 163   163 2403     5   1      Godiva        Dark   2.8      0
## 164   164 2403     5   2        Dove Dark w Nuts   1.0      1
## 165   165 2403     5   3 Ghirardelli        Milk   3.5      0
## 166   166 2403     6   1       Lindt Milk w Nuts   1.3      0
## 167   167 2403     6   2      Godiva       White   2.5      0
## 168   168 2403     6   3        Dove       White   0.8      1
## 169   169 2403     7   1        Dove        Dark   1.4      1
## 170   170 2403     7   2       Lindt        Dark   2.1      0
## 171   171 2403     7   3      Godiva        Dark   3.1      0
## 172   172 2403     8   1        Dove       White   2.9      0
## 173   173 2403     8   2       Lindt        Dark   3.0      0
## 174   174 2403     8   3      Godiva Milk w Nuts   2.2      1
## 175   175 2403     9   1      Godiva Dark w Nuts   1.2      1
## 176   176 2403     9   2       Lindt Dark w Nuts   2.5      0
## 177   177 2403     9   3        Dove Milk w Nuts   1.4      0
## 178   178 2403    10   1        Dove Dark w Nuts   2.5      0
## 179   179 2403    10   2      Godiva Dark w Nuts   0.9      1
## 180   180 2403    10   3       Lindt Dark w Nuts   3.2      0
## 181   181 2403    11   1      Godiva Milk w Nuts   3.7      0
## 182   182 2403    11   2      Godiva        Dark   1.4      0
## 183   183 2403    11   3        Dove        Milk   1.7      1
## 184   184 2403    12   1 Ghirardelli       White   3.7      0
## 185   185 2403    12   2 Ghirardelli        Milk   3.3      1
## 186   186 2403    12   3        Dove        Dark   2.3      0
## 187   187 2403    13   1        Dove        Dark   1.0      1
## 188   188 2403    13   2       Lindt        Dark   3.8      0
## 189   189 2403    13   3 Ghirardelli Dark w Nuts   3.5      0
## 190   190 2403    14   1       Lindt Milk w Nuts   2.8      0
## 191   191 2403    14   2    Hersheys Dark w Nuts   2.8      0
## 192   192 2403    14   3    Hersheys        Milk   2.6      1
## 193   193 2403    15   1 Ghirardelli Milk w Nuts   3.0      0
## 194   194 2403    15   2        Dove        Dark   2.7      1
## 195   195 2403    15   3 Ghirardelli        Dark   3.0      0
## 196   196 2403    16   1        Dove        Milk   3.0      0
## 197   197 2403    16   2        Dove       White   2.5      1
## 198   198 2403    16   3      Godiva        Milk   3.9      0
## 199   199 2403    17   1       Lindt        Dark   0.5      1
## 200   200 2403    17   2 Ghirardelli       White   0.6      0
## 201   201 2403    17   3      Godiva        Dark   3.4      0
## 202   202 2403    18   1        Dove Milk w Nuts   2.2      1
## 203   203 2403    18   2        Dove        Dark   3.6      0
## 204   204 2403    18   3    Hersheys       White   3.8      0
## 205   205 2403    19   1        Dove Dark w Nuts   2.2      1
## 206   206 2403    19   2    Hersheys Milk w Nuts   4.0      0
## 207   207 2403    19   3 Ghirardelli        Dark   2.9      0
## 208   208 2403    20   1      Godiva        Milk   3.2      0
## 209   209 2403    20   2       Lindt        Dark   0.6      1
## 210   210 2403    20   3    Hersheys Dark w Nuts   2.0      0
## 211   211 2403    21   1 Ghirardelli       White   3.4      0
## 212   212 2403    21   2       Lindt        Dark   2.5      0
## 213   213 2403    21   3      Godiva       White   2.5      1
## 214   214 2403    22   1      Godiva Dark w Nuts   3.0      0
## 215   215 2403    22   2       Lindt        Dark   1.1      1
## 216   216 2403    22   3        Dove        Milk   3.8      0
## 217   217 2403    23   1    Hersheys        Milk   0.7      1
## 218   218 2403    23   2    Hersheys       White   2.2      0
## 219   219 2403    23   3        Dove Milk w Nuts   2.7      0
## 220   220 2403    24   1        Dove Dark w Nuts   1.4      1
## 221   221 2403    24   2 Ghirardelli        Milk   3.3      0
## 222   222 2403    24   3      Godiva        Milk   2.2      0
## 223   223 2403    25   1    Hersheys Milk w Nuts   2.3      0
## 224   224 2403    25   2      Godiva Milk w Nuts   1.7      1
## 225   225 2403    25   3 Ghirardelli Milk w Nuts   2.7      0
## 226   226 2405     1   1       Lindt Dark w Nuts   3.9      0
## 227   227 2405     1   2 Ghirardelli Dark w Nuts   2.6      1
## 228   228 2405     1   3      Godiva Dark w Nuts   2.7      0
## 229   229 2405     2   1       Lindt Milk w Nuts   0.9      0
## 230   230 2405     2   2    Hersheys Dark w Nuts   3.3      0
## 231   231 2405     2   3    Hersheys Milk w Nuts   4.0      1
## 232   232 2405     3   1    Hersheys        Milk   3.6      0
## 233   233 2405     3   2        Dove        Milk   1.6      0
## 234   234 2405     3   3 Ghirardelli Milk w Nuts   1.7      1
## 235   235 2405     4   1      Godiva Milk w Nuts   1.4      1
## 236   236 2405     4   2 Ghirardelli       White   2.4      0
## 237   237 2405     4   3      Godiva       White   3.8      0
## 238   238 2405     5   1        Dove Milk w Nuts   3.0      1
## 239   239 2405     5   2      Godiva Dark w Nuts   2.9      0
## 240   240 2405     5   3        Dove        Dark   1.6      0
## 241   241 2405     6   1       Lindt       White   2.5      0
## 242   242 2405     6   2 Ghirardelli       White   2.6      0
## 243   243 2405     6   3       Lindt Dark w Nuts   3.9      1
## 244   244 2405     7   1 Ghirardelli Dark w Nuts   0.7      1
## 245   245 2405     7   2      Godiva       White   2.9      0
## 246   246 2405     7   3        Dove        Milk   0.7      0
## 247   247 2405     8   1    Hersheys Milk w Nuts   0.6      1
## 248   248 2405     8   2 Ghirardelli Dark w Nuts   3.3      0
## 249   249 2405     8   3      Godiva       White   1.1      0
## 250   250 2405     9   1    Hersheys Milk w Nuts   2.7      1
## 251   251 2405     9   2 Ghirardelli Dark w Nuts   2.3      0
## 252   252 2405     9   3      Godiva        Dark   2.6      0
## 253   253 2405    10   1       Lindt        Dark   2.5      0
## 254   254 2405    10   2      Godiva        Dark   1.5      0
## 255   255 2405    10   3 Ghirardelli Dark w Nuts   1.4      1
## 256   256 2405    11   1 Ghirardelli       White   1.5      0
## 257   257 2405    11   2        Dove Dark w Nuts   2.0      0
## 258   258 2405    11   3 Ghirardelli        Dark   2.5      1
## 259   259 2405    12   1 Ghirardelli        Milk   1.7      1
## 260   260 2405    12   2       Lindt        Dark   2.5      0
## 261   261 2405    12   3        Dove        Milk   0.6      0
## 262   262 2405    13   1        Dove        Milk   3.3      0
## 263   263 2405    13   2    Hersheys        Dark   2.8      0
## 264   264 2405    13   3 Ghirardelli        Milk   1.8      1
## 265   265 2405    14   1       Lindt        Dark   3.5      0
## 266   266 2405    14   2 Ghirardelli       White   1.3      0
## 267   267 2405    14   3    Hersheys Milk w Nuts   0.9      1
## 268   268 2405    15   1    Hersheys        Dark   2.6      0
## 269   269 2405    15   2      Godiva        Dark   3.9      1
## 270   270 2405    15   3    Hersheys       White   2.9      0
## 271   271 2405    16   1 Ghirardelli Milk w Nuts   1.1      1
## 272   272 2405    16   2 Ghirardelli        Dark   1.9      0
## 273   273 2405    16   3      Godiva Milk w Nuts   2.1      0
## 274   274 2405    17   1 Ghirardelli       White   2.9      0
## 275   275 2405    17   2      Godiva        Milk   2.4      1
## 276   276 2405    17   3    Hersheys Milk w Nuts   3.9      0
## 277   277 2405    18   1      Godiva       White   3.4      0
## 278   278 2405    18   2 Ghirardelli        Dark   3.9      1
## 279   279 2405    18   3    Hersheys       White   1.9      0
## 280   280 2405    19   1    Hersheys Milk w Nuts   2.9      1
## 281   281 2405    19   2        Dove        Dark   3.4      0
## 282   282 2405    19   3    Hersheys        Milk   1.3      0
## 283   283 2405    20   1       Lindt Dark w Nuts   3.5      0
## 284   284 2405    20   2        Dove        Milk   3.4      1
## 285   285 2405    20   3       Lindt        Dark   0.7      0
## 286   286 2405    21   1    Hersheys        Milk   3.0      0
## 287   287 2405    21   2    Hersheys        Dark   1.8      0
## 288   288 2405    21   3 Ghirardelli        Milk   3.5      1
## 289   289 2405    22   1      Godiva Dark w Nuts   1.6      1
## 290   290 2405    22   2        Dove Dark w Nuts   1.8      0
## 291   291 2405    22   3       Lindt Dark w Nuts   3.6      0
## 292   292 2405    23   1      Godiva       White   1.5      0
## 293   293 2405    23   2    Hersheys       White   1.3      0
## 294   294 2405    23   3      Godiva Milk w Nuts   0.6      1
## 295   295 2405    24   1 Ghirardelli        Dark   2.5      1
## 296   296 2405    24   2 Ghirardelli Dark w Nuts   0.8      0
## 297   297 2405    24   3       Lindt       White   2.1      0
## 298   298 2405    25   1       Lindt       White   3.6      0
## 299   299 2405    25   2    Hersheys       White   2.5      0
## 300   300 2405    25   3 Ghirardelli Dark w Nuts   2.0      1
## 301   301 2407     1   1 Ghirardelli        Dark   3.0      0
## 302   302 2407     1   2       Lindt       White   2.5      0
## 303   303 2407     1   3    Hersheys Dark w Nuts   2.4      1
## 304   304 2407     2   1 Ghirardelli        Milk   2.0      1
## 305   305 2407     2   2       Lindt       White   2.9      0
## 306   306 2407     2   3      Godiva       White   1.9      0
## 307   307 2407     3   1       Lindt        Milk   2.3      0
## 308   308 2407     3   2    Hersheys        Dark   0.6      1
## 309   309 2407     3   3      Godiva       White   0.9      0
## 310   310 2407     4   1    Hersheys       White   1.3      0
## 311   311 2407     4   2        Dove        Dark   1.3      0
## 312   312 2407     4   3       Lindt Dark w Nuts   3.0      1
## 313   313 2407     5   1        Dove        Milk   3.7      0
## 314   314 2407     5   2    Hersheys Milk w Nuts   3.6      1
## 315   315 2407     5   3       Lindt       White   3.6      0
## 316   316 2407     6   1       Lindt       White   4.0      0
## 317   317 2407     6   2        Dove       White   2.5      0
## 318   318 2407     6   3       Lindt Milk w Nuts   0.8      1
## 319   319 2407     7   1      Godiva        Milk   2.5      0
## 320   320 2407     7   2        Dove Dark w Nuts   2.4      1
## 321   321 2407     7   3        Dove       White   2.3      0
## 322   322 2407     8   1    Hersheys Dark w Nuts   2.4      1
## 323   323 2407     8   2    Hersheys       White   1.8      0
## 324   324 2407     8   3      Godiva        Milk   3.7      0
## 325   325 2407     9   1        Dove        Milk   3.9      0
## 326   326 2407     9   2        Dove        Dark   1.9      0
## 327   327 2407     9   3 Ghirardelli Milk w Nuts   1.8      1
## 328   328 2407    10   1       Lindt        Milk   3.7      0
## 329   329 2407    10   2        Dove        Milk   1.1      0
## 330   330 2407    10   3    Hersheys        Milk   1.0      1
## 331   331 2407    11   1      Godiva        Dark   3.3      0
## 332   332 2407    11   2    Hersheys        Dark   3.3      0
## 333   333 2407    11   3 Ghirardelli Dark w Nuts   0.6      1
## 334   334 2407    12   1      Godiva        Milk   1.6      0
## 335   335 2407    12   2 Ghirardelli Dark w Nuts   1.1      1
## 336   336 2407    12   3       Lindt        Milk   1.3      0
## 337   337 2407    13   1       Lindt        Dark   2.0      1
## 338   338 2407    13   2 Ghirardelli       White   3.5      0
## 339   339 2407    13   3       Lindt Milk w Nuts   3.7      0
## 340   340 2407    14   1       Lindt Milk w Nuts   1.9      0
## 341   341 2407    14   2      Godiva        Dark   3.0      0
## 342   342 2407    14   3    Hersheys        Dark   0.6      1
## 343   343 2407    15   1        Dove Milk w Nuts   3.0      0
## 344   344 2407    15   2 Ghirardelli Dark w Nuts   1.2      0
## 345   345 2407    15   3      Godiva       White   1.1      1
## 346   346 2407    16   1       Lindt Milk w Nuts   3.3      0
## 347   347 2407    16   2 Ghirardelli Dark w Nuts   1.6      1
## 348   348 2407    16   3        Dove Dark w Nuts   1.4      0
## 349   349 2407    17   1       Lindt Dark w Nuts   3.3      0
## 350   350 2407    17   2       Lindt        Milk   2.8      0
## 351   351 2407    17   3      Godiva        Milk   0.9      1
## 352   352 2407    18   1       Lindt        Dark   0.8      1
## 353   353 2407    18   2    Hersheys        Milk   3.5      0
## 354   354 2407    18   3    Hersheys Dark w Nuts   2.0      0
## 355   355 2407    19   1      Godiva        Dark   3.3      0
## 356   356 2407    19   2        Dove Milk w Nuts   3.1      0
## 357   357 2407    19   3 Ghirardelli Dark w Nuts   2.9      1
## 358   358 2407    20   1       Lindt Dark w Nuts   1.2      0
## 359   359 2407    20   2       Lindt       White   1.5      0
## 360   360 2407    20   3        Dove        Dark   0.9      1
## 361   361 2407    21   1    Hersheys       White   2.2      1
## 362   362 2407    21   2       Lindt Dark w Nuts   3.3      0
## 363   363 2407    21   3    Hersheys        Milk   1.9      0
## 364   364 2407    22   1        Dove        Milk   3.4      0
## 365   365 2407    22   2 Ghirardelli        Dark   3.3      1
## 366   366 2407    22   3    Hersheys        Dark   3.8      0
## 367   367 2407    23   1 Ghirardelli Milk w Nuts   1.5      1
## 368   368 2407    23   2    Hersheys        Dark   2.8      0
## 369   369 2407    23   3    Hersheys Milk w Nuts   2.5      0
## 370   370 2407    24   1      Godiva       White   0.5      1
## 371   371 2407    24   2 Ghirardelli Dark w Nuts   1.1      0
## 372   372 2407    24   3 Ghirardelli        Dark   1.4      0
## 373   373 2407    25   1      Godiva        Milk   0.9      0
## 374   374 2407    25   2       Lindt        Dark   2.2      0
## 375   375 2407    25   3 Ghirardelli Dark w Nuts   1.0      1
## 376   376 2408     1   1 Ghirardelli       White   3.8      1
## 377   377 2408     1   2        Dove       White   2.0      0
## 378   378 2408     1   3        Dove Dark w Nuts   2.2      0
## 379   379 2408     2   1 Ghirardelli Milk w Nuts   0.8      0
## 380   380 2408     2   2      Godiva Milk w Nuts   2.7      0
## 381   381 2408     2   3        Dove        Milk   0.9      1
## 382   382 2408     3   1        Dove Milk w Nuts   2.6      0
## 383   383 2408     3   2    Hersheys        Milk   1.5      1
## 384   384 2408     3   3       Lindt       White   3.4      0
## 385   385 2408     4   1 Ghirardelli        Dark   2.9      1
## 386   386 2408     4   2       Lindt Milk w Nuts   0.5      0
## 387   387 2408     4   3      Godiva Milk w Nuts   1.5      0
## 388   388 2408     5   1        Dove        Milk   3.9      0
## 389   389 2408     5   2 Ghirardelli Dark w Nuts   1.5      0
## 390   390 2408     5   3      Godiva        Milk   1.1      1
## 391   391 2408     6   1      Godiva Milk w Nuts   1.5      0
## 392   392 2408     6   2 Ghirardelli        Milk   1.4      1
## 393   393 2408     6   3    Hersheys       White   2.5      0
## 394   394 2408     7   1      Godiva Milk w Nuts   2.6      1
## 395   395 2408     7   2    Hersheys       White   3.4      0
## 396   396 2408     7   3 Ghirardelli Dark w Nuts   1.4      0
## 397   397 2408     8   1      Godiva       White   0.8      0
## 398   398 2408     8   2 Ghirardelli Milk w Nuts   1.1      0
## 399   399 2408     8   3      Godiva        Dark   0.5      1
## 400   400 2408     9   1    Hersheys Dark w Nuts   0.6      0
## 401   401 2408     9   2      Godiva        Milk   2.2      1
## 402   402 2408     9   3        Dove Dark w Nuts   1.1      0
## 403   403 2408    10   1 Ghirardelli Dark w Nuts   3.2      0
## 404   404 2408    10   2      Godiva        Milk   2.4      1
## 405   405 2408    10   3        Dove       White   2.9      0
## 406   406 2408    11   1      Godiva        Dark   4.0      0
## 407   407 2408    11   2    Hersheys Milk w Nuts   3.5      0
## 408   408 2408    11   3        Dove        Dark   2.5      1
## 409   409 2408    12   1       Lindt Milk w Nuts   2.0      0
## 410   410 2408    12   2      Godiva        Milk   3.0      1
## 411   411 2408    12   3       Lindt Dark w Nuts   1.0      0
## 412   412 2408    13   1       Lindt Milk w Nuts   3.2      1
## 413   413 2408    13   2       Lindt Dark w Nuts   1.1      0
## 414   414 2408    13   3      Godiva Milk w Nuts   1.0      0
## 415   415 2408    14   1      Godiva        Milk   1.3      1
## 416   416 2408    14   2      Godiva Milk w Nuts   2.0      0
## 417   417 2408    14   3        Dove Dark w Nuts   1.3      0
## 418   418 2408    15   1    Hersheys       White   3.1      0
## 419   419 2408    15   2 Ghirardelli Milk w Nuts   3.7      0
## 420   420 2408    15   3       Lindt        Milk   3.6      1
## 421   421 2408    16   1       Lindt Dark w Nuts   1.0      0
## 422   422 2408    16   2    Hersheys       White   4.0      0
## 423   423 2408    16   3       Lindt        Dark   0.5      1
## 424   424 2408    17   1      Godiva       White   2.5      0
## 425   425 2408    17   2        Dove        Dark   3.5      0
## 426   426 2408    17   3 Ghirardelli        Milk   2.3      1
## 427   427 2408    18   1      Godiva       White   1.0      1
## 428   428 2408    18   2       Lindt Dark w Nuts   3.3      0
## 429   429 2408    18   3 Ghirardelli Dark w Nuts   2.4      0
## 430   430 2408    19   1 Ghirardelli Milk w Nuts   0.8      1
## 431   431 2408    19   2    Hersheys Dark w Nuts   1.6      0
## 432   432 2408    19   3      Godiva Dark w Nuts   1.1      0
## 433   433 2408    20   1        Dove Milk w Nuts   3.2      0
## 434   434 2408    20   2       Lindt Dark w Nuts   2.2      0
## 435   435 2408    20   3    Hersheys        Dark   3.0      1
## 436   436 2408    21   1        Dove Dark w Nuts   1.3      0
## 437   437 2408    21   2      Godiva        Dark   1.7      1
## 438   438 2408    21   3        Dove       White   2.4      0
## 439   439 2408    22   1        Dove        Milk   3.5      1
## 440   440 2408    22   2 Ghirardelli        Milk   2.3      0
## 441   441 2408    22   3 Ghirardelli Dark w Nuts   3.5      0
## 442   442 2408    23   1      Godiva       White   0.9      0
## 443   443 2408    23   2        Dove        Dark   3.0      0
## 444   444 2408    23   3 Ghirardelli        Dark   0.6      1
## 445   445 2408    24   1       Lindt        Dark   1.2      0
## 446   446 2408    24   2      Godiva        Milk   1.1      1
## 447   447 2408    24   3        Dove Dark w Nuts   1.4      0
## 448   448 2408    25   1       Lindt Milk w Nuts   3.8      0
## 449   449 2408    25   2      Godiva Milk w Nuts   0.9      0
## 450   450 2408    25   3 Ghirardelli       White   0.7      1
## 451   451 2409     1   1        Dove        Milk   0.6      0
## 452   452 2409     1   2      Godiva        Dark   0.7      1
## 453   453 2409     1   3        Dove       White   3.6      0
## 454   454 2409     2   1      Godiva Milk w Nuts   2.7      0
## 455   455 2409     2   2      Godiva        Dark   3.9      1
## 456   456 2409     2   3    Hersheys Milk w Nuts   0.7      0
## 457   457 2409     3   1    Hersheys Dark w Nuts   1.7      0
## 458   458 2409     3   2      Godiva        Dark   3.7      1
## 459   459 2409     3   3    Hersheys        Dark   3.0      0
## 460   460 2409     4   1       Lindt        Milk   1.0      1
## 461   461 2409     4   2       Lindt Milk w Nuts   3.6      0
## 462   462 2409     4   3 Ghirardelli Dark w Nuts   0.5      0
## 463   463 2409     5   1    Hersheys Milk w Nuts   0.8      0
## 464   464 2409     5   2      Godiva        Dark   1.5      1
## 465   465 2409     5   3    Hersheys       White   3.3      0
## 466   466 2409     6   1       Lindt        Milk   3.1      0
## 467   467 2409     6   2        Dove       White   2.5      0
## 468   468 2409     6   3      Godiva        Dark   2.6      1
## 469   469 2409     7   1      Godiva       White   3.1      1
## 470   470 2409     7   2        Dove Dark w Nuts   4.0      0
## 471   471 2409     7   3      Godiva        Milk   2.1      0
## 472   472 2409     8   1    Hersheys Dark w Nuts   0.8      0
## 473   473 2409     8   2      Godiva       White   3.2      0
## 474   474 2409     8   3      Godiva        Dark   1.1      1
## 475   475 2409     9   1       Lindt        Dark   2.3      0
## 476   476 2409     9   2      Godiva        Dark   1.7      1
## 477   477 2409     9   3      Godiva       White   3.8      0
## 478   478 2409    10   1       Lindt Milk w Nuts   0.6      0
## 479   479 2409    10   2      Godiva Milk w Nuts   0.8      0
## 480   480 2409    10   3    Hersheys        Dark   3.7      1
## 481   481 2409    11   1      Godiva        Milk   1.6      1
## 482   482 2409    11   2        Dove       White   0.7      0
## 483   483 2409    11   3    Hersheys Dark w Nuts   1.2      0
## 484   484 2409    12   1      Godiva Dark w Nuts   1.1      0
## 485   485 2409    12   2        Dove Dark w Nuts   0.8      0
## 486   486 2409    12   3       Lindt        Dark   3.7      1
## 487   487 2409    13   1        Dove        Milk   3.0      0
## 488   488 2409    13   2       Lindt       White   0.8      0
## 489   489 2409    13   3      Godiva       White   1.9      1
## 490   490 2409    14   1       Lindt Dark w Nuts   0.6      0
## 491   491 2409    14   2        Dove        Milk   3.5      1
## 492   492 2409    14   3        Dove Milk w Nuts   1.9      0
## 493   493 2409    15   1      Godiva        Dark   3.7      0
## 494   494 2409    15   2 Ghirardelli        Dark   1.5      1
## 495   495 2409    15   3        Dove        Dark   1.6      0
## 496   496 2409    16   1    Hersheys Milk w Nuts   0.5      0
## 497   497 2409    16   2        Dove        Milk   3.8      1
## 498   498 2409    16   3        Dove Dark w Nuts   3.7      0
## 499   499 2409    17   1        Dove        Milk   3.9      1
## 500   500 2409    17   2        Dove Milk w Nuts   1.2      0
## 501   501 2409    17   3       Lindt Milk w Nuts   0.5      0
## 502   502 2409    18   1      Godiva Milk w Nuts   2.8      0
## 503   503 2409    18   2       Lindt        Milk   2.7      0
## 504   504 2409    18   3      Godiva       White   2.6      1
## 505   505 2409    19   1    Hersheys        Milk   3.7      0
## 506   506 2409    19   2        Dove Dark w Nuts   4.0      0
## 507   507 2409    19   3        Dove        Dark   2.8      1
## 508   508 2409    20   1        Dove        Dark   0.7      1
## 509   509 2409    20   2      Godiva       White   0.8      0
## 510   510 2409    20   3    Hersheys        Dark   1.9      0
## 511   511 2409    21   1 Ghirardelli Milk w Nuts   0.8      0
## 512   512 2409    21   2    Hersheys        Milk   3.0      1
## 513   513 2409    21   3      Godiva Milk w Nuts   2.4      0
## 514   514 2409    22   1      Godiva        Dark   0.9      1
## 515   515 2409    22   2        Dove Milk w Nuts   3.4      0
## 516   516 2409    22   3    Hersheys Dark w Nuts   3.4      0
## 517   517 2409    23   1      Godiva Dark w Nuts   0.6      0
## 518   518 2409    23   2        Dove       White   1.8      0
## 519   519 2409    23   3        Dove        Dark   3.4      1
## 520   520 2409    24   1    Hersheys Dark w Nuts   3.6      0
## 521   521 2409    24   2      Godiva Milk w Nuts   3.2      0
## 522   522 2409    24   3 Ghirardelli Milk w Nuts   1.4      1
## 523   523 2409    25   1       Lindt       White   1.1      0
## 524   524 2409    25   2 Ghirardelli       White   0.8      1
## 525   525 2409    25   3       Lindt        Milk   2.0      0
## 526   526 2410     1   1        Dove       White   1.4      0
## 527   527 2410     1   2        Dove        Milk   1.0      1
## 528   528 2410     1   3       Lindt Milk w Nuts   2.0      0
## 529   529 2410     2   1      Godiva        Milk   3.5      1
## 530   530 2410     2   2 Ghirardelli        Milk   2.2      0
## 531   531 2410     2   3      Godiva        Dark   2.2      0
## 532   532 2410     3   1 Ghirardelli Dark w Nuts   3.9      0
## 533   533 2410     3   2    Hersheys        Milk   1.2      1
## 534   534 2410     3   3      Godiva Dark w Nuts   2.2      0
## 535   535 2410     4   1      Godiva        Milk   1.3      1
## 536   536 2410     4   2       Lindt Dark w Nuts   0.7      0
## 537   537 2410     4   3    Hersheys        Dark   3.3      0
## 538   538 2410     5   1      Godiva        Dark   2.8      0
## 539   539 2410     5   2        Dove Dark w Nuts   1.0      0
## 540   540 2410     5   3 Ghirardelli        Milk   3.5      1
## 541   541 2410     6   1       Lindt Milk w Nuts   1.3      0
## 542   542 2410     6   2      Godiva       White   2.5      1
## 543   543 2410     6   3        Dove       White   0.8      0
## 544   544 2410     7   1        Dove        Dark   1.4      1
## 545   545 2410     7   2       Lindt        Dark   2.1      0
## 546   546 2410     7   3      Godiva        Dark   3.1      0
## 547   547 2410     8   1        Dove       White   2.9      1
## 548   548 2410     8   2       Lindt        Dark   3.0      0
## 549   549 2410     8   3      Godiva Milk w Nuts   2.2      0
## 550   550 2410     9   1      Godiva Dark w Nuts   1.2      0
## 551   551 2410     9   2       Lindt Dark w Nuts   2.5      0
## 552   552 2410     9   3        Dove Milk w Nuts   1.4      1
## 553   553 2410    10   1        Dove Dark w Nuts   2.5      0
## 554   554 2410    10   2      Godiva Dark w Nuts   0.9      1
## 555   555 2410    10   3       Lindt Dark w Nuts   3.2      0
## 556   556 2410    11   1      Godiva Milk w Nuts   3.7      0
## 557   557 2410    11   2      Godiva        Dark   1.4      0
## 558   558 2410    11   3        Dove        Milk   1.7      1
## 559   559 2410    12   1 Ghirardelli       White   3.7      0
## 560   560 2410    12   2 Ghirardelli        Milk   3.3      1
## 561   561 2410    12   3        Dove        Dark   2.3      0
## 562   562 2410    13   1        Dove        Dark   1.0      1
## 563   563 2410    13   2       Lindt        Dark   3.8      0
## 564   564 2410    13   3 Ghirardelli Dark w Nuts   3.5      0
## 565   565 2410    14   1       Lindt Milk w Nuts   2.8      0
## 566   566 2410    14   2    Hersheys Dark w Nuts   2.8      0
## 567   567 2410    14   3    Hersheys        Milk   2.6      1
## 568   568 2410    15   1 Ghirardelli Milk w Nuts   3.0      1
## 569   569 2410    15   2        Dove        Dark   2.7      0
## 570   570 2410    15   3 Ghirardelli        Dark   3.0      0
## 571   571 2410    16   1        Dove        Milk   3.0      1
## 572   572 2410    16   2        Dove       White   2.5      0
## 573   573 2410    16   3      Godiva        Milk   3.9      0
## 574   574 2410    17   1       Lindt        Dark   0.5      0
## 575   575 2410    17   2 Ghirardelli       White   0.6      1
## 576   576 2410    17   3      Godiva        Dark   3.4      0
## 577   577 2410    18   1        Dove Milk w Nuts   2.2      1
## 578   578 2410    18   2        Dove        Dark   3.6      0
## 579   579 2410    18   3    Hersheys       White   3.8      0
## 580   580 2410    19   1        Dove Dark w Nuts   2.2      0
## 581   581 2410    19   2    Hersheys Milk w Nuts   4.0      1
## 582   582 2410    19   3 Ghirardelli        Dark   2.9      0
## 583   583 2410    20   1      Godiva        Milk   3.2      1
## 584   584 2410    20   2       Lindt        Dark   0.6      0
## 585   585 2410    20   3    Hersheys Dark w Nuts   2.0      0
## 586   586 2410    21   1 Ghirardelli       White   3.4      0
## 587   587 2410    21   2       Lindt        Dark   2.5      0
## 588   588 2410    21   3      Godiva       White   2.5      1
## 589   589 2410    22   1      Godiva Dark w Nuts   3.0      0
## 590   590 2410    22   2       Lindt        Dark   1.1      1
## 591   591 2410    22   3        Dove        Milk   3.8      0
## 592   592 2410    23   1    Hersheys        Milk   0.7      1
## 593   593 2410    23   2    Hersheys       White   2.2      0
## 594   594 2410    23   3        Dove Milk w Nuts   2.7      0
## 595   595 2410    24   1        Dove Dark w Nuts   1.4      0
## 596   596 2410    24   2 Ghirardelli        Milk   3.3      0
## 597   597 2410    24   3      Godiva        Milk   2.2      1
## 598   598 2410    25   1    Hersheys Milk w Nuts   2.3      0
## 599   599 2410    25   2      Godiva Milk w Nuts   1.7      1
## 600   600 2410    25   3 Ghirardelli Milk w Nuts   2.7      0
## 601   601 2411     1   1    Hersheys        Milk   2.2      0
## 602   602 2411     1   2      Godiva Dark w Nuts   2.1      1
## 603   603 2411     1   3        Dove        Milk   3.5      0
## 604   604 2411     2   1 Ghirardelli Milk w Nuts   1.3      1
## 605   605 2411     2   2    Hersheys       White   1.7      0
## 606   606 2411     2   3    Hersheys        Milk   3.5      0
## 607   607 2411     3   1 Ghirardelli Milk w Nuts   1.6      1
## 608   608 2411     3   2        Dove Milk w Nuts   2.0      0
## 609   609 2411     3   3       Lindt Dark w Nuts   1.8      0
## 610   610 2411     4   1       Lindt Milk w Nuts   3.2      0
## 611   611 2411     4   2        Dove Dark w Nuts   2.5      0
## 612   612 2411     4   3       Lindt        Milk   0.8      1
## 613   613 2411     5   1      Godiva Dark w Nuts   1.3      1
## 614   614 2411     5   2      Godiva        Milk   1.1      0
## 615   615 2411     5   3    Hersheys Milk w Nuts   2.7      0
## 616   616 2411     6   1       Lindt        Dark   0.7      0
## 617   617 2411     6   2    Hersheys       White   0.6      0
## 618   618 2411     6   3       Lindt Milk w Nuts   3.3      1
## 619   619 2411     7   1       Lindt        Dark   0.9      0
## 620   620 2411     7   2       Lindt       White   2.9      0
## 621   621 2411     7   3 Ghirardelli        Milk   0.8      1
## 622   622 2411     8   1       Lindt Milk w Nuts   2.0      0
## 623   623 2411     8   2 Ghirardelli Dark w Nuts   1.3      1
## 624   624 2411     8   3       Lindt Dark w Nuts   1.2      0
## 625   625 2411     9   1       Lindt Dark w Nuts   3.4      1
## 626   626 2411     9   2        Dove        Dark   1.8      0
## 627   627 2411     9   3        Dove Dark w Nuts   3.1      0
## 628   628 2411    10   1       Lindt        Dark   1.1      0
## 629   629 2411    10   2    Hersheys       White   1.6      0
## 630   630 2411    10   3    Hersheys Milk w Nuts   3.8      1
## 631   631 2411    11   1    Hersheys Dark w Nuts   2.1      1
## 632   632 2411    11   2        Dove        Dark   2.9      0
## 633   633 2411    11   3      Godiva       White   1.4      0
## 634   634 2411    12   1    Hersheys       White   1.0      0
## 635   635 2411    12   2    Hersheys Milk w Nuts   0.6      1
## 636   636 2411    12   3        Dove Milk w Nuts   2.8      0
## 637   637 2411    13   1 Ghirardelli       White   0.9      0
## 638   638 2411    13   2        Dove        Dark   2.5      1
## 639   639 2411    13   3    Hersheys       White   1.9      0
## 640   640 2411    14   1    Hersheys        Milk   1.8      1
## 641   641 2411    14   2      Godiva        Dark   3.4      0
## 642   642 2411    14   3      Godiva Dark w Nuts   3.2      0
## 643   643 2411    15   1      Godiva        Milk   0.7      1
## 644   644 2411    15   2    Hersheys       White   0.6      0
## 645   645 2411    15   3    Hersheys Dark w Nuts   2.9      0
## 646   646 2411    16   1    Hersheys Milk w Nuts   2.3      0
## 647   647 2411    16   2 Ghirardelli Milk w Nuts   0.6      1
## 648   648 2411    16   3    Hersheys       White   0.8      0
## 649   649 2411    17   1        Dove        Dark   4.0      0
## 650   650 2411    17   2 Ghirardelli        Milk   2.7      1
## 651   651 2411    17   3        Dove       White   1.3      0
## 652   652 2411    18   1        Dove Milk w Nuts   2.1      0
## 653   653 2411    18   2 Ghirardelli       White   1.1      0
## 654   654 2411    18   3 Ghirardelli        Milk   2.5      1
## 655   655 2411    19   1    Hersheys Dark w Nuts   1.2      1
## 656   656 2411    19   2        Dove        Milk   2.9      0
## 657   657 2411    19   3 Ghirardelli       White   1.5      0
## 658   658 2411    20   1      Godiva Milk w Nuts   1.8      1
## 659   659 2411    20   2    Hersheys        Dark   3.2      0
## 660   660 2411    20   3       Lindt        Dark   0.9      0
## 661   661 2411    21   1 Ghirardelli       White   1.5      0
## 662   662 2411    21   2      Godiva Milk w Nuts   2.1      1
## 663   663 2411    21   3       Lindt        Dark   0.6      0
## 664   664 2411    22   1      Godiva Dark w Nuts   2.8      1
## 665   665 2411    22   2      Godiva Milk w Nuts   3.7      0
## 666   666 2411    22   3 Ghirardelli       White   2.2      0
## 667   667 2411    23   1      Godiva Milk w Nuts   3.2      1
## 668   668 2411    23   2    Hersheys Dark w Nuts   4.0      0
## 669   669 2411    23   3 Ghirardelli       White   2.4      0
## 670   670 2411    24   1      Godiva       White   0.9      0
## 671   671 2411    24   2      Godiva Dark w Nuts   3.8      0
## 672   672 2411    24   3 Ghirardelli Milk w Nuts   1.8      1
## 673   673 2411    25   1      Godiva Milk w Nuts   2.3      0
## 674   674 2411    25   2       Lindt Milk w Nuts   1.3      1
## 675   675 2411    25   3        Dove        Milk   2.5      0
## 676   676 2412     1   1    Hersheys       White   1.8      0
## 677   677 2412     1   2    Hersheys Milk w Nuts   2.6      0
## 678   678 2412     1   3       Lindt Milk w Nuts   0.5      1
## 679   679 2412     2   1    Hersheys Milk w Nuts   1.9      0
## 680   680 2412     2   2      Godiva Milk w Nuts   3.4      0
## 681   681 2412     2   3       Lindt        Dark   2.6      1
## 682   682 2412     3   1 Ghirardelli       White   2.7      0
## 683   683 2412     3   2       Lindt        Milk   1.0      0
## 684   684 2412     3   3      Godiva Dark w Nuts   1.7      1
## 685   685 2412     4   1    Hersheys        Milk   0.9      0
## 686   686 2412     4   2    Hersheys        Dark   0.9      1
## 687   687 2412     4   3        Dove       White   0.8      0
## 688   688 2412     5   1       Lindt        Dark   3.3      0
## 689   689 2412     5   2 Ghirardelli Dark w Nuts   3.5      1
## 690   690 2412     5   3      Godiva Dark w Nuts   1.3      0
## 691   691 2412     6   1        Dove Dark w Nuts   3.5      1
## 692   692 2412     6   2    Hersheys        Dark   3.2      0
## 693   693 2412     6   3        Dove       White   3.9      0
## 694   694 2412     7   1 Ghirardelli        Milk   0.6      1
## 695   695 2412     7   2      Godiva        Milk   0.5      0
## 696   696 2412     7   3       Lindt       White   3.8      0
## 697   697 2412     8   1       Lindt        Dark   1.4      1
## 698   698 2412     8   2    Hersheys        Milk   1.2      0
## 699   699 2412     8   3        Dove        Milk   3.1      0
## 700   700 2412     9   1 Ghirardelli        Milk   1.3      0
## 701   701 2412     9   2        Dove        Milk   1.5      0
## 702   702 2412     9   3        Dove        Dark   2.7      1
## 703   703 2412    10   1 Ghirardelli       White   3.8      0
## 704   704 2412    10   2 Ghirardelli Dark w Nuts   3.4      1
## 705   705 2412    10   3    Hersheys        Dark   1.7      0
## 706   706 2412    11   1    Hersheys        Dark   0.6      0
## 707   707 2412    11   2       Lindt Dark w Nuts   2.7      1
## 708   708 2412    11   3       Lindt Milk w Nuts   0.9      0
## 709   709 2412    12   1 Ghirardelli Dark w Nuts   3.0      1
## 710   710 2412    12   2      Godiva       White   1.1      0
## 711   711 2412    12   3    Hersheys        Dark   0.7      0
## 712   712 2412    13   1       Lindt        Dark   1.5      0
## 713   713 2412    13   2    Hersheys        Dark   0.5      1
## 714   714 2412    13   3 Ghirardelli Milk w Nuts   3.1      0
## 715   715 2412    14   1    Hersheys Dark w Nuts   1.0      0
## 716   716 2412    14   2        Dove Milk w Nuts   0.8      0
## 717   717 2412    14   3       Lindt Milk w Nuts   1.0      1
## 718   718 2412    15   1       Lindt       White   2.2      0
## 719   719 2412    15   2 Ghirardelli       White   0.6      1
## 720   720 2412    15   3    Hersheys       White   3.7      0
## 721   721 2412    16   1    Hersheys        Dark   1.4      1
## 722   722 2412    16   2    Hersheys Milk w Nuts   2.4      0
## 723   723 2412    16   3      Godiva       White   3.4      0
## 724   724 2412    17   1 Ghirardelli Dark w Nuts   2.3      1
## 725   725 2412    17   2 Ghirardelli        Milk   1.6      0
## 726   726 2412    17   3      Godiva Dark w Nuts   2.6      0
## 727   727 2412    18   1        Dove Dark w Nuts   1.3      1
## 728   728 2412    18   2    Hersheys       White   1.5      0
## 729   729 2412    18   3        Dove        Dark   3.0      0
## 730   730 2412    19   1    Hersheys        Milk   1.0      0
## 731   731 2412    19   2    Hersheys        Dark   2.5      0
## 732   732 2412    19   3        Dove        Dark   0.5      1
## 733   733 2412    20   1 Ghirardelli        Milk   1.0      0
## 734   734 2412    20   2 Ghirardelli Milk w Nuts   1.0      1
## 735   735 2412    20   3    Hersheys Milk w Nuts   3.5      0
## 736   736 2412    21   1        Dove       White   2.4      0
## 737   737 2412    21   2    Hersheys       White   2.4      0
## 738   738 2412    21   3       Lindt Dark w Nuts   1.2      1
## 739   739 2412    22   1        Dove Dark w Nuts   0.7      1
## 740   740 2412    22   2       Lindt Milk w Nuts   3.2      0
## 741   741 2412    22   3      Godiva Milk w Nuts   2.9      0
## 742   742 2412    23   1 Ghirardelli        Dark   3.5      1
## 743   743 2412    23   2        Dove        Dark   2.8      0
## 744   744 2412    23   3      Godiva       White   2.3      0
## 745   745 2412    24   1 Ghirardelli       White   1.4      0
## 746   746 2412    24   2       Lindt Milk w Nuts   1.7      1
## 747   747 2412    24   3       Lindt        Milk   3.9      0
## 748   748 2412    25   1        Dove        Dark   3.6      0
## 749   749 2412    25   2 Ghirardelli        Dark   3.0      1
## 750   750 2412    25   3    Hersheys Milk w Nuts   3.1      0
## 751   751 2413     1   1       Lindt Dark w Nuts   3.9      1
## 752   752 2413     1   2 Ghirardelli Dark w Nuts   2.6      0
## 753   753 2413     1   3      Godiva Dark w Nuts   2.7      0
## 754   754 2413     2   1       Lindt Milk w Nuts   0.9      1
## 755   755 2413     2   2    Hersheys Dark w Nuts   3.3      0
## 756   756 2413     2   3    Hersheys Milk w Nuts   4.0      0
## 757   757 2413     3   1    Hersheys        Milk   3.6      0
## 758   758 2413     3   2        Dove        Milk   1.6      0
## 759   759 2413     3   3 Ghirardelli Milk w Nuts   1.7      1
## 760   760 2413     4   1      Godiva Milk w Nuts   1.4      1
## 761   761 2413     4   2 Ghirardelli       White   2.4      0
## 762   762 2413     4   3      Godiva       White   3.8      0
## 763   763 2413     5   1        Dove Milk w Nuts   3.0      1
## 764   764 2413     5   2      Godiva Dark w Nuts   2.9      0
## 765   765 2413     5   3        Dove        Dark   1.6      0
## 766   766 2413     6   1       Lindt       White   2.5      1
## 767   767 2413     6   2 Ghirardelli       White   2.6      0
## 768   768 2413     6   3       Lindt Dark w Nuts   3.9      0
## 769   769 2413     7   1 Ghirardelli Dark w Nuts   0.7      1
## 770   770 2413     7   2      Godiva       White   2.9      0
## 771   771 2413     7   3        Dove        Milk   0.7      0
## 772   772 2413     8   1    Hersheys Milk w Nuts   0.6      1
## 773   773 2413     8   2 Ghirardelli Dark w Nuts   3.3      0
## 774   774 2413     8   3      Godiva       White   1.1      0
## 775   775 2413     9   1    Hersheys Milk w Nuts   2.7      0
## 776   776 2413     9   2 Ghirardelli Dark w Nuts   2.3      1
## 777   777 2413     9   3      Godiva        Dark   2.6      0
## 778   778 2413    10   1       Lindt        Dark   2.5      0
## 779   779 2413    10   2      Godiva        Dark   1.5      0
## 780   780 2413    10   3 Ghirardelli Dark w Nuts   1.4      1
## 781   781 2413    11   1 Ghirardelli       White   1.5      0
## 782   782 2413    11   2        Dove Dark w Nuts   2.0      1
## 783   783 2413    11   3 Ghirardelli        Dark   2.5      0
## 784   784 2413    12   1 Ghirardelli        Milk   1.7      0
## 785   785 2413    12   2       Lindt        Dark   2.5      0
## 786   786 2413    12   3        Dove        Milk   0.6      1
## 787   787 2413    13   1        Dove        Milk   3.3      0
## 788   788 2413    13   2    Hersheys        Dark   2.8      0
## 789   789 2413    13   3 Ghirardelli        Milk   1.8      1
## 790   790 2413    14   1       Lindt        Dark   3.5      0
## 791   791 2413    14   2 Ghirardelli       White   1.3      1
## 792   792 2413    14   3    Hersheys Milk w Nuts   0.9      0
## 793   793 2413    15   1    Hersheys        Dark   2.6      0
## 794   794 2413    15   2      Godiva        Dark   3.9      0
## 795   795 2413    15   3    Hersheys       White   2.9      1
## 796   796 2413    16   1 Ghirardelli Milk w Nuts   1.1      0
## 797   797 2413    16   2 Ghirardelli        Dark   1.9      0
## 798   798 2413    16   3      Godiva Milk w Nuts   2.1      1
## 799   799 2413    17   1 Ghirardelli       White   2.9      0
## 800   800 2413    17   2      Godiva        Milk   2.4      1
## 801   801 2413    17   3    Hersheys Milk w Nuts   3.9      0
## 802   802 2413    18   1      Godiva       White   3.4      0
## 803   803 2413    18   2 Ghirardelli        Dark   3.9      0
## 804   804 2413    18   3    Hersheys       White   1.9      1
## 805   805 2413    19   1    Hersheys Milk w Nuts   2.9      1
## 806   806 2413    19   2        Dove        Dark   3.4      0
## 807   807 2413    19   3    Hersheys        Milk   1.3      0
## 808   808 2413    20   1       Lindt Dark w Nuts   3.5      0
## 809   809 2413    20   2        Dove        Milk   3.4      1
## 810   810 2413    20   3       Lindt        Dark   0.7      0
## 811   811 2413    21   1    Hersheys        Milk   3.0      0
## 812   812 2413    21   2    Hersheys        Dark   1.8      0
## 813   813 2413    21   3 Ghirardelli        Milk   3.5      1
## 814   814 2413    22   1      Godiva Dark w Nuts   1.6      1
## 815   815 2413    22   2        Dove Dark w Nuts   1.8      0
## 816   816 2413    22   3       Lindt Dark w Nuts   3.6      0
## 817   817 2413    23   1      Godiva       White   1.5      0
## 818   818 2413    23   2    Hersheys       White   1.3      0
## 819   819 2413    23   3      Godiva Milk w Nuts   0.6      1
## 820   820 2413    24   1 Ghirardelli        Dark   2.5      0
## 821   821 2413    24   2 Ghirardelli Dark w Nuts   0.8      1
## 822   822 2413    24   3       Lindt       White   2.1      0
## 823   823 2413    25   1       Lindt       White   3.6      0
## 824   824 2413    25   2    Hersheys       White   2.5      1
## 825   825 2413    25   3 Ghirardelli Dark w Nuts   2.0      0
## 826   826 2414     1   1       Lindt        Dark   3.7      1
## 827   827 2414     1   2       Lindt       White   3.4      0
## 828   828 2414     1   3    Hersheys        Milk   2.8      0
## 829   829 2414     2   1 Ghirardelli        Milk   4.0      0
## 830   830 2414     2   2       Lindt Dark w Nuts   1.3      0
## 831   831 2414     2   3      Godiva Dark w Nuts   3.8      1
## 832   832 2414     3   1    Hersheys Milk w Nuts   3.0      0
## 833   833 2414     3   2        Dove       White   1.3      1
## 834   834 2414     3   3    Hersheys Dark w Nuts   3.6      0
## 835   835 2414     4   1 Ghirardelli Dark w Nuts   1.4      1
## 836   836 2414     4   2    Hersheys Dark w Nuts   1.4      0
## 837   837 2414     4   3       Lindt       White   2.5      0
## 838   838 2414     5   1 Ghirardelli Dark w Nuts   0.7      0
## 839   839 2414     5   2        Dove       White   1.6      0
## 840   840 2414     5   3        Dove        Dark   1.6      1
## 841   841 2414     6   1 Ghirardelli        Dark   3.7      1
## 842   842 2414     6   2      Godiva       White   3.6      0
## 843   843 2414     6   3 Ghirardelli        Dark   2.1      0
## 844   844 2414     7   1        Dove       White   3.5      0
## 845   845 2414     7   2      Godiva        Dark   3.6      1
## 846   846 2414     7   3        Dove       White   2.9      0
## 847   847 2414     8   1        Dove Milk w Nuts   1.4      1
## 848   848 2414     8   2 Ghirardelli        Milk   1.2      0
## 849   849 2414     8   3       Lindt        Milk   1.7      0
## 850   850 2414     9   1      Godiva        Milk   3.8      0
## 851   851 2414     9   2        Dove        Milk   2.0      0
## 852   852 2414     9   3       Lindt       White   1.3      1
## 853   853 2414    10   1       Lindt        Dark   2.2      1
## 854   854 2414    10   2       Lindt Milk w Nuts   2.8      0
## 855   855 2414    10   3    Hersheys Dark w Nuts   0.8      0
## 856   856 2414    11   1    Hersheys       White   1.7      0
## 857   857 2414    11   2       Lindt Milk w Nuts   1.9      1
## 858   858 2414    11   3      Godiva       White   3.4      0
## 859   859 2414    12   1        Dove        Dark   1.7      1
## 860   860 2414    12   2    Hersheys        Dark   3.1      0
## 861   861 2414    12   3       Lindt Milk w Nuts   3.1      0
## 862   862 2414    13   1       Lindt Dark w Nuts   1.9      1
## 863   863 2414    13   2        Dove       White   0.6      0
## 864   864 2414    13   3       Lindt Milk w Nuts   0.5      0
## 865   865 2414    14   1 Ghirardelli       White   2.9      0
## 866   866 2414    14   2 Ghirardelli Milk w Nuts   3.4      0
## 867   867 2414    14   3 Ghirardelli Dark w Nuts   3.4      1
## 868   868 2414    15   1       Lindt Dark w Nuts   3.0      1
## 869   869 2414    15   2    Hersheys Milk w Nuts   0.9      0
## 870   870 2414    15   3       Lindt        Milk   2.0      0
## 871   871 2414    16   1       Lindt       White   3.6      0
## 872   872 2414    16   2 Ghirardelli Dark w Nuts   3.1      1
## 873   873 2414    16   3 Ghirardelli        Milk   3.6      0
## 874   874 2414    17   1       Lindt Dark w Nuts   1.9      1
## 875   875 2414    17   2       Lindt Milk w Nuts   3.9      0
## 876   876 2414    17   3       Lindt       White   2.8      0
## 877   877 2414    18   1      Godiva        Dark   1.3      1
## 878   878 2414    18   2 Ghirardelli        Milk   3.5      0
## 879   879 2414    18   3       Lindt        Dark   0.7      0
## 880   880 2414    19   1      Godiva Dark w Nuts   1.8      1
## 881   881 2414    19   2        Dove        Dark   2.2      0
## 882   882 2414    19   3      Godiva Milk w Nuts   0.7      0
## 883   883 2414    20   1        Dove        Milk   0.6      0
## 884   884 2414    20   2       Lindt        Dark   3.3      1
## 885   885 2414    20   3    Hersheys Dark w Nuts   1.7      0
## 886   886 2414    21   1       Lindt       White   2.1      0
## 887   887 2414    21   2    Hersheys        Dark   2.6      0
## 888   888 2414    21   3      Godiva Dark w Nuts   2.8      1
## 889   889 2414    22   1       Lindt        Milk   2.6      0
## 890   890 2414    22   2       Lindt        Dark   2.0      1
## 891   891 2414    22   3 Ghirardelli Dark w Nuts   2.4      0
## 892   892 2414    23   1 Ghirardelli        Dark   2.4      0
## 893   893 2414    23   2      Godiva Milk w Nuts   3.5      1
## 894   894 2414    23   3       Lindt       White   3.9      0
## 895   895 2414    24   1 Ghirardelli Milk w Nuts   0.6      0
## 896   896 2414    24   2      Godiva        Dark   3.3      1
## 897   897 2414    24   3        Dove       White   2.6      0
## 898   898 2414    25   1       Lindt        Dark   3.3      0
## 899   899 2414    25   2    Hersheys        Dark   2.1      0
## 900   900 2414    25   3       Lindt Dark w Nuts   3.0      1
## 901   901 2415     1   1 Ghirardelli        Dark   3.0      1
## 902   902 2415     1   2       Lindt       White   2.5      0
## 903   903 2415     1   3    Hersheys Dark w Nuts   2.4      0
## 904   904 2415     2   1 Ghirardelli        Milk   2.0      1
## 905   905 2415     2   2       Lindt       White   2.9      0
## 906   906 2415     2   3      Godiva       White   1.9      0
## 907   907 2415     3   1       Lindt        Milk   2.3      0
## 908   908 2415     3   2    Hersheys        Dark   0.6      1
## 909   909 2415     3   3      Godiva       White   0.9      0
## 910   910 2415     4   1    Hersheys       White   1.3      0
## 911   911 2415     4   2        Dove        Dark   1.3      1
## 912   912 2415     4   3       Lindt Dark w Nuts   3.0      0
## 913   913 2415     5   1        Dove        Milk   3.7      1
## 914   914 2415     5   2    Hersheys Milk w Nuts   3.6      0
## 915   915 2415     5   3       Lindt       White   3.6      0
## 916   916 2415     6   1       Lindt       White   4.0      0
## 917   917 2415     6   2        Dove       White   2.5      0
## 918   918 2415     6   3       Lindt Milk w Nuts   0.8      1
## 919   919 2415     7   1      Godiva        Milk   2.5      0
## 920   920 2415     7   2        Dove Dark w Nuts   2.4      1
## 921   921 2415     7   3        Dove       White   2.3      0
## 922   922 2415     8   1    Hersheys Dark w Nuts   2.4      0
## 923   923 2415     8   2    Hersheys       White   1.8      0
## 924   924 2415     8   3      Godiva        Milk   3.7      1
## 925   925 2415     9   1        Dove        Milk   3.9      1
## 926   926 2415     9   2        Dove        Dark   1.9      0
## 927   927 2415     9   3 Ghirardelli Milk w Nuts   1.8      0
## 928   928 2415    10   1       Lindt        Milk   3.7      1
## 929   929 2415    10   2        Dove        Milk   1.1      0
## 930   930 2415    10   3    Hersheys        Milk   1.0      0
## 931   931 2415    11   1      Godiva        Dark   3.3      1
## 932   932 2415    11   2    Hersheys        Dark   3.3      0
## 933   933 2415    11   3 Ghirardelli Dark w Nuts   0.6      0
## 934   934 2415    12   1      Godiva        Milk   1.6      0
## 935   935 2415    12   2 Ghirardelli Dark w Nuts   1.1      0
## 936   936 2415    12   3       Lindt        Milk   1.3      1
## 937   937 2415    13   1       Lindt        Dark   2.0      1
## 938   938 2415    13   2 Ghirardelli       White   3.5      0
## 939   939 2415    13   3       Lindt Milk w Nuts   3.7      0
## 940   940 2415    14   1       Lindt Milk w Nuts   1.9      1
## 941   941 2415    14   2      Godiva        Dark   3.0      0
## 942   942 2415    14   3    Hersheys        Dark   0.6      0
## 943   943 2415    15   1        Dove Milk w Nuts   3.0      0
## 944   944 2415    15   2 Ghirardelli Dark w Nuts   1.2      1
## 945   945 2415    15   3      Godiva       White   1.1      0
## 946   946 2415    16   1       Lindt Milk w Nuts   3.3      1
## 947   947 2415    16   2 Ghirardelli Dark w Nuts   1.6      0
## 948   948 2415    16   3        Dove Dark w Nuts   1.4      0
## 949   949 2415    17   1       Lindt Dark w Nuts   3.3      0
## 950   950 2415    17   2       Lindt        Milk   2.8      1
## 951   951 2415    17   3      Godiva        Milk   0.9      0
## 952   952 2415    18   1       Lindt        Dark   0.8      1
## 953   953 2415    18   2    Hersheys        Milk   3.5      0
## 954   954 2415    18   3    Hersheys Dark w Nuts   2.0      0
## 955   955 2415    19   1      Godiva        Dark   3.3      1
## 956   956 2415    19   2        Dove Milk w Nuts   3.1      0
## 957   957 2415    19   3 Ghirardelli Dark w Nuts   2.9      0
## 958   958 2415    20   1       Lindt Dark w Nuts   1.2      0
## 959   959 2415    20   2       Lindt       White   1.5      0
## 960   960 2415    20   3        Dove        Dark   0.9      1
## 961   961 2415    21   1    Hersheys       White   2.2      0
## 962   962 2415    21   2       Lindt Dark w Nuts   3.3      1
## 963   963 2415    21   3    Hersheys        Milk   1.9      0
## 964   964 2415    22   1        Dove        Milk   3.4      0
## 965   965 2415    22   2 Ghirardelli        Dark   3.3      1
## 966   966 2415    22   3    Hersheys        Dark   3.8      0
## 967   967 2415    23   1 Ghirardelli Milk w Nuts   1.5      0
## 968   968 2415    23   2    Hersheys        Dark   2.8      1
## 969   969 2415    23   3    Hersheys Milk w Nuts   2.5      0
## 970   970 2415    24   1      Godiva       White   0.5      0
## 971   971 2415    24   2 Ghirardelli Dark w Nuts   1.1      0
## 972   972 2415    24   3 Ghirardelli        Dark   1.4      1
## 973   973 2415    25   1      Godiva        Milk   0.9      0
## 974   974 2415    25   2       Lindt        Dark   2.2      1
## 975   975 2415    25   3 Ghirardelli Dark w Nuts   1.0      0
## 976   976 2417     1   1        Dove        Milk   0.6      1
## 977   977 2417     1   2      Godiva        Dark   0.7      0
## 978   978 2417     1   3        Dove       White   3.6      0
## 979   979 2417     2   1      Godiva Milk w Nuts   2.7      1
## 980   980 2417     2   2      Godiva        Dark   3.9      0
## 981   981 2417     2   3    Hersheys Milk w Nuts   0.7      0
## 982   982 2417     3   1    Hersheys Dark w Nuts   1.7      1
## 983   983 2417     3   2      Godiva        Dark   3.7      0
## 984   984 2417     3   3    Hersheys        Dark   3.0      0
## 985   985 2417     4   1       Lindt        Milk   1.0      0
## 986   986 2417     4   2       Lindt Milk w Nuts   3.6      0
## 987   987 2417     4   3 Ghirardelli Dark w Nuts   0.5      1
## 988   988 2417     5   1    Hersheys Milk w Nuts   0.8      0
## 989   989 2417     5   2      Godiva        Dark   1.5      1
## 990   990 2417     5   3    Hersheys       White   3.3      0
## 991   991 2417     6   1       Lindt        Milk   3.1      0
## 992   992 2417     6   2        Dove       White   2.5      0
## 993   993 2417     6   3      Godiva        Dark   2.6      1
## 994   994 2417     7   1      Godiva       White   3.1      0
## 995   995 2417     7   2        Dove Dark w Nuts   4.0      0
## 996   996 2417     7   3      Godiva        Milk   2.1      1
## 997   997 2417     8   1    Hersheys Dark w Nuts   0.8      0
## 998   998 2417     8   2      Godiva       White   3.2      0
## 999   999 2417     8   3      Godiva        Dark   1.1      1
## 1000 1000 2417     9   1       Lindt        Dark   2.3      0
## 1001 1001 2417     9   2      Godiva        Dark   1.7      1
## 1002 1002 2417     9   3      Godiva       White   3.8      0
## 1003 1003 2417    10   1       Lindt Milk w Nuts   0.6      0
## 1004 1004 2417    10   2      Godiva Milk w Nuts   0.8      1
## 1005 1005 2417    10   3    Hersheys        Dark   3.7      0
## 1006 1006 2417    11   1      Godiva        Milk   1.6      0
## 1007 1007 2417    11   2        Dove       White   0.7      0
## 1008 1008 2417    11   3    Hersheys Dark w Nuts   1.2      1
## 1009 1009 2417    12   1      Godiva Dark w Nuts   1.1      1
## 1010 1010 2417    12   2        Dove Dark w Nuts   0.8      0
## 1011 1011 2417    12   3       Lindt        Dark   3.7      0
## 1012 1012 2417    13   1        Dove        Milk   3.0      0
## 1013 1013 2417    13   2       Lindt       White   0.8      1
## 1014 1014 2417    13   3      Godiva       White   1.9      0
## 1015 1015 2417    14   1       Lindt Dark w Nuts   0.6      1
## 1016 1016 2417    14   2        Dove        Milk   3.5      0
## 1017 1017 2417    14   3        Dove Milk w Nuts   1.9      0
## 1018 1018 2417    15   1      Godiva        Dark   3.7      0
## 1019 1019 2417    15   2 Ghirardelli        Dark   1.5      1
## 1020 1020 2417    15   3        Dove        Dark   1.6      0
## 1021 1021 2417    16   1    Hersheys Milk w Nuts   0.5      1
## 1022 1022 2417    16   2        Dove        Milk   3.8      0
## 1023 1023 2417    16   3        Dove Dark w Nuts   3.7      0
## 1024 1024 2417    17   1        Dove        Milk   3.9      0
## 1025 1025 2417    17   2        Dove Milk w Nuts   1.2      1
## 1026 1026 2417    17   3       Lindt Milk w Nuts   0.5      0
## 1027 1027 2417    18   1      Godiva Milk w Nuts   2.8      0
## 1028 1028 2417    18   2       Lindt        Milk   2.7      1
## 1029 1029 2417    18   3      Godiva       White   2.6      0
## 1030 1030 2417    19   1    Hersheys        Milk   3.7      0
## 1031 1031 2417    19   2        Dove Dark w Nuts   4.0      0
## 1032 1032 2417    19   3        Dove        Dark   2.8      1
## 1033 1033 2417    20   1        Dove        Dark   0.7      1
## 1034 1034 2417    20   2      Godiva       White   0.8      0
## 1035 1035 2417    20   3    Hersheys        Dark   1.9      0
## 1036 1036 2417    21   1 Ghirardelli Milk w Nuts   0.8      1
## 1037 1037 2417    21   2    Hersheys        Milk   3.0      0
## 1038 1038 2417    21   3      Godiva Milk w Nuts   2.4      0
## 1039 1039 2417    22   1      Godiva        Dark   0.9      1
## 1040 1040 2417    22   2        Dove Milk w Nuts   3.4      0
## 1041 1041 2417    22   3    Hersheys Dark w Nuts   3.4      0
## 1042 1042 2417    23   1      Godiva Dark w Nuts   0.6      1
## 1043 1043 2417    23   2        Dove       White   1.8      0
## 1044 1044 2417    23   3        Dove        Dark   3.4      0
## 1045 1045 2417    24   1    Hersheys Dark w Nuts   3.6      0
## 1046 1046 2417    24   2      Godiva Milk w Nuts   3.2      0
## 1047 1047 2417    24   3 Ghirardelli Milk w Nuts   1.4      1
## 1048 1048 2417    25   1       Lindt       White   1.1      0
## 1049 1049 2417    25   2 Ghirardelli       White   0.8      0
## 1050 1050 2417    25   3       Lindt        Milk   2.0      1

Summary of chocolate data

summary(choc.df)
##        X               Ind           Trial         Alt   
##  Min.   :   1.0   Min.   :2401   Min.   : 1   Min.   :1  
##  1st Qu.: 263.2   1st Qu.:2405   1st Qu.: 7   1st Qu.:1  
##  Median : 525.5   Median :2410   Median :13   Median :2  
##  Mean   : 525.5   Mean   :2409   Mean   :13   Mean   :2  
##  3rd Qu.: 787.8   3rd Qu.:2413   3rd Qu.:19   3rd Qu.:3  
##  Max.   :1050.0   Max.   :2417   Max.   :25   Max.   :3  
##          Brand              Type         Price           Chosen      
##  Dove       :214   Dark       :233   Min.   :0.500   Min.   :0.0000  
##  Ghirardelli:186   Dark w Nuts:213   1st Qu.:1.300   1st Qu.:0.0000  
##  Godiva     :235   Milk       :190   Median :2.200   Median :0.0000  
##  Hersheys   :207   Milk w Nuts:205   Mean   :2.211   Mean   :0.3333  
##  Lindt      :208   White      :209   3rd Qu.:3.175   3rd Qu.:1.0000  
##                                      Max.   :4.000   Max.   :1.0000

Data inspection: Brand v. choice

mosaicplot(~ Brand + Chosen, data=choc.df)

Data inspection: Type v. choice

mosaicplot(~ Type + Chosen, data=choc.df)

Data inspection: Price v. choice

mosaicplot(~ Price + Chosen, data=choc.df)

Preparing the Chocolate CBC data for Stan

Coding discrete variables

As with the computer ratings-based conjoint data in Module 1, we have two discrete attributes that need to be coded: Brand and Type.

choc.df
##         X  Ind Trial Alt       Brand        Type Price Chosen
## 1       1 2401     1   1        Dove        Milk   0.6      1
## 2       2 2401     1   2      Godiva        Dark   0.7      0
## 3       3 2401     1   3        Dove       White   3.6      0
## 4       4 2401     2   1      Godiva Milk w Nuts   2.7      0
## 5       5 2401     2   2      Godiva        Dark   3.9      1
## 6       6 2401     2   3    Hersheys Milk w Nuts   0.7      0
## 7       7 2401     3   1    Hersheys Dark w Nuts   1.7      0
## 8       8 2401     3   2      Godiva        Dark   3.7      1
## 9       9 2401     3   3    Hersheys        Dark   3.0      0
## 10     10 2401     4   1       Lindt        Milk   1.0      1
## 11     11 2401     4   2       Lindt Milk w Nuts   3.6      0
## 12     12 2401     4   3 Ghirardelli Dark w Nuts   0.5      0
## 13     13 2401     5   1    Hersheys Milk w Nuts   0.8      0
## 14     14 2401     5   2      Godiva        Dark   1.5      1
## 15     15 2401     5   3    Hersheys       White   3.3      0
## 16     16 2401     6   1       Lindt        Milk   3.1      0
## 17     17 2401     6   2        Dove       White   2.5      0
## 18     18 2401     6   3      Godiva        Dark   2.6      1
## 19     19 2401     7   1      Godiva       White   3.1      0
## 20     20 2401     7   2        Dove Dark w Nuts   4.0      0
## 21     21 2401     7   3      Godiva        Milk   2.1      1
## 22     22 2401     8   1    Hersheys Dark w Nuts   0.8      0
## 23     23 2401     8   2      Godiva       White   3.2      0
## 24     24 2401     8   3      Godiva        Dark   1.1      1
## 25     25 2401     9   1       Lindt        Dark   2.3      0
## 26     26 2401     9   2      Godiva        Dark   1.7      1
## 27     27 2401     9   3      Godiva       White   3.8      0
## 28     28 2401    10   1       Lindt Milk w Nuts   0.6      0
## 29     29 2401    10   2      Godiva Milk w Nuts   0.8      1
## 30     30 2401    10   3    Hersheys        Dark   3.7      0
## 31     31 2401    11   1      Godiva        Milk   1.6      1
## 32     32 2401    11   2        Dove       White   0.7      0
## 33     33 2401    11   3    Hersheys Dark w Nuts   1.2      0
## 34     34 2401    12   1      Godiva Dark w Nuts   1.1      0
## 35     35 2401    12   2        Dove Dark w Nuts   0.8      0
## 36     36 2401    12   3       Lindt        Dark   3.7      1
## 37     37 2401    13   1        Dove        Milk   3.0      1
## 38     38 2401    13   2       Lindt       White   0.8      0
## 39     39 2401    13   3      Godiva       White   1.9      0
## 40     40 2401    14   1       Lindt Dark w Nuts   0.6      0
## 41     41 2401    14   2        Dove        Milk   3.5      1
## 42     42 2401    14   3        Dove Milk w Nuts   1.9      0
## 43     43 2401    15   1      Godiva        Dark   3.7      1
## 44     44 2401    15   2 Ghirardelli        Dark   1.5      0
## 45     45 2401    15   3        Dove        Dark   1.6      0
## 46     46 2401    16   1    Hersheys Milk w Nuts   0.5      0
## 47     47 2401    16   2        Dove        Milk   3.8      1
## 48     48 2401    16   3        Dove Dark w Nuts   3.7      0
## 49     49 2401    17   1        Dove        Milk   3.9      1
## 50     50 2401    17   2        Dove Milk w Nuts   1.2      0
## 51     51 2401    17   3       Lindt Milk w Nuts   0.5      0
## 52     52 2401    18   1      Godiva Milk w Nuts   2.8      1
## 53     53 2401    18   2       Lindt        Milk   2.7      0
## 54     54 2401    18   3      Godiva       White   2.6      0
## 55     55 2401    19   1    Hersheys        Milk   3.7      1
## 56     56 2401    19   2        Dove Dark w Nuts   4.0      0
## 57     57 2401    19   3        Dove        Dark   2.8      0
## 58     58 2401    20   1        Dove        Dark   0.7      0
## 59     59 2401    20   2      Godiva       White   0.8      0
## 60     60 2401    20   3    Hersheys        Dark   1.9      1
## 61     61 2401    21   1 Ghirardelli Milk w Nuts   0.8      0
## 62     62 2401    21   2    Hersheys        Milk   3.0      1
## 63     63 2401    21   3      Godiva Milk w Nuts   2.4      0
## 64     64 2401    22   1      Godiva        Dark   0.9      1
## 65     65 2401    22   2        Dove Milk w Nuts   3.4      0
## 66     66 2401    22   3    Hersheys Dark w Nuts   3.4      0
## 67     67 2401    23   1      Godiva Dark w Nuts   0.6      1
## 68     68 2401    23   2        Dove       White   1.8      0
## 69     69 2401    23   3        Dove        Dark   3.4      0
## 70     70 2401    24   1    Hersheys Dark w Nuts   3.6      0
## 71     71 2401    24   2      Godiva Milk w Nuts   3.2      1
## 72     72 2401    24   3 Ghirardelli Milk w Nuts   1.4      0
## 73     73 2401    25   1       Lindt       White   1.1      0
## 74     74 2401    25   2 Ghirardelli       White   0.8      0
## 75     75 2401    25   3       Lindt        Milk   2.0      1
## 76     76 2402     1   1    Hersheys        Milk   2.2      0
## 77     77 2402     1   2      Godiva Dark w Nuts   2.1      1
## 78     78 2402     1   3        Dove        Milk   3.5      0
## 79     79 2402     2   1 Ghirardelli Milk w Nuts   1.3      0
## 80     80 2402     2   2    Hersheys       White   1.7      0
## 81     81 2402     2   3    Hersheys        Milk   3.5      1
## 82     82 2402     3   1 Ghirardelli Milk w Nuts   1.6      0
## 83     83 2402     3   2        Dove Milk w Nuts   2.0      0
## 84     84 2402     3   3       Lindt Dark w Nuts   1.8      1
## 85     85 2402     4   1       Lindt Milk w Nuts   3.2      0
## 86     86 2402     4   2        Dove Dark w Nuts   2.5      1
## 87     87 2402     4   3       Lindt        Milk   0.8      0
## 88     88 2402     5   1      Godiva Dark w Nuts   1.3      1
## 89     89 2402     5   2      Godiva        Milk   1.1      0
## 90     90 2402     5   3    Hersheys Milk w Nuts   2.7      0
## 91     91 2402     6   1       Lindt        Dark   0.7      1
## 92     92 2402     6   2    Hersheys       White   0.6      0
## 93     93 2402     6   3       Lindt Milk w Nuts   3.3      0
## 94     94 2402     7   1       Lindt        Dark   0.9      1
## 95     95 2402     7   2       Lindt       White   2.9      0
## 96     96 2402     7   3 Ghirardelli        Milk   0.8      0
## 97     97 2402     8   1       Lindt Milk w Nuts   2.0      0
## 98     98 2402     8   2 Ghirardelli Dark w Nuts   1.3      1
## 99     99 2402     8   3       Lindt Dark w Nuts   1.2      0
## 100   100 2402     9   1       Lindt Dark w Nuts   3.4      1
## 101   101 2402     9   2        Dove        Dark   1.8      0
## 102   102 2402     9   3        Dove Dark w Nuts   3.1      0
## 103   103 2402    10   1       Lindt        Dark   1.1      1
## 104   104 2402    10   2    Hersheys       White   1.6      0
## 105   105 2402    10   3    Hersheys Milk w Nuts   3.8      0
## 106   106 2402    11   1    Hersheys Dark w Nuts   2.1      0
## 107   107 2402    11   2        Dove        Dark   2.9      1
## 108   108 2402    11   3      Godiva       White   1.4      0
## 109   109 2402    12   1    Hersheys       White   1.0      0
## 110   110 2402    12   2    Hersheys Milk w Nuts   0.6      0
## 111   111 2402    12   3        Dove Milk w Nuts   2.8      1
## 112   112 2402    13   1 Ghirardelli       White   0.9      0
## 113   113 2402    13   2        Dove        Dark   2.5      1
## 114   114 2402    13   3    Hersheys       White   1.9      0
## 115   115 2402    14   1    Hersheys        Milk   1.8      0
## 116   116 2402    14   2      Godiva        Dark   3.4      1
## 117   117 2402    14   3      Godiva Dark w Nuts   3.2      0
## 118   118 2402    15   1      Godiva        Milk   0.7      1
## 119   119 2402    15   2    Hersheys       White   0.6      0
## 120   120 2402    15   3    Hersheys Dark w Nuts   2.9      0
## 121   121 2402    16   1    Hersheys Milk w Nuts   2.3      0
## 122   122 2402    16   2 Ghirardelli Milk w Nuts   0.6      1
## 123   123 2402    16   3    Hersheys       White   0.8      0
## 124   124 2402    17   1        Dove        Dark   4.0      1
## 125   125 2402    17   2 Ghirardelli        Milk   2.7      0
## 126   126 2402    17   3        Dove       White   1.3      0
## 127   127 2402    18   1        Dove Milk w Nuts   2.1      0
## 128   128 2402    18   2 Ghirardelli       White   1.1      0
## 129   129 2402    18   3 Ghirardelli        Milk   2.5      1
## 130   130 2402    19   1    Hersheys Dark w Nuts   1.2      0
## 131   131 2402    19   2        Dove        Milk   2.9      1
## 132   132 2402    19   3 Ghirardelli       White   1.5      0
## 133   133 2402    20   1      Godiva Milk w Nuts   1.8      0
## 134   134 2402    20   2    Hersheys        Dark   3.2      0
## 135   135 2402    20   3       Lindt        Dark   0.9      1
## 136   136 2402    21   1 Ghirardelli       White   1.5      0
## 137   137 2402    21   2      Godiva Milk w Nuts   2.1      0
## 138   138 2402    21   3       Lindt        Dark   0.6      1
## 139   139 2402    22   1      Godiva Dark w Nuts   2.8      1
## 140   140 2402    22   2      Godiva Milk w Nuts   3.7      0
## 141   141 2402    22   3 Ghirardelli       White   2.2      0
## 142   142 2402    23   1      Godiva Milk w Nuts   3.2      1
## 143   143 2402    23   2    Hersheys Dark w Nuts   4.0      0
## 144   144 2402    23   3 Ghirardelli       White   2.4      0
## 145   145 2402    24   1      Godiva       White   0.9      0
## 146   146 2402    24   2      Godiva Dark w Nuts   3.8      1
## 147   147 2402    24   3 Ghirardelli Milk w Nuts   1.8      0
## 148   148 2402    25   1      Godiva Milk w Nuts   2.3      1
## 149   149 2402    25   2       Lindt Milk w Nuts   1.3      0
## 150   150 2402    25   3        Dove        Milk   2.5      0
## 151   151 2403     1   1        Dove       White   1.4      0
## 152   152 2403     1   2        Dove        Milk   1.0      1
## 153   153 2403     1   3       Lindt Milk w Nuts   2.0      0
## 154   154 2403     2   1      Godiva        Milk   3.5      0
## 155   155 2403     2   2 Ghirardelli        Milk   2.2      1
## 156   156 2403     2   3      Godiva        Dark   2.2      0
## 157   157 2403     3   1 Ghirardelli Dark w Nuts   3.9      0
## 158   158 2403     3   2    Hersheys        Milk   1.2      1
## 159   159 2403     3   3      Godiva Dark w Nuts   2.2      0
## 160   160 2403     4   1      Godiva        Milk   1.3      1
## 161   161 2403     4   2       Lindt Dark w Nuts   0.7      0
## 162   162 2403     4   3    Hersheys        Dark   3.3      0
## 163   163 2403     5   1      Godiva        Dark   2.8      0
## 164   164 2403     5   2        Dove Dark w Nuts   1.0      1
## 165   165 2403     5   3 Ghirardelli        Milk   3.5      0
## 166   166 2403     6   1       Lindt Milk w Nuts   1.3      0
## 167   167 2403     6   2      Godiva       White   2.5      0
## 168   168 2403     6   3        Dove       White   0.8      1
## 169   169 2403     7   1        Dove        Dark   1.4      1
## 170   170 2403     7   2       Lindt        Dark   2.1      0
## 171   171 2403     7   3      Godiva        Dark   3.1      0
## 172   172 2403     8   1        Dove       White   2.9      0
## 173   173 2403     8   2       Lindt        Dark   3.0      0
## 174   174 2403     8   3      Godiva Milk w Nuts   2.2      1
## 175   175 2403     9   1      Godiva Dark w Nuts   1.2      1
## 176   176 2403     9   2       Lindt Dark w Nuts   2.5      0
## 177   177 2403     9   3        Dove Milk w Nuts   1.4      0
## 178   178 2403    10   1        Dove Dark w Nuts   2.5      0
## 179   179 2403    10   2      Godiva Dark w Nuts   0.9      1
## 180   180 2403    10   3       Lindt Dark w Nuts   3.2      0
## 181   181 2403    11   1      Godiva Milk w Nuts   3.7      0
## 182   182 2403    11   2      Godiva        Dark   1.4      0
## 183   183 2403    11   3        Dove        Milk   1.7      1
## 184   184 2403    12   1 Ghirardelli       White   3.7      0
## 185   185 2403    12   2 Ghirardelli        Milk   3.3      1
## 186   186 2403    12   3        Dove        Dark   2.3      0
## 187   187 2403    13   1        Dove        Dark   1.0      1
## 188   188 2403    13   2       Lindt        Dark   3.8      0
## 189   189 2403    13   3 Ghirardelli Dark w Nuts   3.5      0
## 190   190 2403    14   1       Lindt Milk w Nuts   2.8      0
## 191   191 2403    14   2    Hersheys Dark w Nuts   2.8      0
## 192   192 2403    14   3    Hersheys        Milk   2.6      1
## 193   193 2403    15   1 Ghirardelli Milk w Nuts   3.0      0
## 194   194 2403    15   2        Dove        Dark   2.7      1
## 195   195 2403    15   3 Ghirardelli        Dark   3.0      0
## 196   196 2403    16   1        Dove        Milk   3.0      0
## 197   197 2403    16   2        Dove       White   2.5      1
## 198   198 2403    16   3      Godiva        Milk   3.9      0
## 199   199 2403    17   1       Lindt        Dark   0.5      1
## 200   200 2403    17   2 Ghirardelli       White   0.6      0
## 201   201 2403    17   3      Godiva        Dark   3.4      0
## 202   202 2403    18   1        Dove Milk w Nuts   2.2      1
## 203   203 2403    18   2        Dove        Dark   3.6      0
## 204   204 2403    18   3    Hersheys       White   3.8      0
## 205   205 2403    19   1        Dove Dark w Nuts   2.2      1
## 206   206 2403    19   2    Hersheys Milk w Nuts   4.0      0
## 207   207 2403    19   3 Ghirardelli        Dark   2.9      0
## 208   208 2403    20   1      Godiva        Milk   3.2      0
## 209   209 2403    20   2       Lindt        Dark   0.6      1
## 210   210 2403    20   3    Hersheys Dark w Nuts   2.0      0
## 211   211 2403    21   1 Ghirardelli       White   3.4      0
## 212   212 2403    21   2       Lindt        Dark   2.5      0
## 213   213 2403    21   3      Godiva       White   2.5      1
## 214   214 2403    22   1      Godiva Dark w Nuts   3.0      0
## 215   215 2403    22   2       Lindt        Dark   1.1      1
## 216   216 2403    22   3        Dove        Milk   3.8      0
## 217   217 2403    23   1    Hersheys        Milk   0.7      1
## 218   218 2403    23   2    Hersheys       White   2.2      0
## 219   219 2403    23   3        Dove Milk w Nuts   2.7      0
## 220   220 2403    24   1        Dove Dark w Nuts   1.4      1
## 221   221 2403    24   2 Ghirardelli        Milk   3.3      0
## 222   222 2403    24   3      Godiva        Milk   2.2      0
## 223   223 2403    25   1    Hersheys Milk w Nuts   2.3      0
## 224   224 2403    25   2      Godiva Milk w Nuts   1.7      1
## 225   225 2403    25   3 Ghirardelli Milk w Nuts   2.7      0
## 226   226 2405     1   1       Lindt Dark w Nuts   3.9      0
## 227   227 2405     1   2 Ghirardelli Dark w Nuts   2.6      1
## 228   228 2405     1   3      Godiva Dark w Nuts   2.7      0
## 229   229 2405     2   1       Lindt Milk w Nuts   0.9      0
## 230   230 2405     2   2    Hersheys Dark w Nuts   3.3      0
## 231   231 2405     2   3    Hersheys Milk w Nuts   4.0      1
## 232   232 2405     3   1    Hersheys        Milk   3.6      0
## 233   233 2405     3   2        Dove        Milk   1.6      0
## 234   234 2405     3   3 Ghirardelli Milk w Nuts   1.7      1
## 235   235 2405     4   1      Godiva Milk w Nuts   1.4      1
## 236   236 2405     4   2 Ghirardelli       White   2.4      0
## 237   237 2405     4   3      Godiva       White   3.8      0
## 238   238 2405     5   1        Dove Milk w Nuts   3.0      1
## 239   239 2405     5   2      Godiva Dark w Nuts   2.9      0
## 240   240 2405     5   3        Dove        Dark   1.6      0
## 241   241 2405     6   1       Lindt       White   2.5      0
## 242   242 2405     6   2 Ghirardelli       White   2.6      0
## 243   243 2405     6   3       Lindt Dark w Nuts   3.9      1
## 244   244 2405     7   1 Ghirardelli Dark w Nuts   0.7      1
## 245   245 2405     7   2      Godiva       White   2.9      0
## 246   246 2405     7   3        Dove        Milk   0.7      0
## 247   247 2405     8   1    Hersheys Milk w Nuts   0.6      1
## 248   248 2405     8   2 Ghirardelli Dark w Nuts   3.3      0
## 249   249 2405     8   3      Godiva       White   1.1      0
## 250   250 2405     9   1    Hersheys Milk w Nuts   2.7      1
## 251   251 2405     9   2 Ghirardelli Dark w Nuts   2.3      0
## 252   252 2405     9   3      Godiva        Dark   2.6      0
## 253   253 2405    10   1       Lindt        Dark   2.5      0
## 254   254 2405    10   2      Godiva        Dark   1.5      0
## 255   255 2405    10   3 Ghirardelli Dark w Nuts   1.4      1
## 256   256 2405    11   1 Ghirardelli       White   1.5      0
## 257   257 2405    11   2        Dove Dark w Nuts   2.0      0
## 258   258 2405    11   3 Ghirardelli        Dark   2.5      1
## 259   259 2405    12   1 Ghirardelli        Milk   1.7      1
## 260   260 2405    12   2       Lindt        Dark   2.5      0
## 261   261 2405    12   3        Dove        Milk   0.6      0
## 262   262 2405    13   1        Dove        Milk   3.3      0
## 263   263 2405    13   2    Hersheys        Dark   2.8      0
## 264   264 2405    13   3 Ghirardelli        Milk   1.8      1
## 265   265 2405    14   1       Lindt        Dark   3.5      0
## 266   266 2405    14   2 Ghirardelli       White   1.3      0
## 267   267 2405    14   3    Hersheys Milk w Nuts   0.9      1
## 268   268 2405    15   1    Hersheys        Dark   2.6      0
## 269   269 2405    15   2      Godiva        Dark   3.9      1
## 270   270 2405    15   3    Hersheys       White   2.9      0
## 271   271 2405    16   1 Ghirardelli Milk w Nuts   1.1      1
## 272   272 2405    16   2 Ghirardelli        Dark   1.9      0
## 273   273 2405    16   3      Godiva Milk w Nuts   2.1      0
## 274   274 2405    17   1 Ghirardelli       White   2.9      0
## 275   275 2405    17   2      Godiva        Milk   2.4      1
## 276   276 2405    17   3    Hersheys Milk w Nuts   3.9      0
## 277   277 2405    18   1      Godiva       White   3.4      0
## 278   278 2405    18   2 Ghirardelli        Dark   3.9      1
## 279   279 2405    18   3    Hersheys       White   1.9      0
## 280   280 2405    19   1    Hersheys Milk w Nuts   2.9      1
## 281   281 2405    19   2        Dove        Dark   3.4      0
## 282   282 2405    19   3    Hersheys        Milk   1.3      0
## 283   283 2405    20   1       Lindt Dark w Nuts   3.5      0
## 284   284 2405    20   2        Dove        Milk   3.4      1
## 285   285 2405    20   3       Lindt        Dark   0.7      0
## 286   286 2405    21   1    Hersheys        Milk   3.0      0
## 287   287 2405    21   2    Hersheys        Dark   1.8      0
## 288   288 2405    21   3 Ghirardelli        Milk   3.5      1
## 289   289 2405    22   1      Godiva Dark w Nuts   1.6      1
## 290   290 2405    22   2        Dove Dark w Nuts   1.8      0
## 291   291 2405    22   3       Lindt Dark w Nuts   3.6      0
## 292   292 2405    23   1      Godiva       White   1.5      0
## 293   293 2405    23   2    Hersheys       White   1.3      0
## 294   294 2405    23   3      Godiva Milk w Nuts   0.6      1
## 295   295 2405    24   1 Ghirardelli        Dark   2.5      1
## 296   296 2405    24   2 Ghirardelli Dark w Nuts   0.8      0
## 297   297 2405    24   3       Lindt       White   2.1      0
## 298   298 2405    25   1       Lindt       White   3.6      0
## 299   299 2405    25   2    Hersheys       White   2.5      0
## 300   300 2405    25   3 Ghirardelli Dark w Nuts   2.0      1
## 301   301 2407     1   1 Ghirardelli        Dark   3.0      0
## 302   302 2407     1   2       Lindt       White   2.5      0
## 303   303 2407     1   3    Hersheys Dark w Nuts   2.4      1
## 304   304 2407     2   1 Ghirardelli        Milk   2.0      1
## 305   305 2407     2   2       Lindt       White   2.9      0
## 306   306 2407     2   3      Godiva       White   1.9      0
## 307   307 2407     3   1       Lindt        Milk   2.3      0
## 308   308 2407     3   2    Hersheys        Dark   0.6      1
## 309   309 2407     3   3      Godiva       White   0.9      0
## 310   310 2407     4   1    Hersheys       White   1.3      0
## 311   311 2407     4   2        Dove        Dark   1.3      0
## 312   312 2407     4   3       Lindt Dark w Nuts   3.0      1
## 313   313 2407     5   1        Dove        Milk   3.7      0
## 314   314 2407     5   2    Hersheys Milk w Nuts   3.6      1
## 315   315 2407     5   3       Lindt       White   3.6      0
## 316   316 2407     6   1       Lindt       White   4.0      0
## 317   317 2407     6   2        Dove       White   2.5      0
## 318   318 2407     6   3       Lindt Milk w Nuts   0.8      1
## 319   319 2407     7   1      Godiva        Milk   2.5      0
## 320   320 2407     7   2        Dove Dark w Nuts   2.4      1
## 321   321 2407     7   3        Dove       White   2.3      0
## 322   322 2407     8   1    Hersheys Dark w Nuts   2.4      1
## 323   323 2407     8   2    Hersheys       White   1.8      0
## 324   324 2407     8   3      Godiva        Milk   3.7      0
## 325   325 2407     9   1        Dove        Milk   3.9      0
## 326   326 2407     9   2        Dove        Dark   1.9      0
## 327   327 2407     9   3 Ghirardelli Milk w Nuts   1.8      1
## 328   328 2407    10   1       Lindt        Milk   3.7      0
## 329   329 2407    10   2        Dove        Milk   1.1      0
## 330   330 2407    10   3    Hersheys        Milk   1.0      1
## 331   331 2407    11   1      Godiva        Dark   3.3      0
## 332   332 2407    11   2    Hersheys        Dark   3.3      0
## 333   333 2407    11   3 Ghirardelli Dark w Nuts   0.6      1
## 334   334 2407    12   1      Godiva        Milk   1.6      0
## 335   335 2407    12   2 Ghirardelli Dark w Nuts   1.1      1
## 336   336 2407    12   3       Lindt        Milk   1.3      0
## 337   337 2407    13   1       Lindt        Dark   2.0      1
## 338   338 2407    13   2 Ghirardelli       White   3.5      0
## 339   339 2407    13   3       Lindt Milk w Nuts   3.7      0
## 340   340 2407    14   1       Lindt Milk w Nuts   1.9      0
## 341   341 2407    14   2      Godiva        Dark   3.0      0
## 342   342 2407    14   3    Hersheys        Dark   0.6      1
## 343   343 2407    15   1        Dove Milk w Nuts   3.0      0
## 344   344 2407    15   2 Ghirardelli Dark w Nuts   1.2      0
## 345   345 2407    15   3      Godiva       White   1.1      1
## 346   346 2407    16   1       Lindt Milk w Nuts   3.3      0
## 347   347 2407    16   2 Ghirardelli Dark w Nuts   1.6      1
## 348   348 2407    16   3        Dove Dark w Nuts   1.4      0
## 349   349 2407    17   1       Lindt Dark w Nuts   3.3      0
## 350   350 2407    17   2       Lindt        Milk   2.8      0
## 351   351 2407    17   3      Godiva        Milk   0.9      1
## 352   352 2407    18   1       Lindt        Dark   0.8      1
## 353   353 2407    18   2    Hersheys        Milk   3.5      0
## 354   354 2407    18   3    Hersheys Dark w Nuts   2.0      0
## 355   355 2407    19   1      Godiva        Dark   3.3      0
## 356   356 2407    19   2        Dove Milk w Nuts   3.1      0
## 357   357 2407    19   3 Ghirardelli Dark w Nuts   2.9      1
## 358   358 2407    20   1       Lindt Dark w Nuts   1.2      0
## 359   359 2407    20   2       Lindt       White   1.5      0
## 360   360 2407    20   3        Dove        Dark   0.9      1
## 361   361 2407    21   1    Hersheys       White   2.2      1
## 362   362 2407    21   2       Lindt Dark w Nuts   3.3      0
## 363   363 2407    21   3    Hersheys        Milk   1.9      0
## 364   364 2407    22   1        Dove        Milk   3.4      0
## 365   365 2407    22   2 Ghirardelli        Dark   3.3      1
## 366   366 2407    22   3    Hersheys        Dark   3.8      0
## 367   367 2407    23   1 Ghirardelli Milk w Nuts   1.5      1
## 368   368 2407    23   2    Hersheys        Dark   2.8      0
## 369   369 2407    23   3    Hersheys Milk w Nuts   2.5      0
## 370   370 2407    24   1      Godiva       White   0.5      1
## 371   371 2407    24   2 Ghirardelli Dark w Nuts   1.1      0
## 372   372 2407    24   3 Ghirardelli        Dark   1.4      0
## 373   373 2407    25   1      Godiva        Milk   0.9      0
## 374   374 2407    25   2       Lindt        Dark   2.2      0
## 375   375 2407    25   3 Ghirardelli Dark w Nuts   1.0      1
## 376   376 2408     1   1 Ghirardelli       White   3.8      1
## 377   377 2408     1   2        Dove       White   2.0      0
## 378   378 2408     1   3        Dove Dark w Nuts   2.2      0
## 379   379 2408     2   1 Ghirardelli Milk w Nuts   0.8      0
## 380   380 2408     2   2      Godiva Milk w Nuts   2.7      0
## 381   381 2408     2   3        Dove        Milk   0.9      1
## 382   382 2408     3   1        Dove Milk w Nuts   2.6      0
## 383   383 2408     3   2    Hersheys        Milk   1.5      1
## 384   384 2408     3   3       Lindt       White   3.4      0
## 385   385 2408     4   1 Ghirardelli        Dark   2.9      1
## 386   386 2408     4   2       Lindt Milk w Nuts   0.5      0
## 387   387 2408     4   3      Godiva Milk w Nuts   1.5      0
## 388   388 2408     5   1        Dove        Milk   3.9      0
## 389   389 2408     5   2 Ghirardelli Dark w Nuts   1.5      0
## 390   390 2408     5   3      Godiva        Milk   1.1      1
## 391   391 2408     6   1      Godiva Milk w Nuts   1.5      0
## 392   392 2408     6   2 Ghirardelli        Milk   1.4      1
## 393   393 2408     6   3    Hersheys       White   2.5      0
## 394   394 2408     7   1      Godiva Milk w Nuts   2.6      1
## 395   395 2408     7   2    Hersheys       White   3.4      0
## 396   396 2408     7   3 Ghirardelli Dark w Nuts   1.4      0
## 397   397 2408     8   1      Godiva       White   0.8      0
## 398   398 2408     8   2 Ghirardelli Milk w Nuts   1.1      0
## 399   399 2408     8   3      Godiva        Dark   0.5      1
## 400   400 2408     9   1    Hersheys Dark w Nuts   0.6      0
## 401   401 2408     9   2      Godiva        Milk   2.2      1
## 402   402 2408     9   3        Dove Dark w Nuts   1.1      0
## 403   403 2408    10   1 Ghirardelli Dark w Nuts   3.2      0
## 404   404 2408    10   2      Godiva        Milk   2.4      1
## 405   405 2408    10   3        Dove       White   2.9      0
## 406   406 2408    11   1      Godiva        Dark   4.0      0
## 407   407 2408    11   2    Hersheys Milk w Nuts   3.5      0
## 408   408 2408    11   3        Dove        Dark   2.5      1
## 409   409 2408    12   1       Lindt Milk w Nuts   2.0      0
## 410   410 2408    12   2      Godiva        Milk   3.0      1
## 411   411 2408    12   3       Lindt Dark w Nuts   1.0      0
## 412   412 2408    13   1       Lindt Milk w Nuts   3.2      1
## 413   413 2408    13   2       Lindt Dark w Nuts   1.1      0
## 414   414 2408    13   3      Godiva Milk w Nuts   1.0      0
## 415   415 2408    14   1      Godiva        Milk   1.3      1
## 416   416 2408    14   2      Godiva Milk w Nuts   2.0      0
## 417   417 2408    14   3        Dove Dark w Nuts   1.3      0
## 418   418 2408    15   1    Hersheys       White   3.1      0
## 419   419 2408    15   2 Ghirardelli Milk w Nuts   3.7      0
## 420   420 2408    15   3       Lindt        Milk   3.6      1
## 421   421 2408    16   1       Lindt Dark w Nuts   1.0      0
## 422   422 2408    16   2    Hersheys       White   4.0      0
## 423   423 2408    16   3       Lindt        Dark   0.5      1
## 424   424 2408    17   1      Godiva       White   2.5      0
## 425   425 2408    17   2        Dove        Dark   3.5      0
## 426   426 2408    17   3 Ghirardelli        Milk   2.3      1
## 427   427 2408    18   1      Godiva       White   1.0      1
## 428   428 2408    18   2       Lindt Dark w Nuts   3.3      0
## 429   429 2408    18   3 Ghirardelli Dark w Nuts   2.4      0
## 430   430 2408    19   1 Ghirardelli Milk w Nuts   0.8      1
## 431   431 2408    19   2    Hersheys Dark w Nuts   1.6      0
## 432   432 2408    19   3      Godiva Dark w Nuts   1.1      0
## 433   433 2408    20   1        Dove Milk w Nuts   3.2      0
## 434   434 2408    20   2       Lindt Dark w Nuts   2.2      0
## 435   435 2408    20   3    Hersheys        Dark   3.0      1
## 436   436 2408    21   1        Dove Dark w Nuts   1.3      0
## 437   437 2408    21   2      Godiva        Dark   1.7      1
## 438   438 2408    21   3        Dove       White   2.4      0
## 439   439 2408    22   1        Dove        Milk   3.5      1
## 440   440 2408    22   2 Ghirardelli        Milk   2.3      0
## 441   441 2408    22   3 Ghirardelli Dark w Nuts   3.5      0
## 442   442 2408    23   1      Godiva       White   0.9      0
## 443   443 2408    23   2        Dove        Dark   3.0      0
## 444   444 2408    23   3 Ghirardelli        Dark   0.6      1
## 445   445 2408    24   1       Lindt        Dark   1.2      0
## 446   446 2408    24   2      Godiva        Milk   1.1      1
## 447   447 2408    24   3        Dove Dark w Nuts   1.4      0
## 448   448 2408    25   1       Lindt Milk w Nuts   3.8      0
## 449   449 2408    25   2      Godiva Milk w Nuts   0.9      0
## 450   450 2408    25   3 Ghirardelli       White   0.7      1
## 451   451 2409     1   1        Dove        Milk   0.6      0
## 452   452 2409     1   2      Godiva        Dark   0.7      1
## 453   453 2409     1   3        Dove       White   3.6      0
## 454   454 2409     2   1      Godiva Milk w Nuts   2.7      0
## 455   455 2409     2   2      Godiva        Dark   3.9      1
## 456   456 2409     2   3    Hersheys Milk w Nuts   0.7      0
## 457   457 2409     3   1    Hersheys Dark w Nuts   1.7      0
## 458   458 2409     3   2      Godiva        Dark   3.7      1
## 459   459 2409     3   3    Hersheys        Dark   3.0      0
## 460   460 2409     4   1       Lindt        Milk   1.0      1
## 461   461 2409     4   2       Lindt Milk w Nuts   3.6      0
## 462   462 2409     4   3 Ghirardelli Dark w Nuts   0.5      0
## 463   463 2409     5   1    Hersheys Milk w Nuts   0.8      0
## 464   464 2409     5   2      Godiva        Dark   1.5      1
## 465   465 2409     5   3    Hersheys       White   3.3      0
## 466   466 2409     6   1       Lindt        Milk   3.1      0
## 467   467 2409     6   2        Dove       White   2.5      0
## 468   468 2409     6   3      Godiva        Dark   2.6      1
## 469   469 2409     7   1      Godiva       White   3.1      1
## 470   470 2409     7   2        Dove Dark w Nuts   4.0      0
## 471   471 2409     7   3      Godiva        Milk   2.1      0
## 472   472 2409     8   1    Hersheys Dark w Nuts   0.8      0
## 473   473 2409     8   2      Godiva       White   3.2      0
## 474   474 2409     8   3      Godiva        Dark   1.1      1
## 475   475 2409     9   1       Lindt        Dark   2.3      0
## 476   476 2409     9   2      Godiva        Dark   1.7      1
## 477   477 2409     9   3      Godiva       White   3.8      0
## 478   478 2409    10   1       Lindt Milk w Nuts   0.6      0
## 479   479 2409    10   2      Godiva Milk w Nuts   0.8      0
## 480   480 2409    10   3    Hersheys        Dark   3.7      1
## 481   481 2409    11   1      Godiva        Milk   1.6      1
## 482   482 2409    11   2        Dove       White   0.7      0
## 483   483 2409    11   3    Hersheys Dark w Nuts   1.2      0
## 484   484 2409    12   1      Godiva Dark w Nuts   1.1      0
## 485   485 2409    12   2        Dove Dark w Nuts   0.8      0
## 486   486 2409    12   3       Lindt        Dark   3.7      1
## 487   487 2409    13   1        Dove        Milk   3.0      0
## 488   488 2409    13   2       Lindt       White   0.8      0
## 489   489 2409    13   3      Godiva       White   1.9      1
## 490   490 2409    14   1       Lindt Dark w Nuts   0.6      0
## 491   491 2409    14   2        Dove        Milk   3.5      1
## 492   492 2409    14   3        Dove Milk w Nuts   1.9      0
## 493   493 2409    15   1      Godiva        Dark   3.7      0
## 494   494 2409    15   2 Ghirardelli        Dark   1.5      1
## 495   495 2409    15   3        Dove        Dark   1.6      0
## 496   496 2409    16   1    Hersheys Milk w Nuts   0.5      0
## 497   497 2409    16   2        Dove        Milk   3.8      1
## 498   498 2409    16   3        Dove Dark w Nuts   3.7      0
## 499   499 2409    17   1        Dove        Milk   3.9      1
## 500   500 2409    17   2        Dove Milk w Nuts   1.2      0
## 501   501 2409    17   3       Lindt Milk w Nuts   0.5      0
## 502   502 2409    18   1      Godiva Milk w Nuts   2.8      0
## 503   503 2409    18   2       Lindt        Milk   2.7      0
## 504   504 2409    18   3      Godiva       White   2.6      1
## 505   505 2409    19   1    Hersheys        Milk   3.7      0
## 506   506 2409    19   2        Dove Dark w Nuts   4.0      0
## 507   507 2409    19   3        Dove        Dark   2.8      1
## 508   508 2409    20   1        Dove        Dark   0.7      1
## 509   509 2409    20   2      Godiva       White   0.8      0
## 510   510 2409    20   3    Hersheys        Dark   1.9      0
## 511   511 2409    21   1 Ghirardelli Milk w Nuts   0.8      0
## 512   512 2409    21   2    Hersheys        Milk   3.0      1
## 513   513 2409    21   3      Godiva Milk w Nuts   2.4      0
## 514   514 2409    22   1      Godiva        Dark   0.9      1
## 515   515 2409    22   2        Dove Milk w Nuts   3.4      0
## 516   516 2409    22   3    Hersheys Dark w Nuts   3.4      0
## 517   517 2409    23   1      Godiva Dark w Nuts   0.6      0
## 518   518 2409    23   2        Dove       White   1.8      0
## 519   519 2409    23   3        Dove        Dark   3.4      1
## 520   520 2409    24   1    Hersheys Dark w Nuts   3.6      0
## 521   521 2409    24   2      Godiva Milk w Nuts   3.2      0
## 522   522 2409    24   3 Ghirardelli Milk w Nuts   1.4      1
## 523   523 2409    25   1       Lindt       White   1.1      0
## 524   524 2409    25   2 Ghirardelli       White   0.8      1
## 525   525 2409    25   3       Lindt        Milk   2.0      0
## 526   526 2410     1   1        Dove       White   1.4      0
## 527   527 2410     1   2        Dove        Milk   1.0      1
## 528   528 2410     1   3       Lindt Milk w Nuts   2.0      0
## 529   529 2410     2   1      Godiva        Milk   3.5      1
## 530   530 2410     2   2 Ghirardelli        Milk   2.2      0
## 531   531 2410     2   3      Godiva        Dark   2.2      0
## 532   532 2410     3   1 Ghirardelli Dark w Nuts   3.9      0
## 533   533 2410     3   2    Hersheys        Milk   1.2      1
## 534   534 2410     3   3      Godiva Dark w Nuts   2.2      0
## 535   535 2410     4   1      Godiva        Milk   1.3      1
## 536   536 2410     4   2       Lindt Dark w Nuts   0.7      0
## 537   537 2410     4   3    Hersheys        Dark   3.3      0
## 538   538 2410     5   1      Godiva        Dark   2.8      0
## 539   539 2410     5   2        Dove Dark w Nuts   1.0      0
## 540   540 2410     5   3 Ghirardelli        Milk   3.5      1
## 541   541 2410     6   1       Lindt Milk w Nuts   1.3      0
## 542   542 2410     6   2      Godiva       White   2.5      1
## 543   543 2410     6   3        Dove       White   0.8      0
## 544   544 2410     7   1        Dove        Dark   1.4      1
## 545   545 2410     7   2       Lindt        Dark   2.1      0
## 546   546 2410     7   3      Godiva        Dark   3.1      0
## 547   547 2410     8   1        Dove       White   2.9      1
## 548   548 2410     8   2       Lindt        Dark   3.0      0
## 549   549 2410     8   3      Godiva Milk w Nuts   2.2      0
## 550   550 2410     9   1      Godiva Dark w Nuts   1.2      0
## 551   551 2410     9   2       Lindt Dark w Nuts   2.5      0
## 552   552 2410     9   3        Dove Milk w Nuts   1.4      1
## 553   553 2410    10   1        Dove Dark w Nuts   2.5      0
## 554   554 2410    10   2      Godiva Dark w Nuts   0.9      1
## 555   555 2410    10   3       Lindt Dark w Nuts   3.2      0
## 556   556 2410    11   1      Godiva Milk w Nuts   3.7      0
## 557   557 2410    11   2      Godiva        Dark   1.4      0
## 558   558 2410    11   3        Dove        Milk   1.7      1
## 559   559 2410    12   1 Ghirardelli       White   3.7      0
## 560   560 2410    12   2 Ghirardelli        Milk   3.3      1
## 561   561 2410    12   3        Dove        Dark   2.3      0
## 562   562 2410    13   1        Dove        Dark   1.0      1
## 563   563 2410    13   2       Lindt        Dark   3.8      0
## 564   564 2410    13   3 Ghirardelli Dark w Nuts   3.5      0
## 565   565 2410    14   1       Lindt Milk w Nuts   2.8      0
## 566   566 2410    14   2    Hersheys Dark w Nuts   2.8      0
## 567   567 2410    14   3    Hersheys        Milk   2.6      1
## 568   568 2410    15   1 Ghirardelli Milk w Nuts   3.0      1
## 569   569 2410    15   2        Dove        Dark   2.7      0
## 570   570 2410    15   3 Ghirardelli        Dark   3.0      0
## 571   571 2410    16   1        Dove        Milk   3.0      1
## 572   572 2410    16   2        Dove       White   2.5      0
## 573   573 2410    16   3      Godiva        Milk   3.9      0
## 574   574 2410    17   1       Lindt        Dark   0.5      0
## 575   575 2410    17   2 Ghirardelli       White   0.6      1
## 576   576 2410    17   3      Godiva        Dark   3.4      0
## 577   577 2410    18   1        Dove Milk w Nuts   2.2      1
## 578   578 2410    18   2        Dove        Dark   3.6      0
## 579   579 2410    18   3    Hersheys       White   3.8      0
## 580   580 2410    19   1        Dove Dark w Nuts   2.2      0
## 581   581 2410    19   2    Hersheys Milk w Nuts   4.0      1
## 582   582 2410    19   3 Ghirardelli        Dark   2.9      0
## 583   583 2410    20   1      Godiva        Milk   3.2      1
## 584   584 2410    20   2       Lindt        Dark   0.6      0
## 585   585 2410    20   3    Hersheys Dark w Nuts   2.0      0
## 586   586 2410    21   1 Ghirardelli       White   3.4      0
## 587   587 2410    21   2       Lindt        Dark   2.5      0
## 588   588 2410    21   3      Godiva       White   2.5      1
## 589   589 2410    22   1      Godiva Dark w Nuts   3.0      0
## 590   590 2410    22   2       Lindt        Dark   1.1      1
## 591   591 2410    22   3        Dove        Milk   3.8      0
## 592   592 2410    23   1    Hersheys        Milk   0.7      1
## 593   593 2410    23   2    Hersheys       White   2.2      0
## 594   594 2410    23   3        Dove Milk w Nuts   2.7      0
## 595   595 2410    24   1        Dove Dark w Nuts   1.4      0
## 596   596 2410    24   2 Ghirardelli        Milk   3.3      0
## 597   597 2410    24   3      Godiva        Milk   2.2      1
## 598   598 2410    25   1    Hersheys Milk w Nuts   2.3      0
## 599   599 2410    25   2      Godiva Milk w Nuts   1.7      1
## 600   600 2410    25   3 Ghirardelli Milk w Nuts   2.7      0
## 601   601 2411     1   1    Hersheys        Milk   2.2      0
## 602   602 2411     1   2      Godiva Dark w Nuts   2.1      1
## 603   603 2411     1   3        Dove        Milk   3.5      0
## 604   604 2411     2   1 Ghirardelli Milk w Nuts   1.3      1
## 605   605 2411     2   2    Hersheys       White   1.7      0
## 606   606 2411     2   3    Hersheys        Milk   3.5      0
## 607   607 2411     3   1 Ghirardelli Milk w Nuts   1.6      1
## 608   608 2411     3   2        Dove Milk w Nuts   2.0      0
## 609   609 2411     3   3       Lindt Dark w Nuts   1.8      0
## 610   610 2411     4   1       Lindt Milk w Nuts   3.2      0
## 611   611 2411     4   2        Dove Dark w Nuts   2.5      0
## 612   612 2411     4   3       Lindt        Milk   0.8      1
## 613   613 2411     5   1      Godiva Dark w Nuts   1.3      1
## 614   614 2411     5   2      Godiva        Milk   1.1      0
## 615   615 2411     5   3    Hersheys Milk w Nuts   2.7      0
## 616   616 2411     6   1       Lindt        Dark   0.7      0
## 617   617 2411     6   2    Hersheys       White   0.6      0
## 618   618 2411     6   3       Lindt Milk w Nuts   3.3      1
## 619   619 2411     7   1       Lindt        Dark   0.9      0
## 620   620 2411     7   2       Lindt       White   2.9      0
## 621   621 2411     7   3 Ghirardelli        Milk   0.8      1
## 622   622 2411     8   1       Lindt Milk w Nuts   2.0      0
## 623   623 2411     8   2 Ghirardelli Dark w Nuts   1.3      1
## 624   624 2411     8   3       Lindt Dark w Nuts   1.2      0
## 625   625 2411     9   1       Lindt Dark w Nuts   3.4      1
## 626   626 2411     9   2        Dove        Dark   1.8      0
## 627   627 2411     9   3        Dove Dark w Nuts   3.1      0
## 628   628 2411    10   1       Lindt        Dark   1.1      0
## 629   629 2411    10   2    Hersheys       White   1.6      0
## 630   630 2411    10   3    Hersheys Milk w Nuts   3.8      1
## 631   631 2411    11   1    Hersheys Dark w Nuts   2.1      1
## 632   632 2411    11   2        Dove        Dark   2.9      0
## 633   633 2411    11   3      Godiva       White   1.4      0
## 634   634 2411    12   1    Hersheys       White   1.0      0
## 635   635 2411    12   2    Hersheys Milk w Nuts   0.6      1
## 636   636 2411    12   3        Dove Milk w Nuts   2.8      0
## 637   637 2411    13   1 Ghirardelli       White   0.9      0
## 638   638 2411    13   2        Dove        Dark   2.5      1
## 639   639 2411    13   3    Hersheys       White   1.9      0
## 640   640 2411    14   1    Hersheys        Milk   1.8      1
## 641   641 2411    14   2      Godiva        Dark   3.4      0
## 642   642 2411    14   3      Godiva Dark w Nuts   3.2      0
## 643   643 2411    15   1      Godiva        Milk   0.7      1
## 644   644 2411    15   2    Hersheys       White   0.6      0
## 645   645 2411    15   3    Hersheys Dark w Nuts   2.9      0
## 646   646 2411    16   1    Hersheys Milk w Nuts   2.3      0
## 647   647 2411    16   2 Ghirardelli Milk w Nuts   0.6      1
## 648   648 2411    16   3    Hersheys       White   0.8      0
## 649   649 2411    17   1        Dove        Dark   4.0      0
## 650   650 2411    17   2 Ghirardelli        Milk   2.7      1
## 651   651 2411    17   3        Dove       White   1.3      0
## 652   652 2411    18   1        Dove Milk w Nuts   2.1      0
## 653   653 2411    18   2 Ghirardelli       White   1.1      0
## 654   654 2411    18   3 Ghirardelli        Milk   2.5      1
## 655   655 2411    19   1    Hersheys Dark w Nuts   1.2      1
## 656   656 2411    19   2        Dove        Milk   2.9      0
## 657   657 2411    19   3 Ghirardelli       White   1.5      0
## 658   658 2411    20   1      Godiva Milk w Nuts   1.8      1
## 659   659 2411    20   2    Hersheys        Dark   3.2      0
## 660   660 2411    20   3       Lindt        Dark   0.9      0
## 661   661 2411    21   1 Ghirardelli       White   1.5      0
## 662   662 2411    21   2      Godiva Milk w Nuts   2.1      1
## 663   663 2411    21   3       Lindt        Dark   0.6      0
## 664   664 2411    22   1      Godiva Dark w Nuts   2.8      1
## 665   665 2411    22   2      Godiva Milk w Nuts   3.7      0
## 666   666 2411    22   3 Ghirardelli       White   2.2      0
## 667   667 2411    23   1      Godiva Milk w Nuts   3.2      1
## 668   668 2411    23   2    Hersheys Dark w Nuts   4.0      0
## 669   669 2411    23   3 Ghirardelli       White   2.4      0
## 670   670 2411    24   1      Godiva       White   0.9      0
## 671   671 2411    24   2      Godiva Dark w Nuts   3.8      0
## 672   672 2411    24   3 Ghirardelli Milk w Nuts   1.8      1
## 673   673 2411    25   1      Godiva Milk w Nuts   2.3      0
## 674   674 2411    25   2       Lindt Milk w Nuts   1.3      1
## 675   675 2411    25   3        Dove        Milk   2.5      0
## 676   676 2412     1   1    Hersheys       White   1.8      0
## 677   677 2412     1   2    Hersheys Milk w Nuts   2.6      0
## 678   678 2412     1   3       Lindt Milk w Nuts   0.5      1
## 679   679 2412     2   1    Hersheys Milk w Nuts   1.9      0
## 680   680 2412     2   2      Godiva Milk w Nuts   3.4      0
## 681   681 2412     2   3       Lindt        Dark   2.6      1
## 682   682 2412     3   1 Ghirardelli       White   2.7      0
## 683   683 2412     3   2       Lindt        Milk   1.0      0
## 684   684 2412     3   3      Godiva Dark w Nuts   1.7      1
## 685   685 2412     4   1    Hersheys        Milk   0.9      0
## 686   686 2412     4   2    Hersheys        Dark   0.9      1
## 687   687 2412     4   3        Dove       White   0.8      0
## 688   688 2412     5   1       Lindt        Dark   3.3      0
## 689   689 2412     5   2 Ghirardelli Dark w Nuts   3.5      1
## 690   690 2412     5   3      Godiva Dark w Nuts   1.3      0
## 691   691 2412     6   1        Dove Dark w Nuts   3.5      1
## 692   692 2412     6   2    Hersheys        Dark   3.2      0
## 693   693 2412     6   3        Dove       White   3.9      0
## 694   694 2412     7   1 Ghirardelli        Milk   0.6      1
## 695   695 2412     7   2      Godiva        Milk   0.5      0
## 696   696 2412     7   3       Lindt       White   3.8      0
## 697   697 2412     8   1       Lindt        Dark   1.4      1
## 698   698 2412     8   2    Hersheys        Milk   1.2      0
## 699   699 2412     8   3        Dove        Milk   3.1      0
## 700   700 2412     9   1 Ghirardelli        Milk   1.3      0
## 701   701 2412     9   2        Dove        Milk   1.5      0
## 702   702 2412     9   3        Dove        Dark   2.7      1
## 703   703 2412    10   1 Ghirardelli       White   3.8      0
## 704   704 2412    10   2 Ghirardelli Dark w Nuts   3.4      1
## 705   705 2412    10   3    Hersheys        Dark   1.7      0
## 706   706 2412    11   1    Hersheys        Dark   0.6      0
## 707   707 2412    11   2       Lindt Dark w Nuts   2.7      1
## 708   708 2412    11   3       Lindt Milk w Nuts   0.9      0
## 709   709 2412    12   1 Ghirardelli Dark w Nuts   3.0      1
## 710   710 2412    12   2      Godiva       White   1.1      0
## 711   711 2412    12   3    Hersheys        Dark   0.7      0
## 712   712 2412    13   1       Lindt        Dark   1.5      0
## 713   713 2412    13   2    Hersheys        Dark   0.5      1
## 714   714 2412    13   3 Ghirardelli Milk w Nuts   3.1      0
## 715   715 2412    14   1    Hersheys Dark w Nuts   1.0      0
## 716   716 2412    14   2        Dove Milk w Nuts   0.8      0
## 717   717 2412    14   3       Lindt Milk w Nuts   1.0      1
## 718   718 2412    15   1       Lindt       White   2.2      0
## 719   719 2412    15   2 Ghirardelli       White   0.6      1
## 720   720 2412    15   3    Hersheys       White   3.7      0
## 721   721 2412    16   1    Hersheys        Dark   1.4      1
## 722   722 2412    16   2    Hersheys Milk w Nuts   2.4      0
## 723   723 2412    16   3      Godiva       White   3.4      0
## 724   724 2412    17   1 Ghirardelli Dark w Nuts   2.3      1
## 725   725 2412    17   2 Ghirardelli        Milk   1.6      0
## 726   726 2412    17   3      Godiva Dark w Nuts   2.6      0
## 727   727 2412    18   1        Dove Dark w Nuts   1.3      1
## 728   728 2412    18   2    Hersheys       White   1.5      0
## 729   729 2412    18   3        Dove        Dark   3.0      0
## 730   730 2412    19   1    Hersheys        Milk   1.0      0
## 731   731 2412    19   2    Hersheys        Dark   2.5      0
## 732   732 2412    19   3        Dove        Dark   0.5      1
## 733   733 2412    20   1 Ghirardelli        Milk   1.0      0
## 734   734 2412    20   2 Ghirardelli Milk w Nuts   1.0      1
## 735   735 2412    20   3    Hersheys Milk w Nuts   3.5      0
## 736   736 2412    21   1        Dove       White   2.4      0
## 737   737 2412    21   2    Hersheys       White   2.4      0
## 738   738 2412    21   3       Lindt Dark w Nuts   1.2      1
## 739   739 2412    22   1        Dove Dark w Nuts   0.7      1
## 740   740 2412    22   2       Lindt Milk w Nuts   3.2      0
## 741   741 2412    22   3      Godiva Milk w Nuts   2.9      0
## 742   742 2412    23   1 Ghirardelli        Dark   3.5      1
## 743   743 2412    23   2        Dove        Dark   2.8      0
## 744   744 2412    23   3      Godiva       White   2.3      0
## 745   745 2412    24   1 Ghirardelli       White   1.4      0
## 746   746 2412    24   2       Lindt Milk w Nuts   1.7      1
## 747   747 2412    24   3       Lindt        Milk   3.9      0
## 748   748 2412    25   1        Dove        Dark   3.6      0
## 749   749 2412    25   2 Ghirardelli        Dark   3.0      1
## 750   750 2412    25   3    Hersheys Milk w Nuts   3.1      0
## 751   751 2413     1   1       Lindt Dark w Nuts   3.9      1
## 752   752 2413     1   2 Ghirardelli Dark w Nuts   2.6      0
## 753   753 2413     1   3      Godiva Dark w Nuts   2.7      0
## 754   754 2413     2   1       Lindt Milk w Nuts   0.9      1
## 755   755 2413     2   2    Hersheys Dark w Nuts   3.3      0
## 756   756 2413     2   3    Hersheys Milk w Nuts   4.0      0
## 757   757 2413     3   1    Hersheys        Milk   3.6      0
## 758   758 2413     3   2        Dove        Milk   1.6      0
## 759   759 2413     3   3 Ghirardelli Milk w Nuts   1.7      1
## 760   760 2413     4   1      Godiva Milk w Nuts   1.4      1
## 761   761 2413     4   2 Ghirardelli       White   2.4      0
## 762   762 2413     4   3      Godiva       White   3.8      0
## 763   763 2413     5   1        Dove Milk w Nuts   3.0      1
## 764   764 2413     5   2      Godiva Dark w Nuts   2.9      0
## 765   765 2413     5   3        Dove        Dark   1.6      0
## 766   766 2413     6   1       Lindt       White   2.5      1
## 767   767 2413     6   2 Ghirardelli       White   2.6      0
## 768   768 2413     6   3       Lindt Dark w Nuts   3.9      0
## 769   769 2413     7   1 Ghirardelli Dark w Nuts   0.7      1
## 770   770 2413     7   2      Godiva       White   2.9      0
## 771   771 2413     7   3        Dove        Milk   0.7      0
## 772   772 2413     8   1    Hersheys Milk w Nuts   0.6      1
## 773   773 2413     8   2 Ghirardelli Dark w Nuts   3.3      0
## 774   774 2413     8   3      Godiva       White   1.1      0
## 775   775 2413     9   1    Hersheys Milk w Nuts   2.7      0
## 776   776 2413     9   2 Ghirardelli Dark w Nuts   2.3      1
## 777   777 2413     9   3      Godiva        Dark   2.6      0
## 778   778 2413    10   1       Lindt        Dark   2.5      0
## 779   779 2413    10   2      Godiva        Dark   1.5      0
## 780   780 2413    10   3 Ghirardelli Dark w Nuts   1.4      1
## 781   781 2413    11   1 Ghirardelli       White   1.5      0
## 782   782 2413    11   2        Dove Dark w Nuts   2.0      1
## 783   783 2413    11   3 Ghirardelli        Dark   2.5      0
## 784   784 2413    12   1 Ghirardelli        Milk   1.7      0
## 785   785 2413    12   2       Lindt        Dark   2.5      0
## 786   786 2413    12   3        Dove        Milk   0.6      1
## 787   787 2413    13   1        Dove        Milk   3.3      0
## 788   788 2413    13   2    Hersheys        Dark   2.8      0
## 789   789 2413    13   3 Ghirardelli        Milk   1.8      1
## 790   790 2413    14   1       Lindt        Dark   3.5      0
## 791   791 2413    14   2 Ghirardelli       White   1.3      1
## 792   792 2413    14   3    Hersheys Milk w Nuts   0.9      0
## 793   793 2413    15   1    Hersheys        Dark   2.6      0
## 794   794 2413    15   2      Godiva        Dark   3.9      0
## 795   795 2413    15   3    Hersheys       White   2.9      1
## 796   796 2413    16   1 Ghirardelli Milk w Nuts   1.1      0
## 797   797 2413    16   2 Ghirardelli        Dark   1.9      0
## 798   798 2413    16   3      Godiva Milk w Nuts   2.1      1
## 799   799 2413    17   1 Ghirardelli       White   2.9      0
## 800   800 2413    17   2      Godiva        Milk   2.4      1
## 801   801 2413    17   3    Hersheys Milk w Nuts   3.9      0
## 802   802 2413    18   1      Godiva       White   3.4      0
## 803   803 2413    18   2 Ghirardelli        Dark   3.9      0
## 804   804 2413    18   3    Hersheys       White   1.9      1
## 805   805 2413    19   1    Hersheys Milk w Nuts   2.9      1
## 806   806 2413    19   2        Dove        Dark   3.4      0
## 807   807 2413    19   3    Hersheys        Milk   1.3      0
## 808   808 2413    20   1       Lindt Dark w Nuts   3.5      0
## 809   809 2413    20   2        Dove        Milk   3.4      1
## 810   810 2413    20   3       Lindt        Dark   0.7      0
## 811   811 2413    21   1    Hersheys        Milk   3.0      0
## 812   812 2413    21   2    Hersheys        Dark   1.8      0
## 813   813 2413    21   3 Ghirardelli        Milk   3.5      1
## 814   814 2413    22   1      Godiva Dark w Nuts   1.6      1
## 815   815 2413    22   2        Dove Dark w Nuts   1.8      0
## 816   816 2413    22   3       Lindt Dark w Nuts   3.6      0
## 817   817 2413    23   1      Godiva       White   1.5      0
## 818   818 2413    23   2    Hersheys       White   1.3      0
## 819   819 2413    23   3      Godiva Milk w Nuts   0.6      1
## 820   820 2413    24   1 Ghirardelli        Dark   2.5      0
## 821   821 2413    24   2 Ghirardelli Dark w Nuts   0.8      1
## 822   822 2413    24   3       Lindt       White   2.1      0
## 823   823 2413    25   1       Lindt       White   3.6      0
## 824   824 2413    25   2    Hersheys       White   2.5      1
## 825   825 2413    25   3 Ghirardelli Dark w Nuts   2.0      0
## 826   826 2414     1   1       Lindt        Dark   3.7      1
## 827   827 2414     1   2       Lindt       White   3.4      0
## 828   828 2414     1   3    Hersheys        Milk   2.8      0
## 829   829 2414     2   1 Ghirardelli        Milk   4.0      0
## 830   830 2414     2   2       Lindt Dark w Nuts   1.3      0
## 831   831 2414     2   3      Godiva Dark w Nuts   3.8      1
## 832   832 2414     3   1    Hersheys Milk w Nuts   3.0      0
## 833   833 2414     3   2        Dove       White   1.3      1
## 834   834 2414     3   3    Hersheys Dark w Nuts   3.6      0
## 835   835 2414     4   1 Ghirardelli Dark w Nuts   1.4      1
## 836   836 2414     4   2    Hersheys Dark w Nuts   1.4      0
## 837   837 2414     4   3       Lindt       White   2.5      0
## 838   838 2414     5   1 Ghirardelli Dark w Nuts   0.7      0
## 839   839 2414     5   2        Dove       White   1.6      0
## 840   840 2414     5   3        Dove        Dark   1.6      1
## 841   841 2414     6   1 Ghirardelli        Dark   3.7      1
## 842   842 2414     6   2      Godiva       White   3.6      0
## 843   843 2414     6   3 Ghirardelli        Dark   2.1      0
## 844   844 2414     7   1        Dove       White   3.5      0
## 845   845 2414     7   2      Godiva        Dark   3.6      1
## 846   846 2414     7   3        Dove       White   2.9      0
## 847   847 2414     8   1        Dove Milk w Nuts   1.4      1
## 848   848 2414     8   2 Ghirardelli        Milk   1.2      0
## 849   849 2414     8   3       Lindt        Milk   1.7      0
## 850   850 2414     9   1      Godiva        Milk   3.8      0
## 851   851 2414     9   2        Dove        Milk   2.0      0
## 852   852 2414     9   3       Lindt       White   1.3      1
## 853   853 2414    10   1       Lindt        Dark   2.2      1
## 854   854 2414    10   2       Lindt Milk w Nuts   2.8      0
## 855   855 2414    10   3    Hersheys Dark w Nuts   0.8      0
## 856   856 2414    11   1    Hersheys       White   1.7      0
## 857   857 2414    11   2       Lindt Milk w Nuts   1.9      1
## 858   858 2414    11   3      Godiva       White   3.4      0
## 859   859 2414    12   1        Dove        Dark   1.7      1
## 860   860 2414    12   2    Hersheys        Dark   3.1      0
## 861   861 2414    12   3       Lindt Milk w Nuts   3.1      0
## 862   862 2414    13   1       Lindt Dark w Nuts   1.9      1
## 863   863 2414    13   2        Dove       White   0.6      0
## 864   864 2414    13   3       Lindt Milk w Nuts   0.5      0
## 865   865 2414    14   1 Ghirardelli       White   2.9      0
## 866   866 2414    14   2 Ghirardelli Milk w Nuts   3.4      0
## 867   867 2414    14   3 Ghirardelli Dark w Nuts   3.4      1
## 868   868 2414    15   1       Lindt Dark w Nuts   3.0      1
## 869   869 2414    15   2    Hersheys Milk w Nuts   0.9      0
## 870   870 2414    15   3       Lindt        Milk   2.0      0
## 871   871 2414    16   1       Lindt       White   3.6      0
## 872   872 2414    16   2 Ghirardelli Dark w Nuts   3.1      1
## 873   873 2414    16   3 Ghirardelli        Milk   3.6      0
## 874   874 2414    17   1       Lindt Dark w Nuts   1.9      1
## 875   875 2414    17   2       Lindt Milk w Nuts   3.9      0
## 876   876 2414    17   3       Lindt       White   2.8      0
## 877   877 2414    18   1      Godiva        Dark   1.3      1
## 878   878 2414    18   2 Ghirardelli        Milk   3.5      0
## 879   879 2414    18   3       Lindt        Dark   0.7      0
## 880   880 2414    19   1      Godiva Dark w Nuts   1.8      1
## 881   881 2414    19   2        Dove        Dark   2.2      0
## 882   882 2414    19   3      Godiva Milk w Nuts   0.7      0
## 883   883 2414    20   1        Dove        Milk   0.6      0
## 884   884 2414    20   2       Lindt        Dark   3.3      1
## 885   885 2414    20   3    Hersheys Dark w Nuts   1.7      0
## 886   886 2414    21   1       Lindt       White   2.1      0
## 887   887 2414    21   2    Hersheys        Dark   2.6      0
## 888   888 2414    21   3      Godiva Dark w Nuts   2.8      1
## 889   889 2414    22   1       Lindt        Milk   2.6      0
## 890   890 2414    22   2       Lindt        Dark   2.0      1
## 891   891 2414    22   3 Ghirardelli Dark w Nuts   2.4      0
## 892   892 2414    23   1 Ghirardelli        Dark   2.4      0
## 893   893 2414    23   2      Godiva Milk w Nuts   3.5      1
## 894   894 2414    23   3       Lindt       White   3.9      0
## 895   895 2414    24   1 Ghirardelli Milk w Nuts   0.6      0
## 896   896 2414    24   2      Godiva        Dark   3.3      1
## 897   897 2414    24   3        Dove       White   2.6      0
## 898   898 2414    25   1       Lindt        Dark   3.3      0
## 899   899 2414    25   2    Hersheys        Dark   2.1      0
## 900   900 2414    25   3       Lindt Dark w Nuts   3.0      1
## 901   901 2415     1   1 Ghirardelli        Dark   3.0      1
## 902   902 2415     1   2       Lindt       White   2.5      0
## 903   903 2415     1   3    Hersheys Dark w Nuts   2.4      0
## 904   904 2415     2   1 Ghirardelli        Milk   2.0      1
## 905   905 2415     2   2       Lindt       White   2.9      0
## 906   906 2415     2   3      Godiva       White   1.9      0
## 907   907 2415     3   1       Lindt        Milk   2.3      0
## 908   908 2415     3   2    Hersheys        Dark   0.6      1
## 909   909 2415     3   3      Godiva       White   0.9      0
## 910   910 2415     4   1    Hersheys       White   1.3      0
## 911   911 2415     4   2        Dove        Dark   1.3      1
## 912   912 2415     4   3       Lindt Dark w Nuts   3.0      0
## 913   913 2415     5   1        Dove        Milk   3.7      1
## 914   914 2415     5   2    Hersheys Milk w Nuts   3.6      0
## 915   915 2415     5   3       Lindt       White   3.6      0
## 916   916 2415     6   1       Lindt       White   4.0      0
## 917   917 2415     6   2        Dove       White   2.5      0
## 918   918 2415     6   3       Lindt Milk w Nuts   0.8      1
## 919   919 2415     7   1      Godiva        Milk   2.5      0
## 920   920 2415     7   2        Dove Dark w Nuts   2.4      1
## 921   921 2415     7   3        Dove       White   2.3      0
## 922   922 2415     8   1    Hersheys Dark w Nuts   2.4      0
## 923   923 2415     8   2    Hersheys       White   1.8      0
## 924   924 2415     8   3      Godiva        Milk   3.7      1
## 925   925 2415     9   1        Dove        Milk   3.9      1
## 926   926 2415     9   2        Dove        Dark   1.9      0
## 927   927 2415     9   3 Ghirardelli Milk w Nuts   1.8      0
## 928   928 2415    10   1       Lindt        Milk   3.7      1
## 929   929 2415    10   2        Dove        Milk   1.1      0
## 930   930 2415    10   3    Hersheys        Milk   1.0      0
## 931   931 2415    11   1      Godiva        Dark   3.3      1
## 932   932 2415    11   2    Hersheys        Dark   3.3      0
## 933   933 2415    11   3 Ghirardelli Dark w Nuts   0.6      0
## 934   934 2415    12   1      Godiva        Milk   1.6      0
## 935   935 2415    12   2 Ghirardelli Dark w Nuts   1.1      0
## 936   936 2415    12   3       Lindt        Milk   1.3      1
## 937   937 2415    13   1       Lindt        Dark   2.0      1
## 938   938 2415    13   2 Ghirardelli       White   3.5      0
## 939   939 2415    13   3       Lindt Milk w Nuts   3.7      0
## 940   940 2415    14   1       Lindt Milk w Nuts   1.9      1
## 941   941 2415    14   2      Godiva        Dark   3.0      0
## 942   942 2415    14   3    Hersheys        Dark   0.6      0
## 943   943 2415    15   1        Dove Milk w Nuts   3.0      0
## 944   944 2415    15   2 Ghirardelli Dark w Nuts   1.2      1
## 945   945 2415    15   3      Godiva       White   1.1      0
## 946   946 2415    16   1       Lindt Milk w Nuts   3.3      1
## 947   947 2415    16   2 Ghirardelli Dark w Nuts   1.6      0
## 948   948 2415    16   3        Dove Dark w Nuts   1.4      0
## 949   949 2415    17   1       Lindt Dark w Nuts   3.3      0
## 950   950 2415    17   2       Lindt        Milk   2.8      1
## 951   951 2415    17   3      Godiva        Milk   0.9      0
## 952   952 2415    18   1       Lindt        Dark   0.8      1
## 953   953 2415    18   2    Hersheys        Milk   3.5      0
## 954   954 2415    18   3    Hersheys Dark w Nuts   2.0      0
## 955   955 2415    19   1      Godiva        Dark   3.3      1
## 956   956 2415    19   2        Dove Milk w Nuts   3.1      0
## 957   957 2415    19   3 Ghirardelli Dark w Nuts   2.9      0
## 958   958 2415    20   1       Lindt Dark w Nuts   1.2      0
## 959   959 2415    20   2       Lindt       White   1.5      0
## 960   960 2415    20   3        Dove        Dark   0.9      1
## 961   961 2415    21   1    Hersheys       White   2.2      0
## 962   962 2415    21   2       Lindt Dark w Nuts   3.3      1
## 963   963 2415    21   3    Hersheys        Milk   1.9      0
## 964   964 2415    22   1        Dove        Milk   3.4      0
## 965   965 2415    22   2 Ghirardelli        Dark   3.3      1
## 966   966 2415    22   3    Hersheys        Dark   3.8      0
## 967   967 2415    23   1 Ghirardelli Milk w Nuts   1.5      0
## 968   968 2415    23   2    Hersheys        Dark   2.8      1
## 969   969 2415    23   3    Hersheys Milk w Nuts   2.5      0
## 970   970 2415    24   1      Godiva       White   0.5      0
## 971   971 2415    24   2 Ghirardelli Dark w Nuts   1.1      0
## 972   972 2415    24   3 Ghirardelli        Dark   1.4      1
## 973   973 2415    25   1      Godiva        Milk   0.9      0
## 974   974 2415    25   2       Lindt        Dark   2.2      1
## 975   975 2415    25   3 Ghirardelli Dark w Nuts   1.0      0
## 976   976 2417     1   1        Dove        Milk   0.6      1
## 977   977 2417     1   2      Godiva        Dark   0.7      0
## 978   978 2417     1   3        Dove       White   3.6      0
## 979   979 2417     2   1      Godiva Milk w Nuts   2.7      1
## 980   980 2417     2   2      Godiva        Dark   3.9      0
## 981   981 2417     2   3    Hersheys Milk w Nuts   0.7      0
## 982   982 2417     3   1    Hersheys Dark w Nuts   1.7      1
## 983   983 2417     3   2      Godiva        Dark   3.7      0
## 984   984 2417     3   3    Hersheys        Dark   3.0      0
## 985   985 2417     4   1       Lindt        Milk   1.0      0
## 986   986 2417     4   2       Lindt Milk w Nuts   3.6      0
## 987   987 2417     4   3 Ghirardelli Dark w Nuts   0.5      1
## 988   988 2417     5   1    Hersheys Milk w Nuts   0.8      0
## 989   989 2417     5   2      Godiva        Dark   1.5      1
## 990   990 2417     5   3    Hersheys       White   3.3      0
## 991   991 2417     6   1       Lindt        Milk   3.1      0
## 992   992 2417     6   2        Dove       White   2.5      0
## 993   993 2417     6   3      Godiva        Dark   2.6      1
## 994   994 2417     7   1      Godiva       White   3.1      0
## 995   995 2417     7   2        Dove Dark w Nuts   4.0      0
## 996   996 2417     7   3      Godiva        Milk   2.1      1
## 997   997 2417     8   1    Hersheys Dark w Nuts   0.8      0
## 998   998 2417     8   2      Godiva       White   3.2      0
## 999   999 2417     8   3      Godiva        Dark   1.1      1
## 1000 1000 2417     9   1       Lindt        Dark   2.3      0
## 1001 1001 2417     9   2      Godiva        Dark   1.7      1
## 1002 1002 2417     9   3      Godiva       White   3.8      0
## 1003 1003 2417    10   1       Lindt Milk w Nuts   0.6      0
## 1004 1004 2417    10   2      Godiva Milk w Nuts   0.8      1
## 1005 1005 2417    10   3    Hersheys        Dark   3.7      0
## 1006 1006 2417    11   1      Godiva        Milk   1.6      0
## 1007 1007 2417    11   2        Dove       White   0.7      0
## 1008 1008 2417    11   3    Hersheys Dark w Nuts   1.2      1
## 1009 1009 2417    12   1      Godiva Dark w Nuts   1.1      1
## 1010 1010 2417    12   2        Dove Dark w Nuts   0.8      0
## 1011 1011 2417    12   3       Lindt        Dark   3.7      0
## 1012 1012 2417    13   1        Dove        Milk   3.0      0
## 1013 1013 2417    13   2       Lindt       White   0.8      1
## 1014 1014 2417    13   3      Godiva       White   1.9      0
## 1015 1015 2417    14   1       Lindt Dark w Nuts   0.6      1
## 1016 1016 2417    14   2        Dove        Milk   3.5      0
## 1017 1017 2417    14   3        Dove Milk w Nuts   1.9      0
## 1018 1018 2417    15   1      Godiva        Dark   3.7      0
## 1019 1019 2417    15   2 Ghirardelli        Dark   1.5      1
## 1020 1020 2417    15   3        Dove        Dark   1.6      0
## 1021 1021 2417    16   1    Hersheys Milk w Nuts   0.5      1
## 1022 1022 2417    16   2        Dove        Milk   3.8      0
## 1023 1023 2417    16   3        Dove Dark w Nuts   3.7      0
## 1024 1024 2417    17   1        Dove        Milk   3.9      0
## 1025 1025 2417    17   2        Dove Milk w Nuts   1.2      1
## 1026 1026 2417    17   3       Lindt Milk w Nuts   0.5      0
## 1027 1027 2417    18   1      Godiva Milk w Nuts   2.8      0
## 1028 1028 2417    18   2       Lindt        Milk   2.7      1
## 1029 1029 2417    18   3      Godiva       White   2.6      0
## 1030 1030 2417    19   1    Hersheys        Milk   3.7      0
## 1031 1031 2417    19   2        Dove Dark w Nuts   4.0      0
## 1032 1032 2417    19   3        Dove        Dark   2.8      1
## 1033 1033 2417    20   1        Dove        Dark   0.7      1
## 1034 1034 2417    20   2      Godiva       White   0.8      0
## 1035 1035 2417    20   3    Hersheys        Dark   1.9      0
## 1036 1036 2417    21   1 Ghirardelli Milk w Nuts   0.8      1
## 1037 1037 2417    21   2    Hersheys        Milk   3.0      0
## 1038 1038 2417    21   3      Godiva Milk w Nuts   2.4      0
## 1039 1039 2417    22   1      Godiva        Dark   0.9      1
## 1040 1040 2417    22   2        Dove Milk w Nuts   3.4      0
## 1041 1041 2417    22   3    Hersheys Dark w Nuts   3.4      0
## 1042 1042 2417    23   1      Godiva Dark w Nuts   0.6      1
## 1043 1043 2417    23   2        Dove       White   1.8      0
## 1044 1044 2417    23   3        Dove        Dark   3.4      0
## 1045 1045 2417    24   1    Hersheys Dark w Nuts   3.6      0
## 1046 1046 2417    24   2      Godiva Milk w Nuts   3.2      0
## 1047 1047 2417    24   3 Ghirardelli Milk w Nuts   1.4      1
## 1048 1048 2417    25   1       Lindt       White   1.1      0
## 1049 1049 2417    25   2 Ghirardelli       White   0.8      0
## 1050 1050 2417    25   3       Lindt        Milk   2.0      1

Dummy coding

As in, "Just don't do it, dummy." Unfortunately, the default coding in model.matrix() is dummy coding. This coding is useful in experiments where there is a control condition, but is less useful for discrete attributes in conjoint where no level is "special".

model.matrix(~ Brand, data = choc.df)
##      (Intercept) BrandGhirardelli BrandGodiva BrandHersheys BrandLindt
## 1              1                0           0             0          0
## 2              1                0           1             0          0
## 3              1                0           0             0          0
## 4              1                0           1             0          0
## 5              1                0           1             0          0
## 6              1                0           0             1          0
## 7              1                0           0             1          0
## 8              1                0           1             0          0
## 9              1                0           0             1          0
## 10             1                0           0             0          1
## 11             1                0           0             0          1
## 12             1                1           0             0          0
## 13             1                0           0             1          0
## 14             1                0           1             0          0
## 15             1                0           0             1          0
## 16             1                0           0             0          1
## 17             1                0           0             0          0
## 18             1                0           1             0          0
## 19             1                0           1             0          0
## 20             1                0           0             0          0
## 21             1                0           1             0          0
## 22             1                0           0             1          0
## 23             1                0           1             0          0
## 24             1                0           1             0          0
## 25             1                0           0             0          1
## 26             1                0           1             0          0
## 27             1                0           1             0          0
## 28             1                0           0             0          1
## 29             1                0           1             0          0
## 30             1                0           0             1          0
## 31             1                0           1             0          0
## 32             1                0           0             0          0
## 33             1                0           0             1          0
## 34             1                0           1             0          0
## 35             1                0           0             0          0
## 36             1                0           0             0          1
## 37             1                0           0             0          0
## 38             1                0           0             0          1
## 39             1                0           1             0          0
## 40             1                0           0             0          1
## 41             1                0           0             0          0
## 42             1                0           0             0          0
## 43             1                0           1             0          0
## 44             1                1           0             0          0
## 45             1                0           0             0          0
## 46             1                0           0             1          0
## 47             1                0           0             0          0
## 48             1                0           0             0          0
## 49             1                0           0             0          0
## 50             1                0           0             0          0
## 51             1                0           0             0          1
## 52             1                0           1             0          0
## 53             1                0           0             0          1
## 54             1                0           1             0          0
## 55             1                0           0             1          0
## 56             1                0           0             0          0
## 57             1                0           0             0          0
## 58             1                0           0             0          0
## 59             1                0           1             0          0
## 60             1                0           0             1          0
## 61             1                1           0             0          0
## 62             1                0           0             1          0
## 63             1                0           1             0          0
## 64             1                0           1             0          0
## 65             1                0           0             0          0
## 66             1                0           0             1          0
## 67             1                0           1             0          0
## 68             1                0           0             0          0
## 69             1                0           0             0          0
## 70             1                0           0             1          0
## 71             1                0           1             0          0
## 72             1                1           0             0          0
## 73             1                0           0             0          1
## 74             1                1           0             0          0
## 75             1                0           0             0          1
## 76             1                0           0             1          0
## 77             1                0           1             0          0
## 78             1                0           0             0          0
## 79             1                1           0             0          0
## 80             1                0           0             1          0
## 81             1                0           0             1          0
## 82             1                1           0             0          0
## 83             1                0           0             0          0
## 84             1                0           0             0          1
## 85             1                0           0             0          1
## 86             1                0           0             0          0
## 87             1                0           0             0          1
## 88             1                0           1             0          0
## 89             1                0           1             0          0
## 90             1                0           0             1          0
## 91             1                0           0             0          1
## 92             1                0           0             1          0
## 93             1                0           0             0          1
## 94             1                0           0             0          1
## 95             1                0           0             0          1
## 96             1                1           0             0          0
## 97             1                0           0             0          1
## 98             1                1           0             0          0
## 99             1                0           0             0          1
## 100            1                0           0             0          1
## 101            1                0           0             0          0
## 102            1                0           0             0          0
## 103            1                0           0             0          1
## 104            1                0           0             1          0
## 105            1                0           0             1          0
## 106            1                0           0             1          0
## 107            1                0           0             0          0
## 108            1                0           1             0          0
## 109            1                0           0             1          0
## 110            1                0           0             1          0
## 111            1                0           0             0          0
## 112            1                1           0             0          0
## 113            1                0           0             0          0
## 114            1                0           0             1          0
## 115            1                0           0             1          0
## 116            1                0           1             0          0
## 117            1                0           1             0          0
## 118            1                0           1             0          0
## 119            1                0           0             1          0
## 120            1                0           0             1          0
## 121            1                0           0             1          0
## 122            1                1           0             0          0
## 123            1                0           0             1          0
## 124            1                0           0             0          0
## 125            1                1           0             0          0
## 126            1                0           0             0          0
## 127            1                0           0             0          0
## 128            1                1           0             0          0
## 129            1                1           0             0          0
## 130            1                0           0             1          0
## 131            1                0           0             0          0
## 132            1                1           0             0          0
## 133            1                0           1             0          0
## 134            1                0           0             1          0
## 135            1                0           0             0          1
## 136            1                1           0             0          0
## 137            1                0           1             0          0
## 138            1                0           0             0          1
## 139            1                0           1             0          0
## 140            1                0           1             0          0
## 141            1                1           0             0          0
## 142            1                0           1             0          0
## 143            1                0           0             1          0
## 144            1                1           0             0          0
## 145            1                0           1             0          0
## 146            1                0           1             0          0
## 147            1                1           0             0          0
## 148            1                0           1             0          0
## 149            1                0           0             0          1
## 150            1                0           0             0          0
## 151            1                0           0             0          0
## 152            1                0           0             0          0
## 153            1                0           0             0          1
## 154            1                0           1             0          0
## 155            1                1           0             0          0
## 156            1                0           1             0          0
## 157            1                1           0             0          0
## 158            1                0           0             1          0
## 159            1                0           1             0          0
## 160            1                0           1             0          0
## 161            1                0           0             0          1
## 162            1                0           0             1          0
## 163            1                0           1             0          0
## 164            1                0           0             0          0
## 165            1                1           0             0          0
## 166            1                0           0             0          1
## 167            1                0           1             0          0
## 168            1                0           0             0          0
## 169            1                0           0             0          0
## 170            1                0           0             0          1
## 171            1                0           1             0          0
## 172            1                0           0             0          0
## 173            1                0           0             0          1
## 174            1                0           1             0          0
## 175            1                0           1             0          0
## 176            1                0           0             0          1
## 177            1                0           0             0          0
## 178            1                0           0             0          0
## 179            1                0           1             0          0
## 180            1                0           0             0          1
## 181            1                0           1             0          0
## 182            1                0           1             0          0
## 183            1                0           0             0          0
## 184            1                1           0             0          0
## 185            1                1           0             0          0
## 186            1                0           0             0          0
## 187            1                0           0             0          0
## 188            1                0           0             0          1
## 189            1                1           0             0          0
## 190            1                0           0             0          1
## 191            1                0           0             1          0
## 192            1                0           0             1          0
## 193            1                1           0             0          0
## 194            1                0           0             0          0
## 195            1                1           0             0          0
## 196            1                0           0             0          0
## 197            1                0           0             0          0
## 198            1                0           1             0          0
## 199            1                0           0             0          1
## 200            1                1           0             0          0
## 201            1                0           1             0          0
## 202            1                0           0             0          0
## 203            1                0           0             0          0
## 204            1                0           0             1          0
## 205            1                0           0             0          0
## 206            1                0           0             1          0
## 207            1                1           0             0          0
## 208            1                0           1             0          0
## 209            1                0           0             0          1
## 210            1                0           0             1          0
## 211            1                1           0             0          0
## 212            1                0           0             0          1
## 213            1                0           1             0          0
## 214            1                0           1             0          0
## 215            1                0           0             0          1
## 216            1                0           0             0          0
## 217            1                0           0             1          0
## 218            1                0           0             1          0
## 219            1                0           0             0          0
## 220            1                0           0             0          0
## 221            1                1           0             0          0
## 222            1                0           1             0          0
## 223            1                0           0             1          0
## 224            1                0           1             0          0
## 225            1                1           0             0          0
## 226            1                0           0             0          1
## 227            1                1           0             0          0
## 228            1                0           1             0          0
## 229            1                0           0             0          1
## 230            1                0           0             1          0
## 231            1                0           0             1          0
## 232            1                0           0             1          0
## 233            1                0           0             0          0
## 234            1                1           0             0          0
## 235            1                0           1             0          0
## 236            1                1           0             0          0
## 237            1                0           1             0          0
## 238            1                0           0             0          0
## 239            1                0           1             0          0
## 240            1                0           0             0          0
## 241            1                0           0             0          1
## 242            1                1           0             0          0
## 243            1                0           0             0          1
## 244            1                1           0             0          0
## 245            1                0           1             0          0
## 246            1                0           0             0          0
## 247            1                0           0             1          0
## 248            1                1           0             0          0
## 249            1                0           1             0          0
## 250            1                0           0             1          0
## 251            1                1           0             0          0
## 252            1                0           1             0          0
## 253            1                0           0             0          1
## 254            1                0           1             0          0
## 255            1                1           0             0          0
## 256            1                1           0             0          0
## 257            1                0           0             0          0
## 258            1                1           0             0          0
## 259            1                1           0             0          0
## 260            1                0           0             0          1
## 261            1                0           0             0          0
## 262            1                0           0             0          0
## 263            1                0           0             1          0
## 264            1                1           0             0          0
## 265            1                0           0             0          1
## 266            1                1           0             0          0
## 267            1                0           0             1          0
## 268            1                0           0             1          0
## 269            1                0           1             0          0
## 270            1                0           0             1          0
## 271            1                1           0             0          0
## 272            1                1           0             0          0
## 273            1                0           1             0          0
## 274            1                1           0             0          0
## 275            1                0           1             0          0
## 276            1                0           0             1          0
## 277            1                0           1             0          0
## 278            1                1           0             0          0
## 279            1                0           0             1          0
## 280            1                0           0             1          0
## 281            1                0           0             0          0
## 282            1                0           0             1          0
## 283            1                0           0             0          1
## 284            1                0           0             0          0
## 285            1                0           0             0          1
## 286            1                0           0             1          0
## 287            1                0           0             1          0
## 288            1                1           0             0          0
## 289            1                0           1             0          0
## 290            1                0           0             0          0
## 291            1                0           0             0          1
## 292            1                0           1             0          0
## 293            1                0           0             1          0
## 294            1                0           1             0          0
## 295            1                1           0             0          0
## 296            1                1           0             0          0
## 297            1                0           0             0          1
## 298            1                0           0             0          1
## 299            1                0           0             1          0
## 300            1                1           0             0          0
## 301            1                1           0             0          0
## 302            1                0           0             0          1
## 303            1                0           0             1          0
## 304            1                1           0             0          0
## 305            1                0           0             0          1
## 306            1                0           1             0          0
## 307            1                0           0             0          1
## 308            1                0           0             1          0
## 309            1                0           1             0          0
## 310            1                0           0             1          0
## 311            1                0           0             0          0
## 312            1                0           0             0          1
## 313            1                0           0             0          0
## 314            1                0           0             1          0
## 315            1                0           0             0          1
## 316            1                0           0             0          1
## 317            1                0           0             0          0
## 318            1                0           0             0          1
## 319            1                0           1             0          0
## 320            1                0           0             0          0
## 321            1                0           0             0          0
## 322            1                0           0             1          0
## 323            1                0           0             1          0
## 324            1                0           1             0          0
## 325            1                0           0             0          0
## 326            1                0           0             0          0
## 327            1                1           0             0          0
## 328            1                0           0             0          1
## 329            1                0           0             0          0
## 330            1                0           0             1          0
## 331            1                0           1             0          0
## 332            1                0           0             1          0
## 333            1                1           0             0          0
## 334            1                0           1             0          0
## 335            1                1           0             0          0
## 336            1                0           0             0          1
## 337            1                0           0             0          1
## 338            1                1           0             0          0
## 339            1                0           0             0          1
## 340            1                0           0             0          1
## 341            1                0           1             0          0
## 342            1                0           0             1          0
## 343            1                0           0             0          0
## 344            1                1           0             0          0
## 345            1                0           1             0          0
## 346            1                0           0             0          1
## 347            1                1           0             0          0
## 348            1                0           0             0          0
## 349            1                0           0             0          1
## 350            1                0           0             0          1
## 351            1                0           1             0          0
## 352            1                0           0             0          1
## 353            1                0           0             1          0
## 354            1                0           0             1          0
## 355            1                0           1             0          0
## 356            1                0           0             0          0
## 357            1                1           0             0          0
## 358            1                0           0             0          1
## 359            1                0           0             0          1
## 360            1                0           0             0          0
## 361            1                0           0             1          0
## 362            1                0           0             0          1
## 363            1                0           0             1          0
## 364            1                0           0             0          0
## 365            1                1           0             0          0
## 366            1                0           0             1          0
## 367            1                1           0             0          0
## 368            1                0           0             1          0
## 369            1                0           0             1          0
## 370            1                0           1             0          0
## 371            1                1           0             0          0
## 372            1                1           0             0          0
## 373            1                0           1             0          0
## 374            1                0           0             0          1
## 375            1                1           0             0          0
## 376            1                1           0             0          0
## 377            1                0           0             0          0
## 378            1                0           0             0          0
## 379            1                1           0             0          0
## 380            1                0           1             0          0
## 381            1                0           0             0          0
## 382            1                0           0             0          0
## 383            1                0           0             1          0
## 384            1                0           0             0          1
## 385            1                1           0             0          0
## 386            1                0           0             0          1
## 387            1                0           1             0          0
## 388            1                0           0             0          0
## 389            1                1           0             0          0
## 390            1                0           1             0          0
## 391            1                0           1             0          0
## 392            1                1           0             0          0
## 393            1                0           0             1          0
## 394            1                0           1             0          0
## 395            1                0           0             1          0
## 396            1                1           0             0          0
## 397            1                0           1             0          0
## 398            1                1           0             0          0
## 399            1                0           1             0          0
## 400            1                0           0             1          0
## 401            1                0           1             0          0
## 402            1                0           0             0          0
## 403            1                1           0             0          0
## 404            1                0           1             0          0
## 405            1                0           0             0          0
## 406            1                0           1             0          0
## 407            1                0           0             1          0
## 408            1                0           0             0          0
## 409            1                0           0             0          1
## 410            1                0           1             0          0
## 411            1                0           0             0          1
## 412            1                0           0             0          1
## 413            1                0           0             0          1
## 414            1                0           1             0          0
## 415            1                0           1             0          0
## 416            1                0           1             0          0
## 417            1                0           0             0          0
## 418            1                0           0             1          0
## 419            1                1           0             0          0
## 420            1                0           0             0          1
## 421            1                0           0             0          1
## 422            1                0           0             1          0
## 423            1                0           0             0          1
## 424            1                0           1             0          0
## 425            1                0           0             0          0
## 426            1                1           0             0          0
## 427            1                0           1             0          0
## 428            1                0           0             0          1
## 429            1                1           0             0          0
## 430            1                1           0             0          0
## 431            1                0           0             1          0
## 432            1                0           1             0          0
## 433            1                0           0             0          0
## 434            1                0           0             0          1
## 435            1                0           0             1          0
## 436            1                0           0             0          0
## 437            1                0           1             0          0
## 438            1                0           0             0          0
## 439            1                0           0             0          0
## 440            1                1           0             0          0
## 441            1                1           0             0          0
## 442            1                0           1             0          0
## 443            1                0           0             0          0
## 444            1                1           0             0          0
## 445            1                0           0             0          1
## 446            1                0           1             0          0
## 447            1                0           0             0          0
## 448            1                0           0             0          1
## 449            1                0           1             0          0
## 450            1                1           0             0          0
## 451            1                0           0             0          0
## 452            1                0           1             0          0
## 453            1                0           0             0          0
## 454            1                0           1             0          0
## 455            1                0           1             0          0
## 456            1                0           0             1          0
## 457            1                0           0             1          0
## 458            1                0           1             0          0
## 459            1                0           0             1          0
## 460            1                0           0             0          1
## 461            1                0           0             0          1
## 462            1                1           0             0          0
## 463            1                0           0             1          0
## 464            1                0           1             0          0
## 465            1                0           0             1          0
## 466            1                0           0             0          1
## 467            1                0           0             0          0
## 468            1                0           1             0          0
## 469            1                0           1             0          0
## 470            1                0           0             0          0
## 471            1                0           1             0          0
## 472            1                0           0             1          0
## 473            1                0           1             0          0
## 474            1                0           1             0          0
## 475            1                0           0             0          1
## 476            1                0           1             0          0
## 477            1                0           1             0          0
## 478            1                0           0             0          1
## 479            1                0           1             0          0
## 480            1                0           0             1          0
## 481            1                0           1             0          0
## 482            1                0           0             0          0
## 483            1                0           0             1          0
## 484            1                0           1             0          0
## 485            1                0           0             0          0
## 486            1                0           0             0          1
## 487            1                0           0             0          0
## 488            1                0           0             0          1
## 489            1                0           1             0          0
## 490            1                0           0             0          1
## 491            1                0           0             0          0
## 492            1                0           0             0          0
## 493            1                0           1             0          0
## 494            1                1           0             0          0
## 495            1                0           0             0          0
## 496            1                0           0             1          0
## 497            1                0           0             0          0
## 498            1                0           0             0          0
## 499            1                0           0             0          0
## 500            1                0           0             0          0
## 501            1                0           0             0          1
## 502            1                0           1             0          0
## 503            1                0           0             0          1
## 504            1                0           1             0          0
## 505            1                0           0             1          0
## 506            1                0           0             0          0
## 507            1                0           0             0          0
## 508            1                0           0             0          0
## 509            1                0           1             0          0
## 510            1                0           0             1          0
## 511            1                1           0             0          0
## 512            1                0           0             1          0
## 513            1                0           1             0          0
## 514            1                0           1             0          0
## 515            1                0           0             0          0
## 516            1                0           0             1          0
## 517            1                0           1             0          0
## 518            1                0           0             0          0
## 519            1                0           0             0          0
## 520            1                0           0             1          0
## 521            1                0           1             0          0
## 522            1                1           0             0          0
## 523            1                0           0             0          1
## 524            1                1           0             0          0
## 525            1                0           0             0          1
## 526            1                0           0             0          0
## 527            1                0           0             0          0
## 528            1                0           0             0          1
## 529            1                0           1             0          0
## 530            1                1           0             0          0
## 531            1                0           1             0          0
## 532            1                1           0             0          0
## 533            1                0           0             1          0
## 534            1                0           1             0          0
## 535            1                0           1             0          0
## 536            1                0           0             0          1
## 537            1                0           0             1          0
## 538            1                0           1             0          0
## 539            1                0           0             0          0
## 540            1                1           0             0          0
## 541            1                0           0             0          1
## 542            1                0           1             0          0
## 543            1                0           0             0          0
## 544            1                0           0             0          0
## 545            1                0           0             0          1
## 546            1                0           1             0          0
## 547            1                0           0             0          0
## 548            1                0           0             0          1
## 549            1                0           1             0          0
## 550            1                0           1             0          0
## 551            1                0           0             0          1
## 552            1                0           0             0          0
## 553            1                0           0             0          0
## 554            1                0           1             0          0
## 555            1                0           0             0          1
## 556            1                0           1             0          0
## 557            1                0           1             0          0
## 558            1                0           0             0          0
## 559            1                1           0             0          0
## 560            1                1           0             0          0
## 561            1                0           0             0          0
## 562            1                0           0             0          0
## 563            1                0           0             0          1
## 564            1                1           0             0          0
## 565            1                0           0             0          1
## 566            1                0           0             1          0
## 567            1                0           0             1          0
## 568            1                1           0             0          0
## 569            1                0           0             0          0
## 570            1                1           0             0          0
## 571            1                0           0             0          0
## 572            1                0           0             0          0
## 573            1                0           1             0          0
## 574            1                0           0             0          1
## 575            1                1           0             0          0
## 576            1                0           1             0          0
## 577            1                0           0             0          0
## 578            1                0           0             0          0
## 579            1                0           0             1          0
## 580            1                0           0             0          0
## 581            1                0           0             1          0
## 582            1                1           0             0          0
## 583            1                0           1             0          0
## 584            1                0           0             0          1
## 585            1                0           0             1          0
## 586            1                1           0             0          0
## 587            1                0           0             0          1
## 588            1                0           1             0          0
## 589            1                0           1             0          0
## 590            1                0           0             0          1
## 591            1                0           0             0          0
## 592            1                0           0             1          0
## 593            1                0           0             1          0
## 594            1                0           0             0          0
## 595            1                0           0             0          0
## 596            1                1           0             0          0
## 597            1                0           1             0          0
## 598            1                0           0             1          0
## 599            1                0           1             0          0
## 600            1                1           0             0          0
## 601            1                0           0             1          0
## 602            1                0           1             0          0
## 603            1                0           0             0          0
## 604            1                1           0             0          0
## 605            1                0           0             1          0
## 606            1                0           0             1          0
## 607            1                1           0             0          0
## 608            1                0           0             0          0
## 609            1                0           0             0          1
## 610            1                0           0             0          1
## 611            1                0           0             0          0
## 612            1                0           0             0          1
## 613            1                0           1             0          0
## 614            1                0           1             0          0
## 615            1                0           0             1          0
## 616            1                0           0             0          1
## 617            1                0           0             1          0
## 618            1                0           0             0          1
## 619            1                0           0             0          1
## 620            1                0           0             0          1
## 621            1                1           0             0          0
## 622            1                0           0             0          1
## 623            1                1           0             0          0
## 624            1                0           0             0          1
## 625            1                0           0             0          1
## 626            1                0           0             0          0
## 627            1                0           0             0          0
## 628            1                0           0             0          1
## 629            1                0           0             1          0
## 630            1                0           0             1          0
## 631            1                0           0             1          0
## 632            1                0           0             0          0
## 633            1                0           1             0          0
## 634            1                0           0             1          0
## 635            1                0           0             1          0
## 636            1                0           0             0          0
## 637            1                1           0             0          0
## 638            1                0           0             0          0
## 639            1                0           0             1          0
## 640            1                0           0             1          0
## 641            1                0           1             0          0
## 642            1                0           1             0          0
## 643            1                0           1             0          0
## 644            1                0           0             1          0
## 645            1                0           0             1          0
## 646            1                0           0             1          0
## 647            1                1           0             0          0
## 648            1                0           0             1          0
## 649            1                0           0             0          0
## 650            1                1           0             0          0
## 651            1                0           0             0          0
## 652            1                0           0             0          0
## 653            1                1           0             0          0
## 654            1                1           0             0          0
## 655            1                0           0             1          0
## 656            1                0           0             0          0
## 657            1                1           0             0          0
## 658            1                0           1             0          0
## 659            1                0           0             1          0
## 660            1                0           0             0          1
## 661            1                1           0             0          0
## 662            1                0           1             0          0
## 663            1                0           0             0          1
## 664            1                0           1             0          0
## 665            1                0           1             0          0
## 666            1                1           0             0          0
## 667            1                0           1             0          0
## 668            1                0           0             1          0
## 669            1                1           0             0          0
## 670            1                0           1             0          0
## 671            1                0           1             0          0
## 672            1                1           0             0          0
## 673            1                0           1             0          0
## 674            1                0           0             0          1
## 675            1                0           0             0          0
## 676            1                0           0             1          0
## 677            1                0           0             1          0
## 678            1                0           0             0          1
## 679            1                0           0             1          0
## 680            1                0           1             0          0
## 681            1                0           0             0          1
## 682            1                1           0             0          0
## 683            1                0           0             0          1
## 684            1                0           1             0          0
## 685            1                0           0             1          0
## 686            1                0           0             1          0
## 687            1                0           0             0          0
## 688            1                0           0             0          1
## 689            1                1           0             0          0
## 690            1                0           1             0          0
## 691            1                0           0             0          0
## 692            1                0           0             1          0
## 693            1                0           0             0          0
## 694            1                1           0             0          0
## 695            1                0           1             0          0
## 696            1                0           0             0          1
## 697            1                0           0             0          1
## 698            1                0           0             1          0
## 699            1                0           0             0          0
## 700            1                1           0             0          0
## 701            1                0           0             0          0
## 702            1                0           0             0          0
## 703            1                1           0             0          0
## 704            1                1           0             0          0
## 705            1                0           0             1          0
## 706            1                0           0             1          0
## 707            1                0           0             0          1
## 708            1                0           0             0          1
## 709            1                1           0             0          0
## 710            1                0           1             0          0
## 711            1                0           0             1          0
## 712            1                0           0             0          1
## 713            1                0           0             1          0
## 714            1                1           0             0          0
## 715            1                0           0             1          0
## 716            1                0           0             0          0
## 717            1                0           0             0          1
## 718            1                0           0             0          1
## 719            1                1           0             0          0
## 720            1                0           0             1          0
## 721            1                0           0             1          0
## 722            1                0           0             1          0
## 723            1                0           1             0          0
## 724            1                1           0             0          0
## 725            1                1           0             0          0
## 726            1                0           1             0          0
## 727            1                0           0             0          0
## 728            1                0           0             1          0
## 729            1                0           0             0          0
## 730            1                0           0             1          0
## 731            1                0           0             1          0
## 732            1                0           0             0          0
## 733            1                1           0             0          0
## 734            1                1           0             0          0
## 735            1                0           0             1          0
## 736            1                0           0             0          0
## 737            1                0           0             1          0
## 738            1                0           0             0          1
## 739            1                0           0             0          0
## 740            1                0           0             0          1
## 741            1                0           1             0          0
## 742            1                1           0             0          0
## 743            1                0           0             0          0
## 744            1                0           1             0          0
## 745            1                1           0             0          0
## 746            1                0           0             0          1
## 747            1                0           0             0          1
## 748            1                0           0             0          0
## 749            1                1           0             0          0
## 750            1                0           0             1          0
## 751            1                0           0             0          1
## 752            1                1           0             0          0
## 753            1                0           1             0          0
## 754            1                0           0             0          1
## 755            1                0           0             1          0
## 756            1                0           0             1          0
## 757            1                0           0             1          0
## 758            1                0           0             0          0
## 759            1                1           0             0          0
## 760            1                0           1             0          0
## 761            1                1           0             0          0
## 762            1                0           1             0          0
## 763            1                0           0             0          0
## 764            1                0           1             0          0
## 765            1                0           0             0          0
## 766            1                0           0             0          1
## 767            1                1           0             0          0
## 768            1                0           0             0          1
## 769            1                1           0             0          0
## 770            1                0           1             0          0
## 771            1                0           0             0          0
## 772            1                0           0             1          0
## 773            1                1           0             0          0
## 774            1                0           1             0          0
## 775            1                0           0             1          0
## 776            1                1           0             0          0
## 777            1                0           1             0          0
## 778            1                0           0             0          1
## 779            1                0           1             0          0
## 780            1                1           0             0          0
## 781            1                1           0             0          0
## 782            1                0           0             0          0
## 783            1                1           0             0          0
## 784            1                1           0             0          0
## 785            1                0           0             0          1
## 786            1                0           0             0          0
## 787            1                0           0             0          0
## 788            1                0           0             1          0
## 789            1                1           0             0          0
## 790            1                0           0             0          1
## 791            1                1           0             0          0
## 792            1                0           0             1          0
## 793            1                0           0             1          0
## 794            1                0           1             0          0
## 795            1                0           0             1          0
## 796            1                1           0             0          0
## 797            1                1           0             0          0
## 798            1                0           1             0          0
## 799            1                1           0             0          0
## 800            1                0           1             0          0
## 801            1                0           0             1          0
## 802            1                0           1             0          0
## 803            1                1           0             0          0
## 804            1                0           0             1          0
## 805            1                0           0             1          0
## 806            1                0           0             0          0
## 807            1                0           0             1          0
## 808            1                0           0             0          1
## 809            1                0           0             0          0
## 810            1                0           0             0          1
## 811            1                0           0             1          0
## 812            1                0           0             1          0
## 813            1                1           0             0          0
## 814            1                0           1             0          0
## 815            1                0           0             0          0
## 816            1                0           0             0          1
## 817            1                0           1             0          0
## 818            1                0           0             1          0
## 819            1                0           1             0          0
## 820            1                1           0             0          0
## 821            1                1           0             0          0
## 822            1                0           0             0          1
## 823            1                0           0             0          1
## 824            1                0           0             1          0
## 825            1                1           0             0          0
## 826            1                0           0             0          1
## 827            1                0           0             0          1
## 828            1                0           0             1          0
## 829            1                1           0             0          0
## 830            1                0           0             0          1
## 831            1                0           1             0          0
## 832            1                0           0             1          0
## 833            1                0           0             0          0
## 834            1                0           0             1          0
## 835            1                1           0             0          0
## 836            1                0           0             1          0
## 837            1                0           0             0          1
## 838            1                1           0             0          0
## 839            1                0           0             0          0
## 840            1                0           0             0          0
## 841            1                1           0             0          0
## 842            1                0           1             0          0
## 843            1                1           0             0          0
## 844            1                0           0             0          0
## 845            1                0           1             0          0
## 846            1                0           0             0          0
## 847            1                0           0             0          0
## 848            1                1           0             0          0
## 849            1                0           0             0          1
## 850            1                0           1             0          0
## 851            1                0           0             0          0
## 852            1                0           0             0          1
## 853            1                0           0             0          1
## 854            1                0           0             0          1
## 855            1                0           0             1          0
## 856            1                0           0             1          0
## 857            1                0           0             0          1
## 858            1                0           1             0          0
## 859            1                0           0             0          0
## 860            1                0           0             1          0
## 861            1                0           0             0          1
## 862            1                0           0             0          1
## 863            1                0           0             0          0
## 864            1                0           0             0          1
## 865            1                1           0             0          0
## 866            1                1           0             0          0
## 867            1                1           0             0          0
## 868            1                0           0             0          1
## 869            1                0           0             1          0
## 870            1                0           0             0          1
## 871            1                0           0             0          1
## 872            1                1           0             0          0
## 873            1                1           0             0          0
## 874            1                0           0             0          1
## 875            1                0           0             0          1
## 876            1                0           0             0          1
## 877            1                0           1             0          0
## 878            1                1           0             0          0
## 879            1                0           0             0          1
## 880            1                0           1             0          0
## 881            1                0           0             0          0
## 882            1                0           1             0          0
## 883            1                0           0             0          0
## 884            1                0           0             0          1
## 885            1                0           0             1          0
## 886            1                0           0             0          1
## 887            1                0           0             1          0
## 888            1                0           1             0          0
## 889            1                0           0             0          1
## 890            1                0           0             0          1
## 891            1                1           0             0          0
## 892            1                1           0             0          0
## 893            1                0           1             0          0
## 894            1                0           0             0          1
## 895            1                1           0             0          0
## 896            1                0           1             0          0
## 897            1                0           0             0          0
## 898            1                0           0             0          1
## 899            1                0           0             1          0
## 900            1                0           0             0          1
## 901            1                1           0             0          0
## 902            1                0           0             0          1
## 903            1                0           0             1          0
## 904            1                1           0             0          0
## 905            1                0           0             0          1
## 906            1                0           1             0          0
## 907            1                0           0             0          1
## 908            1                0           0             1          0
## 909            1                0           1             0          0
## 910            1                0           0             1          0
## 911            1                0           0             0          0
## 912            1                0           0             0          1
## 913            1                0           0             0          0
## 914            1                0           0             1          0
## 915            1                0           0             0          1
## 916            1                0           0             0          1
## 917            1                0           0             0          0
## 918            1                0           0             0          1
## 919            1                0           1             0          0
## 920            1                0           0             0          0
## 921            1                0           0             0          0
## 922            1                0           0             1          0
## 923            1                0           0             1          0
## 924            1                0           1             0          0
## 925            1                0           0             0          0
## 926            1                0           0             0          0
## 927            1                1           0             0          0
## 928            1                0           0             0          1
## 929            1                0           0             0          0
## 930            1                0           0             1          0
## 931            1                0           1             0          0
## 932            1                0           0             1          0
## 933            1                1           0             0          0
## 934            1                0           1             0          0
## 935            1                1           0             0          0
## 936            1                0           0             0          1
## 937            1                0           0             0          1
## 938            1                1           0             0          0
## 939            1                0           0             0          1
## 940            1                0           0             0          1
## 941            1                0           1             0          0
## 942            1                0           0             1          0
## 943            1                0           0             0          0
## 944            1                1           0             0          0
## 945            1                0           1             0          0
## 946            1                0           0             0          1
## 947            1                1           0             0          0
## 948            1                0           0             0          0
## 949            1                0           0             0          1
## 950            1                0           0             0          1
## 951            1                0           1             0          0
## 952            1                0           0             0          1
## 953            1                0           0             1          0
## 954            1                0           0             1          0
## 955            1                0           1             0          0
## 956            1                0           0             0          0
## 957            1                1           0             0          0
## 958            1                0           0             0          1
## 959            1                0           0             0          1
## 960            1                0           0             0          0
## 961            1                0           0             1          0
## 962            1                0           0             0          1
## 963            1                0           0             1          0
## 964            1                0           0             0          0
## 965            1                1           0             0          0
## 966            1                0           0             1          0
## 967            1                1           0             0          0
## 968            1                0           0             1          0
## 969            1                0           0             1          0
## 970            1                0           1             0          0
## 971            1                1           0             0          0
## 972            1                1           0             0          0
## 973            1                0           1             0          0
## 974            1                0           0             0          1
## 975            1                1           0             0          0
## 976            1                0           0             0          0
## 977            1                0           1             0          0
## 978            1                0           0             0          0
## 979            1                0           1             0          0
## 980            1                0           1             0          0
## 981            1                0           0             1          0
## 982            1                0           0             1          0
## 983            1                0           1             0          0
## 984            1                0           0             1          0
## 985            1                0           0             0          1
## 986            1                0           0             0          1
## 987            1                1           0             0          0
## 988            1                0           0             1          0
## 989            1                0           1             0          0
## 990            1                0           0             1          0
## 991            1                0           0             0          1
## 992            1                0           0             0          0
## 993            1                0           1             0          0
## 994            1                0           1             0          0
## 995            1                0           0             0          0
## 996            1                0           1             0          0
## 997            1                0           0             1          0
## 998            1                0           1             0          0
## 999            1                0           1             0          0
## 1000           1                0           0             0          1
## 1001           1                0           1             0          0
## 1002           1                0           1             0          0
## 1003           1                0           0             0          1
## 1004           1                0           1             0          0
## 1005           1                0           0             1          0
## 1006           1                0           1             0          0
## 1007           1                0           0             0          0
## 1008           1                0           0             1          0
## 1009           1                0           1             0          0
## 1010           1                0           0             0          0
## 1011           1                0           0             0          1
## 1012           1                0           0             0          0
## 1013           1                0           0             0          1
## 1014           1                0           1             0          0
## 1015           1                0           0             0          1
## 1016           1                0           0             0          0
## 1017           1                0           0             0          0
## 1018           1                0           1             0          0
## 1019           1                1           0             0          0
## 1020           1                0           0             0          0
## 1021           1                0           0             1          0
## 1022           1                0           0             0          0
## 1023           1                0           0             0          0
## 1024           1                0           0             0          0
## 1025           1                0           0             0          0
## 1026           1                0           0             0          1
## 1027           1                0           1             0          0
## 1028           1                0           0             0          1
## 1029           1                0           1             0          0
## 1030           1                0           0             1          0
## 1031           1                0           0             0          0
## 1032           1                0           0             0          0
## 1033           1                0           0             0          0
## 1034           1                0           1             0          0
## 1035           1                0           0             1          0
## 1036           1                1           0             0          0
## 1037           1                0           0             1          0
## 1038           1                0           1             0          0
## 1039           1                0           1             0          0
## 1040           1                0           0             0          0
## 1041           1                0           0             1          0
## 1042           1                0           1             0          0
## 1043           1                0           0             0          0
## 1044           1                0           0             0          0
## 1045           1                0           0             1          0
## 1046           1                0           1             0          0
## 1047           1                1           0             0          0
## 1048           1                0           0             0          1
## 1049           1                1           0             0          0
## 1050           1                0           0             0          1
## attr(,"assign")
## [1] 0 1 1 1 1
## attr(,"contrasts")
## attr(,"contrasts")$Brand
## [1] "contr.treatment"

Effects coding (1)

  • A better coding scheme is the sum-to-one coding.
    • No level is designated as the base level.
    • All parameter values can be interpreted as "relative to the average."
    • You can compute a parameter value for the left-out level (negative sum of the parameters for other levels).
    • It is easier to put a symetric prior on these parameters. See Kevin's blog post.

Effects coding (2)

model.matrix(~ Brand, data = choc.df, 
             contrasts = list(Brand = "contr.sum"))
##      (Intercept) Brand1 Brand2 Brand3 Brand4
## 1              1      1      0      0      0
## 2              1      0      0      1      0
## 3              1      1      0      0      0
## 4              1      0      0      1      0
## 5              1      0      0      1      0
## 6              1      0      0      0      1
## 7              1      0      0      0      1
## 8              1      0      0      1      0
## 9              1      0      0      0      1
## 10             1     -1     -1     -1     -1
## 11             1     -1     -1     -1     -1
## 12             1      0      1      0      0
## 13             1      0      0      0      1
## 14             1      0      0      1      0
## 15             1      0      0      0      1
## 16             1     -1     -1     -1     -1
## 17             1      1      0      0      0
## 18             1      0      0      1      0
## 19             1      0      0      1      0
## 20             1      1      0      0      0
## 21             1      0      0      1      0
## 22             1      0      0      0      1
## 23             1      0      0      1      0
## 24             1      0      0      1      0
## 25             1     -1     -1     -1     -1
## 26             1      0      0      1      0
## 27             1      0      0      1      0
## 28             1     -1     -1     -1     -1
## 29             1      0      0      1      0
## 30             1      0      0      0      1
## 31             1      0      0      1      0
## 32             1      1      0      0      0
## 33             1      0      0      0      1
## 34             1      0      0      1      0
## 35             1      1      0      0      0
## 36             1     -1     -1     -1     -1
## 37             1      1      0      0      0
## 38             1     -1     -1     -1     -1
## 39             1      0      0      1      0
## 40             1     -1     -1     -1     -1
## 41             1      1      0      0      0
## 42             1      1      0      0      0
## 43             1      0      0      1      0
## 44             1      0      1      0      0
## 45             1      1      0      0      0
## 46             1      0      0      0      1
## 47             1      1      0      0      0
## 48             1      1      0      0      0
## 49             1      1      0      0      0
## 50             1      1      0      0      0
## 51             1     -1     -1     -1     -1
## 52             1      0      0      1      0
## 53             1     -1     -1     -1     -1
## 54             1      0      0      1      0
## 55             1      0      0      0      1
## 56             1      1      0      0      0
## 57             1      1      0      0      0
## 58             1      1      0      0      0
## 59             1      0      0      1      0
## 60             1      0      0      0      1
## 61             1      0      1      0      0
## 62             1      0      0      0      1
## 63             1      0      0      1      0
## 64             1      0      0      1      0
## 65             1      1      0      0      0
## 66             1      0      0      0      1
## 67             1      0      0      1      0
## 68             1      1      0      0      0
## 69             1      1      0      0      0
## 70             1      0      0      0      1
## 71             1      0      0      1      0
## 72             1      0      1      0      0
## 73             1     -1     -1     -1     -1
## 74             1      0      1      0      0
## 75             1     -1     -1     -1     -1
## 76             1      0      0      0      1
## 77             1      0      0      1      0
## 78             1      1      0      0      0
## 79             1      0      1      0      0
## 80             1      0      0      0      1
## 81             1      0      0      0      1
## 82             1      0      1      0      0
## 83             1      1      0      0      0
## 84             1     -1     -1     -1     -1
## 85             1     -1     -1     -1     -1
## 86             1      1      0      0      0
## 87             1     -1     -1     -1     -1
## 88             1      0      0      1      0
## 89             1      0      0      1      0
## 90             1      0      0      0      1
## 91             1     -1     -1     -1     -1
## 92             1      0      0      0      1
## 93             1     -1     -1     -1     -1
## 94             1     -1     -1     -1     -1
## 95             1     -1     -1     -1     -1
## 96             1      0      1      0      0
## 97             1     -1     -1     -1     -1
## 98             1      0      1      0      0
## 99             1     -1     -1     -1     -1
## 100            1     -1     -1     -1     -1
## 101            1      1      0      0      0
## 102            1      1      0      0      0
## 103            1     -1     -1     -1     -1
## 104            1      0      0      0      1
## 105            1      0      0      0      1
## 106            1      0      0      0      1
## 107            1      1      0      0      0
## 108            1      0      0      1      0
## 109            1      0      0      0      1
## 110            1      0      0      0      1
## 111            1      1      0      0      0
## 112            1      0      1      0      0
## 113            1      1      0      0      0
## 114            1      0      0      0      1
## 115            1      0      0      0      1
## 116            1      0      0      1      0
## 117            1      0      0      1      0
## 118            1      0      0      1      0
## 119            1      0      0      0      1
## 120            1      0      0      0      1
## 121            1      0      0      0      1
## 122            1      0      1      0      0
## 123            1      0      0      0      1
## 124            1      1      0      0      0
## 125            1      0      1      0      0
## 126            1      1      0      0      0
## 127            1      1      0      0      0
## 128            1      0      1      0      0
## 129            1      0      1      0      0
## 130            1      0      0      0      1
## 131            1      1      0      0      0
## 132            1      0      1      0      0
## 133            1      0      0      1      0
## 134            1      0      0      0      1
## 135            1     -1     -1     -1     -1
## 136            1      0      1      0      0
## 137            1      0      0      1      0
## 138            1     -1     -1     -1     -1
## 139            1      0      0      1      0
## 140            1      0      0      1      0
## 141            1      0      1      0      0
## 142            1      0      0      1      0
## 143            1      0      0      0      1
## 144            1      0      1      0      0
## 145            1      0      0      1      0
## 146            1      0      0      1      0
## 147            1      0      1      0      0
## 148            1      0      0      1      0
## 149            1     -1     -1     -1     -1
## 150            1      1      0      0      0
## 151            1      1      0      0      0
## 152            1      1      0      0      0
## 153            1     -1     -1     -1     -1
## 154            1      0      0      1      0
## 155            1      0      1      0      0
## 156            1      0      0      1      0
## 157            1      0      1      0      0
## 158            1      0      0      0      1
## 159            1      0      0      1      0
## 160            1      0      0      1      0
## 161            1     -1     -1     -1     -1
## 162            1      0      0      0      1
## 163            1      0      0      1      0
## 164            1      1      0      0      0
## 165            1      0      1      0      0
## 166            1     -1     -1     -1     -1
## 167            1      0      0      1      0
## 168            1      1      0      0      0
## 169            1      1      0      0      0
## 170            1     -1     -1     -1     -1
## 171            1      0      0      1      0
## 172            1      1      0      0      0
## 173            1     -1     -1     -1     -1
## 174            1      0      0      1      0
## 175            1      0      0      1      0
## 176            1     -1     -1     -1     -1
## 177            1      1      0      0      0
## 178            1      1      0      0      0
## 179            1      0      0      1      0
## 180            1     -1     -1     -1     -1
## 181            1      0      0      1      0
## 182            1      0      0      1      0
## 183            1      1      0      0      0
## 184            1      0      1      0      0
## 185            1      0      1      0      0
## 186            1      1      0      0      0
## 187            1      1      0      0      0
## 188            1     -1     -1     -1     -1
## 189            1      0      1      0      0
## 190            1     -1     -1     -1     -1
## 191            1      0      0      0      1
## 192            1      0      0      0      1
## 193            1      0      1      0      0
## 194            1      1      0      0      0
## 195            1      0      1      0      0
## 196            1      1      0      0      0
## 197            1      1      0      0      0
## 198            1      0      0      1      0
## 199            1     -1     -1     -1     -1
## 200            1      0      1      0      0
## 201            1      0      0      1      0
## 202            1      1      0      0      0
## 203            1      1      0      0      0
## 204            1      0      0      0      1
## 205            1      1      0      0      0
## 206            1      0      0      0      1
## 207            1      0      1      0      0
## 208            1      0      0      1      0
## 209            1     -1     -1     -1     -1
## 210            1      0      0      0      1
## 211            1      0      1      0      0
## 212            1     -1     -1     -1     -1
## 213            1      0      0      1      0
## 214            1      0      0      1      0
## 215            1     -1     -1     -1     -1
## 216            1      1      0      0      0
## 217            1      0      0      0      1
## 218            1      0      0      0      1
## 219            1      1      0      0      0
## 220            1      1      0      0      0
## 221            1      0      1      0      0
## 222            1      0      0      1      0
## 223            1      0      0      0      1
## 224            1      0      0      1      0
## 225            1      0      1      0      0
## 226            1     -1     -1     -1     -1
## 227            1      0      1      0      0
## 228            1      0      0      1      0
## 229            1     -1     -1     -1     -1
## 230            1      0      0      0      1
## 231            1      0      0      0      1
## 232            1      0      0      0      1
## 233            1      1      0      0      0
## 234            1      0      1      0      0
## 235            1      0      0      1      0
## 236            1      0      1      0      0
## 237            1      0      0      1      0
## 238            1      1      0      0      0
## 239            1      0      0      1      0
## 240            1      1      0      0      0
## 241            1     -1     -1     -1     -1
## 242            1      0      1      0      0
## 243            1     -1     -1     -1     -1
## 244            1      0      1      0      0
## 245            1      0      0      1      0
## 246            1      1      0      0      0
## 247            1      0      0      0      1
## 248            1      0      1      0      0
## 249            1      0      0      1      0
## 250            1      0      0      0      1
## 251            1      0      1      0      0
## 252            1      0      0      1      0
## 253            1     -1     -1     -1     -1
## 254            1      0      0      1      0
## 255            1      0      1      0      0
## 256            1      0      1      0      0
## 257            1      1      0      0      0
## 258            1      0      1      0      0
## 259            1      0      1      0      0
## 260            1     -1     -1     -1     -1
## 261            1      1      0      0      0
## 262            1      1      0      0      0
## 263            1      0      0      0      1
## 264            1      0      1      0      0
## 265            1     -1     -1     -1     -1
## 266            1      0      1      0      0
## 267            1      0      0      0      1
## 268            1      0      0      0      1
## 269            1      0      0      1      0
## 270            1      0      0      0      1
## 271            1      0      1      0      0
## 272            1      0      1      0      0
## 273            1      0      0      1      0
## 274            1      0      1      0      0
## 275            1      0      0      1      0
## 276            1      0      0      0      1
## 277            1      0      0      1      0
## 278            1      0      1      0      0
## 279            1      0      0      0      1
## 280            1      0      0      0      1
## 281            1      1      0      0      0
## 282            1      0      0      0      1
## 283            1     -1     -1     -1     -1
## 284            1      1      0      0      0
## 285            1     -1     -1     -1     -1
## 286            1      0      0      0      1
## 287            1      0      0      0      1
## 288            1      0      1      0      0
## 289            1      0      0      1      0
## 290            1      1      0      0      0
## 291            1     -1     -1     -1     -1
## 292            1      0      0      1      0
## 293            1      0      0      0      1
## 294            1      0      0      1      0
## 295            1      0      1      0      0
## 296            1      0      1      0      0
## 297            1     -1     -1     -1     -1
## 298            1     -1     -1     -1     -1
## 299            1      0      0      0      1
## 300            1      0      1      0      0
## 301            1      0      1      0      0
## 302            1     -1     -1     -1     -1
## 303            1      0      0      0      1
## 304            1      0      1      0      0
## 305            1     -1     -1     -1     -1
## 306            1      0      0      1      0
## 307            1     -1     -1     -1     -1
## 308            1      0      0      0      1
## 309            1      0      0      1      0
## 310            1      0      0      0      1
## 311            1      1      0      0      0
## 312            1     -1     -1     -1     -1
## 313            1      1      0      0      0
## 314            1      0      0      0      1
## 315            1     -1     -1     -1     -1
## 316            1     -1     -1     -1     -1
## 317            1      1      0      0      0
## 318            1     -1     -1     -1     -1
## 319            1      0      0      1      0
## 320            1      1      0      0      0
## 321            1      1      0      0      0
## 322            1      0      0      0      1
## 323            1      0      0      0      1
## 324            1      0      0      1      0
## 325            1      1      0      0      0
## 326            1      1      0      0      0
## 327            1      0      1      0      0
## 328            1     -1     -1     -1     -1
## 329            1      1      0      0      0
## 330            1      0      0      0      1
## 331            1      0      0      1      0
## 332            1      0      0      0      1
## 333            1      0      1      0      0
## 334            1      0      0      1      0
## 335            1      0      1      0      0
## 336            1     -1     -1     -1     -1
## 337            1     -1     -1     -1     -1
## 338            1      0      1      0      0
## 339            1     -1     -1     -1     -1
## 340            1     -1     -1     -1     -1
## 341            1      0      0      1      0
## 342            1      0      0      0      1
## 343            1      1      0      0      0
## 344            1      0      1      0      0
## 345            1      0      0      1      0
## 346            1     -1     -1     -1     -1
## 347            1      0      1      0      0
## 348            1      1      0      0      0
## 349            1     -1     -1     -1     -1
## 350            1     -1     -1     -1     -1
## 351            1      0      0      1      0
## 352            1     -1     -1     -1     -1
## 353            1      0      0      0      1
## 354            1      0      0      0      1
## 355            1      0      0      1      0
## 356            1      1      0      0      0
## 357            1      0      1      0      0
## 358            1     -1     -1     -1     -1
## 359            1     -1     -1     -1     -1
## 360            1      1      0      0      0
## 361            1      0      0      0      1
## 362            1     -1     -1     -1     -1
## 363            1      0      0      0      1
## 364            1      1      0      0      0
## 365            1      0      1      0      0
## 366            1      0      0      0      1
## 367            1      0      1      0      0
## 368            1      0      0      0      1
## 369            1      0      0      0      1
## 370            1      0      0      1      0
## 371            1      0      1      0      0
## 372            1      0      1      0      0
## 373            1      0      0      1      0
## 374            1     -1     -1     -1     -1
## 375            1      0      1      0      0
## 376            1      0      1      0      0
## 377            1      1      0      0      0
## 378            1      1      0      0      0
## 379            1      0      1      0      0
## 380            1      0      0      1      0
## 381            1      1      0      0      0
## 382            1      1      0      0      0
## 383            1      0      0      0      1
## 384            1     -1     -1     -1     -1
## 385            1      0      1      0      0
## 386            1     -1     -1     -1     -1
## 387            1      0      0      1      0
## 388            1      1      0      0      0
## 389            1      0      1      0      0
## 390            1      0      0      1      0
## 391            1      0      0      1      0
## 392            1      0      1      0      0
## 393            1      0      0      0      1
## 394            1      0      0      1      0
## 395            1      0      0      0      1
## 396            1      0      1      0      0
## 397            1      0      0      1      0
## 398            1      0      1      0      0
## 399            1      0      0      1      0
## 400            1      0      0      0      1
## 401            1      0      0      1      0
## 402            1      1      0      0      0
## 403            1      0      1      0      0
## 404            1      0      0      1      0
## 405            1      1      0      0      0
## 406            1      0      0      1      0
## 407            1      0      0      0      1
## 408            1      1      0      0      0
## 409            1     -1     -1     -1     -1
## 410            1      0      0      1      0
## 411            1     -1     -1     -1     -1
## 412            1     -1     -1     -1     -1
## 413            1     -1     -1     -1     -1
## 414            1      0      0      1      0
## 415            1      0      0      1      0
## 416            1      0      0      1      0
## 417            1      1      0      0      0
## 418            1      0      0      0      1
## 419            1      0      1      0      0
## 420            1     -1     -1     -1     -1
## 421            1     -1     -1     -1     -1
## 422            1      0      0      0      1
## 423            1     -1     -1     -1     -1
## 424            1      0      0      1      0
## 425            1      1      0      0      0
## 426            1      0      1      0      0
## 427            1      0      0      1      0
## 428            1     -1     -1     -1     -1
## 429            1      0      1      0      0
## 430            1      0      1      0      0
## 431            1      0      0      0      1
## 432            1      0      0      1      0
## 433            1      1      0      0      0
## 434            1     -1     -1     -1     -1
## 435            1      0      0      0      1
## 436            1      1      0      0      0
## 437            1      0      0      1      0
## 438            1      1      0      0      0
## 439            1      1      0      0      0
## 440            1      0      1      0      0
## 441            1      0      1      0      0
## 442            1      0      0      1      0
## 443            1      1      0      0      0
## 444            1      0      1      0      0
## 445            1     -1     -1     -1     -1
## 446            1      0      0      1      0
## 447            1      1      0      0      0
## 448            1     -1     -1     -1     -1
## 449            1      0      0      1      0
## 450            1      0      1      0      0
## 451            1      1      0      0      0
## 452            1      0      0      1      0
## 453            1      1      0      0      0
## 454            1      0      0      1      0
## 455            1      0      0      1      0
## 456            1      0      0      0      1
## 457            1      0      0      0      1
## 458            1      0      0      1      0
## 459            1      0      0      0      1
## 460            1     -1     -1     -1     -1
## 461            1     -1     -1     -1     -1
## 462            1      0      1      0      0
## 463            1      0      0      0      1
## 464            1      0      0      1      0
## 465            1      0      0      0      1
## 466            1     -1     -1     -1     -1
## 467            1      1      0      0      0
## 468            1      0      0      1      0
## 469            1      0      0      1      0
## 470            1      1      0      0      0
## 471            1      0      0      1      0
## 472            1      0      0      0      1
## 473            1      0      0      1      0
## 474            1      0      0      1      0
## 475            1     -1     -1     -1     -1
## 476            1      0      0      1      0
## 477            1      0      0      1      0
## 478            1     -1     -1     -1     -1
## 479            1      0      0      1      0
## 480            1      0      0      0      1
## 481            1      0      0      1      0
## 482            1      1      0      0      0
## 483            1      0      0      0      1
## 484            1      0      0      1      0
## 485            1      1      0      0      0
## 486            1     -1     -1     -1     -1
## 487            1      1      0      0      0
## 488            1     -1     -1     -1     -1
## 489            1      0      0      1      0
## 490            1     -1     -1     -1     -1
## 491            1      1      0      0      0
## 492            1      1      0      0      0
## 493            1      0      0      1      0
## 494            1      0      1      0      0
## 495            1      1      0      0      0
## 496            1      0      0      0      1
## 497            1      1      0      0      0
## 498            1      1      0      0      0
## 499            1      1      0      0      0
## 500            1      1      0      0      0
## 501            1     -1     -1     -1     -1
## 502            1      0      0      1      0
## 503            1     -1     -1     -1     -1
## 504            1      0      0      1      0
## 505            1      0      0      0      1
## 506            1      1      0      0      0
## 507            1      1      0      0      0
## 508            1      1      0      0      0
## 509            1      0      0      1      0
## 510            1      0      0      0      1
## 511            1      0      1      0      0
## 512            1      0      0      0      1
## 513            1      0      0      1      0
## 514            1      0      0      1      0
## 515            1      1      0      0      0
## 516            1      0      0      0      1
## 517            1      0      0      1      0
## 518            1      1      0      0      0
## 519            1      1      0      0      0
## 520            1      0      0      0      1
## 521            1      0      0      1      0
## 522            1      0      1      0      0
## 523            1     -1     -1     -1     -1
## 524            1      0      1      0      0
## 525            1     -1     -1     -1     -1
## 526            1      1      0      0      0
## 527            1      1      0      0      0
## 528            1     -1     -1     -1     -1
## 529            1      0      0      1      0
## 530            1      0      1      0      0
## 531            1      0      0      1      0
## 532            1      0      1      0      0
## 533            1      0      0      0      1
## 534            1      0      0      1      0
## 535            1      0      0      1      0
## 536            1     -1     -1     -1     -1
## 537            1      0      0      0      1
## 538            1      0      0      1      0
## 539            1      1      0      0      0
## 540            1      0      1      0      0
## 541            1     -1     -1     -1     -1
## 542            1      0      0      1      0
## 543            1      1      0      0      0
## 544            1      1      0      0      0
## 545            1     -1     -1     -1     -1
## 546            1      0      0      1      0
## 547            1      1      0      0      0
## 548            1     -1     -1     -1     -1
## 549            1      0      0      1      0
## 550            1      0      0      1      0
## 551            1     -1     -1     -1     -1
## 552            1      1      0      0      0
## 553            1      1      0      0      0
## 554            1      0      0      1      0
## 555            1     -1     -1     -1     -1
## 556            1      0      0      1      0
## 557            1      0      0      1      0
## 558            1      1      0      0      0
## 559            1      0      1      0      0
## 560            1      0      1      0      0
## 561            1      1      0      0      0
## 562            1      1      0      0      0
## 563            1     -1     -1     -1     -1
## 564            1      0      1      0      0
## 565            1     -1     -1     -1     -1
## 566            1      0      0      0      1
## 567            1      0      0      0      1
## 568            1      0      1      0      0
## 569            1      1      0      0      0
## 570            1      0      1      0      0
## 571            1      1      0      0      0
## 572            1      1      0      0      0
## 573            1      0      0      1      0
## 574            1     -1     -1     -1     -1
## 575            1      0      1      0      0
## 576            1      0      0      1      0
## 577            1      1      0      0      0
## 578            1      1      0      0      0
## 579            1      0      0      0      1
## 580            1      1      0      0      0
## 581            1      0      0      0      1
## 582            1      0      1      0      0
## 583            1      0      0      1      0
## 584            1     -1     -1     -1     -1
## 585            1      0      0      0      1
## 586            1      0      1      0      0
## 587            1     -1     -1     -1     -1
## 588            1      0      0      1      0
## 589            1      0      0      1      0
## 590            1     -1     -1     -1     -1
## 591            1      1      0      0      0
## 592            1      0      0      0      1
## 593            1      0      0      0      1
## 594            1      1      0      0      0
## 595            1      1      0      0      0
## 596            1      0      1      0      0
## 597            1      0      0      1      0
## 598            1      0      0      0      1
## 599            1      0      0      1      0
## 600            1      0      1      0      0
## 601            1      0      0      0      1
## 602            1      0      0      1      0
## 603            1      1      0      0      0
## 604            1      0      1      0      0
## 605            1      0      0      0      1
## 606            1      0      0      0      1
## 607            1      0      1      0      0
## 608            1      1      0      0      0
## 609            1     -1     -1     -1     -1
## 610            1     -1     -1     -1     -1
## 611            1      1      0      0      0
## 612            1     -1     -1     -1     -1
## 613            1      0      0      1      0
## 614            1      0      0      1      0
## 615            1      0      0      0      1
## 616            1     -1     -1     -1     -1
## 617            1      0      0      0      1
## 618            1     -1     -1     -1     -1
## 619            1     -1     -1     -1     -1
## 620            1     -1     -1     -1     -1
## 621            1      0      1      0      0
## 622            1     -1     -1     -1     -1
## 623            1      0      1      0      0
## 624            1     -1     -1     -1     -1
## 625            1     -1     -1     -1     -1
## 626            1      1      0      0      0
## 627            1      1      0      0      0
## 628            1     -1     -1     -1     -1
## 629            1      0      0      0      1
## 630            1      0      0      0      1
## 631            1      0      0      0      1
## 632            1      1      0      0      0
## 633            1      0      0      1      0
## 634            1      0      0      0      1
## 635            1      0      0      0      1
## 636            1      1      0      0      0
## 637            1      0      1      0      0
## 638            1      1      0      0      0
## 639            1      0      0      0      1
## 640            1      0      0      0      1
## 641            1      0      0      1      0
## 642            1      0      0      1      0
## 643            1      0      0      1      0
## 644            1      0      0      0      1
## 645            1      0      0      0      1
## 646            1      0      0      0      1
## 647            1      0      1      0      0
## 648            1      0      0      0      1
## 649            1      1      0      0      0
## 650            1      0      1      0      0
## 651            1      1      0      0      0
## 652            1      1      0      0      0
## 653            1      0      1      0      0
## 654            1      0      1      0      0
## 655            1      0      0      0      1
## 656            1      1      0      0      0
## 657            1      0      1      0      0
## 658            1      0      0      1      0
## 659            1      0      0      0      1
## 660            1     -1     -1     -1     -1
## 661            1      0      1      0      0
## 662            1      0      0      1      0
## 663            1     -1     -1     -1     -1
## 664            1      0      0      1      0
## 665            1      0      0      1      0
## 666            1      0      1      0      0
## 667            1      0      0      1      0
## 668            1      0      0      0      1
## 669            1      0      1      0      0
## 670            1      0      0      1      0
## 671            1      0      0      1      0
## 672            1      0      1      0      0
## 673            1      0      0      1      0
## 674            1     -1     -1     -1     -1
## 675            1      1      0      0      0
## 676            1      0      0      0      1
## 677            1      0      0      0      1
## 678            1     -1     -1     -1     -1
## 679            1      0      0      0      1
## 680            1      0      0      1      0
## 681            1     -1     -1     -1     -1
## 682            1      0      1      0      0
## 683            1     -1     -1     -1     -1
## 684            1      0      0      1      0
## 685            1      0      0      0      1
## 686            1      0      0      0      1
## 687            1      1      0      0      0
## 688            1     -1     -1     -1     -1
## 689            1      0      1      0      0
## 690            1      0      0      1      0
## 691            1      1      0      0      0
## 692            1      0      0      0      1
## 693            1      1      0      0      0
## 694            1      0      1      0      0
## 695            1      0      0      1      0
## 696            1     -1     -1     -1     -1
## 697            1     -1     -1     -1     -1
## 698            1      0      0      0      1
## 699            1      1      0      0      0
## 700            1      0      1      0      0
## 701            1      1      0      0      0
## 702            1      1      0      0      0
## 703            1      0      1      0      0
## 704            1      0      1      0      0
## 705            1      0      0      0      1
## 706            1      0      0      0      1
## 707            1     -1     -1     -1     -1
## 708            1     -1     -1     -1     -1
## 709            1      0      1      0      0
## 710            1      0      0      1      0
## 711            1      0      0      0      1
## 712            1     -1     -1     -1     -1
## 713            1      0      0      0      1
## 714            1      0      1      0      0
## 715            1      0      0      0      1
## 716            1      1      0      0      0
## 717            1     -1     -1     -1     -1
## 718            1     -1     -1     -1     -1
## 719            1      0      1      0      0
## 720            1      0      0      0      1
## 721            1      0      0      0      1
## 722            1      0      0      0      1
## 723            1      0      0      1      0
## 724            1      0      1      0      0
## 725            1      0      1      0      0
## 726            1      0      0      1      0
## 727            1      1      0      0      0
## 728            1      0      0      0      1
## 729            1      1      0      0      0
## 730            1      0      0      0      1
## 731            1      0      0      0      1
## 732            1      1      0      0      0
## 733            1      0      1      0      0
## 734            1      0      1      0      0
## 735            1      0      0      0      1
## 736            1      1      0      0      0
## 737            1      0      0      0      1
## 738            1     -1     -1     -1     -1
## 739            1      1      0      0      0
## 740            1     -1     -1     -1     -1
## 741            1      0      0      1      0
## 742            1      0      1      0      0
## 743            1      1      0      0      0
## 744            1      0      0      1      0
## 745            1      0      1      0      0
## 746            1     -1     -1     -1     -1
## 747            1     -1     -1     -1     -1
## 748            1      1      0      0      0
## 749            1      0      1      0      0
## 750            1      0      0      0      1
## 751            1     -1     -1     -1     -1
## 752            1      0      1      0      0
## 753            1      0      0      1      0
## 754            1     -1     -1     -1     -1
## 755            1      0      0      0      1
## 756            1      0      0      0      1
## 757            1      0      0      0      1
## 758            1      1      0      0      0
## 759            1      0      1      0      0
## 760            1      0      0      1      0
## 761            1      0      1      0      0
## 762            1      0      0      1      0
## 763            1      1      0      0      0
## 764            1      0      0      1      0
## 765            1      1      0      0      0
## 766            1     -1     -1     -1     -1
## 767            1      0      1      0      0
## 768            1     -1     -1     -1     -1
## 769            1      0      1      0      0
## 770            1      0      0      1      0
## 771            1      1      0      0      0
## 772            1      0      0      0      1
## 773            1      0      1      0      0
## 774            1      0      0      1      0
## 775            1      0      0      0      1
## 776            1      0      1      0      0
## 777            1      0      0      1      0
## 778            1     -1     -1     -1     -1
## 779            1      0      0      1      0
## 780            1      0      1      0      0
## 781            1      0      1      0      0
## 782            1      1      0      0      0
## 783            1      0      1      0      0
## 784            1      0      1      0      0
## 785            1     -1     -1     -1     -1
## 786            1      1      0      0      0
## 787            1      1      0      0      0
## 788            1      0      0      0      1
## 789            1      0      1      0      0
## 790            1     -1     -1     -1     -1
## 791            1      0      1      0      0
## 792            1      0      0      0      1
## 793            1      0      0      0      1
## 794            1      0      0      1      0
## 795            1      0      0      0      1
## 796            1      0      1      0      0
## 797            1      0      1      0      0
## 798            1      0      0      1      0
## 799            1      0      1      0      0
## 800            1      0      0      1      0
## 801            1      0      0      0      1
## 802            1      0      0      1      0
## 803            1      0      1      0      0
## 804            1      0      0      0      1
## 805            1      0      0      0      1
## 806            1      1      0      0      0
## 807            1      0      0      0      1
## 808            1     -1     -1     -1     -1
## 809            1      1      0      0      0
## 810            1     -1     -1     -1     -1
## 811            1      0      0      0      1
## 812            1      0      0      0      1
## 813            1      0      1      0      0
## 814            1      0      0      1      0
## 815            1      1      0      0      0
## 816            1     -1     -1     -1     -1
## 817            1      0      0      1      0
## 818            1      0      0      0      1
## 819            1      0      0      1      0
## 820            1      0      1      0      0
## 821            1      0      1      0      0
## 822            1     -1     -1     -1     -1
## 823            1     -1     -1     -1     -1
## 824            1      0      0      0      1
## 825            1      0      1      0      0
## 826            1     -1     -1     -1     -1
## 827            1     -1     -1     -1     -1
## 828            1      0      0      0      1
## 829            1      0      1      0      0
## 830            1     -1     -1     -1     -1
## 831            1      0      0      1      0
## 832            1      0      0      0      1
## 833            1      1      0      0      0
## 834            1      0      0      0      1
## 835            1      0      1      0      0
## 836            1      0      0      0      1
## 837            1     -1     -1     -1     -1
## 838            1      0      1      0      0
## 839            1      1      0      0      0
## 840            1      1      0      0      0
## 841            1      0      1      0      0
## 842            1      0      0      1      0
## 843            1      0      1      0      0
## 844            1      1      0      0      0
## 845            1      0      0      1      0
## 846            1      1      0      0      0
## 847            1      1      0      0      0
## 848            1      0      1      0      0
## 849            1     -1     -1     -1     -1
## 850            1      0      0      1      0
## 851            1      1      0      0      0
## 852            1     -1     -1     -1     -1
## 853            1     -1     -1     -1     -1
## 854            1     -1     -1     -1     -1
## 855            1      0      0      0      1
## 856            1      0      0      0      1
## 857            1     -1     -1     -1     -1
## 858            1      0      0      1      0
## 859            1      1      0      0      0
## 860            1      0      0      0      1
## 861            1     -1     -1     -1     -1
## 862            1     -1     -1     -1     -1
## 863            1      1      0      0      0
## 864            1     -1     -1     -1     -1
## 865            1      0      1      0      0
## 866            1      0      1      0      0
## 867            1      0      1      0      0
## 868            1     -1     -1     -1     -1
## 869            1      0      0      0      1
## 870            1     -1     -1     -1     -1
## 871            1     -1     -1     -1     -1
## 872            1      0      1      0      0
## 873            1      0      1      0      0
## 874            1     -1     -1     -1     -1
## 875            1     -1     -1     -1     -1
## 876            1     -1     -1     -1     -1
## 877            1      0      0      1      0
## 878            1      0      1      0      0
## 879            1     -1     -1     -1     -1
## 880            1      0      0      1      0
## 881            1      1      0      0      0
## 882            1      0      0      1      0
## 883            1      1      0      0      0
## 884            1     -1     -1     -1     -1
## 885            1      0      0      0      1
## 886            1     -1     -1     -1     -1
## 887            1      0      0      0      1
## 888            1      0      0      1      0
## 889            1     -1     -1     -1     -1
## 890            1     -1     -1     -1     -1
## 891            1      0      1      0      0
## 892            1      0      1      0      0
## 893            1      0      0      1      0
## 894            1     -1     -1     -1     -1
## 895            1      0      1      0      0
## 896            1      0      0      1      0
## 897            1      1      0      0      0
## 898            1     -1     -1     -1     -1
## 899            1      0      0      0      1
## 900            1     -1     -1     -1     -1
## 901            1      0      1      0      0
## 902            1     -1     -1     -1     -1
## 903            1      0      0      0      1
## 904            1      0      1      0      0
## 905            1     -1     -1     -1     -1
## 906            1      0      0      1      0
## 907            1     -1     -1     -1     -1
## 908            1      0      0      0      1
## 909            1      0      0      1      0
## 910            1      0      0      0      1
## 911            1      1      0      0      0
## 912            1     -1     -1     -1     -1
## 913            1      1      0      0      0
## 914            1      0      0      0      1
## 915            1     -1     -1     -1     -1
## 916            1     -1     -1     -1     -1
## 917            1      1      0      0      0
## 918            1     -1     -1     -1     -1
## 919            1      0      0      1      0
## 920            1      1      0      0      0
## 921            1      1      0      0      0
## 922            1      0      0      0      1
## 923            1      0      0      0      1
## 924            1      0      0      1      0
## 925            1      1      0      0      0
## 926            1      1      0      0      0
## 927            1      0      1      0      0
## 928            1     -1     -1     -1     -1
## 929            1      1      0      0      0
## 930            1      0      0      0      1
## 931            1      0      0      1      0
## 932            1      0      0      0      1
## 933            1      0      1      0      0
## 934            1      0      0      1      0
## 935            1      0      1      0      0
## 936            1     -1     -1     -1     -1
## 937            1     -1     -1     -1     -1
## 938            1      0      1      0      0
## 939            1     -1     -1     -1     -1
## 940            1     -1     -1     -1     -1
## 941            1      0      0      1      0
## 942            1      0      0      0      1
## 943            1      1      0      0      0
## 944            1      0      1      0      0
## 945            1      0      0      1      0
## 946            1     -1     -1     -1     -1
## 947            1      0      1      0      0
## 948            1      1      0      0      0
## 949            1     -1     -1     -1     -1
## 950            1     -1     -1     -1     -1
## 951            1      0      0      1      0
## 952            1     -1     -1     -1     -1
## 953            1      0      0      0      1
## 954            1      0      0      0      1
## 955            1      0      0      1      0
## 956            1      1      0      0      0
## 957            1      0      1      0      0
## 958            1     -1     -1     -1     -1
## 959            1     -1     -1     -1     -1
## 960            1      1      0      0      0
## 961            1      0      0      0      1
## 962            1     -1     -1     -1     -1
## 963            1      0      0      0      1
## 964            1      1      0      0      0
## 965            1      0      1      0      0
## 966            1      0      0      0      1
## 967            1      0      1      0      0
## 968            1      0      0      0      1
## 969            1      0      0      0      1
## 970            1      0      0      1      0
## 971            1      0      1      0      0
## 972            1      0      1      0      0
## 973            1      0      0      1      0
## 974            1     -1     -1     -1     -1
## 975            1      0      1      0      0
## 976            1      1      0      0      0
## 977            1      0      0      1      0
## 978            1      1      0      0      0
## 979            1      0      0      1      0
## 980            1      0      0      1      0
## 981            1      0      0      0      1
## 982            1      0      0      0      1
## 983            1      0      0      1      0
## 984            1      0      0      0      1
## 985            1     -1     -1     -1     -1
## 986            1     -1     -1     -1     -1
## 987            1      0      1      0      0
## 988            1      0      0      0      1
## 989            1      0      0      1      0
## 990            1      0      0      0      1
## 991            1     -1     -1     -1     -1
## 992            1      1      0      0      0
## 993            1      0      0      1      0
## 994            1      0      0      1      0
## 995            1      1      0      0      0
## 996            1      0      0      1      0
## 997            1      0      0      0      1
## 998            1      0      0      1      0
## 999            1      0      0      1      0
## 1000           1     -1     -1     -1     -1
## 1001           1      0      0      1      0
## 1002           1      0      0      1      0
## 1003           1     -1     -1     -1     -1
## 1004           1      0      0      1      0
## 1005           1      0      0      0      1
## 1006           1      0      0      1      0
## 1007           1      1      0      0      0
## 1008           1      0      0      0      1
## 1009           1      0      0      1      0
## 1010           1      1      0      0      0
## 1011           1     -1     -1     -1     -1
## 1012           1      1      0      0      0
## 1013           1     -1     -1     -1     -1
## 1014           1      0      0      1      0
## 1015           1     -1     -1     -1     -1
## 1016           1      1      0      0      0
## 1017           1      1      0      0      0
## 1018           1      0      0      1      0
## 1019           1      0      1      0      0
## 1020           1      1      0      0      0
## 1021           1      0      0      0      1
## 1022           1      1      0      0      0
## 1023           1      1      0      0      0
## 1024           1      1      0      0      0
## 1025           1      1      0      0      0
## 1026           1     -1     -1     -1     -1
## 1027           1      0      0      1      0
## 1028           1     -1     -1     -1     -1
## 1029           1      0      0      1      0
## 1030           1      0      0      0      1
## 1031           1      1      0      0      0
## 1032           1      1      0      0      0
## 1033           1      1      0      0      0
## 1034           1      0      0      1      0
## 1035           1      0      0      0      1
## 1036           1      0      1      0      0
## 1037           1      0      0      0      1
## 1038           1      0      0      1      0
## 1039           1      0      0      1      0
## 1040           1      1      0      0      0
## 1041           1      0      0      0      1
## 1042           1      0      0      1      0
## 1043           1      1      0      0      0
## 1044           1      1      0      0      0
## 1045           1      0      0      0      1
## 1046           1      0      0      1      0
## 1047           1      0      1      0      0
## 1048           1     -1     -1     -1     -1
## 1049           1      0      1      0      0
## 1050           1     -1     -1     -1     -1
## attr(,"assign")
## [1] 0 1 1 1 1
## attr(,"contrasts")
## attr(,"contrasts")$Brand
## [1] "contr.sum"

Coding the chocolate data

choc.contrasts <- list(Brand = "contr.sum", Type = "contr.sum")
choc.coded <- model.matrix(~ Brand + Type, data = choc.df, 
                           contrasts = choc.contrasts)
choc.coded <- choc.coded[,2:ncol(choc.coded)] # remove intercept
# Fix the bad labels from contr.sum
choc.names <- c("BrandDove", "BrandGhirardelli", "BrandGodiva", 
                "BrandHersheys", "TypeDark", "TypeDarkNuts", 
                "TypeMilk", "TypeMilkNuts")
colnames(choc.coded) <- choc.names 

Append the coded attributes to choc.df

choc.df <- cbind(choc.df, choc.coded)
head(choc.df)
##   X  Ind Trial Alt    Brand        Type Price Chosen BrandDove
## 1 1 2401     1   1     Dove        Milk   0.6      1         1
## 2 2 2401     1   2   Godiva        Dark   0.7      0         0
## 3 3 2401     1   3     Dove       White   3.6      0         1
## 4 4 2401     2   1   Godiva Milk w Nuts   2.7      0         0
## 5 5 2401     2   2   Godiva        Dark   3.9      1         0
## 6 6 2401     2   3 Hersheys Milk w Nuts   0.7      0         0
##   BrandGhirardelli BrandGodiva BrandHersheys TypeDark TypeDarkNuts
## 1                0           0             0        0            0
## 2                0           1             0        1            0
## 3                0           0             0       -1           -1
## 4                0           1             0        0            0
## 5                0           1             0        1            0
## 6                0           0             1        0            0
##   TypeMilk TypeMilkNuts
## 1        1            0
## 2        0            0
## 3       -1           -1
## 4        0            1
## 5        0            0
## 6        0            1

Respondents and questions

unique(choc.df$Ind)
##  [1] 2401 2402 2403 2405 2407 2408 2409 2410 2411 2412 2413 2414 2415 2417
unique(choc.df$Trial)
##  [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
## [24] 24 25

Creating objects like those declared in mnl.stan

R <- length(unique(choc.df$Ind))
S <- length(unique(choc.df$Trial))
Y <- rep(NA, R*S)
X <- vector("list", R*S)
n <- 1
for (r in unique(choc.df$Ind)) { # respondents
  for (s in unique(choc.df$Trial)){ # choice scenarios
     scenario <- choc.df[choc.df$Ind==r & choc.df$Trial==s,]
     X[[n]] <- data.matrix(scenario[,c(7, 9:16)]) # price and coded brand and type
     Y[n] <- scenario$Alt[as.logical(scenario$Chosen)]
     n <- n + 1
  }
}

Double check X and Y

str(Y)
##  int [1:350] 1 2 2 1 2 3 3 3 2 2 ...
str(X)
## List of 350
##  $ : num [1:3, 1:9] 0.6 0.7 3.6 1 0 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "1" "2" "3"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.7 3.9 0.7 0 0 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "4" "5" "6"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.7 3.7 3 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "7" "8" "9"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1 3.6 0.5 -1 -1 0 -1 -1 1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "10" "11" "12"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.8 1.5 3.3 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "13" "14" "15"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.1 2.5 2.6 -1 1 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "16" "17" "18"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.1 4 2.1 0 1 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "19" "20" "21"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.8 3.2 1.1 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "22" "23" "24"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.3 1.7 3.8 -1 0 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "25" "26" "27"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.6 0.8 3.7 -1 0 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "28" "29" "30"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.6 0.7 1.2 0 1 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "31" "32" "33"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.1 0.8 3.7 0 1 -1 0 0 -1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "34" "35" "36"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 0.8 1.9 1 -1 0 0 -1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "37" "38" "39"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.6 3.5 1.9 -1 1 1 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "40" "41" "42"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.7 1.5 1.6 0 0 1 0 1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "43" "44" "45"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.5 3.8 3.7 0 1 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "46" "47" "48"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.9 1.2 0.5 1 1 -1 0 0 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "49" "50" "51"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.8 2.7 2.6 0 -1 0 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "52" "53" "54"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.7 4 2.8 0 1 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "55" "56" "57"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.7 0.8 1.9 1 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "58" "59" "60"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.8 3 2.4 0 0 0 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "61" "62" "63"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.9 3.4 3.4 0 1 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "64" "65" "66"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.6 1.8 3.4 0 1 1 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "67" "68" "69"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.6 3.2 1.4 0 0 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "70" "71" "72"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.1 0.8 2 -1 0 -1 -1 1 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "73" "74" "75"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.2 2.1 3.5 0 0 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "76" "77" "78"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.3 1.7 3.5 0 0 0 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "79" "80" "81"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.6 2 1.8 0 1 -1 1 0 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "82" "83" "84"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.2 2.5 0.8 -1 1 -1 -1 0 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "85" "86" "87"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.3 1.1 2.7 0 0 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "88" "89" "90"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.7 0.6 3.3 -1 0 -1 -1 0 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "91" "92" "93"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.9 2.9 0.8 -1 -1 0 -1 -1 1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "94" "95" "96"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2 1.3 1.2 -1 0 -1 -1 1 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "97" "98" "99"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.4 1.8 3.1 -1 1 1 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "100" "101" "102"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.1 1.6 3.8 -1 0 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "103" "104" "105"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.1 2.9 1.4 0 1 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "106" "107" "108"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1 0.6 2.8 0 0 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "109" "110" "111"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.9 2.5 1.9 0 1 0 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "112" "113" "114"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.8 3.4 3.2 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "115" "116" "117"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.7 0.6 2.9 0 0 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "118" "119" "120"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.3 0.6 0.8 0 0 0 0 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "121" "122" "123"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 4 2.7 1.3 1 0 1 0 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "124" "125" "126"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.1 1.1 2.5 1 0 0 0 1 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "127" "128" "129"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.2 2.9 1.5 0 1 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "130" "131" "132"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.8 3.2 0.9 0 0 -1 0 0 -1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "133" "134" "135"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.5 2.1 0.6 0 0 -1 1 0 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "136" "137" "138"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.8 3.7 2.2 0 0 0 0 0 1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "139" "140" "141"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.2 4 2.4 0 0 0 0 0 1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "142" "143" "144"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.9 3.8 1.8 0 0 0 0 0 1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "145" "146" "147"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.3 1.3 2.5 0 -1 1 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "148" "149" "150"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.4 1 2 1 1 -1 0 0 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "151" "152" "153"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.5 2.2 2.2 0 0 0 0 1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "154" "155" "156"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.9 1.2 2.2 0 0 0 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "157" "158" "159"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.3 0.7 3.3 0 -1 0 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "160" "161" "162"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.8 1 3.5 0 1 0 0 0 1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "163" "164" "165"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.3 2.5 0.8 -1 0 1 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "166" "167" "168"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.4 2.1 3.1 1 -1 0 0 -1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "169" "170" "171"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.9 3 2.2 1 -1 0 0 -1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "172" "173" "174"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.2 2.5 1.4 0 -1 1 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "175" "176" "177"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.5 0.9 3.2 1 0 -1 0 0 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "178" "179" "180"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.7 1.4 1.7 0 0 1 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "181" "182" "183"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.7 3.3 2.3 0 0 1 1 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "184" "185" "186"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1 3.8 3.5 1 -1 0 0 -1 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "187" "188" "189"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.8 2.8 2.6 -1 0 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "190" "191" "192"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 2.7 3 0 1 0 1 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "193" "194" "195"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 2.5 3.9 1 1 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "196" "197" "198"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.5 0.6 3.4 -1 0 0 -1 1 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "199" "200" "201"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.2 3.6 3.8 1 1 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "202" "203" "204"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.2 4 2.9 1 0 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "205" "206" "207"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.2 0.6 2 0 -1 0 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "208" "209" "210"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.4 2.5 2.5 0 -1 0 1 -1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "211" "212" "213"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 1.1 3.8 0 -1 1 0 -1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "214" "215" "216"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.7 2.2 2.7 0 0 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "217" "218" "219"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.4 3.3 2.2 1 0 0 0 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "220" "221" "222"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.3 1.7 2.7 0 0 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "223" "224" "225"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.9 2.6 2.7 -1 0 0 -1 1 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "226" "227" "228"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.9 3.3 4 -1 0 0 -1 0 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "229" "230" "231"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.6 1.6 1.7 0 1 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "232" "233" "234"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.4 2.4 3.8 0 0 0 0 1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "235" "236" "237"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 2.9 1.6 1 0 1 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "238" "239" "240"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.5 2.6 3.9 -1 0 -1 -1 1 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "241" "242" "243"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.7 2.9 0.7 0 0 1 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "244" "245" "246"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 0.6 3.3 1.1 0 0 0 0 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "247" "248" "249"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.7 2.3 2.6 0 0 0 0 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "250" "251" "252"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.5 1.5 1.4 -1 0 0 -1 0 1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "253" "254" "255"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.5 2 2.5 0 1 0 1 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "256" "257" "258"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.7 2.5 0.6 0 -1 1 1 -1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "259" "260" "261"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.3 2.8 1.8 1 0 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "262" "263" "264"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.5 1.3 0.9 -1 0 0 -1 1 0 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "265" "266" "267"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.6 3.9 2.9 0 0 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "268" "269" "270"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.1 1.9 2.1 0 0 0 1 1 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "271" "272" "273"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.9 2.4 3.9 0 0 0 1 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "274" "275" "276"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.4 3.9 1.9 0 0 0 0 1 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "277" "278" "279"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.9 3.4 1.3 0 1 0 0 0 0 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "280" "281" "282"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3.5 3.4 0.7 -1 1 -1 -1 0 -1 -1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "283" "284" "285"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 3 1.8 3.5 0 0 0 0 0 1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "286" "287" "288"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.6 1.8 3.6 0 1 -1 0 0 -1 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "289" "290" "291"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 1.5 1.3 0.6 0 0 0 0 0 0 1 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "292" "293" "294"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##  $ : num [1:3, 1:9] 2.5 0.8 2.1 0 0 -1 1 1 -1 0 ...
##   ..- attr(*, "dimnames")=List of 2
##   .. ..$ : chr [1:3] "295" "296" "297"
##   .. ..$ : chr [1:9] "Price" "BrandDove" "BrandGhirardelli" "BrandGodiva" ...
##   [list output truncated]

Create the list object for stan()

choc.standata <- list(N=length(Y), C=3, K=9, Y=Y, X=X)
rm(Y, X, n, R, S, r, s, choc.contrasts, scenario, choc.coded)

Estimating the mnl model using the chocolate data

Call Stan

choc.stan <- stan(file="mnl.stan", data=choc.standata) 
# default: chains=4, iter=2000

Check for convergence (1)

Inspect Rhat and n_eff in the summary output.

summary(choc.stan)$summary[,c("n_eff", "Rhat")]
##            n_eff      Rhat
## beta[1] 4000.000 0.9996794
## beta[2] 4000.000 0.9995332
## beta[3] 4000.000 0.9998139
## beta[4] 4000.000 1.0002581
## beta[5] 4000.000 0.9994365
## beta[6] 4000.000 0.9997451
## beta[7] 4000.000 0.9992790
## beta[8] 4000.000 1.0001818
## beta[9] 4000.000 0.9999386
## lp__    1592.957 1.0009636

Check for convergence (2)

Eyeball the traceplots.

plot(choc.stan, plotfun="trace")

Visualize parameter posteriors

plot(choc.stan)

Summarize the estimates

data.frame(params=c("Price", choc.names), check.names=FALSE, 
           summary(choc.stan, pars=c("beta"))$summary)
##                   params        mean     se_mean         sd       2.5%
## beta[1]            Price -0.31433151 0.001143779 0.07233894 -0.4570357
## beta[2]        BrandDove -0.08335508 0.002248909 0.14223350 -0.3607629
## beta[3] BrandGhirardelli  0.40454140 0.002306114 0.14585144  0.1156286
## beta[4]      BrandGodiva  0.45937060 0.001995520 0.12620775  0.2225408
## beta[5]    BrandHersheys -0.54291065 0.002466835 0.15601632 -0.8499034
## beta[6]         TypeDark  0.49525385 0.002081247 0.13162960  0.2461364
## beta[7]     TypeDarkNuts  0.17415063 0.002222929 0.14059040 -0.1067573
## beta[8]         TypeMilk  0.58916820 0.002217490 0.14024637  0.3172985
## beta[9]     TypeMilkNuts -0.01226111 0.002423181 0.15325541 -0.3183260
##                 25%          50%         75%      97.5% n_eff      Rhat
## beta[1] -0.36190105 -0.314062969 -0.26336640 -0.1799064  4000 0.9996794
## beta[2] -0.18078775 -0.081950763  0.01473935  0.1933658  4000 0.9995332
## beta[3]  0.30521799  0.405661172  0.50267147  0.6956871  4000 0.9998139
## beta[4]  0.37087217  0.459972445  0.54596193  0.7101510  4000 1.0002581
## beta[5] -0.64546249 -0.542877214 -0.43704837 -0.2407513  4000 0.9994365
## beta[6]  0.40435494  0.495401081  0.58567137  0.7501762  4000 0.9997451
## beta[7]  0.07808479  0.173560021  0.26951315  0.4537108  4000 0.9992790
## beta[8]  0.49135851  0.587418058  0.68584867  0.8646478  4000 1.0001818
## beta[9] -0.11528195 -0.009074101  0.09066796  0.2844074  4000 0.9999386

More posterior summaries with ShinyStan

launch_shinystan(choc.stan)

The posterior is multidimensional

Don't forget that the posterior is multidimensional. If you find a strong posterior correlation between two parameters, it means those two parameters are partially confounded in the data.

Simulating choice shares in R using posterior draws

Function for computing shares from a point estimate of beta

shares.mnl.point <- function(beta,  # vector of parameters (part-worths)
                             X) {   # attribute matrix X for scenario (coded)
  if (length(beta) != ncol(X)) 
    stop("length of beta doesn't match columns in X")
  V <- exp(X %*% beta)
  data.frame(shares=V/sum(V), X)
}

Computing shares from point estimates (1)

Pull out the posterior means of beta.

beta.mean <- summary(choc.stan)$summary[1:9,1]
beta.mean
##     beta[1]     beta[2]     beta[3]     beta[4]     beta[5]     beta[6] 
## -0.31433151 -0.08335508  0.40454140  0.45937060 -0.54291065  0.49525385 
##     beta[7]     beta[8]     beta[9] 
##  0.17415063  0.58916820 -0.01226111

Computing shares from point estimates (2)

Compute shares. This is bad practice as it does not account for our uncertainty in beta!

shares.mnl.point(beta.mean, choc.standata$X[[1]]) 
##       shares Price BrandDove BrandGhirardelli BrandGodiva BrandHersheys
## 1 0.38758042   0.6         1                0           0             0
## 2 0.58833796   0.7         0                0           1             0
## 3 0.02408162   3.6         1                0           0             0
##   TypeDark TypeDarkNuts TypeMilk TypeMilkNuts
## 1        0            0        1            0
## 2        1            0        0            0
## 3       -1           -1       -1           -1

Posterior draws of beta

To understand the full posterior of the shares, we should use all of the posterior draws for beta, which represent out uncertainty in beta.

beta.draws <- extract(choc.stan, pars="beta")$beta
head(beta.draws)
##           
## iterations       [,1]         [,2]      [,3]      [,4]       [,5]
##       [1,] -0.3478703  0.080482142 0.1982551 0.3997360 -0.4916839
##       [2,] -0.3848950 -0.277779343 0.4747460 0.3318566 -0.3193495
##       [3,] -0.2097009 -0.233821846 0.4922533 0.4403002 -0.5418049
##       [4,] -0.2575421 -0.104066720 0.3681182 0.4721159 -0.7740544
##       [5,] -0.3611979 -0.007947251 0.5943515 0.4500375 -0.8675597
##       [6,] -0.3023791 -0.017249531 0.2073573 0.4758840 -0.7463994
##           
## iterations      [,6]       [,7]      [,8]        [,9]
##       [1,] 0.4956138 0.17113025 0.5858199  0.03014834
##       [2,] 0.3976540 0.25159835 0.8122452 -0.27290201
##       [3,] 0.5960043 0.07043425 0.3797149  0.17093460
##       [4,] 0.6792963 0.41529620 0.6517011 -0.22398854
##       [5,] 0.3745087 0.05316832 0.5126430  0.08792478
##       [6,] 0.4500410 0.28622403 0.4238720 -0.12191060

Function for computing shares for each of the posterior draws of beta

Once you have a set of posterior draws for the model parameters, you can obtain posterior draws for any function of those parameters by computing the function for each draw.

shares.mnl.post <- function(draws,  # matrix of draws (use extract())
                            X) {    # attribute matrix X for scenario
  shares <- matrix(NA, nrow=nrow(draws), ncol=nrow(X))
  for (draw in 1:nrow(draws)) {
     shares[draw,] <- shares.mnl.point(draws[draw,], X)[,1]
  }
  shares
}

Posterior distribution of shares (1)

shares.draw <- shares.mnl.post(beta.draws, choc.standata$X[[1]])
summary(shares.draw)
##        V1               V2               V3          
##  Min.   :0.1903   Min.   :0.3502   Min.   :0.006366  
##  1st Qu.:0.3426   1st Qu.:0.5399   1st Qu.:0.018668  
##  Median :0.3869   Median :0.5870   Median :0.023983  
##  Mean   :0.3889   Mean   :0.5858   Mean   :0.025323  
##  3rd Qu.:0.4319   3rd Qu.:0.6336   3rd Qu.:0.030514  
##  Max.   :0.6292   Max.   :0.7961   Max.   :0.068483

Posterior distribution of shares (2)

apply(shares.draw, 2, quantile, probs=c(0.5, 0.025, 0.975))
##            [,1]      [,2]       [,3]
## 50%   0.3868640 0.5870258 0.02398315
## 2.5%  0.2640505 0.4449724 0.01161982
## 97.5% 0.5260401 0.7156864 0.04596499

Summary of Module 2

In this module we have

  • Built a multinomial logit model in Stan.
    • data, parameters and model blocks
    • core data types: arrays, vectors, matrices
    • sampling statements and distributions
  • Tested the model using synthetic data.
  • Estimated the model using chocolate bar CBC data.
  • Computed the full posterior of shares based on the posterior draws of beta.
  • Learned about the Rhat and n_eff measures for assessing convergence.

Next, we move on to hierarchical models.