s-news
[Top] [All Lists]

[S] Different R^2s?

To: s-news@wubios.wustl.edu
Subject: [S] Different R^2s?
From: Brian Beckage <bb2@duke.edu>
Date: Thu, 29 Apr 1999 15:35:09 -0400 (EDT)
Sender: owner-s-news@wubios.wustl.edu
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.

Thanks,
Brian

The data are:

> merc.design[,1:8]
   price date mileage mod500 mod450 mod380 mod280 mod200 
 1 30495   11       7      1      0      0      0      0
 2 22250    9      16      1      0      0      0      0
 3 23995    9       8      1      0      0      0      0
 4 18495    9      15      1      0      0      0      0
 5 20950   10      26      1      0      0      0      0
 6 21500    9      18      1      0      0      0      0
 7 19995    7      24      1      0      0      0      0
 8 18950    7      20      1      0      0      0      0
 9 15695    6      13      0      1      0      0      0
10 15995    6      27      0      1      0      0      0
11 16595    6      18      0      1      0      0      0
12 15995    6      25      0      1      0      0      0
13  9950    1      43      0      1      0      0      0
14 17995    9      23      0      0      1      0      0
15 17495    8      16      0      0      1      0      0
16 21995    9      13      0      0      1      0      0
17 21995   11       2      0      0      1      0      0
18 19695   10       5      0      0      1      0      0
19 16850    8      15      0      0      1      0      0
20 16750    8      44      0      0      1      0      0
21 19850    8      22      0      0      1      0      0
22 21000    9       5      0      0      1      0      0
23 17950    7      44      0      0      1      0      0
24 17995   11       6      0      0      0      1      0
25 16295   10      14      0      0      0      1      0
26 16495    9       4      0      0      0      1      0
27 15995    8      15      0      0      0      1      0
28 13995    9       7      0      0      0      1      0
29 16995   11      11      0      0      0      1      0
30 15595    9      14      0      0      0      1      0
31 11995    7      11      0      0      0      1      0
32 13195    8      13      0      0      0      1      0
33  8995    5      31      0      0      0      1      0
34 17500    8      25      0      0      0      1      0
35 15450    8      25      0      0      0      1      0
36 14750   10      21      0      0      0      1      0
37 15750    8      16      0      0      0      1      0
38 12250    7      27      0      0      0      1      0
39 10995   10      13      0      0      0      0      1
40 10995   10      12      0      0      0      0      1
41 10495    9      24      0      0      0      0      1
42  8995    7      34      0      0      0      0      1
43 10295    9       7      0      0      0      0      1
44  6450    5      41      0      0      0      0      1
45 10950    8      29      0      0      0      0      1
46  9750    8      21      0      0      0      0      1
47  6950    4      35      0      0      0      0      1
   price date mileage mod500 mod450 mod380 mod280 mod200 
48  9950    9      11      0      0      0      0      1
49  8750    9      40      0      0      0      0      1
50 10750   10      12      0      0      0      0      1
51  4950    4      57      0      0      0      0      1
52  9250   10      23      0      0      0      0      1
53  9250    8      21      0      0      0      0      1
54  8995    9      24      0      0      0      0      1
-----------------------------------------------------------------------
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

<Prev in Thread] Current Thread [Next in Thread>