Shared Concepts and Topics

Changing the Weighting Scheme

The standard LS-means have equal coefficients across classification effects; however, the OBSMARGINS option in the LSMEANS statement changes these coefficients to be proportional to those found in the specified data set, or in the input data set if you do not specify a data set for observed margins. This adjustment is reasonable when you want your inferences to apply to a population that is not necessarily balanced but has the margins observed in the specified data set.

The computation of observed margins uses all observations for which there are no missing independent variables, including those for which there are missing dependent variables. Also, if there is a WEIGHT variable, weighted margins are used to construct the LS-means coefficients. If the observed margins data set is balanced or if you specify a simple one-way model, the LS-means will be unchanged by the OBSMARGINS option.

The BYLEVEL option modifies the observed-margins LS-means. Instead of computing the margins across the entire data set, separate margins are computed for each level of the LS-mean effect in question. The resulting LS-means are actually equal to raw means in this case. The BYLEVEL option disables the AT option if it is specified.

You might want to use the E option in conjunction with either the OBSMARGINS or BYLEVEL option to verify that the modified LS-means coefficients are the ones you want. It is possible that the modified LS-means are not estimable when the standard ones are, or vice versa.

Last updated: December 09, 2022