Re: Different R^2 values with same variables
- From: shiling99@xxxxxxxxx
- Date: 29 Mar 2006 11:16:59 -0800
I think I got your problem.
When you use selection method, SAS will use ONLY data points as if all
x's + y has valid values-- which is much smaller than, say, when you
use x1+y. This causes the all difference.
In the case with data below, one uses 47 obs while the other uses 81.
proc reg data=temp;
model y=x1- x3 / SELECTION=RSQUARE START=1 STOP=1 ;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: y
R-Square Selection Method
Number of Observations Read 100
Number of Observations Used 47
Number of Observations with Missing Values 53
*regular reg;
proc reg data=temp;
model y=x1 ;
run;
quit;
The REG Procedure
Model: MODEL1
Dependent Variable: y
Number of Observations Read 100
Number of Observations Used 81
Number of Observations with Missing Values 19
pekkajarvela@xxxxxxxxx wrote:
shiling99@xxxxxxxxx kirjoitti:
I am glad you find your problrm.
However, your problem cannot be reproduced. Here is my sas simulation
codes.
The missing number will not be in regression according to the listing
file. And in both cases the results(R-square) are the same.
Yes, with your dataset I got equal R^2 values for both with selection
and without selection. BUT let's take the same dataset modifed as given
below with independents x1,x2,x3 and the dependent y. Here are the
results, those values in parentheses () are R^2 values without any
selection. As you can see R^2 values with and without selection are all
diffrent except for the last case where all independents are in model.
The REG Procedure
Model: Linear_Regression_Model
Dependent Variable: y
R-Square Selection Method
Number
in
Model R-Square Variables in Model
1 0.0434 x1 (NO selection R^2 = 0.0266)
1 0.0302 x2 (0.0000)
1 0.0258 x3 (0.0022)
2 0.0665 x1 x3 (0.0733)
2 0.0629 x1 x2 (0.0163)
2 0.0538 x2 x3 (0.0124)
3 0.0845 x1 x2 x3 (0.0845)
QUESTION: What does SAS do so that it gives different R^2 values with
the same dataset depending on if R^2 selection is used or not?
------- dataset -------
x1 x2 x3 y
0.884 0.074 0.464 2.065
0.398 0.634 0.012 -0.695
0.812 0.768 0.709 1.012
0.723 0.013 0.155 0.532
0.393 0.255 0.72 0.839
0.47 . 0.239 2.666
0.975 . 0.722 2.335
0.341 . 0.989 -0.217
0.6 . 0.799 2.426
0.564 . 0.159 3.427
0.496 . . 2.756
0.985 0.456 . 2.58
0.298 0.854 . 2.852
0.281 0.197 . 1.72
0.729 0.172 . 3.045
0.939 0.551 . 2.01
0.07 0.694 . 1.926
0.76 0.004 . 1.857
0.428 0.276 . .
0.029 0.598 . -1.207
0.782 0.73 0.759 2.938
0.056 0.33 0.82 1.566
0.459 0.962 0.014 -2.171
0.462 0.586 0.986 0.095
0.068 0.001 0.044 1.04
0.934 0.843 0.163 1.981
0.762 . 0.862 2.744
0.366 . 0.425 0.285
0.196 . 0.551 1.007
0.041 . 0.307 0.443
0.892 . 0.741 1.193
0.435 0.346 0.819 3.694
0.941 0.48 0.837 3.639
0.403 0.802 0.358 1.635
0.036 0.178 0.515 1.04
. 0.524 0.493 2.8
. 0.99 0.465 -0.26
. 0.099 0.127 .
. 0.08 0.081 1.175
. 0.044 0.769 1.938
. 0.496 0.351 1.295
. 0.734 0.408 0.799
. 0.473 0.385 0.958
. 0.548 0.141 3.396
. 0.257 0.203 3.021
. 0.962 0.596 1.459
. 0.534 0.292 0.071
. 0.333 0.909 0.241
. 0.764 0.644 1.016
. 0.623 0.544 0.693
0.837 0.712 0.572 1.714
0.006 0.704 0.921 0.385
0.968 0.671 0.879 2.454
0.126 0.646 0.886 2.622
0.595 0.475 0.166 1.487
0.108 0.056 0.179 0.037
0.153 0.124 0.393 .
0.926 0.298 0.78 0.049
0.615 0.075 0.659 -0.424
0.534 0.366 0.529 2.29
0.837 0.016 0.989 0.167
0.636 0.495 0.235 2.564
0.149 0.018 0.868 0.435
0.872 0.388 0.012 3.761
0.805 0.897 0.255 2.266
0.228 0.689 0.013 2.619
0.601 0.484 0.986 1.565
0.86 0.027 0.603 2.416
0.787 0.505 0.841 1.561
0.861 0.44 0.371 0.659
0.631 0.932 0.687 2.701
0.513 0.319 0.395 0.393
0.659 0.553 0.426 -0.129
0.1 0.466 0.314 1.837
0.501 0.832 0.921 2.769
0.317 0.561 0.073 .
0.212 0.162 0.328 0.162
0.9 0.967 0.676 2.102
0.684 0.028 0.254 0.429
0.12 0.436 0.754 3.261
0.818 0.834 0.686 0.687
0.385 0.608 0.442 0.268
0.241 0.65 0.541 0.622
0.243 0.44 0.83 -0.123
0.925 0.049 . 2.507
0.414 0.947 . 1.714
0.164 0.17 . 3.382
0.875 0.491 . 1.974
0.44 0.972 . 1.412
0.138 0.291 . 2.905
0.84 0.595 . 0.82
0.18 0.478 . 2.465
0.072 0.719 . 1.645
0.637 0.248 . 0.827
0.598 0.957 . .
0.441 0.262 . 3.11
0.765 0.104 . 0.608
0.368 0.875 . 1.025
0.079 0.447 . 3.442
0.067 0.617 . 1.377
.
- References:
- Different R^2 values with same variables
- From: pekkajarvela
- Re: Different R^2 values with same variables
- From: Jerry Dallal
- Re: Different R^2 values with same variables
- From: pekkajarvela
- Re: Different R^2 values with same variables
- From: shiling99
- Re: Different R^2 values with same variables
- From: pekkajarvela
- Different R^2 values with same variables
- Prev by Date: Nice KENDALL (& Stuart NOT) Roadmap to SPSS doc (was: pseudorandom generators)
- Next by Date: Flexible probability density function
- Previous by thread: Re: Different R^2 values with same variables
- Next by thread: Variance as central moment
- Index(es):
Relevant Pages
|