Chapter 7. Linear and logistic regression

 

This chapter covers

  • Using linear regression to predict quantities
  • Using logistic regression to predict probabilities or categories
  • Extracting relations and advice from functional models
  • Interpreting the diagnostics from R’s lm() call
  • Interpreting the diagnostics from R’s glm() call

In the last chapter, we worked through using memorization methods for prediction. In this chapter, we’ll talk about a different class of methods for both scoring and classification: functional methods. These are methods that learn a model that is a continuous function of its inputs (versus being a mere lookup table). This class of methods is especially useful when you don’t just want to predict an outcome, but you also want to know the relationship between the input variables and the outcome. This knowledge can prove useful because this relationship can often be used as advice on how to get the outcome that you want.

In this chapter, we’ll show how to use linear regression to predict customer income and logistic regression to predict the probability that a newborn baby will need extra medical attention. These are two of the most common functional methods (there are many others, including generalized additive models, neural nets, and support vector machines). We’ll also walk through the diagnostics that R produces when you fit a linear or logistic model.

7.1. Using linear regression

7.2. Using logistic regression

7.3. Summary