Regression Modeling in R: A Hands-On Course
Regression is the workhorse of data science: it draws the single best line (or surface) through a cloud of points and turns it into numbers you can read, test, and act on. This eight-lesson interactive course builds regression in R from the ground up, from the least-squares line to the full family of generalized linear models, with live diagrams you steer as you learn.
Most tutorials hand you lm(), point at the coefficients, and move on. The judgment lives in everything around that one line: knowing what the slope actually means, checking whether the model's assumptions hold, spotting the single row that quietly bends the whole fit, and knowing when to trust a prediction. This course teaches that judgment, one concept at a time, with no black boxes.
This is the regression stop on the Data Scientist path. Each lesson is a guided, interactive experience: you manipulate live charts in the browser, answer checkpoints, and write and run R as you go.
The eight lessons
Lesson 1: OLS Regression from Scratch
The line that minimizes squared error, the normal equations behind it, fitting it in R with lm(), and reading the coefficients and R-squared. The foundation everything else builds on.
Start Lesson 1: OLS Regression from Scratch
Lesson 2: Regression Assumptions and Residuals
The four assumptions every linear model leans on (linearity, independence, constant variance, normality) and how to read residual plots to check whether they actually hold.
Start Lesson 2: Regression Assumptions and Residuals
Lesson 3: Influence and Leverage
High-leverage points versus genuinely influential observations, Cook's distance, and what a single unusual row can do to a fit you thought was solid.
Start Lesson 3: Influence and Leverage
Lesson 4: Multicollinearity in Regression
When predictors move together, coefficients turn unstable and signs flip. Measure it with the VIF, understand why it happens, and learn how to detect and fix it.
Start Lesson 4: Multicollinearity in Regression
Lesson 5: Heteroskedasticity and Autocorrelation
Non-constant error variance and correlated errors break the standard errors, not the line. Spot both, and correct them with robust and corrected standard errors.
Start Lesson 5: Heteroskedasticity and Autocorrelation
Lesson 6: Inference and Prediction in Regression
Confidence intervals versus prediction intervals, tests on coefficients, and the difference between explaining a relationship and predicting a new value.
Start Lesson 6: Inference and Prediction in Regression
Lesson 7: Logistic Regression Done Properly
When the outcome is yes or no, you model a probability. The logit link, odds ratios, fitting with glm(), and reading a logistic model without fooling yourself.
Start Lesson 7: Logistic Regression Done Properly
Lesson 8: GLMs Beyond Logistic
Linear and logistic regression are two members of one family. Meet the rest: Poisson for counts, Gamma for positive skew, and how the link function matches the model to the response.
Start Lesson 8: GLMs Beyond Logistic
Who this is for
You can run R and read its output, and you have seen a scatter plot and an average before. You do not need any prior statistics or modeling background; every term is defined as it appears. By the end you will be able to fit a regression model, check that it is trustworthy, and read what it is telling you.
What you will be able to do
- Fit a linear model with
lm()and explain what its slope, intercept, and R-squared mean - Check the assumptions behind a regression by reading residual plots
- Diagnose leverage, influence, and multicollinearity, and know what to do about each
- Fit logistic regression and other GLMs, and match the right model to the response
Ready? Begin with Lesson 1.