In: Statistics and Probability
The table below gives the age and bone density for five randomly selected women. Using this data, consider the equation of the regression line, yˆ=b0+b1x, for predicting a woman's bone density based on her age. Keep in mind, the correlation coefficient may or may not be statistically significant for the data given. Remember, in practice, it would not be appropriate to use the regression line to make a prediction if the correlation coefficient is not statistically significant. Age 37 41 58 61 67 Bone Density 343 330 318 314 312 Table Step 1 of 6 : Find the estimated slope. Round your answer to three decimal places.
For the given example i write the R code.
The R-code is as follows:
x=c(37,41,58,61,67)
y=c(343,330,318,314,312)
l=lm(y~x)
summary(l)
plot(l)
And the Output is as follows:
Call: lm(formula = y ~ x) Residuals: 1 2 3 4 5 4.4968 -4.6796 -0.4293 -1.5616 2.1738 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 373.8715 8.3921 44.55 2.49e-05 *** x -0.9559 0.1552 -6.16 0.00861 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 4.061 on 3 degrees of freedom Multiple R-squared: 0.9267, Adjusted R-squared: 0.9023 F-statistic: 37.95 on 1 and 3 DF, p-value: 0.008609
The regression model is:
Y=373.8715 - 0.9559X
The estimated slope is - 0.9559.