These syntax examples were written for the second edition and retained with the third-edition computing materials. Table and page numbers refer to the original examples. Screenshots show the SPSS version used at the time.
SPSS Computing and point-and-click instructions · Download SPSS data and syntax
Chapter 3
Table 1: A One-Sample t-Test
The data set analyzed to replicate Chapter 3 Table 1 consists of IQ (WISC-R) measurements on six hyperactive children. The question of interest is: “are hyperactive children in the school district brighter than the average student?” The mean IQ among the students is known to be 98. Thus, the null hypothesis in this situation is that the population mean for the hyperactive students is also 98.
To answer such a question we perform a one sample t-test specifying the value of the null hypothesis (/TESTVAL) as 98. Because a t-value squared with X degrees of freedom is equivalent to an F value with one numerator and X denominator degrees of freedom, our results are equivalent to those reported in the book. Recall that the observed F-value (with 1 and 5 degrees of freedom) in the book is 9, whereas our t-value (with 5 degrees of freedom) is 3.
At this point, clicking Run and then All is necessary in order to obtain the results.
Table 3: A One-Way ANOVA
The following data set consists of three groups of 10 participants who were randomly assigned to one mood-induced condition. After viewing a video that was supposed to induce a certain mood state, the participants rated their mood state on several scales. The hypothesis of interest is whether the population group mean on Global Affect Rating differed among the groups.
To answer such a question we perform a one-way ANOVA with SPSS syntax and obtain the results in Table 3.4.
At this point, clicking Run and then All is necessary in order to obtain the results.
Tables 7 and 9: Univariate Descriptive Statistics
The data set analyzed to replicate Chapter 3 Tables 7 and 9 consists of the number of drinks per week at a nine month
follow-up for participants in five different therapy groups. The purpose of this data set is to assess the likelihood of the assumptions of the parametric statistical tests (in this case the assumptions of normality and homogeneity of variance). This data set is also of interest in order to explore potential transformations (e.g., the log transformation), such that the parametric assumptions may be more satisfied.
Here we perform some univariate descriptive statistics for each of the six variables in Tables 3.7 and 3.9 by “exploring” the data.
At this point, clicking Run and then All is necessary in order to obtain the results. By default Explore outputs several other statistics that are not given in Tables 3.7 and 3.9. Note that the median for T1 CRA-D should be 10.98, not 11.89 as is listed in Table 3.9. In addition, the kurtosis for T2 CRA-D in the book should be 2.78, not 1.06 as is listed in Table 3.9.
Chapter 4
Table 1: Performing Pairwise and Complex Comparisons
The hypothetical example shown in Table 4.1 consists of systolic blood pressure scores for 20 participants in four treatment groups for hypertension. The participants were randomly assigned to the four treatment groups of interest: drug therapy, biofeedback, diet, and combination. Note that for this example, there are not equal sample sizes in each group.
Our first hypothesis of interest is whether the drug therapy and feedback groups differ in their effectiveness in treating hypertension. To test this hypothesis, we perform a simple pairwise comparison (/CONTRAST is the statement that specifies this) for the drug therapy and feedback groups. An illustrative example of the calculations for this analysis is shown in Table 4.2, while the output and contrast coefficients for this analysis are shown in Table 4.4.
At this point, click Run and then All to obtain the results.
Our second hypothesis of interest is whether the average of the drug therapy, biofeedback, and diet groups differs from the combination group in effectiveness in treating hypertension. Using the data from Table 4.1, we test this hypothesis by performing a complex comparison of means (/CONTRAST) by comparing the average of the means of the drug therapy, biofeedback, and diet groups to the mean of the combination group. An illustrative example of the calculations for this analysis is shown in Table 4.3, while the output and contrast coefficients for this analysis are shown in Table 4.4.
At this point, click Run and then All to obtain the results.
Chapter 5
Table 4: Comparisons/Contrasts
The following data consists of blood pressure measurements for six individuals randomly assigned to one of four groups. Our purpose here is to perform four planed contrasts in order to discern if group differences exist for the selected contrasts of interests.
1. Comparisons/contrasts are performed by syntax within the ONEWAY ANOVA procedure. By default, procedures for homogeneity of variance assumed and homogeneity of variance not assumed are carried out.
At this point, clicking Run and then All is necessary in order to obtain the results.
* Note that using the /POSTHOC option allows one to form confidence intervals using a variety of critical values. However, the confidence intervals formed are for all pairwise comparisons, which may not be of interest for a particular question. For example, the question of interest in the present situation involved three pairwise comparisons and one complex comparison, for a total of four confidence intervals. The critical value using the Bonferroni criterion should then be alpha divided by 4. However, by performing the Bonferroni procedure via the Post Hoc procedure the alpha is divided by six, as there are six possible pairwise comparisons for four groups. In addition, the Post Hoc procedure is limited to pairwise comparisons and thus does not form confidence intervals for complex comparisons.
Chapter 6
Table 1: Performing a Trend Analysis
The data in Table 6.1 consist of recall scores for 24 children who have been randomly assigned to one of four experimental conditions where there are 6 children in each condition. The experimental conditions of interest are 1, 2, 3, and 4 minutes where the number of minutes is the amount of time the child is allotted to study a list of words before attempting to recall the words. The dependent variable (i.e., the recall scores) are the number of words the child is able to recall after a brief interference task.
The first hypothesis of interest is whether the number of words recalled is linearly related to the number of minutes spent studying. We first test this hypothesis by determining if the linear trend (/POLYNOMIAL = 1) is statistically significant. Pages 252 and 253 are associated with this test.
At this point, click Run and then All to obtain the results.
If one is interested in estimating the slope associated with the linear trend, then one should specify a /CONTRAST statement (as was done in Chapter 4) with the contrast coefficients corresponding to a linear trend instead of a /POLYNOMIAL statement. Of course, one must then remember to divide by the sum of the squared contrast coefficients in order to obtain the correct estimate of the slope.
Next, we are interested in determining if there is any nonlinearity present in the relationship between the number of words recalled and the amount of time spent studying. In fact, the analysis just presented supplies the statistical test of this hypothesis in the “Deviation” row under “Linear Term” in the output. Page 257 demonstrates the results associated with this statistical test.
Finally, we are interest in determining if the quadratic or cubic components of the relationship between the number of words recalled and the amount of time spent studying are statistically significant. In order to obtain the results for these tests, simply specify the degree of the polynomial as cubic instead of linear (/POLYNOMIAL = 3). It is important to note that the results for the linear, deviation from linear, quadratic, and cubic trends replicated by the procedures shown here are illustrated in Table 6.3.
Chapter 7
Table 1: Two by Two Factorial Design Treated as a One-Way ANOVA
The following data consists of blood pressure measurements taken after the end of treatment for five individuals that were randomly assigned to one of four groups. The initial question of interest is whether there is a significant difference between any of the group means, that is, are all of the population group means equal or is there a difference somewhere.
1. As before, we can perform a one-way ANOVA via the One-Way ANOVA procedure to replicate the results given in Table 7.2.
2. At this point clicking Run and then All will produce the results of the one-way ANOVA given in Table 7.2.
* Note that this analysis does not take into consideration the interaction between biofeedback and drug. For pedagogical reasons this data set is analyzed as though it were a one-way design with four groups. As is explained in the text, the concept of an interaction is important and should not be overlooked. Table 7.7 shows the results of the data from Table 7.5, where the interaction of biofeedback and drug is explicitly taken into consideration.
Table 5: Two by Two Factorial Design
The following data is a generalization of the blood pressure data given in Table 7.1 (as there are now three, rather than two, levels of the drug factor). In addition to assessing the likelihood of there being a biofeedback or a drug main effect, the interaction is explicitly taken into consideration. The results replicate those given in Table 7.7.
1. Rather than making use of the One-Way ANOVA procedure, it is necessary to use a more general procedure, namely that of the Univariate procedure.
2. At this point clicking Run and then All will produce the results of the two-by-three ANOVA given in Table 7.7.
Note that because the Univariate procedure is a generalization of the One-Way ANOVA procedure, it too can be used to perform a one-way ANOVA. The advantages of using the One-Way procedure for one-way designs, however, comes from the additional options (e.g., contrasts and additional statistics) uniquely available from the One-Way procedure.
Table 9: Examining Simple Main Effects
The following data is a generalization of the blood pressure data given in Table 7.5 (which itself was a generalization of the data given in Table 7.1). After the interaction is found to be significant, a common recommendation is to examine simple main effects. Recall that a simple main effect is the main effect of one factor given a fixed level of another factor. In this case interest is in determining if there are any differences in drugs (a) given biofeedback and (b) given no biofeedback.
1. As was done for the data in Table 7.5, the UNIANOVA will be used. In addition to the commands given for Table 7.5, EMMEANS is also added. EMMEANS stands for Estimated Marginal Means of the dependent given each level of the compare variable (feedback in this instance). The tables part of the EMMEANS command creates a table (feedback by drug) which allows for the compare variable to be fixed at each cell in the table (the Univariate Tests table is where the simple main effects are given). Note that this method used the within mean square as the error term, as is the recommended error term (page 302) when homogeneity of variance can be assumed.
At this point clicking Run and then All will produce the results discussed on page 301.
Table 11: Interaction Contrasts for Factorial Designs
The following data represents a two way factorial design where diagnosis and task are fully crossed, each with three levels. Of interest for the results displayed in Table 7.12 is whether the interaction contrast specified in Figure 7.3 and 7.4 is statistically significant. Namely the question pertains to whether the relationship of the mean of grammar and classification versus recognition differs for those in the amnesic and Huntington’s group. The procedure SPSS syntax procedure MANOVA is very general and can handle many types of analyses. Interaction contrasts are easily performed in this procedure.
The /CONTRAST statements accompanied by a SPECIAL matrix is what defines the contrasts that are to be carried out. Notice the first row is (generally) always filled with as many 1s as levels of the factor specified in the parentheses following the /CONTRAST statement. Excluding the first row of 1s, there are the numbers of levels of the factor minus one remaining rows. These rows should (generally) always specify orthogonal contrasts, otherwise the results will differ from what is expected.
Because interest lies in an interaction contrast, we must specify a SPECIAL matrix for both factors (the first row in each SPECIAL matrix is what is of interest for the present example). The /DESIGN command specifies the particular contrast that is desired. Because we are interested in an interaction contrast, we will be crossing the individual coefficients from the first row of each of the SPECIAL matrices. We do this by calling upon the first row from the diagnose SPECIAL matrix and crossing it, using BY, with the first row of the task SPECIAL matrix.
Table 15: Nonorthogonal Factorial Designs
The following hypothetical salary data represents a nonorthogonal two-by-two factorial design. The first factor (sex) is crossed with college (degree or no degree). The primary question of interest is whether or not there is sex discrimination in terms of salary.
As before with factorial ANOVAs, this analysis makes use of the UNIANOVA procedure. What is important to notice here is the /METHOD=SSTYPE(3) option is included. Whereas before it was not necessary to include such a specification (because cells always had an equal number of participates and thus all types of the sums of squares were equal), for nonorthogonal designs it is import to realize the type of sums of squares being used (the differences are formally given in Tables 7.19 through 7.22).
Notice that the type of sum of squares is selected by specifying 1, 2, 3, or 4 in the SSTYPE() option (Type 3 sums of squares is the default in SPSS). Note that for the effect entered first into the Fixed Factor(s) box can make a difference. For example, if the effect “A” is entered into the first effect entered into the Fixed Factor(s) box, the analysis actually performed is a “Type I sums of squares where ‘A’ is entered into the equation first.”
Table 23: Nonorthogonal Factorial Designs
The following data represent the relative effectiveness of three forms of psychotherapy for alleviating depression. Fifteen individuals were randomly assigned to one of three groups. After the fact, these individuals where placed into one of three categories based on the severity of their depression. Thus, this data set represents a 3 by 3 nonorthogonal factorial design with post hoc blocking.
As before with factorial ANOVAs in SPSS syntax, this analysis makes use of the UNIANOVA procedure. What is important to notice here is the /METHOD=SSTYPE() option must specify the desired type of sums of squares. For illustrative purposes, we have included the necessary syntax to replicate everything given in Table 7.25. It is important to notice the bottom two UNIANOVA statements. They both specify Type I sums of squares, however the entry of the main effects on the /DESIGN line is reversed. The first Type I sums of squares statement (third overall) corresponds to the “Type I—B entered first” summary while the second Type I sums of squares statement (the last one) corresponds to the “Type I—A entered first” summary.
At this point clicking Run and then All will yield the results from each of the four ways of analyzing the data given in Table 7.23 and summarized in Table 7.25.
Chapter 8
Table 12: Performing a Three-Way ANOVA
The data in Table 8.12 consist of blood pressure scores for 72 participants. Three categorical independent variables: the presence and absence of biofeedback (biofeed), drug X, Y, or Z (drug), and diet absent or present (diet) have been factorially combined to form a 2 x 3 x 2 design where each person contributes one blood pressure score to one of the 12 different experimental conditions. For this example, there are 6 participants in each group.
At this point in illustrating the SPSS syntax, it is necessary to start using the MANOVA procedure. This procedure is more general than the procedures used up to this point and thus is typically more flexible when attempting to carry out a variety of analyses. This is the primary reason that this procedure is being used, as the procedures used up to this point do not allow for some of the analyses associated with Chapter 8, Table 12 to be directly carried out.
First, the omnibus tests of interest will be computed to determine if there are differences among the groups on the mean level of blood pressure. Table 8.14 illustrates the results replicated here.
At this point, click Run and then All to obtain the results.
Because we are now using the MANOVA procedure through SPSS syntax, we can proceed with the more specific analyses of interest. The next analyses to be carried out are the simple interaction tests. Specifically we are interested in testing the interaction between biofeedback and drug within the diet absent and diet present conditions. The results of these analyses we are replicating are in Table 8.16.
At this point, click Run and then All to obtain the results.
Further, one may by interested in testing the simple, simple main effects. In particular, we illustrate how to calculate the simple, simple main effects within the diet absent condition. The results for these analyses can be found in Table 8.17.
First, we illustrate the syntax to perform the simple, simple main effects for biofeedback at specific levels of drug and diet absent:
At this point, click Run and then All to obtain the results.
Next, we illustrate the syntax to perform the simple, simple main effects for drug at specific levels of biofeedback and diet absent:
At this point, click Run and then All to obtain the results.
The next set of analyses of interest is individual cell mean comparisons as tested in Table 8.18. All these cell mean comparisons are tested within the diet absent condition. We first illustrate the syntax to perform the individual cell mean comparisons between different levels of drug within the biofeedback present and diet absent condition. It is important to realize that the contrast/special statement used here specifies the drug comparisons and the tests obtained depend on the coefficients used in the SPECIAL matrix:
At this point, click Run and then All to obtain the results.
Also, we illustrate the syntax to perform the individual cell mean comparisons between different levels of drug within the biofeedback absent and diet absent condition:
At this point, click Run and then All to obtain the results.
Notice that the syntax for the individual cell mean comparisons also provides parameter estimates and confidence intervals. In fact, the /CONTRAST statement and SPECIAL matrix provide these by default. Table 8.22 illustrates the Tukey HSD confidence intervals for these individual cell mean comparisons. While the Tukey HSD confidence intervals cannot be produced directly using SPSS syntax in more complex designs such as the three-way ANOVA of interest here, one can still obtain the Tukey HSD confidence intervals by hand through using the parameter estimates, the standard errors, and looking up the Tukey HSD critical value so that Table 8.22 can be replicated. It is important to remember to check the parameter estimates to determine if they are scaled properly because SPSS MANOVA does not always yield the scaling of the parameter estimate that one might be interested. If the scaling is not correct, the parameter estimate and standard error must be scaled appropriately.
A further set of analyses of interest are the simple main effect of biofeedback when diet is present and the simple main effect of drug when diet is present. The results corresponding to the syntax for these analyses illustrated here can be found in Table 8.19:
At this point, click Run and then All to obtain the results.
We are also interested in obtaining the confidence intervals corresponding to Tables 8.21 and 8.22. Table 8.21 deals with the simple, simple main effects of biofeedback at specific levels of drug and the diet absent condition along with the simple main effect of biofeedback within the diet present condition. Table 8.22 deals with individual cell mean comparisons between the levels of drug for the biofeedback present and absent conditions and diet absent. We deal with each of these tables in turn.
We first illustrate the syntax that can be used to obtain the (unstandarized) confidence intervals for the simple, simple main effects of biofeedback when diet is absent that are shown in Table 8.21:
At this point, click Run and then All to obtain the results.
Here is the syntax that can be used to obtain the (unstandarized) confidence intervals for the simple main effects of biofeedback when diet is present shown in Table 8.21:
At this point, click Run and then All to obtain the results.
Notice that the difference in the syntax shown here and the syntax shown previously for these effects is the \PRINT PARAMETERS(ESTIM) command which provides the confidence interval and parameter estimate. It is also important to note that all of the confidence intervals (and parameter estimates) must be multiplied by -2 to exactly replicate the results obtained in Table 8.21 for the unstandardized effects. This is due to (1) the sign of the confidence interval is arbitrary as it depends on which mean is subtracted from the other and (2) SPSS MANOVA actually uses variable codings that specify only one-half the mean difference (as opposed to the whole mean difference) in these situations. In order to find the approximate standardized intervals refer to chapter 8, page 384. We also may be interested in confidence intervals for the individual cell mean comparisons between drugs for biofeedback present and biofeedback absent when diet is absent. As mentioned earlier, the results in Table 8.22 can be obtained using the SPSS syntax for the individual cell mean comparisons illustrated above.
Chapter 9
Table 1: Analysis of Covariance
The following data represent a pre-post design, where a training program designed to assist people in losing weight is evaluated. An initial measure of weight is collected to use as a baseline measure (specifically as a covariate in the present analysis) and then participants are randomly assigned to one of two groups. At the end of the training program another measure of weight is obtained. The question of interest is: “did the participants who received the treatment lose more weight than those that were assigned to the wait-list control group?”
The analysis data given in Table 9.1 begins by making use of the SPSS Univariate ANOVA procedure (UNIANOVA). The difference in this design compared to those examined previously is that a covariate is included in the analysis. As before, we will begin by writing out the syntax for a univariate ANOVA. The major difference in the present situation is that a WITH statement is included on the second line of the syntax. The WITH statement proceeds the covariates of interest, in this case x (the initial weight). Also notice the /PRINT = PARAMETER line included in the syntax. Without this option the ANCOVA is performed and thus the F and probability values are given for each of the effects in the analysis. However, we are also interested in the parameter estimates, namely the slope and the intercept. Including the /PRINT = PARAMETER option provides the parameter estimates in addition to their tests of significance.
At this point clicking Run and then All will yield the ANCOVA results for the data given in Table 9.1.
Table 7: Analysis of Covariance and Estimating Adjusted Means
The following data represent a three group pre-post design, where 30 depressives were randomly assigned to one of three conditions. The primary question of interest is: “do individuals in some groups change more on their measures of depression than do individuals in other groups?”
The analysis data given in Table 9.7 begins by making use of the SPSS Univariate ANOVA procedure (UNIANOVA). The difference in this design compared to those examined previously is that a covariate is included in the analysis. The major difference in the present situation is that a WITH statement is included on the second line of the syntax. The WITH statement begins the covariates of interest, in this case pre. Also notice the /PRINT = PARAMETER line included in the syntax. Without this option the ANCOVA is performed and thus the F and p values are given for each of the effects in the analysis. However, we are also interested in the parameter estimates, namely the slope and the intercept. Including the /PRINT = PARAMETER option provides the parameter estimates in addition to their tests of significance. Notice further that an additional optional line is given, namely: /EMMEANS = TABLES(cond) WITH(pre=MEAN). This /EMMEANS line will produce the adjusted means of the cond given (or conditional on) the covariate pre. These adjusted means correspond to those given in Table 9.8 of the text.
At this point clicking Run and then All will yield the ANCOVA results, including the parameter estimates and the adjusted means. Note that at the time of this writing Tables 9.8 and 9.10 cannot seem to be replicated via the SPSS Univariate procedure.
Table 11: Analyzing Randomized Block Design
The question of interest in the present situation assumes that there are three blocks of elderly participants, six per block. The elderly participants are sorted into the three blocks as a function of their age. The purpose of the study was to assess the effect of age on motor control, measured by the number of errors on a certain task (where there were three tasks). The goal here is to replicate the results from the top portion of Table 9.12 (At this point performing the ANOVA and the ANCOVA also included in Table 9.12 should be straightforward.).
The results given in the upper portion of Table 9.12 can be obtained by making use of the SPSS Univariate ANOVA procedure (UNIANOVA). Because the task and the blocks are both treated as different factors, the analysis proceeds as a two factor design that includes the interaction.
At this point clicking Run and then All will yield the results given in the top portion of Table 9.12. Note also that if one were interested in performing the ANOVA that is given in the middle portion of Table 9.12, all that would be required is to remove block from the model line and the from /DESIGN line (as well as to remove the block by task interaction (block*task) from the /DESIGN line). To replicate the ANCOVA results given in the lower portion of Table 9.12, all that would have to be done is to remove block from the model line and the from /DESIGN line (as well as to remove the block by task interaction (block*task) from the /DESIGN line), and include a WITH statement on the model line for x (y BY task WITH x) and add x to the /DESIGN line.
Chapter 10
Table 5: Performing a Mixed Model ANOVA
The data in Table 10.5 consist of simulated ACT scores from 40 participants where 10 participants were selected from each of four schools. It is assumed that the schools are randomly selected from a population of schools in America in order to generalize the results found. Two schools (and thus, 20 participants) are randomly assigned to the computer-based ACT training program, while the other two schools are randomly assigned to the standard paper-and-pencil program in order to assess the effectiveness of these different types of programs.
The primary hypothesis of interest is whether the standard paper-and-pencil and computer-based ACT training programs differ in effectiveness. The following procedure generates the output to assess this hypothesis. It is important to note that, as of this writing, SPSS through the point and click procedure does not provide the correct statistical test for the main effect of the random factor in this situation as the denominator is incorrectly specified as the mean square for the interaction instead of the mean square error. The following syntax does provide the correct statistical tests in a two-factor mixed model design, keeping in mind that the correct statistical test for the fixed effect is found at the end of the output under the “Custom Hypothesis Tests” section.
At this point, click Run and then All to obtain the results.
Table 9: Performing an ANOVA on Nested Designs
The data in Table 10.9 consist of general severity rating scores from 24 participants after each participant receives therapy from one of 6 therapist trainees. Three of the trainees are males while the other three trainees are females. In this sense, the trainees are nested within their particular gender.
The hypothesis of primary interest is determining the effect of gender on severity score ratings. The following syntax provides the output necessary to test this hypothesis. The results obtained from the output replicate the results shown in Table 10.9.
At this point, click Run and then All to obtain the results.
Chapter 11
Table 1: Repeated Measures (Univariate Approach)
For the present data set, six individuals were observed under two different conditions. The question of interest is: “does the mean of the scores in Condition 1 differ from the mean of the scores in Condition 2?”
The analysis of the data (results of which are given in Table 11.3) proceed by making use of the GLM procedure where a within subject factor is specified (/WSFACTOR).
Notice that the two levels of the repeated factor are specified under GLM. Also notice that “2” is specified after cond on the /WSFACTOR line, which tells SPSS that there are two levels of the within subject factor cond. Including Polynomial on the /WSFACTOR line is not necessary for this particular analysis (namely because there are only two levels), but for more complex designs it will often provide meaningful information (which will be discussed later).
At this point clicking Run and then All will yield the results of the analysis. Note that by default several types of analyses are run, of which only Tests of Within-Subjects Contrasts is of interest to replicate the results found in Table 11.3.
Download the SPSS syntax for Table 1
* Encoding: UTF-8.
GLM
ycond1 ycond2
/WSFACTOR = cond 2 Polynomial
/METHOD = SSTYPE(3)
/CRITERIA = ALPHA(.05)
/WSDESIGN = cond .
Table 4
No analyses are conducted for this data set.
Table 5: Repeated Measures (Univariate Approach)
For the present data set, 12 children were each observed four times over an 18 month period. The dependent variable is the age-normed general cognitive score on the McCarthy Scales of Children’s Abilities. Interest is to determine if the children were sampled from a population where growth in cognitive ability is more rapid or less rapid than average.
The analysis of the data proceeds by making use of the GLM procedure where a within subject factor is specified (/WSFACTOR).
Notice that the four levels of the repeated factor (months) are specified under GLM. Also notice that 4 is specified after months on the /WSFACTOR line, telling SPSS that there are four levels of the within subject factor for months.
At this point clicking Run and then All will yield the results of the analysis (given on page 539). Note that there are several analyses performed and output by default. The one that is currently of interest is the Sphericity Assumed result contained in the Tests of Within Subjects Effects output box. Although each of the four results contained in the Tests of Within Subjects Effects output box are the same in this instance, in general this will not be the case, as is explained in the second half of Chapter 11. Note that the adjusted F tests (which will soon be of interest) are given in the Tests of Within Subjects Effects output box.
Table 19: Intraclass Correlations
For the present (hypothetical) data set (taken from Shrout and Fleiss, 1979) consists of six participants who are ranked by four judges.
As is pointed out on page 563, the structure of Table 11.19 is analogous to that of Table 11.5 (repeated measures). However, notice that in the data file that the data are entered differently. For the repeated measures design (e.g., 11.5), each row corresponded to a different participant, while each column corresponded with another measurement. The main reason for the difference in how the data was entered is mainly because of the procedures used to analyze the data. SPSS and SAS allow repeated measures data to be entered in a “participants by occasions” fashion, whereas in order to get the appropriate mean squares to carryout the intraclass correlations for the data given in Table 11.19, a mixed-effects (one fixed factor and one random factor) ANOVA needs to be performed. It should be pointed out that the repeated measures data could have been entered in a similar fashion as Table 19 and 20, however, the powerful repeated measures procedures built into SPSS and SAS would not be directly utilized.
Because the intraclass correlations, as given towards the end of Chapter 11, are not directly obtainable via SPSS or SAS, mixed-effects ANOVAs are utilized such that the appropriate mean squares can be inserted into the appropriate formulas. Note that we obtain the mean squares by way of a mixed-effects ANOVA, but either a random-effects or a fixed-effects ANOVA could have been utilized, because the corresponding mean squares are equivalent in each situation (the F ratios are what is different, which is not of interest in the present situation).
The analysis proceeds by making use of the Univariate procedure. Notice that there is a /RANDOM line which denotes the random effect of subject. Other than the /RANDOM statement, the analysis proceeds as would a standard two factor (fixed-effects) ANOVA design.
At this point clicking Run and then All will yield the results of the mixed-effects ANOVA, which can then be used to calculate the intraclass correlation coefficients.
Table 20
The analysis of the data contained in Table 11.20 is carried out in exactly the same manner as was the data contained in Table 11.19. Thus, a mixed effects ANOVA model is performed in order to obtain the mean squares which are then used in the formulas give towards the end of Chapter 11.
Chapter 12
Table 1: Performing a Two-Way Within-Subjects ANOVA
The data in Table 12.1 consist of reaction time scores for 10 participants where each participant contributes 6 scores to the analysis. In particular, each participant is exposed to each of 6 experimental conditions, which are obtained by factorially combining angle (0, 4, and 8) with noise (absent and present).
First, the tests of interest are the omnibus tests within the two-factor within-subjects ANOVA.
At this point, click Run and then All to obtain the results.
It is important to note that one can obtain the test of the quadratic trend (using a separate error term) for the angle main effect by placing a /PRINT SIGNIF(UNIV) statement after the /WSFACTOR statement. One must realize that the default in SPSS for within-subject factors is to produce contrasts using orthogonal polynomial trends. Thus, one will find the tests of the linear and quadratic trends, respectively, under the multivariate test for the angle main effect. One will find that the result obtained from the SPSS output replicates the result for the test of the quadratic trend for the angle main effect using the separate error term found on page 580. If one were interested in utilizing the pooled error term for the test of quadratic trend of angle, the pooled error term is the mean square used for the angle main effect through the mixed-model approach. Dividing the “Hypoth. MS” corresponding to the test of the quadratic trend of angle by the pooled error term yields the appropriate F ratio for this test. This result should be identical to the F ratio using the pooled error term found on page 580. It is also important to note one potential advantage of the SPSS point and click approach over the SPSS syntax approach. While the syntax approach does produce estimates of epsilon, it does not produce the adjusted statistical tests; the point and click approach produces the adjusted statistical tests, although it does not produce the estimates of epsilon. Thus, depending on the information one is interested in both approaches can be useful. However, in order to replicate the results demonstrated in Table 12.13, one must use the point and click approach.
Also of interest are the simple effects for angle within specific levels of noise and the simple effects for noise within specific levels of angle. The following syntax produces the results for these analyses that replicate the results found in Table 12.6:
At this point, click Run and then All to obtain the results.
Also, potentially of interest are interaction contrasts. We can replicate the results shown on page 583 using a separate error term for the test to determine if the difference between angle 0 and angle 8 is the same for young and older participants with the syntax for the omnibus test with the addition of a /PRINT SIGNIF(UNIV) statement. In fact the first contrast (denoted “T5” by default) found under the multivariate test for the noise by angle omnibus test corresponds to this test. It is important to note that, as mentioned on page 583, it is generally advisable to use separate error terms rather than pooled error terms for comparisons more specific than the omnibus tests in the context of within-subjects designs, and these are the tests presented here. However, one can still use the pooled error term by running the omnibus tests and forming F tests for more specific contrasts using the appropriate pooled error terms from these omnibus test analyses.
Table 15: Performing an ANOVA with One Within-Subject Factor and One Between Subject Factor (A Split-Plot Design)
The data in Table 12.15 consist of reaction time scores for 10 young participants where each participant contributes 3 scores to the analysis. In particular, each participant is exposed to each of 3 experimental conditions, angle (0, 4, and 8). For the current analyses Table 12.15 is appended to Table 12.7, which contains reaction time scores for 10 old participants for angles of 0, 4, and 8. Thus, it is necessary to perform some data management before analyzing the data.
After opening Table 12.15 in SPSS, click Data, Merge Files, and then Add Cases.

