Chapter 5. Classifying Outcomes with Logistic Regression
In the last chapter, we learned the core of the linear regression model; in such a model we assume the predicted variable is quantitative (or metric). In this chapter, we will learn how to deal with qualitative (or categorical) variables, such as colors, gender, biological species, political party/affiliation, just to name a few examples. Notice that some variables can be codified as quantitative or as qualitative; for example, we can talk about the categorical variables red and green if we are talking about color names or the quantitative 650 nm and 510 nm if we are talking about wavelengths. One of the problems when dealing with categorical variables is assigning a class to a given observation; this problem is known as classification and is a supervised problem since we have a sample of already classified instances and the task is basically about predicting the correct class for new instances and/or learning about the...