# Experimental (factorial) design not exploiting the variance

I want to construct a design to use Choice Based Conjoint Analysis. I want to focus on D-Optimality, for that reason I use the R package AlgDesign which uses Fedorov Algorithm. I create 7 attributes with 4,5,15,20,2,3,3 levels each one respectively.

library("AlgDesign")
levels.design = c(4,5,15,20,2,3,3)
f.design <- gen.factorial(levels.design)

fract.design <- optFederov(
data=f.design,criterion = "D",
approximate=TRUE)

design1 <- as.data.frame(fract.design\$design)


In the picture you can see the first 13 out of 91 profiles. However, I do not understand why for X4 it only takes -19 or +19, when in fact there are 20 levels. The same applies to the other variables.

Question 1: So I do not understand how you can exploit the variance between profiles and thus the trade-offs when using CBC if it only varies between 2 levels.

Question 2: Also, I don't understand what Proportion column means and haven't found anything clear enough on the documentation.

I would really appreciate if someone could give me some insights on what is going on.

UPDATE

By reading some papers I think that extremes values are taken in order to maximize information. However I'd appreciate some more details on this as I do not totally grasp the concept. Especially when the available options are fewer, e.g. 3 attributes with 3 levels, the algorithm also takes the intermediate level. Why?

• Are your levels continuous or discrete? optFederov treats them as continuous. If they are discrete, you need to make a matrix of dummy values. Have you checked Conjoint.ly or Sawtooth for ready-made CBC? Mar 2, 2017 at 23:49
• @k-zar Thanks for the response! It is a mix of variables what I have, some are discrete and some continous. Could you explain a bit more why they are treated as continous and what are the implications please? And yes! I do have Sawtooth but I am working on a research project improving some parts of CBC. Thanks! Mar 3, 2017 at 8:19
• If you have discrete variables, you should convert them into dummies. And do scaling on continuous variables. If you have any interaction terms or squared terms, they should be also converted into columns of your design matrix Mar 3, 2017 at 8:22
• Yes, that's the way. Sawtooth surely does that for you. Mar 3, 2017 at 8:26
• Buy the way, it's not 12, but 8 columns Mar 3, 2017 at 8:27

## 1 Answer

As mentioned in the comments, you need to do the following:

• Convert all categorical factors into dummy variables (make sure that you apply correct dummy coding: if a factor has three levels you only need two variables)
• Scale all continuous variables
• optFederov cannot really model interaction effects or squared terms that you specify in the formula, so if you introduce them, make sure to calculate separate columns

optFedrov also cannot really handle large designs. If you have many terms in your model, I suggest using this wrapper algorithm: https://algorithmia.com/algorithms/nikitos/optimaldesign

• I've been reading on the topic and in this paper where they explain how optFederov works they do not convert all categorical factors into dummy variables (e.g. Price is assumed to be a four-level factor as stated in the paper). jstage.jst.go.jp/article/air/17/2/17_2_86/_pdf Any suggestion on this point? Mar 7, 2017 at 9:17
• Interesting, but I have used this function and experienced your problem. optFederov is not a brilliantly written function: it fails with large designs. I found that it works fine if you supply a properly coded model matrix as I suggested. The wrapper algorithm deals with the other issues of optFederov Mar 7, 2017 at 10:32
• I think I have found the way to overcome the problem! f.design <- gen.factorial(levels.design,factors="all") by specifying factors="all" when generating the full factorial design all values are treated as factors and the extremes are not taken anymore. Mar 7, 2017 at 15:31