Session Ready
Exercise

Non-linear logistic regression

In chapter 3, you explored the distance commuters traveled and the linear effect this had on the probability of somebody riding the bus. However, what if this relationship is non-linear and non-monotonic?

probitVsLogit

For example, what if people who commute the shortest distances and longest are less likely to ride the bus? You can add non-linear terms to formulas in R using the I(..) function as part of your formula. For example y~I(x^2) allows you to estimate a coefficient for x*x. During this exercise, you will examine the bus data more.

Instructions
100 XP
  • Add the formula y ~ I(x^2) to the formula option in the second call to geom_smooth().