19
Linear Regression Modeling Using a Graph & the Line of Best Fit

Linear Regression Modeling

Embed Size (px)

DESCRIPTION

A short tutorial on linear modeling using the "line of best fit" grahing method.

Citation preview

Page 1: Linear Regression Modeling

Linear Regression Modeling

Using a Graph & the Line of Best Fit

Page 2: Linear Regression Modeling

What is a regression model?

Many times in an algebra problem we are given an equation, and asked to calculate values using that equation.

For example, if we are given the equation

,

we can then calculate y given different values of x.

So if , then

and if , then

Page 3: Linear Regression Modeling

What is a regression model?

But sometimes, we are given the data and asked to create an equation that models the data.

In other words, we already have the answers but need to figure out the equation that gives us those answers.

Page 4: Linear Regression Modeling

What is a regression model?

In mathematics, this is called a regression model, since we are sort of working backwards to find an equation, when we already have the answers.

Page 5: Linear Regression Modeling

Why do we need them?

Regression models have many applications in industry and science.

Regression models can predict future trends, like population growth.

Regression models can be used to estimate costs and profits for businesses.

Regression models can help medical care professionals determine how much medication to prescribe for their patients.

Page 6: Linear Regression Modeling

The First Step: Linear Regressions

The most basic kinds of regression models are linear regressions. We will start with creating a linear regression of a set of model data using the “line of best fit” method, by making a graph in the Cartesian plane.

Page 7: Linear Regression Modeling

Linear Regression Modeling Using a Graph

Plot the data

Determine the “best fit” line by examination

Develop the equation of the line of best fit

Your linear model is complete

Page 8: Linear Regression Modeling

Model Datax y- 7 - 6- 5 - 3- 3 - 1- 1 00 22 34 57 7

Plot the data on the Cartesian plane

The result is called a “scatter plot”

Page 9: Linear Regression Modeling

This is the scatter plot of our model data.

Page 10: Linear Regression Modeling

Adding the best fit line1. The best fit line should:

a) Pass through two points that are easy to find on the graph.

b) Come as close as possible to as many of the data points in the scatter plot as possible

2. There should be about the same number of points from the scatter plot above the line as below it.

3. The best fit line can pass through some of the points on the scatter plot, but it does not have to pass through any of them.

Page 11: Linear Regression Modeling

This line does not pass through two points that are easy to find on the graph.

This will make it more difficult to determine the equation of this line.

Page 12: Linear Regression Modeling

This line passes through two points that are easy to find on the graph, but it does not pass very close to most of the points in the scatter plot.

This means that it is not a very good fit for the given data.

Page 13: Linear Regression Modeling

This line passes close to many of the data points in the scatter plot, but most of the points are above the line; only one point is below the line.

We’re getting closer!

Page 14: Linear Regression Modeling

The line passes through two easy to find points.It passes close to most of the points in the scatter plot.There are several points both above and below the line.This looks like a good fit for the data!

Remember, there may be more than one line that is a good fit. You have to decide which one looks “best” to you.

Page 15: Linear Regression Modeling

Find the Equation of Your Best-fit Line

1. Calculate the slope of the line

2. Using the slope-intercept form of a linear equation, , substitute one of the points on your best-fit line into the equation for x and y, and substitute the slope you found in step 1.

3. Solve the resulting equation for b, giving you the y-intercept.

4. Rewrite the equation in slope-intercept form using the correct values for slope and the y-intercept (b).

Page 16: Linear Regression Modeling

Step 1: Calculate slopeThe slope of this line is:

Page 17: Linear Regression Modeling

Step 2: Substitute values into

We will use the point (6,7), so

Giving us:

Step 3: Solve for b: (first multiply everything by 13):

Page 18: Linear Regression Modeling

Step 4: Substitute the values calculated for m and b.

And the equation of the regression line is:

Page 19: Linear Regression Modeling

That’s it!Now we can use our model to predict or estimate further values in our data set, but that are not included in the data.

For example, x = 12 is not one of the original data points. However, by using our regression model equation, we can estimate the y – value when x = 12.The resulting solution is: