BaşlayınÜcretsiz başlayın

Fitting a logistic regression

Pittsburgh is a city located in Allegheny County, PA, USA. Commuters living in this area have different options for commuting to work, including taking the bus. Using data from 2015, you will see if the number of commuting days per week increases the chance somebody will ride the bus. The choice of riding the bus is a binary outcome, hence you will use a logistic regression to model this data.

Bu egzersiz, kursun bir parçasıdır

Generalized Linear Models in R

Kursa Göz Atın

Egzersiz talimatları

  • Using the data.frame bus, fit a logistic regression in R using glm() with a "binomial" family. The variable Bus should be predicted by CommuteDays.
  • Save the model as bus_out.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Build a glm using the bus data frame that models Bus predicted by CommuteDays
bus_out <- ___
Kodu Düzenle ve Çalıştır