8.3 Incorporating Categorical Data Into A GLM

How can we do computations on categorical data? How do we plug a categorical variable like gender (male/female) into a mathematical equation? Categorical variables must be converted into one or more indicator variables. An indicator variable is a variable that can take on two values: a zero or a one. A zero indicates the absence of the attribute and a one indicates the presence of the attribute. The number of indicator variables needed for a categorical variable with H levels is H - 1.

Examples

_ _

The figures ?? and ?? illustrate the importance of utilizing indicator variables when analyzing categorical variables, as opposed to treating categorical variables as continuous variables.


PIC
Figure 8.2: Proper handling of categorical data within a general linear model.



PIC
Figure 8.3: Improper handling of categorical data within a general linear model.