EMMEANS Subcommand (GENLIN command)
The EMMEANS
subcommand displays
estimated marginal means of the dependent variable for all level combinations
of a set of factors. Note that these are predicted, not observed,
means. Estimated marginal means can be computed based on the original
scale of the dependent variable or the based on the link function
transformation.
- Multiple
EMMEANS
subcommands are allowed. Each is treated independently. - The
EMMEANS
subcommand may be specified with no additional keywords. The output for an emptyEMMEANS
subcommand is the overall estimated marginal mean of the response, collapsing over any factors and holding any covariates at their overall means. - Estimated marginal means are not available if the
multinomial distribution is used. If
DISTRIBUTION = MULTINOMIAL
on theMODEL
subcommand and theEMMEANS
subcommand is specified, thenEMMEANS
is ignored and a warning is issued.
TABLES Keyword
The TABLES
keyword specifies
the cells for which estimated marginal means are displayed.
- Valid options are factors appearing on the
GENLIN
command factor list, and crossed factors constructed of factors on the factor list. Crossed factors can be specified using an asterisk (*) or the keywordBY
. All factors in a crossed factor specification must be unique. - If the
TABLES
keyword is specified, then theGENLIN
procedure collapses over any factors on theGENLIN
command factor list but not on theTABLES
keyword before computing the estimated marginal means for the dependent variable. - If the
TABLES
keyword is not specified, then the overall estimated marginal mean of the dependent variable, collapsing over any factors, is computed.
CONTROL Keyword
The CONTROL
keyword specifies
the covariate values to use when computing the estimated marginal
means.
- Specify one or more covariates appearing
on the
GENLIN
command covariate list, each of which must be followed by a numeric value or the keywordMEAN
in parentheses. - If a numeric value is given for a covariate, then the estimated marginal
means will be computed by holding the covariate at the supplied value.
If the keyword
MEAN
is used, then the estimated marginal means will be computed by holding the covariate at its overall mean. If a covariate is not specified on theCONTROL
option, then its overall mean will be used in estimated marginal means calculations. - Any covariate may occur only once on the
CONTROL
keyword.
The SCALE
keyword specifies
whether to compute estimated marginal means based on the original
scale of the dependent variable or based on the link function transformation.
ORIGINAL. Estimated
marginal means are based on the original scale of the dependent variable. Estimated marginal means are computed for the response. This is
the default.Note that when the dependent variable is specified using
the events/trials option, ORIGINAL
gives the estimated marginal means for the events/trials proportion
rather than for the number of events.
TRANSFORMED. Estimated marginal means are based on the link function transformation. Estimated marginal means are computed for the linear predictor.
Example
The following syntax specifies
a logistic regression model with binary dependent variable Y and categorical
predictor A. Estimated marginal means are requested for each level
of A. Because SCALE = ORIGINAL
is used, the estimated marginal means are based on the original
response. Thus, the estimated marginal means are real numbers between
0 and 1. If SCALE = TRANSFORMED
had been used instead, then the estimated marginal means would be
based on the logit-transformed response and would be real numbers
between negative and positive infinity.
GENLIN y BY a
/MODEL a
DISTRIBUTION=BINOMIAL
LINK=LOGIT
/EMMEANS TABLES=a SCALE=ORIGINAL.
COMPARE Keyword
The COMPARE
keyword specifies
a factor or a set of crossed factors, the levels or level combinations
of which are compared using the contrast type specified on the CONTRAST
keyword.
- Valid
options are factors appearing on the
TABLES
keyword. Crossed factors can be specified using an asterisk (*) or the keywordBY
. All factors in a crossed factor specification must be unique. - The
COMPARE
keyword is valid only if theTABLES
keyword is also specified. - If a single factor is specified,
then levels of the factor are compared for each level combination
of any other factors on the
TABLES
keyword. - If a set of crossed factors is specified,
then level combinations of the crossed factors are compared for each
level combination of any other factors on the
TABLES
keyword. Crossed factors may be specified only ifPAIRWISE
is specified on theCONTRAST
keyword. - By
default, the
GENLIN
procedure sorts levels of the factors in ascending order and defines the highest level as the last level. (If the factor is a string variable, then the value of the highest level is locale-dependent.) However, the sort order can be modified using theORDER
keyword following the factor list on theGENLIN
command. - Only one
COMPARE
keyword is allowed on a givenEMMEANS
subcommand.
CONTRAST Keyword
The CONTRAST
keyword specifies
the type of contrast to use for the levels of the factor, or level
combinations of the crossed factors, on the COMPARE
keyword. The CONTRAST
keyword creates an L matrix
(that is, a coefficient matrix) such that the columns corresponding
to the factor(s) match the contrast given. The other columns are adjusted
so that the L matrix is estimable.
- The
CONTRAST
keyword is valid only if theCOMPARE
keyword is also specified. - If a single factor
is specified on the
COMPARE
keyword, then any contrast type may be specified on theCONTRAST
keyword. - If a set of crossed
factors is specified on the
COMPARE
keyword, then only thePAIRWISE
keyword may be specified on theCONTRAST
keyword. - Only one
CONTRAST
keyword is allowed on a givenEMMEANS
subcommand. - If the
COMPARE
keyword is specified withoutCONTRAST
, then pairwise comparisons are performed for the factor(s) onCOMPARE
. -
DIFFERENCE
,HELMERT
,REPEATED
, andSIMPLE
contrasts are defined with respect to a first or last level. The first or last level is determined by theORDER
specification following the factors on theGENLIN
command line. By default,ORDER = ASCENDING
and the last level corresponds to the last level.
The following contrast types are available.
PAIRWISE. Pairwise comparisons are computed for all level combinations of the specified or implied factors. This is the default contrast type.
For example,
GENLIN y BY a b c
…
/EMMEANS TABLES=a*b*c COMPARE a*b CONTRAST=PAIRWISE.
The specified contrast performs pairwise comparisons of all level combinations of factors A and B, for each level of factor C.
Pairwise contrasts are not orthogonal.
DEVIATION (value). Each level of the factor is compared to the grand mean. Deviation contrasts are not orthogonal.
DIFFERENCE. Each level of the factor except the first is compared to the mean of previous levels. In a balanced design, difference contrasts are orthogonal.
HELMERT. Each level of the factor except the last is compared to the mean of subsequent levels. In a balanced design, Helmert contrasts are orthogonal.
POLYNOMIAL (number list). Polynomial contrasts. The first degree of
freedom contains the linear effect across the levels of the factor,
the second contains the quadratic effect, and so on. By default, the
levels are assumed to be equally spaced; the default metric is (1
2 . . . k), where k levels are involved.The POLYNOMIAL
keyword may be followed optionally
by parentheses containing a number list. Numbers in the list must
be separated by spaces or commas. Unequal spacing may be specified
by entering a metric consisting of one number for each level of the
factor. Only the relative differences between the terms of the metric
matter. Thus, for example, (1 2 4) is the same metric as (2 3 5) or
(20 30 50) because, in each instance, the difference between the second
and third numbers is twice the difference between the first and second.
All numbers in the metric must be unique; thus, (1 1 2) is not valid.
A user-specified metric must supply at least as many numbers as
there are levels of the compared factor. If too few numbers are specified,
then a warning is issued and hypothesis tests are not performed. If
too many numbers are specified, then a warning is issued but hypothesis
tests are still performed. In the latter case, the contrast is created
based on the specified numbers beginning with the first and using
as many numbers as there are levels of the compared factor. In any
event, we recommend printing the L matrix (/PRINT LMATRIX
) to confirm that the proper contrast is
being constructed.
For example,
GENLIN y BY a
…
/EMMEANS TABLES=a CONTRAST=POLYNOMIAL(1 2 4).
Suppose that factor A has three levels. The specified contrast indicates that the three levels of A are actually in the proportion 1:2:4.
Alternatively, suppose that factor A has two levels. In this case, the specified contrast indicates that the two levels of A are in the proportion 1:2.
In a balanced design, polynomial contrasts are orthogonal.
REPEATED. Each level of the factor except the last is compared to the next level. Repeated contrasts are not orthogonal.
SIMPLE (value). Each level of the factor except the last
is compared to the last level. The SIMPLE
keyword may be followed optionally by parentheses
containing a value. Put the value inside a pair of quotes if it is
formatted (such as date or currency) or if the factor is of string
type. If a value is specified, then the factor level with that value
is used as the omitted reference category. If the specified value
does not exist in the data, then a warning is issued and the last
level is used.
For example,
GENLIN y BY a
…
/EMMEANS TABLES=a CONTRAST=SIMPLE(1).
The specified contrast compares all levels of factor A (except level 1) to level 1.
Simple contrasts are not orthogonal.
PADJUST Keyword
The PADJUST
keyword indicates
the method of adjusting the significance level.
LSD. Least significant difference. This method does not control the overall probability of rejecting the hypotheses that some linear contrasts are different from the null hypothesis value(s). This is the default.
BONFERRONI. Bonferroni. This method adjusts the observed significance level for the fact that multiple contrasts are being tested.
SEQBONFERRONI. Sequential Bonferroni. This is a sequentially step-down rejective Bonferroni procedure that is much less conservative in terms of rejecting individual hypotheses but maintains the same overall significance level.
SIDAK. Sidak. This method provides tighter bounds than the Bonferroni approach.
SEQSIDAK. Sequential Sidak. This is a sequentially step-down rejective Sidak procedure that is much less conservative in terms of rejecting individual hypotheses but maintains the same overall significance level.