19
Linear Regression Using Excel

Tutorial Linear Regression

Embed Size (px)

Citation preview

Page 1: Tutorial Linear Regression

Linear Regression Using Excel

Page 2: Tutorial Linear Regression

Introduction

This tutorial will walk through the steps in performing linear regression using Microsoft Excel. The stress strain data shown in the table below will be plotted and linearly regressed using the 'Add Trendline' feature available with

Microsoft Excel.

Constructing The Table

The very first thing that needs to be done is to type in the numbers into Excel, as shown:

Page 3: Tutorial Linear Regression

Plotting The Data

Page 4: Tutorial Linear Regression

Highlight the data starting by clicking cell A4, then while holding the left button down, drag the cursor to cell B11.

Once highlighted, click on the chart wizard button. A small chart wizard window will pop up, then choose 'XY

(Scatter)', followed by clicking on the uppermost chart sub-type (the one where the dots aren't connected) as shown

below. Then click on 'Next >'

Plotting The Data (Continued)

Page 5: Tutorial Linear Regression

Then click on 'Series'

Plotting The Data (Continued)

Page 6: Tutorial Linear Regression

In the name field, type in 'Experimental Data'. Then click on 'Next >'

Plotting The Data (Continued)

Page 7: Tutorial Linear Regression

For the chart title type in 'Linear Regression Example'. For the Value (X) axis type in 'Strain (x10^-6 mm/mm)', and

for the value (Y) axis type in 'Stress (Mpa)'. Then click on 'Finish'

Plotting The Data (Continued)

Page 8: Tutorial Linear Regression

The plot of the data is completed.

Applying Linear Regression To The Plotted Data

Page 9: Tutorial Linear Regression

Right click exactly on a point on the plot, then a smaller window will pop up. Select 'Add Trendline...'.

Applying Linear Regression To The Plotted Data (Continued)

Page 10: Tutorial Linear Regression

Choose the 'Linear' trend/regression type. Then click on 'Options'.

Applying Linear Regression To The Plotted Data (Continued)

Page 11: Tutorial Linear Regression

Type in 'Linear Regression of Data' in the custom trendline name. Also, make sure to apply a check mark on 'Display equation on chart' and Display R-squared value on chart'

boxes. Then click on 'OK'

Page 12: Tutorial Linear Regression

Applying Linear Regression To The Plotted Data (Continued)

The plot of the original data together with the linear regression is completed. At this point the Excel work is

done. However, minor improvements can still be performed. Note that the next few steps might not work with older versions of Excel so the 'Final Adjustments'

section may be skipped when using older versions of Excel. Go on to the next page.

Page 13: Tutorial Linear Regression

Final Adjustments

Lets change that 'x10^-6' in cell A2 into a micron (micro meter) greek letter. To do this, left click on cell A2 to select

it, then in the formula bar, replace 'x10^-6' with the letter 'm' (lowercase). Then, still in the formula bar, highlight 'm'

and change the font type to symbol.

Page 14: Tutorial Linear Regression

Final Adjustments

Then, the micron symbol shows up in cell A2.

Page 15: Tutorial Linear Regression

Final Adjustments

Similarly, it can also be done on the plot as shown below.

Page 16: Tutorial Linear Regression

Copying And Pasting An Excel Plot Into Microsoft Word

Now all the Excel work is done. To show the result together with a discussion, it needs to be pasted into a word processing program such as Microsoft Word. One way to do this is by right clicking on the plot, and when a smaller

window pops-up select 'Copy'.

Page 17: Tutorial Linear Regression

Copying And Pasting An Excel Plot Into Microsoft Word (Continued)

Then start up Microsoft Word. On the toolbar click on 'Edit' and then 'Paste'.

Page 18: Tutorial Linear Regression

Copying And Pasting An Excel Plot Into Microsoft Word (Continued)

Then the plot is pasted into Microsoft Word. This concludes the tutorial.

Page 19: Tutorial Linear Regression