SAS Work Shop - GLM |
Statistical Programs |

Handout # 2.1 |
College of Agriculture |

LSMEANSA common question asked about GLM is the difference between the MEANS and LSMEANS statements. In some cases they are equivalent and at other times LSMEANS are more appropriate. The definition of each is as follows: **MEANS -**- These are what is usually meant by mean (average) and are computed
by summing all the data points and dividing by the total # of points.
They are also referred to as arithmetic means and they are based on
the data only.
**LSMEANS -**- Least Squares Means can be defined as a linear combination (sum) of the estimated effects (means, etc) from a linear model. These means are based on the model used.
In the case where the data contains NO missing values, the results of the MEANS and LSMEANS statements are identical. When missing values do occur, the two will differ. In such a case the LSMEANS are preferred because they reflect the model that is being fit to the data. LSMEANS are also used when a covariate(s) appears in the model such as in ANCOVA (See handout # 4). The following example illustrates the similarity and difference between theses two methods in balanced and unbalanced data. EXAMPLE:This data set has a factor A with 3 levels (1, 2, & 3) with 3 reps of each. A MEANS statement would calculate the overall mean of factor A by summing all 9 data points & dividing by 9, The MEANS statement now produces: Return to TOP; Return to Outline. |