Back in a previous section, I promised that the same dummy-coding method that we used to regress binary categorical variables could be adapted to handle categorical variables with more than two values. For an example of this, we are going to use the same WeightLoss dataset as we did to illustrate ANOVA.
To review, the WeightLoss dataset contains pounds lost and self-esteem measurements for three weeks for three different groups: a control group, one group just on a diet, and one group that dieted and exercised. We will be trying to predict the amount of weight lost in week two by the group the participant was in.
Instead of just having one dummy-coded predictor, we now need two. Specifically: