<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>FAQ/Contrasts</title><revhistory><revision><revnumber>5</revnumber><date>2013-03-08 10:17:32</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>4</revnumber><date>2006-08-02 15:54:11</date><authorinitials>PeterWatson</authorinitials></revision><revision><revnumber>3</revnumber><date>2006-06-30 22:57:02</date><authorinitials>Scripting Subsystem</authorinitials></revision><revision><revnumber>2</revnumber><date>2006-06-30 22:55:30</date><authorinitials>Scripting Subsystem</authorinitials></revision><revision><revnumber>1</revnumber><date>2006-06-30 21:37:48</date><authorinitials>Scripting Subsystem</authorinitials></revision></revhistory></articleinfo><section><title>Components of Interaction</title><para>With some help from SPSS support, lots of experimentation, and the post archived at <ulink url="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0107&amp;L=spssx-l&amp;F=&amp;S=&amp;P=13210"/> I have come up with the following generalised summary of how /LMATRIX and /MMATRIX can be used to decompose a three-way interaction between two repeated measures factors, X_within and Y_within, and one between-subjects factor, group, assuming that each factor has three levels. My syntax might look something like this: </para><para>GLM <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYb#">XaYb</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYc#">XaYc</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYb#">XbYb</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYc#">XbYc</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYb#">XcYb</ulink> <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYc#">XcYc</ulink> BY group </para><para>/WSFACTOR = X_within 3 Polynomial Y_within 3 Polynomial </para><para>/METHOD = SSTYPE(3) </para><para>/CRITERIA = ALPHA(.05) </para><para>/WSDESIGN = X_within Y_within X_within*Y_within </para><para>/DESIGN = group . </para><para>If I have a significant three-way interaction and want to decompose it, I may be interested in any of the nine simple interaction effects that involve all three levels of the interacting factors, i.e.: </para><para>(1-3) X_within*group at Ya, Yb, Yc; </para><para>(4-6) Y_within*group at Xa, Xb, Xc; </para><para>(7-9) X_within*Y_within at G1, G2, G3. </para><para>The following steps provide some insight into how /LMATRIX and /MATRIX are used on their own before coming to how they are used together to find the nine simple interaction effects mentioned above </para><para>(i.) I can use an /LMATRIX subcommand on its own to define a contrast between my between-Ss factor(s), e.g.: /LMATRIX 'difference between group1 and group2' group 1 -1 0 In the output from this I get the equivalent of a LSD post-hoc test on the significance of the difference between group1 and group2, averaged across all X and Y. I can run as many of these contrasts as I care to in separate /LMATRIX subcommands. </para><para>(ii.) Alternatively I can put more than one contrast into a single /LMATRIX subcommand, separating them by semicolons, e.g.: /LMATRIX 'pooled group difference' group 1 -1 0; group 1 0 -1 In the output from this I get one test per contrast I define, plus an F-test on the &quot;averaged variable&quot;, equivalent to a test on the main effect of group. </para><para>(iii.) By extension, I can use an /MMATRIX subcommand on its own to define a contrast between two of my within-Ss variables, e.g.: /MMATRIX 'difference between Xa and Xb at Y=a' <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> 1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> -1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> 0 The /MMATRIX could also be written using ALL, so: /MMATRIX 'Difference between Xa and Xb at Y=a' all 1 0 0 -1 0 0 0 0 0 In the output from this I the equivalent of an unadjusted pairwise comparison (averaging across all groups) between Xa and Xb at Y=a, which could also have been produced through an /EMMEANS subcommand. I can only run one /MMATRIX subcommand at once. </para><para>(iv.) However, I can put more than one contrast into a single /MMATRIX subcommand, separating them by semicolons, e.g.: /MMATRIX 'Pooled X_within difference at Y=a' <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> 1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> -1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> 0; <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> 1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> 0 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> -1 In the output from this I get one test per contrast I define, plus a multivariate test that is the equivalent of the simple main effect of X_within at Y=a (which I could also produce through an /EMMEANS subcommand). </para><para>(v.) I can combine /LMATRIX and /MMATRIX subcommands in the same routine to test for the simple interaction effects between factors, e.g.: /LMATRIX 'interaction X_within*group at Y=a' group 1 -1 0; group 1 0 -1 /MMATRIX 'Pooled X_within difference at Y=a' <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> 1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> -1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> 0; <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> 1 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink> 0 <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink> -1 Notice that the /LMATRIX description has changed, because inclusion of the /MMATRIX modifies the reported results. In the output from this I get several different results: First is the K-matrix of contrast results, which in this instance contains four results. L1 column 1 is a test on the difference between (<ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> minus <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink>) for group 1 and (<ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> minus <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XbYa#">XbYa</ulink>) for group 2; L1 column 2 is a test on (<ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> minus <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink>) for group 1 and (<ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XaYa#">XaYa</ulink> minus <ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/XcYa#">XcYa</ulink>) for group 2. L2 is the same as L1 except the comparison is between groups 1 and 3. In other words these are tests on the relative size of selected pairwise comparisons. Second is a multivariate test result, which is a test on the interaction X_within*group at Y=a. The above syntax can therefore be generalized to find any of the simple interaction effects involving one-within and one between-Ss factor at fixed levels of the other within-Ss factor, i.e., 1-6 from the beginning. Finally are two univariate test results, which (I think) are a test of the simple interaction effect of between group and Xa/Xb at Ya, and between group and Xa/Xc at Ya, respectively. (vi) The last combination of /MMATRIX and /LMATRIX needed to solve for simple interaction effects 7-9 (involving two within-Ss factors at fixed levels of the between-Ss factor) causing problems. To fix the level of the between-subjects group, use three LMATRIX subcommands: /LMATRIX 'interaction X_within*Y_within at G=1' Intercept 1 group 1 0 0 /LMATRIX 'interaction X_within*Y_within at G=2' Intercept 1 group 0 1 0 /LMATRIX 'interaction X_within*Y_within at G=3' Intercept 1 group 0 0 1 Note that these are *not* pooled. To get the interaction of the two within factors X and Y use: /MMATRIX 'pooled X_within and Y_within differences' all 1 -1 0 -1 1 0 0 0 0; all 1 0 -1 0 0 0 -1 0 1 Here these are pooled over the two linearly independent possibilities: the interaction of 1 and 2, and of 1 and 3. The third, the interaction of levels 2 and 3, is omitted because it is redundant. This produces three multivariate results, one for each level of G for the simple interaction effect of X_within*Y_within. There are also three pairs of univariate results: I think the first is a test of the simple interaction effect of Xa/Xb * Ya/Yb at the relevant level of group; the second is a test of the simple interaction effect of Xa/Xc *Ya/Yc at the relevant level of group. </para><para>Nicholas Gibson -- Psychology and Religion Research Programme Faculty of Divinity, University of Cambridge West Road, Cambridge, CB3 9BS, UK tel +44 (0)1223 763010 · fax +44 (0)1223 763003 <ulink url="http://www.divinity.cam.ac.uk/pcp/personnel/nicholas.html"/> </para><para><ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/FAQ#">Return to Statistics FAQ page</ulink> </para><para><ulink url="https://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/Contrasts/statswiki/CbuStatistics#">Return to Statistics main page</ulink> </para><para><ulink url="http://www.mrc-cbu.cam.ac.uk/">Return to CBU main page</ulink> </para><para>These pages are maintained by <ulink url="mailto:ian.nimmo-smith@mrc-cbu.cam.ac.uk">Ian Nimmo-Smith</ulink> and <ulink url="mailto:peter.watson@mrc-cbu.cam.ac.uk">Peter Watson</ulink> </para></section></article>