BookmarkSubscribeRSS Feed
ACLAN
Obsidian | Level 7

Hi all, 

 

I'm running a one way ANOVA analysis in SAS based on the following code: 

 

proc anova data=dt;
class SERINDEX;
model Value0USNumdec = SERINDEX;
run;

 

The output returns:

The SAS System

The ANOVA Procedure
 
Dependent Variable: Value0USNumdec
Source DF Sum of Squares Mean Square F Value Pr > FModelErrorCorrected Total
40.002200000.0005500027.50<.0001
200.000400000.00002000  
240.00260000   

 

R-Square Coeff Var Root MSE Value0USNumdec Mean
0.8461540.9126810.0044720.490000

 

Source DF Anova SS Mean Square F Value Pr > FSERINDEX
40.002200000.0005500027.50<.0001

 

 

As an R user, I'm used to get the DF, Variance component (VC), CV (as percentage), SD and Root MSE both for the model and for the error when I perform an one-way ANOVA analysis.  

 

How can I specify this output in SAS? The user guide for Proc Anova has nothing on it. I also looked at the proc Varcomp or proc mixed procedures but they seem not to give the output I need as well. 

 

4 REPLIES 4
PaigeMiller
Diamond | Level 26

You really ought to format your output so that it is readable, that will help us and thus you get better answers and quicker answers. For output, a screen capture is fine (and readable).

 

I'm used to get the DF, Variance component (VC), CV (as percentage), SD and Root MSE both for the model and for the error

 

I do not know what the "variance component (VC)" in a one-way ANOVA means. Can you explain/provide a formula?

 

The SD**2 is the "Mean Square" column. There is no such thing as a root MSE both for the model and for the error. It only exists for the error, and is shown. The DF and CV are shown.

 

 

--
Paige Miller
ACLAN
Obsidian | Level 7

ACLAN_0-1619704740120.png

This is the R output I'm used to where the "estimates" for the errors and the model are shown. I wanted to create a similar output in SAS where, for both the error and the model I have the DF, SD and CV (%). Is there any option or another proc statement that I can use to obtained something similar to the image above?

PaigeMiller
Diamond | Level 26

I asked you to explain what VC means in a one-way ANOVA, or provide the formula, I don't see that.

 

Everything else you ask for is in the ANOVA output, or can be computed from the ANOVA output.

 

There is nothing in SAS that produces this exact output; but you can of course program something to produce this exact output (although I am skeptical that matching the R output appearance exactly is necessary, or worth the effort)

--
Paige Miller
SteveDenham
Jade | Level 19

Looking at this output, i notice a line for total, one for the one-way factor and one for the error.  The total variance is that obtained from a null model (no effects).  The error variance is the residual error after fitting the model, and the attributed variance component for the one-way factor is the difference between those two.  Now comes the tricky part to think about, and it comes from the usual definition of variance component - the variance that is attributable to some random effect.  Now if you assume that SERINDEX is a random effect (and thus that this is a simplified nested model), then that value in the R output is then a random variance component.

 

But in PROC ANOVA, SERINDEX would be fit as a fixed, non-nested effect.  Perhaps PROC NESTED would give you what you want.  Without the dataset it is hard to tell.

 

SteveDenham

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 797 views
  • 0 likes
  • 3 in conversation