title: R - Why is linear model intercept significant despite being set (indirectly) to zero?
body: <p>From my understanding, the significance of an intercept term (β<sub>0</sub> in y = β<sub>0</sub> + β<sub>1</sub>x + ɛ) in a given model is tested by comparison to zero (whereby, a non-significant β<sub>0</sub>
  = 0, and a significant β<sub>0</sub> ≠ 0).</p>
  <p>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:</p>
  <pre><code>x = c(-5:50)
  y = c(-5:50)
  plot(y~x) # Plotting the relationship between y and x, obviously passing through zero
  </code></pre>
  <p><a href="https://i.stack.imgur.com/ID5RA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ID5RA.jpg" alt="enter image description here" /></a></p>
  <pre><code>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(&gt;|t|)
  (Intercept) -3.798e-15  2.153e-16 -1.764e+01   &lt;2e-16
  x            1.000e+00  7.772e-18  1.287e+17   &lt;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: &lt; 2.2e-16
  
  Warning message:
  In summary.lm(lm(y ~ x)) : essentially perfect fit: summary may be 
  unreliable
  </code></pre>
  <p>My additional question, then, is how does base R calculate the significance of an intercept coefficient (formula would be much appreciated)?</p>