The NESTED Procedure

Contrasted with Other SAS Procedures

The NESTED procedure performs a computationally efficient analysis of variance for data with a nested design, estimating the different components of variance and also testing for their significance if the design is balanced (see the section Unbalanced Data). Although other procedures (such as GLM and MIXED) provide similar analyzes, PROC NESTED is both easier to use and computationally more efficient for this special type of design. This is especially true when the design involves a large number of factors, levels, or observations.

For example, to specify a four-factor completely nested design in the GLM procedure, you use the following form:

class a b c d;
model y=a b(a) c(a b) d(a b c);

However, to specify the same design in PROC NESTED, you simply use the following form:

class a b c d;
var y;

In addition, other procedures require TEST statements to perform appropriate tests, whereas the NESTED procedure produces the appropriate tests automatically. However, PROC NESTED makes one assumption about the input data that the other procedures do not: PROC NESTED assumes that the input data set is sorted by the classification (CLASS) variables defining the effects. If you use PROC NESTED on data that are not sorted by the CLASS variables, then the results might not be valid.