The GLM Procedure

Means versus LS-Means

(View the complete code for this example.)

Computing and comparing arithmetic means—either simple or weighted within-group averages of the input data—is a familiar and well-studied statistical process. This is the right approach to summarizing and comparing groups for one-way and balanced designs. However, in unbalanced designs with more than one effect, the arithmetic mean for a group might not accurately reflect the "typical" response for that group, since it does not take other effects into account.

For example, the following analysis of an unbalanced two-way design produces the ANOVA, means, and LS-means shown in Figure 47.18, Figure 47.19, and Figure 47.20.

data twoway;
   input Treatment Block y @@;
   datalines;
1 1 17   1 1 28   1 1 19   1 1 21   1 1 19
1 2 43   1 2 30   1 2 39   1 2 44   1 2 44
1 3 16
2 1 21   2 1 21   2 1 24   2 1 25
2 2 39   2 2 45   2 2 42   2 2 47
2 3 19   2 3 22   2 3 16
3 1 22   3 1 30   3 1 33   3 1 31
3 2 46
3 3 26   3 3 31   3 3 26   3 3 33   3 3 29   3 3 25
;
title "Unbalanced Two-way Design";
ods select ModelANOVA Means LSMeans;

proc glm data=twoway;
   class Treatment Block;
   model y = Treatment|Block;
   means Treatment;
   lsmeans Treatment;
run;

ods select all;

Figure 47.18: ANOVA Results for Unbalanced Two-Way Design

Unbalanced Two-way Design

The GLM Procedure
 
Dependent Variable: y

SourceDFType I SSMean SquareF ValuePr > F
Treatment28.0606064.0303030.240.7888
Block22621.8641241310.93206277.95<.0001
Treatment*Block432.6843618.1710900.490.7460

SourceDFType III SSMean SquareF ValuePr > F
Treatment2266.130682133.0653417.910.0023
Block21883.729465941.86473256.00<.0001
Treatment*Block432.6843618.1710900.490.7460


Figure 47.19: Treatment Means for Unbalanced Two-Way Design

Unbalanced Two-way Design

The GLM Procedure

Level of
Treatment
Ny
MeanStd Dev
11129.090909111.5104695
21129.181818211.5569735
31130.18181826.3058414


Figure 47.20: Treatment LS-means for Unbalanced Two-Way Design

Unbalanced Two-way Design

The GLM Procedure
Least Squares Means

Treatmenty LSMEAN
125.6000000
228.3333333
334.4444444


No matter how you look at them, these data exhibit a strong effect due to the blocks (F test ) and no significant interaction between treatments and blocks (F test ). But the lack of balance affects how the treatment effect is interpreted: in a main-effects-only model, there are no significant differences between the treatment means themselves (Type I F test ), but there are highly significant differences between the treatment means corrected for the block effects (Type III F test ).

LS-means are, in effect, within-group means appropriately adjusted for the other effects in the model. More precisely, they estimate the marginal means for a balanced population (as opposed to the unbalanced design). For this reason, they are also called estimated population marginal means by Searle, Speed, and Milliken (1980). In the same way that the Type I F test assesses differences between the arithmetic treatment means (when the treatment effect comes first in the model), the Type III F test assesses differences between the LS-means. Accordingly, for the unbalanced two-way design, the discrepancy between the Type I and Type III tests is reflected in the arithmetic treatment means and treatment LS-means, as shown in Figure 47.19 and Figure 47.20. See the section Construction of Least Squares Means for more on LS-means.

Note that, while the arithmetic means are always uncorrelated (under the usual assumptions for analysis of variance), the LS-means might not be. This fact complicates the problem of multiple comparisons for LS-means; see the following section.