Solved – Finding Least Squares Prediction Equation

least squaresregression

The Question

Consider the following data concerning the demand ($y$) and price ($x$) of a consumer product

Demand $|$ 252 $\space$244$\space$ 241 $\space$ 234 $\space$ 230 $\space$ 223

Price$\space\space\space\space\space$ $|$2.00 $\space$2.20 2.40 2.60 2.80 3.00

Write the least squares prediction equation.

My attempt

I was able to find the least squares point estimates:

$b_1=$ $6\sum^6_{i=1}x_iy_i-(\sum^6_{i=1}x_i)(\sum^6_{i=1}yi)\over{6\sum^6_{i=1}x_i^2-(\sum_{i=1}^6x_i)^2}$$=$-27.71$

$b_0=\bar{y}-b_1\bar{x}=306.62$

(where $\bar{y}=$$\sum^6_{i=1}y_i\over{6}$ and $\bar{x}=$$\sum^6_{i=1}x_i\over{6}$)

Update!!

Thanks to this community, I learned that the least squares prediction equation is $\hat{y}=b_0+b_1x$ which means my equation is:

$$\hat{y}=-27.71+306.62x$$

my problem is when I model this to predict changes in demand by setting price to a value, for example 2.40, I do not seem to be able to get near the actual result.

i.e. $$\hat{y}=-27.71-306.62(2.40)\approx 708.18$$ which is nowhere near the actual demand!

Is there an error in my calculations? Or is it a problem in the math?

Thanks!

Best Answer

You've got your parameters reversed. Your estimated model is:

$$\hat{d}_i = 306.62 - 27.71p_i + \epsilon_i$$

Hence:

Your forecast of demand given a price of 2.4 would be $306.62 - 27.71*2.4 = 240.1$.


Additional comments:

  • I checked your results by running the regression myself (based upon what numbers you have in the question) and I get the above numbers.
  • Here you are estimating a demand curve. Running a regression like this makes sense ONLY IF the variation in price is due to variation in supply. To estimate a demand curve, you need a shifting supply curve (eg. estimate demand for orange juice using variation in price due to supply shocks to florida orange crop). To estimate a supply curve, you need a shifting demand curve. If both the demand curve and the supply curve are shifting at the same time, you're essentially screwed and can't estimate either one (unless the problem has additional structure).