[R] R-Squared with biglm?

Thomas Lumley tlumley at u.washington.edu
Mon Apr 20 22:15:38 CEST 2009


On Mon, 20 Apr 2009, Bryan Lim wrote:

> I've been working with a rather large data set (~10M rows), and while biglm 
> works beautifully for generating coefficients, it does not report an 
>r-squared. It does report RSS. Any idea on how one could coax an R-squared out 
>of biglm?

Hmm. I don't ever use r-squared, so I didn't implement it. I'll add the null model RSS to the output for the next verson

The obvious work-around is to fit a model with only an intercept, and divide the RSS for the two models, but that takes twice as long.

The necessary information is all in the QR decomposition, the problem is just getting it out. A Horrible Hack is to use the leaps package and do
   leaps:::leaps.from.biglm(model)$nullrss
to get the null model RSS.

    -thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list