In: Statistics and Probability
Write the equation of the line. |
What is r? |
What is r squared? |
Using the equation of the line if x is 25 what is y? |
Using the equation of the line if y is 20 what is x. |
x | 25 | 32 | 27 | 24 | 26 | 18 | 20 | 23 | 20 | 16 | 19 | 15 | 20 | 27 | 27 |
y | 28 | 34 | 36 | 28 | 31 | 22 | 24 | 26 | 24 | 23 | 22 | 13 | 23 | 35 | 29 |
I used R software to solve this question.
R codes and output:
> x=c(25,32,27,24,26,18,20,23,20,16,19,15,20,27,27)
> y=c(28,34,36,28,31,22,24,26,24,23,22,13,23,35,29)
> fit=lm(y~x)
> summary(fit)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-4.8794 -1.1275 -0.1275 0.6499 4.4565
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.7991 3.4361 0.233 0.82
x 1.1387 0.1489 7.645 3.66e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.671 on 13 degrees of freedom
Multiple R-squared: 0.818, Adjusted R-squared: 0.804
F-statistic: 58.45 on 1 and 13 DF, p-value: 3.662e-06
1.
The equation of the line is
Y = 0.7991 + 1.1387 X
2.
r =
3.
r2 = 0.818
4.
If x is 25 then
Y = 0.7991 + 1.1387 X
Y = 0.7991 + 1.1387 (25)
Y = 29.2666
5.
If y is 20 then
Y = 0.7991 + 1.1387 X
20 = 0.7991 + 1.1387 X
X = (20 - 0.7991) / 1.1387
X = 16.8621