2
$\begingroup$

I am programming in R using hierarchical bayes for a choice-based conjoint task and wondering how I code the "none of the above" option in the design matrix?

The R code that I am using is below, which contains the rhierMnlRwMixture() function from the bayesm package. The response options are from two product bundles plus a none of the above option (3 response options). Is it correct to use all 0's in the third row of the design matrix which relates to the none of the above option (example for respondent 1 first choice)?

R code:

mcmc=list(R=20000,keep=10)  
library(bayesm)
out=rhierMnlRwMixture(Data=list(p=3,lgtdata=lgtdata),Prior=list(ncomp=1),Mcmc=mcmc)

$y

[1] 2

$X    
     [,1] [,2] [,3] [,4] [,5]
 [1,]    1    0    0    0    1    
 [2,]    0    0    1    0    0    
 [3,]    0    0    0    0    0
$\endgroup$
  • 1
    $\begingroup$ if you are looking for r code you might be better off on R-help or StackOverflow. Alternatively please edit your question to clarify the statistical issue you face. $\endgroup$ – mdewey Jan 10 '17 at 18:20
0
$\begingroup$

This depends on how you structure your matrix. But keep in mind that "None of the above" is a choice that is different from your baseline choice.

For example, of you have two attributes with two levels each, you will have four coefficients for the levels because the baseline levels in each attribute will be represented as zeros in all the other indicator variables. If you want an opt-out alternative, you should include another indicator variable for it, so that it is not confused with the baseline levels.

This has nothing to do with HB specifically, rather with your experimental design.

Of the shelf conjoint tools such as Conjoint.ly will do matrix design for you.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.