In: Statistics and Probability
Below are the average heights for American boys in 1990.
Age (years) | Height (cm) |
---|---|
birth | 50.8 |
2 | 83.8 |
3 | 91.4 |
5 | 106.6 |
7 | 119.3 |
10 | 137.1 |
14 | 157.5 |
A.) Calculate the least squares line. Put the equation in the form of: ŷ = a + bx. (Round your answers to three decimal places.)
B.) Find the correlation coefficient r. (Round your answer to four decimal places.)
C.) Find the estimated average height for a one-year-old. (Use your equation from part (d). Round your answer to one decimal place.)
D.) Find the estimated average height for a eleven-year-old. (Use your equation from part (d). Round your answer to two decimal places.)
E.) Use the least squares line to estimate the average height for a fifty-four-year-old man. (Use your equation from part (d). Round your answer to one decimal place.)
F.) What is the slope of the least squares (best-fit) line? (Round your answer to three decimal places.)
> # Entering the data > Age = c(1,2,3,5,7,10,14) > Height = c(50.8,83.8,91.4,106.6,119.3,137.1,157.5) > dataset = data.frame(Age,Height) > > > # Calculating the least square line > reg_line = lm(Height ~ Age, data = dataset) > summary(reg_line) Call: lm(formula = Height ~ Age, data = dataset) Residuals: 1 2 3 4 5 6 7 -19.566 6.178 6.523 7.212 5.402 1.436 -7.185 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 63.1110 7.0528 8.948 0.000291 *** Age 7.2553 0.9522 7.619 0.000619 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 10.94 on 5 degrees of freedom Multiple R-squared: 0.9207, Adjusted R-squared: 0.9048 F-statistic: 58.05 on 1 and 5 DF, p-value: 0.0006191 # The fitted regression line is Y = 63.111 + 7.255*age > #b) Correlation coefficient > cor(Height,Age) [1] 0.9595
C) The estimated average height for a one-year-old is
y = 63.111 + 7.255 = 70.4
D) The estimated average height for a eleven-year-old is
y = 63.111 + 7.255*11 = 142.92
E) The least squares line to estimate the average height for a fifty-four-year-old man is
y = 63.111 + 7.255*54 = 454.88
F) The slope of the best fitted line is 7.255