Vous êtes sur la page 1sur 10

Example: Simple regression

Instructor Sara López


Department of Statistics
Example: Fuel consumption and weight
for 10 US cars (1981)

Car Weight Fuel Consumption


(‘000 pounds) (gallons / 100 miles)
AMC Concord 3.4 5.5
Chevy Caprice 3.8 5.9
Ford Wagon 4.1 6.5
Chevette 2.2 3.3
Toyota Corona 2.6 3.6
Ford Mustang 2.9 4.6
Mazda GLC 2.0 2.9
AMC Sprint 2.7 3.6
VW Rabbit 1.9 3.1
Buick Century 3.4 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
b1 = 2
= = 1.64
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 5.5 5.21 0.29
3.8 5.9 5.87 0.035
4.1 6.5 6.36 0.14
2.2 3.3 3.24 0.057
2.6 3.6 3.90 –0.30
2.9 4.6 4.39 0.21
2.0 2.9 2.91 –0.015
2.7 3.6 4.06 –0.46
1.9 3.1 2.75 0.35
3.4 4.9 5.21 –0.31
Example (5)

The residual variance estimator is:


n
1
sˆR2 = ∑
n − 2 i =1
ei
2

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

Vous aimerez peut-être aussi