In: Statistics and Probability
Xi |
3 |
12 |
6 |
20 |
14 |
Yi |
55 |
40 |
55 |
10 |
15 |
B – Compute the Standard Error of the estimate.
Using R we can have the result:
CODE:
x <- c(3,12,6,20,14)
y <- c(55,40,55,10,15)
summary(lm(y~x))
OUTPUT:
> x <- c(3,12,6,20,14)
> y <- c(55,40,55,10,15)
> summary(lm(y~x))
Call:
lm(formula = y ~ x)
Residuals:
1 2 3 4 5
-4 8 5 2 -11
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 68.0000 8.1774 8.316 0.00364 **
x -3.0000 0.6526 -4.597 0.01935 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 8.756 on 3 degrees of freedom
Multiple R-squared: 0.8757, Adjusted R-squared: 0.8342
F-statistic: 21.13 on 1 and 3 DF, p-value: 0.01935
So, the standard error of estimate is 8.756.
We can elaborately compute that as follows;
CODE:
y_hat <- 68 - 3* x
y_hat
sqrt(sum((y - y_hat)^2)/3)
OUTPUT:
> y_hat <- 68 - 3* x
> y_hat
[1] 59 32 50 8 26
> sqrt(sum((y - y_hat)^2)/3)
[1] 8.75595
Here we also get same result as 8.75595 8.756.
We use the divisor 3 as df as we have 5 observations and we don't have any population known parameter so we are estimating the population parameters so we have df (5-2)=3