Regression Analysis Using Excel: X Abp
Regression Analysis Using Excel: X Abp
Simple regression
Use Solver and some simple utility function to compute some demands for commodity 1 as a
function of income and prices. Here is a small sample
x1 = a − bp1
The data points are depicted below.
1
These notes are almost identical to those in the Regression Analysis Slides
Clearly no line is going to pass through each point. Regression analysis starts with an initial
guess as to the values of the parameters a and b. It then computes the vertical distance between
the line and each dot and then sums the square of these distances.
The regression program then finds the parameters that minimize this sum of “squared errors.”
The estimated parameter vector is then called the least squares estimate.
From the Home Ribbon, click on Data. On the far right you will see the Analysis Options
Click on OK.
You need to enter the Y (dependent variable data). This is the array of demands [D3:D8].
You also need to enter the X (independent variable array.) This is the array [B3:B8].
You do want a constant term so leave the “constant is zero” box blank.
Note that the default is for the regression results to appear on a new worksheet.
If would like to see them on the same worksheet you need to tell the program where to write the
results. Om my spreadsheet everything is blank to the South-West of A10 so I choose the region
A10:P30.
Click OK and the results will appear.
SUMMARY OUTPUT
We are interested in the coefficients. What the SUMMARY OUTPUT reveals is that the least
squares estimate is
x1 = 433 −142 p1
The R2 is 0.85 indicating that we have “explained” 85% of the variation.
Drawing the chart
Using the estimated coefficients we can compute the estimated demand for each price.
We can then plot the estimated demand curve on the same chart as the actual scatter plot.
Multiple Regression
Simple regression leaves out the fact that the variation in x1 results not just from the variation
in p1 but in the other price and income as well. The analysis proceeds as before but now the X‐
array is J3:L8. The new SUMMARY OUTPUT IS
We should not put too much faith in this result as there are only 6 observations and 4
explanatory variables (including the constant.)