LINEAR MODELING IN R > MISSION 456

Estimating the Coefficients and Fitting Linear Models

In this lesson of our Linear Modeling in R course, you'll begin to dig deeper into linear modeling with R. You'll use R's lm() function and the least squares criterion to fit a linear model to the data.

As you fit the model, though, you'll also be learning about how to effectively interpret your results. You'll make use of familiar statistics concepts like confidence intervals and standard error as you assess the accuracy of the coefficients.

You'll also learn to fit a trendline to a scatterplot in ggplot2 both manually and by using an lm argument.

Of course, as you work with the model, you'll also be reviewing programming and statistics concepts from earlier in our Data Analyst in R path

Objectives

  • Estimate the coefficients using least squares
  • Learn to fit, assess, and plot a model using lm

Mission Outline

1. Introduction
2. ​Fitting a Bivariate Linear Regression Model
3. ​Estimating the Slope
4. ​Estimating the Intercept
5. ​Visualizing Model Fit
6. ​Estimating the Predictions
7. ​Estimating the Residuals
8. ​Estimating the Residual Sum of Squares
9. ​​Understanding RSS
10. ​Recap
11. Takeaways

linear-regression-for-machine-learning

Course Info:

Intermediate

The median completion time for this course is 7.23 hours. View Details

This course requires a premium subscription and includes five missions and one guided project.  It is the 11th course in the Data Analyst in R.

START LEARNING FREE

Take a Look Inside

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);