Average gas prices

Columbia, SC
Year Gas Price
2002 $0.70
2003 $1.04
2004 $1.15
2005 $1.38
2006 $1.86
2007 $1.70
2008 $2.55
2009 $1.29
2010 $2.22
2011 $2.56
Cabs use a valuable commodity-gas!
Find the linear regression equation that models the data above.

To find the linear regression equation that models the given data, we will use the least squares method.

First, let's assign the year as the independent variable (x) and the gas price as the dependent variable (y).

Next, we need to calculate the mean of x and y, denoted as x̄ and ȳ, respectively.

x̄ = (2002 + 2003 + ... + 2011) / 10 = 2006.5
ȳ = (0.70 + 1.04 + ... + 2.56) / 10 = 1.72

Now, we can calculate the slope (b) using the formula:
b = Σ((xi - x̄)(yi - ȳ)) / Σ((xi - x̄)^2)
= ((2002-2006.5)(0.70-1.72) + (2003-2006.5)(1.04-1.72) + ... + (2011-2006.5)(2.56-1.72)) /
((2002-2006.5)^2 + (2003-2006.5)^2 + ... + (2011-2006.5)^2)

To shorten the calculation, you may use the following:

b = (Σ(xi*yi) - (10 * x̄ * ȳ)) / Σ(x_i^2) - (10 * x̄^2))

Now, let's calculate b:

b = ((2002*0.70) + (2003*1.04) + ... + (2011*2.56) - (10 * 2006.5 * 1.72)) /
((2002^2) + (2003^2) + ... + (2011^2) - (10 * (2006.5^2))

At this point, the calculation becomes quite arduous, so you may consider using a calculator or spreadsheet software to perform these computations.

Once you calculate b, use the formula for the y-intercept (a):
a = ȳ - b * x̄

Finally, the linear regression equation that models the data is:

y = a + b * x

where a represents the y-intercept and b represents the slope.