You are on page 1of 18

Linear Regression Using Excel

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:
Plotting The Data

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)

Then click on 'Series'


Plotting The Data (Continued)

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


on 'Next >'
Plotting The Data (Continued)

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)

The plot of the data is completed.


Applying Linear Regression To The
Plotted Data
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)
Choose the 'Linear' trend/regression type. Then click on
'Options'.

Applying Linear Regression To The


Plotted Data (Continued)
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'

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.

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.

Final Adjustments
Then, the micron symbol shows up in cell A2.
Final Adjustments

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


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'.
Copying And Pasting An Excel Plot Into
Microsoft Word (Continued)

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


and then 'Paste'.
Copying And Pasting An Excel Plot Into
Microsoft Word (Continued)

Then the plot is pasted into Microsoft Word. This concludes


the tutorial.

You might also like