Hi All,
I am using the following SAS to code to compute the variance components of four categorical variables. I need to compute the R2 of the model. Can I directly use the Sum Squares Error and Sum Squares Total given in the output or should I be using a different technique?
proc sort data=ANOVATEST;
by Y I_Code C_name S_C;
proc nested data=Anovatest;
class Y I_Code C_name S_C;
var S_RA;
run;
quit;
In the above, S_RA is a continuous variable and Y represents year, I_Code C_name S_C are categorical variables representing effects.
Variance Source | DF | Sum of Squares |
Total | 23436 | 8120.03 |
Y | 11 | 11.704 |
I_Code | 785 | 626.329 |
C_Name | 18735 | 6542.12 |
S_C | 3532 | 893.299 |
Error | 373 | 46.5771 |
Thanks in advance for your time.
Without testing, R^2 = (TSS - ESS)/TSS. Explained variation over total variation.
Steve Denham
Without testing, R^2 = (TSS - ESS)/TSS. Explained variation over total variation.
Steve Denham
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.