Next, read in the file for Table 12.7 and then press OK on the Add Cases from … screen. The final step that is necessary to perform the split-plot ANOVA is to add a fourth column to the file for the between-subjects factor, age (with levels of old and young). For the current analysis, it is assumed that old is coded 1 and young is coded 2 for this variable.
Now we move on to performing the split-plot ANOVA. The first tests of interest here are the omnibus tests within the split-plot ANOVA. The following syntax replicates the results shown in Table 12.19:
At this point, click Run and then All to obtain the results.
Also, in order to illustrate how to perform tests of marginal means in the context of split-plot designs, we test for the quadratic trend of the angle effect, averaging over age. This tests corresponds to the test performed on page 600 using a separate error term. In fact, in order to obtain this test, it is only necessary to add a /PRINT SIGNIF (UNIV) statement directly after the /ERROR = WITHIN statement in the above syntax. Then, the test of interest is labeled “T3” under the multivariate test for the angle main effect. If one were interested in using the pooled error term approach for this test of the quadratic trend of angle, one could divide the mean square for the contrast associated with the quadratic trend of angle by the mean square used as the denominator for the omnibus test of the angle main effect using the univariate mixed-model approach. Using the syntax suggested here, this pooled error term is the mean square found at the end of the output in the section with the heading “Tests involving 'ANGLE' Within-Subject Effect” in the row denoted “WITHIN CELLS”.
Also of interest are the simple effects for angle within specific levels of noise and the simple effects for noise within specific levels of angle. Specifically, the tests shown here are the simple effect of angle for young participants and the simple effect of age at angle 0. It is important to note that one could either use the separate error term or pooled error term approach for these tests. We illustrate how to perform both here. The following syntax produces the tests of the simple effect angle for young participants using the separate error term approach shown on page 602. Note that the young participants are coded as “2” for the age variable and thus the output corresponding to this value is of interest here:
At this point, click Run and then All to obtain the results.
The SPLIT FILE command shown above separates the file so that a one-way within-subjects ANOVA is performed for each level of age, thus yielding the simple effect of angle for the young participants (along with the simple effect for angle for the old participants) using separate error terms. The following syntax yields the test of the simple effect of angle for the young participants using the pooled error term as shown on page 602:
At this point, click Run and then All to obtain the results.
As mentioned, we are also interested in obtaining the test of the simple effect of age at angle 0. The following syntax produces this test as shown on page 603 using a separate error term:
At this point, click Run and then All to obtain the results.
It is also possible to test the simple effect of age at angle 0 using a pooled error term. More information on the advantages and disadvantages of using a pooled error term over a separate error term in this situation can be found on pages 604-605. One can obtain the pooled error term indirectly in this situation by taking an unweighted average of the error mean squares for the tests of the simple effects of age at angle 0, angle 4, and angle 8 (these values are 6890, 7105, and 7245 respectively for the current example). One would then divide the hypothesis mean square found in the SPSS output for the test of the simple effect of age at angle 0 by the pooled error term to find the appropriate F ratio, and would then compare this value to the appropriate critical value from the F distribution.
Other tests of potential interest include interaction contrasts. In particular, it may be of interest to determine if the quadratic trend is different for young and old participants. As is the case for other more specific group comparisons, either a separate or a pooled error term could potentially be used. In fact, this test using a separate error term can be obtained through the syntax for the omnibus test with the addition of a /PRINT SIGNIF (UNIV) command directly after the /WSFACTOR = angle(3) statement. Then, one can find this test denoted “T3” underneath the multivariate test for the age by angle interaction. If one were interested in using the pooled error term approach for this test of an interaction contrast, one could divide the mean square for the interaction contrast by the mean square used as the denominator for the omnibus test of the interaction using the univariate mixed-model approach. Using the syntax suggested here, this pooled error term is the mean square found at the end of the output in the section with the heading “Tests involving 'ANGLE' Within-Subject Effect” in the row denoted “WITHIN CELLS”.
Table 21: Performing an ANOVA on a Latin Square Design
The data in Table 12.21 consist of hypothetical aggressiveness scores for 6 monkeys who have been exposed to three types of drugs (A, B, and C). In order to control for potential order effects, a Latin square design is utilized. In particular, two randomly constituted squares are formed with three monkeys randomly assigned to each square and also randomly assigned to the particular row of the square that assigns the order that they are exposed to treatment
The hypothesis of primary interest is whether the drugs differ in their effectiveness in controlling aggression in the monkeys. Thus, the test of the condition main effect is of primary interest. The current SPSS syntax reproduces the results for test of the condition main effect shown on page 615:
At this point, click Run and then All to obtain the results.
Chapter 13
Table 1: Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 13.1, five participants were measured at two occasions. The question of interest is: “is there a difference between Time 1 and Time 2 scores?”
The analysis of the data proceeds as it did in Chapter 11 for the univariate approach to repeated measures. The difference here is that instead of examining the results of the univariate tests, we will be examining the results of the multivariate tests. Because the GLM procedure for repeated measures performs both the univariate and the multivariate approach to repeated measures, the analysis proceeds in the same way; the results of interest is what will differ.
Notice that the two levels of the repeated factor (time) are specified under GLM. Also notice that “2” is specified after time on the /WSFACTOR line, telling SPSS that there are two levels of the within subject factor for time.
At this point clicking Run and then All will yield the results of the analysis (given on page 626). Note that there are several analyses performed and output by default. The results of interest in this case are those given under the Multivariate Tests heading.
Table 2: Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 13.2, eight participants were measured at three occasions. The question of interest is: “Is there a population mean difference between across Time 1, Time 2, and Time 3 measurement occasions?”
The analysis of the data proceed in exactly the same way as it did for the data given in Chapter 13 Table 1 (as well
as it did for the repeated measures given in Chapter 11). For this reason step-by-step instructions are
not given for this data set.
Table 5: Repeated Measures (Multivariate Approach)
The McCarthy data contained in Table 13.5, which was previously analyzed in Table 11.5, is now analyzed using the multivariate approach to repeated measures.
The analysis of this data proceed in exactly the same way as it did for the data given in Chapter 13 Table 1 (as well
as it did for the repeated measures given in Chapter 11). For this reason step-by-step instructions are
not given for this data set.
Table 12: Testing Polynomial Contrasts
For the hypothetical data contained in Table 13.2, the linear and quadratic D variables were formed by making use of the appropriate coefficients from Appendix Table A.10. Because the eight participants were measured at three occasions, both a linear and a quadratic effect can be tested. The question of interest in this instance is: “is there a linear and/or quadratic trend exhibited by the group over time?” Recall that in the book (pages 646-647) it was shown that the D variables for linear and quadratic effects led to an omnibus F test of 19.148, which was a value previously obtained for the omnibus effect. Because the particular values chosen for the D variables do not matter (unless it leads to a linear combination of columns), we will focus only on the tests of the individual contrasts when analyzing the data given in Table 12.
Because columns one and two already represent the linear and quadratic effect respectively, all that needs to be done is to test mean of the column in order to determine if it differs from zero. The easiest way to do this is by making use of the T-Test procedure. Note that because we are interested in testing whether the linear and/or quadratic components are significantly different from zero, the /TESTVAL (i.e., the value of the null hypothesis) should be specified as zero. Below gives the code for the linear and then for the quadratic polynomial effect.
At this point clicking Run and then All will yield the results for both the linear and the quadratic component.
Note that a more direct way to carryout tests of polynomial trends is to specify polynomial contrasts directly from the raw data when carrying out a repeated measures analysis. Below shows the code for the raw data (i.e., Table 13.2) where the linear and quadratic components from Table 13.12 were derived. Note the option Polynomial specified on the /WSFACTOR line. This option leads to tests of the polynomials in the repeated measures analysis carried out with the GLM procedure.
At this point clicking Run and then All will yield the results of interest.
Chapter 14
Table 1: Higher Order Designs for Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 14.1, a perceptual psychologist studying the visual system was interested in determining the extent to which interfering visual stimuli slow the ability to recognize letters. Participants are brought into a laboratory where they are seated in front of a tachistoscope. Variations in the presentations of letters is examined with interest being on the reaction time for target letters presented either in the center of the screen or off centered with and without “noise” accompanying the target letters.
The analysis of the data given in Table 14.1 begins by making use of the GLM procedure. The within subject effects are listed under GLM in the order they were entered in the data file. The within subject factor line (/WSFACTOR) specifies first the factor that is “changing slowest” (here noise because the data is input so that the first two columns consist of the same level of noise while the levels of angle change) with its number of levels (“2” in this case) and lastly the factor that is “changing fastest” along with its number of levels (“2” in this case). Notice that we include Polynomial behind each factor. This tells SPSS how we want the D variables formed. Recall that the D variables can be defined however we wish (although they cannot be linearly dependent), but by additional information can be gained by defining them in a substantially meaningful way. Oftentimes defining the D variables as polynomials is meaningful when the factor is quantitative, because we only have two levels of the factor it does not provide any extra substantive insight. As usual we will choose Type III sums of squares and specifying the main effects and the interaction on the within subjects design (/WSDESIGN) line.
At this point clicking Run and then All will yield the results of the analysis (which are given on page 686 of the text). Note that there are several analyses performed and various output given by default. The results of interest in this case are those given under the Multivariate Tests heading.
Table 3: D Variables for Higher Order Designs for Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 14.1, Table 14.3 gives the set of D variables. The D variables are subsequently used to analyze the data given in Table 14.1. Recall that we analyzed the data contained in Table 14.1 directly using SPSS without (explicitly) forming D variables. Although obtaining the results of the main effects is easily accomplished using the data directly, forming and then analyzing D variables directly also has its benefits (which are delineated in the chapter). Below we analyze the D variables contained in Table 14.3. As expected, our results will match those previously obtained when we analyzed the raw data (i.e., skipping the step of explicitly forming D variables). However, the method to be outlined here provides a different way to accomplish the same goal. We will soon see that analyzing the data by explicitly forming D variables has its advantages.
At this point clicking Run and the All will yield the results of interest. Note that the results of the analysis match those given on page 686 in the text.
Table 4: Higher Order Designs for Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 14.1, a perceptual psychologist studying the visual system was interested in determining the extent to which interfering visual stimuli slow the ability to recognize letters. Participants are brought into a laboratory where they are seated in front of a tachistoscope. Variations in the presentations of letters is examined with interest being on the reaction time for target letters presented either in the center of the screen or off centered with and without “noise” accompanying the target letters.
The analysis of the data given in Table 14.4 begins by making use of the GLM procedure. The within subject effects are listed under GLM. The within subject factor line (/WSFACTOR) specifies first the factor that is “changing slowest” (here noise because the data is input so that the first three variables entered consist of the same level of noise, while the levels of angle change) with the number of levels of noise (“2” in this case) and lastly the factor angle, which is “changing fastest” (with “3” levels in this case). As usual we will choose Type III sums of squares and specifying the main effects and the interaction on the within subjects design (/WSDESIGN) line. Because some may be interested in marginal means, we include the /EMMEANS options which computes marginal means for noise and angle at each level of noise (for the first /EMMEANS statement) and then at each level of angle (for the last /EMMEANS statement).
At this point clicking Run and then All will yield the results of the analysis (which are given on page 694 in the text). Note that there are several analyses performed and various output given by default. The results for the main effects and interaction are those given under the Multivariate Tests heading. Because of the difficulty of performing tests of simple effects and confidence intervals around confidence intervals for contrasts with the data structure presented in Table 11.4 and the ease of performing such analyses for the data structure presented in Table 11.5 (recall Table 11.5 consists of preformed D variables of substantively interesting questions), we show how to obtain the results given in the text by making use of the D variables given in Table 11.5.
Table 5: D Variables for Higher Order Designs for Repeated Measures (Multivariate Approach)
For the hypothetical data contained in Table 14.4, Table 14.5 gives an appropriate and substantively interesting set of D variables. The D variables (rather than the raw data itself) is used because of the benefits and flexibility gained from analyzing the D variables directly (rather than indirectly as we did with the Table 14.4 data).
Because the data of Table 14.5 is already in the form of D variables, rather than using the Repeated Measures procedures, the Multivariate procedures themselves can be used. Thus, by calling upon the GLM procedure and specifying that the parameter estimates should be printed (/PRINT=PARAMETER), the results of interest (specifically the omnibus main effects and interaction as well as the specific contrasts specified by the D variables) will be obtained.
At this point clicking Run and then All will yield the results of interest.
Table 8: One-Within One-Between (Multivariate Approach)
For the hypothetical data contained in Table 14.8, a perceptual psychologist is interested in age differences (“young” and “old”) in reaction time on a perceptual task. In addition, the psychologist is also interested in the effect of angle (zero degrees off center and eight degrees off center). The question of interest is to see if there are is a main effect of age, a main effect of angle, and an interaction between the two.
The analysis of the data given in Table 14.8 begins by making use of the GLM procedure. As before, we specify the within-subjects factor under GLM, however here we also have a BY statement. Variables to the right of the BY statement specify the between subject effects, in this case group. Because we have two levels of the within-subject factor angle, we include /WSFACTOR with angle 2 to the right of it. Group is included on the /DESIGN line (because it is a between subject factor) and angle is included on the /WSDESIGN line.
After clicking Run and then All the results will be produced. Note that, as before, for the within-subject effects both the univariate and the multivariate approaches are performed by default. Here we are only concerned with the multivariate approach. The results obtained match those given in the text on pages 707 (for the between-subject main effect), 709 (for the interaction), and 712 (for the within-subject main effect).
Table 10: One-Within One-Between (Multivariate Approach)
The hypothetical data contained in Table 14.10 contains an additional level of angle (four degrees) that was not considered in Table 14.8.
The basic analysis of the data given in Table 14.10 begins by making use of the General Linear Model procedure as we have done before or by making use of the Multivariate Analysis of Variance (MANOVA) procedure. In general the MANOVA procedure is more flexible than the GLM procedure. We will use both procedures for the initial tests of the omnibus effects and then do most of the remaining analyses using the MANOVA procedure.
Notice that the layout is to some degree specific to the procedure. Because the GLM procedure has been used extensively, no further comments are given on how to set up the commands. The grouping factor used in MANOVA must be followed by parentheses with the lowest and the highest level of the grouping factor (here we have group 1 and group 2). The /WSFACTOR is specified angle with three levels of the factor. The general split plot design is thus easily handled by the GLM and the MANOVA procedures.
At this point clicking Run and then All will produce the omnibus effects.
Further investigation of the main effects and the interaction often reveals valuable information. Here we follow up the significant omnibus tests with tests of the linear and the quadratic effect, as well as the interaction of the linear and the quadratic component. Specifically we are able to discern whether there is some linear trend, some quadratic trend, and we are also able to discern if there is an interaction between groups and the linear and quadratic trends. Here we have used a SPECIAL matrix with a linear and a quadratic effect specified (this specification is analogous to forming and testing D variables). Note that on the options on the /WSDESIGN line are the necessary specifications to test the first and second contrast given in the (angle) special matrix.
At this point clicking Run and then All will produce the omnibus effects.
Also of interest may be tests of the between-subject effect at each level of the within-subjects factor. For simplicity we simply perform three separate ANOVAs (since there are only two levels between subject factor, what is performed is actually a t test). Notice that because the tests are formed independent of each other, the error term is not pooled, but specific to each level of the repeated factor.
At this point clicking Run and then All will produce the omnibus effects.
Also of interest are within-subject effects at fixed values of the between subjects factor. Because there are two ways we can conceptualize the error term (either as separate for the two groups or combined (see pages 730-733), we perform the analysis both ways. First we use the MANOVA procedure where we specify MWITHIN on the /DESIGN line. This tells SPSS that we want to perform the test of the within subject factor for group one and then do it for group two. The easiest way to perform the same test only using a separate error term is to split the file into the two groups. We do this by first sorting the file by groups and then splitting it by groups. After this is done we can make use of the GLM repeated measures capabilities and perform the tests of the within subject effect at each of the two levels of group.
At this point clicking Run and then All will produce the omnibus effects.
Chapter 15
Table 1
The first table in Chapter 15 presents the Hypothetical McCarthy data again. This data set is used throughout the chapter as the to illustrate the discussion given on the mixed model. At the time of this writing the mixed model procedure is SPSS is not as fully developed the SAS analog PROC MIXED. For this reason no analyses using SPSS are provided to replicate the analyses given in Chapter 15. For those interested, the procedure MIXED is the SPSS syntax analog of PROC MIXED in SAS.
Chapter 16
Table 1
The first table in Chapter 16 presents the Severity Ratings by Clinical Trainees, which was originally given in Table 10.9. The data set is analyzed again using the multilevel model approach and the results are compared with those obtained in Chapter 10.
At the time of this writing the mixed model procedure is SPSS is not as fully developed the SAS analog PROC MIXED. For this reason no analyses using SPSS are provided to replicate the analyses given in Chapter 16, which were all done using PROC MIXED. For those interested, the procedure MIXED is the SPSS syntax analog of PROC MIXED in SAS.
Table 4
The hypothetical data contained in Table 16.4 is supposed to represent the data from 29 children who participated in a study to evaluate the effectiveness of an intervention designed to increase inductive reasoning skills. The data consists of children who are nested within one of six classrooms, where each classroom contained students from both the control and the experimental condition. The question of interest is whether or not the children who participated in the experimental group actually improved their cognitive reasoning ability.
At the time of this writing the mixed model procedure is SPSS is not as fully developed the SAS analog PROC MIXED. For this reason no analyses using SPSS are provided to replicate the analyses given in Chapter 16, which were all done using PROC MIXED. For those interested, the procedure MIXED is the SPSS syntax analog of PROC MIXED in SAS.