Aan de slagGa gratis aan de slag

Fitting a multiple logistic regression

In the video, you learned about fitting a regression with two different predictor variables. In this exercise, you'll get to build the model we talked about. The distance a commuter rides might be important in determining if they are more likely to ride the bus. Similarly, the number of days a commuter goes to work might be important in determining if they are more likely to ride the bus. Using this model, we will examine how this variables may be used to predict the chance a commuter rides the bus.

Deze oefening maakt deel uit van de cursus

Generalized Linear Models in R

Cursus bekijken

Oefeninstructies

  • Build a logistic regression using the bus data frame. Save the output as bus_both.
  • Predict if someone rides the Bus based upon both CommuteDays and MilesOneWay. Make sure you use the variables in this order in the formula..
  • Use summary() on bus_both.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Build a logistic regression with Bus predicted by CommuteDays and MilesOneWay
___

# Look at the summary of the output
___
Code bewerken en uitvoeren