BookmarkSubscribeRSS Feed
BlueNose
Quartz | Level 8

Hello all,

 

I have lab results and I want to do variance analysis as a part of an R&R analysis. My main interest is the variance components, i.e., what is the variance associated with each factor and what is the percentage of each factor out of the total variability. I have a continuous variable Y and 4 factors: X1, X2, X3 and X4.

 

I tried 3 different PROC's for this analysis: MIXED, VARCOMP and NESTED. MIXED and VARCOMP gave me identical results, while NESTED was different. In the results of NESTED, I got for the total variance, the exact observed variance of the entire dataset, while in MIXED or VARCOMP, the total variance was higher by 10 (65 instead of 55) from the observed variance.

 

One of my factors is responsible for most of the variance, I know it as a fact (can be seen graphically). In NESTED is had 99.9% of the total variability, while in MIXED or VARCOMP less (still over 90%). On the surface, it looks like NESTED is better, since it actually gives me the observed variance. Anyone who will look at the output of MIXED or VARCOMP will wonder where the total variability came from. I tried this also in JMP (which is automatic), and it ran the variance component using a Bayesian estimation, and then the total variance was almost as the observed (2 units less).

 

Does anyone here known why I see such big differences between NESTED and VARCOMP (or MIXED) ? Which one should I go with ?

 

Thank you in advance.

 

My code is:

 

 

proc varcomp method=reml data=RR;
class X1 X2 X3 X4;
model Y=X1 X2(X1) X3(X1 X2) X4(X1 X2 X3) / fixed=0;
run;

proc nested data=RR; 
class X1 X2 X3 X4;
var Y;
run;

 

1 REPLY 1
PaigeMiller
Diamond | Level 26

You should not expect these two methods to produce identical results.

 

PROC NESTED uses the ANOVA sums of squares breakdown of variance, PROC VARCOMP uses REML (Restricted Maximum Likelihood), and these will not give the same answers.

 

The ANOVA sums of squares method can produce negative variance estimates, while (Restricted) Maximum Likelihood will not produce negative variance estimates.

 

If you have fixed factors in your design, REML will probably be better, but its really not as simple as that.

 

 

--
Paige Miller

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 1668 views
  • 2 likes
  • 2 in conversation