You are on page 1of 8

SPSS Basics for One-way ANOVA

As an illustration of the process, consider the data given in Example 11-8, pp. 593 595, of Blumans Elementary Statistics: A Brief Version. Problem Statement: A researcher wishes to try three different techniques to lower the blood pressure of individuals diagnosed with high blood pressure. The subjects are randomly assigned to three groups; the first group takes medication, the second group exercises, and the third group follows a special diet. After four weeks, the reduction in each persons blood pressure is recorded. At = 0.05 , test the claim that there is no difference among the means. The data are: Medication Exercise Diet 10 12 9 15 13 6 8 3 0 2 5 9 12 8 4

Defining Variables and Entering the Data


Begin by defining the variables in an SPSS Data file in the Variable View window of the SPSS Data Editor; be sure to safe the data file and the resulting output file. Heres how this might be done. First name the variables; let Bp represent the variable for blood pressure and Tr the categorical variable for treatment method. Note that even though Tr is categorical, it is assigned numerical (integer) values. SPSS will interpret these values as identifying which group each value of Bp belongs to. For both variables, set the number of decimal places to be zero. Next, give each variable a (short) label, and finally assign labels to each value of Tr, as shown below.

The Variable View window of the SPSS Data Editor should have the appearance shown below. Prepared by: Chris Hay-Jahans, UAS Mathematics Program Page 1 of 8

SPSS Basics for One-way ANOVA

Switch the data editor to the Data View window and enter the data as shown below. Be sure to save the file as soon as you are done.

Performing the One-Way ANOVA F-test


The hypotheses to be tested are H 0 : 1 = 2 = 3 (Claim)

H 1 : At least one mean is different from the others

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 2 of 8

SPSS Basics for One-way ANOVA


To perform the One-way ANOVA F-test, select the following command sequences from the SPSS Data Editor tool bar: Analyze Compare Means One-Way Anova In the One-Way ANOVA menu window, place Bp in the Dependent List box and Tr in the Factor box, as shown below.

To complete the process described in the text, select OK in this window without doing anything else. The resulting output is the ANOVA table shown below.
ANOVA Blood Pressure Sum of Squares 160.133 104.800 264.933 df 2 12 14 Mean Square 80.067 8.733 F 9.168 Sig. .004

Between Groups Within Groups Total

This duplicates the ANOVA table given in the text, with one minor difference the column Sig. provides the p-value for the test; and, since p < , the null hypothesis is rejected. As mentioned in the text, this result allows us only to conclude that at least one (true) treatment mean differs from the others; we can say nothing about the relative sizes of the (true) treatment means. Further tests can be performed to determine which treatment mean(s) differ and, consequently, determine which (true) treatment mean(s) might have the highest (or lowest) values

Verifying the Assumptions for the One-Way ANOVA F-test


The assumptions for the one-way ANOVA F-test, as expressed in in the text, are: 1. The populations from which the samples were obtained must be normally or approximately normally distributed. 2. The samples must be independent of one another 3. The variances of the populations must be equal.

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 3 of 8

SPSS Basics for One-way ANOVA


Graphical and numerical assessments of the first and third assumptions can be performed as follows. Assessing the normality and constant variance assumptions: From the toolbar, select the commands: Analyze Descriptive Statistics Explore. The, assign variables as shown, and check the Plots button in the Display choices as shown below

Next, click on the Plots button, and in the Explore: Plots window, make the choices shown below.

Click on Continue, then OK in the Explore window. The first table that is of use in the resulting output is the Tests of Normality table, shown below.

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 4 of 8

SPSS Basics for One-way ANOVA


Tests of Normality Treatment Medication Exercise Diet Kolmogorov-Smirnov Statistic df Sig. .175 5 .200* .199 5 .200* .191 5 .200*
a

Blood Pressure

Statistic .974 .967 .958

Shapiro-Wilk df 5 5 5

Sig. .899 .858 .794

*. This is a lower bound of the true significance. a. Lilliefors Significance Correction

This table provides results of the test of the following hypotheses: H0 : The population random variable is normally distributed H1: The population random variable is not normally distributed The results of two tests are given in this table; the one to use is the Shapiro-Wilk test. In this case the (shaded) p-values given in the last column for Bp values, for each of the three treatments, are large enough to conclude that the assumption of (approximate) normality of the populations from which the samples were obtained should not be rejected The normality assumption may be assumed valid. The second table of use is that of the Test of Homogeneity of Variances shown below.
Test of Homogeneity of Variance Levene Statistic .384 .205 .205 .383 df1 2 2 2 2 df2 12 12 10.977 12 Sig. .689 .818 .818 .690

