Logistic Regression in R, Clearly Explained!!!! @statquest
Logistic Regression in R, Clearly Explained!!!!  @statquest
Uploaded July 2018 | Updated September 2026, 1 week ago
This video describes how to do Logistic Regression in R, step-by-step. We start by importing a dataset and cleaning it up, then we perform logistic regression on a very simple model, followed by a fancy model. Lastly we draw a graph of the predicted probabilities that came from the Logistic Regression.

The code that I use in this video can be found on the StatQuest GitHub:
github.com/StatQuest/logistic_regression_demo/blob/master/logistic_regression_demo.R

For more details on what's going on, check out the following StatQuests:

For a general overview of Logistic Regression:
youtu.be/yIYKR4sgzI8

The odds and log(odds), clearly explained:
youtu.be/ARfXDSkQf1Y

The odds ratio and log(odds ratio), clearly explained:
youtu.be/8nm0G-1uJzA

Logistic Regression, Details Part 1, Coefficients:
youtu.be/vN5cNN2-HWE

Logistic Regression, Details Part 2, Fitting a line with Maximum Likelihood:
youtu.be/BfKanl1aSG0

Logistic Regression Details Part 3, R-squared and its p-value:
youtu.be/xxFYro8QuXA

Saturated Models and Deviance Statistics, Clearly Explained:
youtu.be/9T0wlKdew6I

Deviance Residuals, Clearly Explained:
youtu.be/JC56jS2gVUE

For a complete index of all the StatQuest videos, check out:
statquest.org/video-index

If you'd like to support StatQuest, please consider...

Patreon: patreon.com/statquest
...or...
YouTube Membership: youtube.com/channel/UCtYLUTtgS3k1Fg4y5tAhLbw/join

...buying one of my books, a study guide, a t-shirt or hoodie, or a song from the StatQuest store...
statquest.org/statquest-store

...or just donating to StatQuest!
paypal.me/statquest

Lastly, if you want to keep up with me as I research and create new StatQuests, follow me on twitter:
twitter.com/joshuastarmer

0:00 Awesome song and introduction
0:29 Load and format data
3:54 Dealing with missing data
5:03 Verifying that the data is not imbalanced
6:44 Logistic regression with one independent variable
12:48 Logistic regression with many independent variables
15:13 Graphing the predicted probabilities

#statquest #logistic
Logistic Regression in R, Clearly Explained!!!!Coding a ChatGPT Like Transformer From Scratch in PyTorchThree more lessons from my Pop!!!Design Matrices For Linear Models, Clearly Explained!!!The Essential Main Ideas of Neural NetworksHow to Prune Regression Trees, Clearly Explained!!!Reinforcement Learning with Neural Networks: Mathematical DetailsHuman Stories in AI: Nana Janashia@TechWorld With NanaMaximum Likelihood For the Normal Distribution, step-by-step!!!A Drink From The Welljoe and sueMultiple Regression, Clearly Explained!!!
StatQuest with Josh Starmer |

Logistic Regression in R, Clearly Explained!!!!

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER