This book is in Open Review. I want your feedback to make the book better for you and other readers. To add your annotation, select some text and then click the on the pop-up menu. To see the annotations of others, click the button in the upper right hand corner of the page

Chapter 13 Regression with categorical variables

So far we assumed that the explanatory variables in the model are numerical. But is it possible somehow to capture the effect of categorical variables on the variable of interest? After all, we can expect, for example, sales of silver mobile phone to differ from the sales of the pink one.

The short answer to this question is “yes”. This can be done by transforming variables in categorical scale to the set of binary variables, which in regression context are called “dummy variables”.

Consider an example…

But the categorical scale contains two types of variables: (i) nominal, (ii) ordinal (Section 1.2). While the former only contains “description”, the latter also has an order, which in some cases can be used by models.