On Thu, 29 Apr 1999, Brian Beckage wrote:
>
> Hello,
>
> I noticed that when I fit the following two models I get
> different R^2's when (I think) they should be the same.
>
> model1<-lm(log(price)~date+mileage+date:mileage+mod450+mod380+
> mod280+mod200,data=merc.design)
>
> model2<-lm(log(price)~-1+date+mileage+date:mileage+mod500+mod450+mod380+
> mod280+mod200,data=merc.design)
>
> summary(model1) yields an R^2 of 0.9395 while summary(model2) yields an
> R^2 of 0.9999. I'm using Splus3.4.
You may think they should be the same, but S-PLUS does not. I agree.
The difference is the null model: this has an intercept in the first
case and not the second. Think of R^2 as
RSS(fitted model) / RSS(null model)
If you think of it as a squared correlation it only makes sense if
you remove means iff there is a mean in the model.
This has been discussed here quite regularly: you will find much
longer discussions in the archives.
--
Brian D. Ripley, ripley@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news
|