As you saw in the case of continuous variables in the previous section, it is quite straightforward to understand the relationships between the input and output variables from the coefficients and p-values. However, it becomes not so straightforward when we introduce categorical variables. Categorical variables often do not have any natural order, or they are encoded with non-numerical values, but in linear regression, we need the input variables to have numerical values that signify the order or magnitudes of the variables. For example, we cannot easily encode the State variable in our dataset with certain orderings or values. That is why we need to handle categorical variables differently from continuous variables ...
Categorical variables
Get Hands-On Data Science for Marketing now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.