Modeling with Data in the Tidyverse
Fit and interpret linear regression models in R with the tidyverse, then compare them using R-squared, RMSE and a validation set.
Linear regression is at the center of this course, used to describe how an outcome variable relates to one or more explanatory variables. You fit models in R with tidyverse tools for two purposes. The first is explaining an outcome, such as whether an instructor’s age helps account for teaching evaluation scores. The second is predicting one, such as a house’s price from its size and condition. You then judge which of several fitted models does each job best.
What You Will Achieve
- Explore a dataset with plots, numerical summaries and a log10 transformation before fitting any model
- Fit a regression on a numerical or categorical explanatory variable and compute its fitted values and residuals
- Predict house prices for new houses with a parallel slopes model and other regressions on several variables
- Choose between competing models by comparing their R-squared and RMSE on training and test data
Program Overview
Modeling Framework and Exploratory Data Analysis
Sets out the terms of modeling and the split between explaining and predicting, then examines the data before any formal model is fit.
- Modeling for explanation and for prediction
- The modeling problem
- Visual and numerical summaries of age and house size
- Correlation and the log10 transformation
Basic and Multiple Regression
Fits regression lines with one predictor for University of Texas teaching scores, then adds more predictors to model Seattle-area house prices.
- Best-fitting regression lines
- Numerical and categorical explanatory variables
- Fitted values, predictions and residuals
- Parallel slopes models and predictions on new houses
Model Assessment and Selection
Measures how well a model fits the data or how accurately it predicts, and uses those measures to pick between models.
- Sum of squared residuals and R-squared
- MSE and RMSE
- The validation set prediction framework with training and test data
Certificate Awarded (Paid)
Job Outlook
Regression modeling in R is used wherever an outcome has to be explained or predicted from data, including work in statistics, causal inference, machine learning and artificial intelligence.
Good for: R users who want to build and interpret linear regression models on real datasets and learn how to judge which model fits best.
Keep in mind: The course centers on linear regression, worked through on two datasets: University of Texas teaching evaluations and Seattle-area house prices.
Bottom line: A tidyverse route into regression that ties each model to the question it answers, ending with R-squared, RMSE and a train-test check for choosing among them.
Frequently Asked Questions
Whose teaching scores and house prices are modeled?
Two real datasets run through the course. Teaching evaluation scores for instructors at the University of Texas at Austin support the single-predictor regressions, and house prices from the Seattle metropolitan area support the multiple regression chapter.
How does modeling for explanation differ from modeling for prediction?
Explanation asks whether a variable helps account for an outcome, such as whether instructors' ages relate to their evaluation scores. Prediction asks how accurately an outcome can be estimated, such as a house's price from its size and condition. The first chapter introduces both and the modeling problem each one poses.
Are categorical predictors part of the regression work?
Yes. Single-predictor regressions are fit with categorical variables such as instructor gender and rank, and in the multiple regression chapter a house's condition joins its size in a parallel slopes model, while waterfront status is paired with size for predictions.
User Reviews
Write your review
You must be logged in to post a review.
Reviews can only be posted by registered learners. Log in or create a free account, then you will return here to post.


There are no reviews yet.