Blood Pressure

Based on Mean Based on Median Based on Median and with adjusted df Based on trimmed mean

The test to use here is the one that is Based on Median. This table provides results of the test of the following hypotheses: H0 : The population variances are equal H1: The population variances are not equal. Here too, the p-value given in the last column is sufficiently large to conclude the the assumption of constant variances should not be rejected The constant variance assumption may be assumed valid. In addition to the above tables, several scatter plots appear in the output; of these the three Normal QQ Plots can be useful. In this case the data samples by treatments are small and the plots are not very informative.

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 5 of 8

SPSS Basics for One-way ANOVA


An ideal Normal QQ Plot will have plotted points that appear to approximately fit a linear trend; a reference line will be provided by SPSS. A graphical assessment of the constant variance assumption may be performed using a standard error plot of Bp by treatment levels. To obtain an appropriate plot, select the toolbar commands: Graphs Legacy Dialogs Error bar. Then, select Simple in the Error Bar menu window and click on the Define button. In the resulting Define Simple Error Bar: Summaries for Groups of Cases window, make the assignments for Bp for Variable, Tr for Category Axis, and set the Bars Represent option to be standard error of mean. Use a Multiplier of 1. Click on OK to get the plot shown below.

If the error bars are close to each other in length, as appears to be the case here, one might expect the constant variance assumption to be approximately valid. Verifying the validity of the independence assumption: The validity of the independence assumption can be difficult to assess. The best approach is to ensure that the independence of the samples is ensured by proper sampling and data collection practices.

Pair-wise Comparisons of Treatment Means


SPSS can be instructed to perform pair-wise comparisons in the process of setting up for the One-Way ANOVA F-test. The two tests mentioned in the text are Tukeys test and Scheffes test. In the One-Way ANOVA window

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 6 of 8

SPSS Basics for One-way ANOVA

click on the Post Hoc button, then select the options indicated below.

Click on Continue and then OK. The output includes two tables, one titled Post Hoc Tests and one Homogeneous Subsets. The Post Hoc Tests table, shown below, includes the results of a simultaneous set of tests of hypotheses of the form H0 : The two means are equal H1: The two means are not equal. Also included in this table are 95% confidence intervals for each pair of means. Relevant rows, for tests and intervals are shaded; all other rows are repetitions of these rows.

Prepared by: Chris Hay-Jahans, UAS Mathematics Program

Page 7 of 8

SPSS Basics for One-way ANOVA


Multiple Comparisons Dependent Variable: Blood Pressure Mean Difference (I-J) 8.000* 4.200 -8.000* -3.800 -4.200 3.800 8.000* 4.200 -8.000* -3.800 -4.200 3.800

Tukey HSD

(I) Treatment Medication Exercise Diet

Scheffe

Medication Exercise Diet

(J) Treatment Exercise Diet Medication Diet Medication Exercise Exercise Diet Medication Diet Medication Exercise

Std. Error 1.869 1.869 1.869 1.869 1.869 1.869 1.869 1.869 1.869 1.869 1.869 1.869

Sig. .003 .103 .003 .147 .103 .147 .004 .122 .004 .169 .122 .169

95% Confidence Interval Lower Bound Upper Bound 3.01 12.99 -.79 9.19 -12.99 -3.01 -8.79 1.19 -9.19 .79 -1.19 8.79 2.79 13.21 -1.01 9.41 -13.21 -2.79 -9.01 1.41 -9.41 1.01 -1.41 9.01

*. The mean difference is significant at the .05 level.

The Homogeneous Subsets table, shown below, groups the treatments into subsets within which the treatment means are considered not significantly different. The estimated means for the two homogeneous subsets are shaded.
Blood Pressure Subset for alpha = .05 1 2 3.80 7.60 7.60 11.80 .147 .103 3.80 7.60 7.60 11.80 .169 .122

a Tukey HSD

Scheffea

Treatment Exercise Diet Medication Sig. Exercise Diet Medication Sig.

N 5 5 5 5 5 5

Means for groups in homogeneous subsets are displayed. a. Uses Harmonic Mean Sample Size = 5.000.

It can be seen that the second homogeneous subset, {Diet, Medication}, contains the treatments that produce the largest reduction in blood pressure.

Closing Comments
While working through these exercises it will have been noticed that many other menu options are available within the One-Way ANOVA procedure for SPSS. These provide further capabilities beyond the scope of an elementary statistics course. Prepared by: Chris Hay-Jahans, UAS Mathematics Program Page 8 of 8

You might also like