Example: Simple regression
Instructor Sara López Department of Statistics
Example: Fuel consumption and weight for 10 US cars (1981) Car AMC Concord Chevy Caprice Ford Wagon Chevette Toyota Corona Ford Mustang Mazda GLC AMC Sprint VW Rabbit Buick Century
Weight (‘000 pounds) 3.4 3.8 4.1 2.2 2.6 2.9 2.0 2.7 1.9 3.4
Fuel Consumption (gallons / 100 miles) 5.5 5.9 6.5 3.3 3.6 4.6 2.9 3.6 3.1 4.9
Example (2)
The data has been collected to show that the weight of the car affects the fuel consumption So, which is the response and which is the explanatory variable? A scatter plot of these data is on the next slide
Scatter plot of data
Example (3)
The mean and variance of the weights are 2.9 and 0.576. The mean and variance of the fuel consumptions are 4.39 and 1.621. The covariance between weight and fuel consumption is +0.943. Therefore the regression line has parameters:
cov( x, y ) 0.943 = = 1.64 b1 = 2 sx 0.576 b = y − βˆ x = 4.39 − 1.64 × 2.9 = −0.37. 0
1
Data and regression line
Example (4): The Residuals xi (weight)
yi (fuel)
yˆ i = −0.37 + 1.64 xi
ei = yi − yˆ i
3.4 3.8 4.1 2.2 2.6 2.9 2.0 2.7 1.9 3.4
5.5 5.9 6.5 3.3 3.6 4.6 2.9 3.6 3.1 4.9
5.21 5.87 6.36 3.24 3.90 4.39 2.91 4.06 2.75 5.21
0.29 0.035 0.14 0.057 –0.30 0.21 –0.015 –0.46 0.35 –0.31
Example (5) The residual variance estimator is: n 1 2 sˆR2 = e ∑ i n − 2 i =1 1 = [0.29 2 + 0.0352 + + (−0.31) 2 ] 10 − 2 = 0.084
Example
What is the fuel consumption of a car that weighs 3.0? The estimate and confidence interval for the mean weight is:
Our prediction for the weight, and its confidence interval, are:
Example
In general, the 95% confidence interval for mean fuel consumption of a car weighing 1000x pounds is:
And the 95% confidence interval for the fuel consumption of a car weighing 1000x pounds is:
We should not predict consumption outside the range 1.9 to 4.1