The NESTED Procedure

Example 81.1 Variability of Calcium Concentration in Turnip Greens

(View the complete code for this example.)

In the following example from Snedecor and Cochran (1967), an experiment is conducted to study the variability of calcium concentration in turnip greens. Four plants are selected at random; then three leaves are randomly selected from each plant. Two 100-mg samples are taken from each leaf. The amount of calcium is determined by microchemical methods.

Because the data are read in sorted order, it is not necessary to use PROC SORT on the CLASS variables. Leaf is nested in Plant; Sample is nested in Leaf and is left for the residual term. All the effects are random effects. The following statements read the data and invoke PROC NESTED. These statements produce Output 81.1.1.

title 'Calcium Concentration in Turnip Leaves--Nested Random Model';
title2 'Snedecor and Cochran, ''Statistical Methods'', 1967, p. 286';
data Turnip;
   do Plant=1 to 4;
      do Leaf=1 to 3;
         do Sample=1 to 2;
            input Calcium @@;
            output;
         end;
      end;
   end;
   datalines;
3.28 3.09 3.52 3.48 2.88 2.80 2.46 2.44
1.87 1.92 2.19 2.19 2.77 2.66 3.74 3.44
2.55 2.55 3.78 3.87 4.07 4.12 3.31 3.31
;
proc nested data=Turnip;
   class plant leaf;
   var calcium;
run;

Output 81.1.1: Analysis of Calcium Concentration in Turnip Greens Using PROC NESTED

Calcium Concentration in Turnip Leaves--Nested Random Model
Snedecor and Cochran, 'Statistical Methods', 1967, p. 286

The NESTED Procedure

Coefficients of
Expected Mean Squares
SourcePlantLeafError
Plant621
Leaf021
Error001

Nested Random Effects Analysis of Variance for Variable Calcium
Variance SourceDFSum of SquaresF ValuePr > FError TermMean SquareVariance ComponentPercent of Total
Total2310.270396   0.4465390.532938100.0000
Plant37.5603467.670.0097Leaf2.5201150.36522368.5302
Leaf82.63020049.41<.0001Error0.3287750.16106030.2212
Error120.079850   0.0066540.0066541.2486

Calcium Mean3.01208333
Standard Error of Calcium Mean0.32404445


The results indicate that there is significant (nonzero) variation from plant to plant (Pr > F is 0.0097) and from leaf to leaf within a plant (Pr > F is less than 0.0001). Notice that the variance component for Plant uses the Leaf mean square as an error term in the model rather than the error mean square.