In: Statistics and Probability
Listed below are altitudes (in thousands of feet) and outside air temperatures (in °F) recorded by a curious passenger during Delta Flight 1053 from New Orleans to Atlanta.
Altitude | 3 | 10 | 14 | 22 | 28 | 31 | 33 |
Temperature | 57 | 37 | 24 | -5 | -30 | -41 | -54 |
Below is the scatterplot of this data with the best-fit line.
Correlation coefficient (r) = -0.997
Meanaltitude = 20.14
Meantemperature = -1.71
Standard deviationaltitude (sx) = 11.423
Standard deviationtemperature (sy) = 42.221
Write down the equation for the best-fit line:
temperature = [ Select ] ["2.5", "-3.2", "-3.7", "3.7"] altitude + [ Select ] ["65.3", "72.8", "77.9", "-69.4"]
What is r2 of the best-fit line?
r2 = [ Select ] ["-0.994", "0.994", "-0.999", "0.999"]
The regression equation predicts the outside temperature to be 61.7 when the altitude is 3. What is the residual when the altitude is 3?
Residualaltitude=3 = [ Select ] ["-6.3", "-4.7", "4.7", "6.3"]
Using R code as follow we get
> Altitude=c(3,10,14,22,28,31,33)
> Temperature=c(57,37,24,-5,-30,-41,-54)
> cor(Altitude,Temperature)
[1] -0.9967768
> fit=lm(Temperature~Altitude)
> fit
Call:
lm(formula = Temperature ~ Altitude)
Coefficients:
(Intercept) Altitude
72.498 -3.684
> summary(fit)
Call:
lm(formula = Temperature ~ Altitude)
Residuals:
1 2 3 4 5 6 7
-4.4453 1.3449 3.0821 3.5566 0.6624 0.7153 -4.9161
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 72.4982 3.0169 24.03 2.33e-06 ***
Altitude -3.6843 0.1326 -27.78 1.13e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.71 on 5 degrees of freedom
Multiple R-squared: 0.9936, Adjusted R-squared:
0.9923
F-statistic: 771.9 on 1 and 5 DF, p-value: 1.131e-06
Equation of best line fit is
temperature = - 3.7 * altitude + 72.8
-----------------------------------------------
r2=0.999
----------------------------------------------------------------
Residual altitude of 3 = actual vaule of 3 - fitted value of 3
= 57 - 61.7
Residual altitude of 3 = - 4.7