Skip to content

Question about linear regression in R

4 messages · Miles Yang, R. Michael Weylandt, David Winsemius +1 more

#
What exactly is it that's worrying you? It's a problematic regression
for a few reasons, but ultimately it seems pretty ok, though I'd be
ever so slightly worried about the R^2 value being misinterpreted.

Michael
On Mon, Nov 14, 2011 at 10:49 PM, Miles Yang <miles2yang at gmail.com> wrote:
#
On Nov 14, 2011, at 10:49 PM, Miles Yang wrote:

            
You are asking R to tell you if the mean of the log of 3 was different  
than 0. It is.
#
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