From my understanding, the significance of an intercept term (β0 in y = β0 + β1x + ɛ) in a given model is tested by comparison to zero (whereby, a non-significant β0 = 0, and a significant β0 ≠ 0).
If this is indeed the case, why, then, does a simple linear model in R with an intercept set (indirectly) to zero, yield a significant coefficient? Please see the attached example below:
x = c(-5:50)
y = c(-5:50)
plot(y~x) # Plotting the relationship between y and x, obviously passing through zero
summary(lm(y~x))
Call: lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-1.638e-15 -5.034e-16 -1.994e-16 1.047e-16 3.016e-15
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.798e-15 2.153e-16 -1.764e+01 <2e-16
x 1.000e+00 7.772e-18 1.287e+17 <2e-16
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.401e-16 on 54 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 1.655e+34 on 1 and 54 DF, p-value: < 2.2e-16
Warning message:
In summary.lm(lm(y ~ x)) : essentially perfect fit: summary may be
unreliable
My additional question, then, is how does base R calculate the significance of an intercept coefficient (formula would be much appreciated)?