[R] lm without intercept, false R-squared

peter dalgaard pdalgd at gmail.com
Wed Jun 27 10:34:30 CEST 2012


On Jun 27, 2012, at 09:33 , Christof Kluß wrote:

> Hi
> 
> is there a command that calculates the correct adjusted R-squared, when
> I work without intercept? (The R-squared from lm without intercept is
> false.)

When people say that, they are usually implying that a "correct" R-squared can be negative!

If for some reason you want to use an alternative *definition* of R^2, it should be easy enough to calculate it yourself, e.g. (if the proportion reduction in variance is wanted):

Y <- rnorm(100, 10, 1)
x <- 1:100
(var(Y) - summary(lm(Y~x-1))$sigma^2)/var(Y)

(comes out as -31 or so)


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list