# 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

## Lesson Outline

- Introduction
- Fitting a Bivariate Linear Regression Model
- Estimating the Slope
- Estimating the Intercept
- Visualizing Model Fit
- Estimating the Predictions
- Estimating the Residuals
- Estimating the Residual Sum of Squares
- Understanding RSS
- Recap
- Takeaways

Get started for free

No credit card required.

**Already have an account?** Sign in →

By creating an account you agree to accept our terms of use and privacy policy.