Hello everybody,
It’s Michael, and today I’ll be discussing graphing with logistic regression. This will serve as a continuation of R Lesson 4: Logistic Regression Models (I’ll be using the dataset and the models from that post).
Let’s start by graphing the second model from R Lesson 4. That’s the one that includes season count and premiere year (I feel this would be more appropriate to graph as it is the more quantitative of the two models).
Here’s the formula for the model if you’re interested (as well as the output):

Now let’s plot the model (but first, let’s remember to install the ggplot2 package).
Next we have to figure out the probabilities that each show will be renewed (or not).
And finally, let’s plot the model.
What are some conclusions we can draw from the model?
- The shows with less than 25 seasons and that premiered between 1975 and the early 90s (such as Roseanne which had 10 seasons and premiered in 1988) had no chance at renewal.
- For shows with less than 25 seasons, the more recently the show premiered, the more likely it was renewed (as shown by the progressively brighter colors).
- For the few outlier shows with more than 25 seasons (regardless of when they premiered) they had a 100% chance at renewal.
- The two notable examples would be The Simpsons (at 29 seasons) and SNL (at 43 seasons)
Thanks for reading,
Michael