Session Ready
Exercise

Fit logistic regression

In this exercise, you will continue with the data from the study on the contamination of ground water with arsenic in Bangladesh where you want to model the probability of switching the current well given the level of arsenic present in the well.

Recall the dataset structure:

Dataset wells is preloaded in the workspace.

Instructions
100 XP
  • Import statsmodels and glm.
  • Using glm() fit a logistic regression model where switch is predicted by arsenic.
  • Print model summary using .summary().