Skip to content
Prev 277421 / 398506 Next

Question about linear regression in R

Dear Miles,

Within rounding error, you got the right intercept, log(3); slope, 0;
residuals, all 0; residual standard error, 0; and standard errors of the
intercept and slope, both 0. The R^2 should have been undefined (i.e., 0/0),
but dividing one number that's 0 within rounding error by another gives a
wild result. Likewise for the omnibus F and t-test for the slope. The moral:
don't expect floating-point arithmetic on a computer to be perfectly
precise.

I hope this helps,
 John

--------------------------------
John Fox
Senator William McMaster
  Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox