Re: [R] Regression through the origin

From: Karl Ove Hufthammer <karloh_at_mi.uib.no>
Date: Tue 23 May 2006 - 21:56:52 EST

Trujillo L. skreiv:

> Sorry for the naiveness of my question but I have been trying in the
> R-help and the CRAN website without any success. I am trying to perform
> a regression through the origin (without intercept) and my main concern
> is about its evaluative statistics. It is clear for me that R squared
> does not make sense if you do not have an intercept in your model

There are many different definitions of R². Most of them are equivalent *only* for the simple linear regression model, y = a + b · x + ε.

R (the program) use a different formula for calculating R² when you fit a regression through the origin than for a simple linear regression; and the definition used *does* make sense. (Some other statistics software use the same definition in the two cases, which makes the resulting statistic meaningless in the case of regression through the origin.)

The (IHMO) most sensible way to interprete R² is as the proportional reduction in variation when fitting a more complex model over fitting a simpler model. See this excellent paper for a thorough discussion:

Anderson-Sprecher R. (1994). ‘Model comparisons and R²’. The American Statistician, volume 48, number 2, pages 113–117.

And for a discussion of the different definitions of R², especially when using transformed variables, see:

Kvålseth T.O. (1985). ‘Cautionary note about R²’. The American Statistician, volume 39, number 4, pages 279–285.

> If I still want to perform a regression in that
> conditions, does R have any options to evaluate the model adequacy
> correctly?

Try some diagnostic plots:

x = rnorm(100)
y = 1 + x + rnorm(100)
l=lm(y~x-1) # Note: Wrong model (we need an intercept)! summary(l)
par(mfrow=c(2,2))
plot(l)

As you can see, the fit is not very good. You might also want to try:

plot(y~x)
abline(l,col="red")

-- 
Karl Ove Hufthammer

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue May 23 23:16:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 24 May 2006 - 00:10:17 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.