linear regression in excel. linear regression in this presentation you will learn the following:...

25
Linear Regression In Excel

Post on 20-Dec-2015

239 views

Category:

Documents


1 download

TRANSCRIPT

Linear Regression In Excel

Linear Regression

In this presentation you will learn the following:

How to make a scatter plot in Excel (Click Here)

How to add the line of best fit (or trend line) to your scatter plot (Click Here)

How to put multiple best fit lines on the same graph (Click Here)

Linear Regression

Open an Excel file and type the data on page 41 of your workbook

Linear Regression

Click Insert, then Chart

Linear Regression

Click Next

Linear Regression

Click Next

Linear Regression

Click

Linear Regression

And the results . . .

Tuition & Fees at Public Colleges

0

1000

2000

3000

4000

1980 1985 1990 1995 2000

Year

Mea

n A

nn

ual

Fee

s ($

)

Series1

Linear Regression

Left-click on a data point. You’ll see that several of the data points are highlighted.

Linear Regression

Once you selected your data points, right-click, choose “Add Trendline”

Linear Regression

We want a linear trendline since the plotted data appears be linear

Click

Click

Linear Regression

Click

Click

Linear Regression

And the results . . .

Tuition & Fees at Public Colleges

y = 168.73x - 333677

R2 = 0.9884

0

1000

2000

3000

4000

1980 1985 1990 1995 2000

Year

Mea

n A

nn

ual

Fee

s ($

) Series1

Linear (Series1)

Linear Regression A word about the correlation

coefficient (R): Excel can only display the square the

correlation coefficient To find the correlation coefficient value

you need to take the square root Then, depending on whether the slope of

of your trendline is positive or negative you’ll be able say whether R is positive or negative

Linear Regression

What if we wanted to add multiple trendlines to the same graph?

The U of A Factbook contains interesting information about the demographics of the university

Linear Regression

An excerpt of data is shown below:

Linear Regression

Let’s suppose we wanted to compare the trends of resident and non-resident tuition and fees from 1995 to 2004

Go ahead and type in the data in a blank Excel worksheet

Linear Regression

Your data should look something like:

Linear Regression

Making the scatter plots

Highlight the cells where the resident values are stored

Click

Click

Linear Regression

Highlight cells where the years are stored

Since we’re going to plot two sets of data we’ll want to title our plot of the residents

Click add to so we can do the same thing for the non-residents

Linear RegressionTitle this plot of the non-residents

Highlight the cells where the year values are stored

Highlight Non-Resident Tuition & Fee values

Click

Linear Regression

Title your plots as shown below:

Click

Linear Regression

And the results . . .

Tuition & Fees at the U of A: Residents vs Non-Residents

0

5000

10000

15000

1990 1995 2000 2005

Year

Tu

itio

n &

Fee

s ($

) Residents

Non-Residents

Linear Regression

Now as before, click on the data points for each plot and add a trendline

The results of this are displayed on the next slide

Linear Regression

And the results . . .Tuition & Fees at the U of A: Residents vs

Non-Residents y = 545.53x - 1E+06

R2 = 0.9436

y = 207.55x - 412430

R2 = 0.7592

0

5000

10000

15000

1990 1995 2000 2005

Year

Tu

itio

n &

Fee

s ($

)

Residents

Non-Residents

Linear (Non-Residents)

Linear(Residents)