| Date: | Tue, 25 Jan 2000 15:48:00 -0600 |
| Reply-To: | "Nichols, David" <nichols@SPSS.COM> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | "Nichols, David" <nichols@SPSS.COM> |
| Subject: | Re: decomposing interactions with glm |
|---|
Specification of simple effects in GLM is easier in some cases than in
MANOVA, and more difficult in others. There are three ways that I can think
of to address getting simple effects: 1) the EMMEANS subcommand with the
COMPARE keyword, 2) using LMATRIX and/or MMATRIX, and 3) some trickery. If
the within subjects factors on which the simple effects are to be computed
have only two levels, or you're satisfied with multivariate tests, then
trickery is not necessary. If you want the averaged univariate approach
tests, current functioning requires that a bit of trickery be employed.
1) The first and simplest option requires specification of an EMMEANS
subcommand with a COMPARE keyword. In this example, we have two between
subjects factors, call them A and B, and two within subjects factors, call
them C and D. The second request is for the simple main effects of C nested
within the combinations of the levels of D and A, presumably averaging over
the levels of B (I hope I'm reading the request correctly). The
specification would be
/EMMEANS TABLES(A*C*D) COMPARE(C)
You can also add an ADJUST keyword to get Sidak or Bonferroni adjusted
pairwise comparisons among the levels of C at each combination of A*D;
without this, you get them as LSD (uncorrected) comparisons. You also get a
multivariate omnibus test for each simple main effect of C. If you want the
averaged test for each simple main effect of C, you have to resort to 3).
The general rule here is that you can specify any product term with EMMEANS
TABLES, and any single effect with COMPARE, and you get simple main effects
of that effect within each combination of the other factors involved in the
product term, averaging across any other factors in the design not specified
on EMMEANS. If there are covariates in the design, they are fixed at their
grand mean values. There is an option (WITH) to specify other values at
which to fix individual covariates.
2) The second option involves using the general LBM=K formulation of a
linear hypothesis test. This is done using the L, M, and K matrices. K is
most often set to 0, so I won't mention it further, except to note that it
allows you to test against specific nonzero null hypothesized values. If the
problem has only one dependent variable, M is going to be a scalar with the
value 1, and you'd just use LMATRIX. In the repeated measures situation,
you'll often want to use both.
LMATRIX can be specified as many times as you want, and each one generates a
separate estimation and test or set of estimations and tests. In the case of
the first request here, we need to nest something from the within subjects
side of the model within each combination of the between subjects factors.
For simplicity I'll treat A and B as if they each have two levels; if there
were more, you would simply add more similar LMATRIX subcommands. To nest
within the (1,1) combination of levels of A*B in a factorial design like
this, you would use
GLM V1 TO V4 BY A B
/WSFACTORS C 2 D 2
/LMATRIX 'At AB 11' INTERCEPT 1 A 1 0 B 1 0 A*B 1 0 0 0
or
GLM V1 TO V4 BY A B
/WSFACTORS C 2 D 2
/LMATRIX 'At AB 11' ALL 1 1 0 1 0 1 0 0 0
The string within the single quotes is an optional user supplied label for
the contrast. To get the whole set, you could use
GLM V1 TO V4 BY A B
/WSFACTORS C 2 D 2
/LMATRIX 'At AB 11' ALL 1 1 0 1 0 1 0 0 0
/LMATRIX 'At AB 12' ALL 1 1 0 0 1 0 1 0 0
/LMATRIX 'At AB 21' ALL 1 0 1 1 0 0 0 1 0
/LMATRIX 'At AB 22' ALL 1 0 1 0 1 0 0 0 1
If for some reason you want to have more than one of these combined in a
multiple degree of freedom test, you simply specify two or more on one
LMATRIX subcommand, separated by one or more semicolons. If you specify some
that are linearly dependent on each other, you nevertheless get them, and
you get an omnibus test that covers the space spanned by the set.
Now we've given the between subjects part of the picture, but not the within
subjects part. We need the interaction of C*D within each level of A*B.
We've seen how to do the nesting in A*B, but not the specification of the
interaction of C*D. That uses MMATRIX.
MMATRIX functions in a manner that's quite similar to LMATRIX, but there are
some differences. For one thing, the specifications of coefficients in
MMATRIX apply directly to the list of dependent variables, not to the model
parameters, as they do with LMATRIX. Second, you can have only one MMATRIX
subcommand per run of GLM. As with LMATRIX, you can have as many contrasts
or linear combinations on an MMATRIX as you want, separated by commas, and
they will all be executed. Omnibus tests for the space spanned will again be
generated, even if there are linear dependencies in the set of combinations
specified.
Suppose that C and D each has only two levels. There would then be only a
single contrast required to specify their interaction:
GLM V1 TO V4 BY A B
/WSFACTORS C 2 D 2
MMATRIX 'Interaction' ALL 1 -1 -1 1
If the C*D combination was 2*3, for example, you might specify:
GLM V1 TO V4 BY A B
/WSFACTORS C 2 D 2
MMATRIX ALL 1 0 -1 -1 0 1; ALL 0 1 -1 0 -1 1
In this case, you would get individual point estimates for each contrast
among the levels of the within subjects factors, but you would also get an
omnibus test that applies to the set of contrasts specified. This would done
as a multivariate test. Instead of ALL, you can name individual dependents
and their coefficient values, with any unnamed dependents assigned 0
coefficients.
The LMATRIX and MMATRIX specifications are combined, so that by specifying
the C*D interaction on MMATRIX, along with the multiple nestings on separate
LMATRIX subcommands, you would get this for each of the combinations of A*B.
If you didn't have any between subjects factors, you'd skip the LMATRIX
subcommand altogether. The LMATRIX generated would be a constant for the
intercept.
(As a side note, specification of the simple effects given by EMMEANS
COMPARE can be done using a combination of LMATRIX and MMATRIX, but it's
generally considerably more trouble than using EMMEANS.)
3) The trickery is necessary when you want to make simple effects be
estimated without using EMMEANS or LMATRIX/MMATRIX. The primary usefulness
of this is when you want the averaged univariate approach tests for within
subjects factors, since these are currently not provided when using EMMEANS
or LMATRIX/MMATRIX.
In the example discussed here, we want to get the C*D interaction nested
within each level of A*B. If that C*D interaction has multiple degrees of
freedom, the user might want the averaged univariate approach tests, instead
of or in addition to, the multivariate tests. These will only be provided
with the "standard" part of the output, not with the EMMEANS or
LMATRIX/MMATRIX results. So we need a way to trick GLM into nesting the
within subjects results within each combination of A*B. The way to do this
is to compute a set of new dummy variables, one for each combination of
levels of A*B, and use these as covariates instead of the A and B factors in
a new run of GLM. For example, suppose C and D both have three levels, A and
B still each have two. We can then specify:
COMPUTE AB11=(A=1) & (B=1).
COMPUTE AB12=(A=1) & (B=2).
COMPUTE AB21=(A=2) & (B=1).
COMPUTE AB22=(A=2) & (B=2).
GLM V1 TO V9 WITH AB11 AB12 AB21 AB22
/WSFACTORS C 3 D 3
/INTERCEPT=EXCLUDE.
Note that we've excluded the intercept here. The standard output for the
within subjects effects will include effects for C*D*AB11, for example,
which is C*D nested within level (1,1) of the original A and B factors.
Suppose we want the simple effects of C within each level of D. This time in
order to get the averaged approach tests, we'd need to either use the
subsets of dependents that correspond to the levels of D one at a time, or
else treat the D designation as one of measures as opposed to a second
within subjects factor, so that each set of them will be handled separately
in it's own test. The specification of the dependents on the GLM command
would need to specify the right order, such as
GLM C1D1 C2D1 C3D1 C1D2 C2D2 C3D2 C1D3 C2D3 C3D3 (BY or WITH . . .)
/WSFACTORS C 3.
That is, when treating the D designation as a measure rather than specifying
it on WSFACTORS, you need to make sure that the dependents are organized
with that designation as the primary one (think of measures as being a type
of factor that's all the way to the left and so increments the most slowly).
This discussion so far leaves at least one other issue unresolved: suppose I
want to have the averaged tests for one or more within factors, but I want
them to be nested within some other factors but averaged across the levels
of other factors. For example, one request here was for C*D(A), averaged
over B. This gets a step trickier, but can still be done. Dummy code the
levels of A. For B, use effect codings, such as 1 and -1 for a two level
factor, and 1 0 -1 and 0 1 -1 for a three level factor. Then, for the
situation with 2 levels of A, and 3 levels of B, C, and D, we have:
COMPUTE A1=(A=1).
COMPUTE A2=(A=2).
RECODE B (1=1) (2=0) (3=-1) INTO B1.
RECODE B (1=0) (2=1) (3=-1) INTO B2.
GLM V1 TO V9 WITH A1 A2 B1 B2
/WSFACTORS C 3 D 3
/INTERCEPT=EXCLUDE
/DESIGN=A1 A2 B1 B2 A1*B1 A1*B2.
The C*D*A1 and C*D*A2 effects should be what's desired. (This approach
assumes that there are no empty combinations of A*B; if there are, things
are going to get even more complicated.)
As my use of the word "trickery" for some of the solutions provided here
should make clear, I'm aware of the fact that GLM doesn't easily address all
applications of simple effects. I've requested that we enhance it's
capabilities in this area (as always, these enhancements compete with a
variety of other important things for limited resources). For certain
situations, I'd not blame anyone for continuing to use MANOVA. There are
some important advantages to the GLM approach, such as being able to specify
many simple effects in one run, along with the basic results, and being able
to get pairwise comparisons for them.
David Nichols
Principal Support Statistician and
Manager of Statistical Support
SPSS Inc.
> -----Original Message-----
> From: Hans-Georg Bosshardt
> [mailto:hgb@GOLEM.KLI.PSY.RUHR-UNI-BOCHUM.DE]
> Sent: Wednesday, January 19, 2000 11:25 AM
> To: SPSSX-L@LISTSERV.UGA.EDU
> Subject: [SPSSX-L] decomposing interactions with glm
>
>
> Hi everybody,
>
> I have a mixed design with two between-subject and two repeated
> measurement factors. Does anybody know how to decompose two- or
> three-way interactions into simple main effects and simple
> interactions with glm?
>
> More specifically, I need the simple two-way interactions
> between the repeated measurement factors at each level of the
> between-subject factors. I also need the simple main effects for one
> of the within-subject factors at each level of the other within and
> of one between-feactors.
>
> Does anyone have directions for decomposing these interactions
> with glm - I had no problems to do so with manova?
>
> Thank you very much in advance. Hans-Georg Bosshardt
>
>
>
>
>
> =====================================
> * Prof. Dr. Hans-Georg Bosshardt
> * Fakultaet fuer Psychologie der
> * Ruhr-Universitaet Bochum
> * Postfach 102148
> * D-44780 Bochum, Germany
> *
> * Tel(office): +49.(0)234.32.27338
> * Fax(office): +49.(0)234.3214.110
> * Tel(priv): +49.(0)234.793700
> =====================================
>
|