Regression using Excel
First, you need to enter the data or open the existing data file.
We will use the file cars2010.csv
(save it to disk,
then just double-click on it, and it will open up automatically in Excel)
For example, let's fit the equation
Y = b0 + b1*X
with Y = City MPG and X = engine displacement
1) Select the columns you'd like to analyze
(if you need to select two non-adjacent columns,
press <ctrl> while clicking on the two columns you need)
2) Go to menus Insert, Charts, Scatter to make a scatterplot
3) right-click on the dots and in the menu that pops up select Add Trendline
Select the options Display equation on chart and Display R-squared value on chart
You will get the plot with the least squares lines through it and the equation
displayed on the chart. It also shows the value of r squared.
The two class examples (ice cream and tannin) can be found here:
icecream.xls
tannin.xls