One-Way Analysis of Variance in SPSS

Tsagris Michail
MSc in Statistics
mtsagris@yahoo.gr

2

1 Introduction.................................................................................................................4 2 One way Analysis of Variance I.................................................................................4 3 One way Analysis of Variance II..............................................................................12 4 Nonparametric Analysis of Variance (Kruskal-Wallis test)......................................20 5 Analysis of variance for dependent samples Repeated-Measures ANOVA.............22 6 Non-parametric analysis of variance for dependent samples....................................26

3

1 Introduction The purpose of these notes is to exhibit the way to perform analysis of variance using SPSS. This means that one has to know what ANOVA is and therefore be willing to perform it using this statistical package. We will also see the Kruskal Wallis test, non-parametric alternative to the one way ANOVA. Furthermore we will see what happens when the samples are not independent, both parametrically and nonparametrically. Any comments are kindly welcome since they can improve the presentation and the validity of these notes. 2 One way Analysis of Variance I Let us assume that we have the case where the response time (in seconds) of mice when exposed to a drug is of interest. We gave four different doses (different mgs of the drug) to a sample of mice and recorded their response time to the dose. Each mouse participated once in the experiment. The question of interest is whether the response times differ across the doses. In other words, does the dose affect the response time? The experiment took place under the same conditions for all mice and randomization of the mice within and between the doses is valid. It is obvious that we have more than one observation in each cell (replication) and the response times are independent with each other. Types of doses 1 2 3 4 Response Times 18 16 14 10 19 18 12 8 14 16 10 12 16 19 12 16 12 16 8 14 18 16 10 12

Table 1: Response times of mice At first, we will type the data in SPSS Data Editor as follows: Starting from the first row of table 1, we type the data vertically in SPSS. Then we continue with the second row and so on. Next, in a second column next to the first we enter the doses. The types of doses correspond to the factor of interest and the doses are simply the levels of the factor. Therefore, we must enter the levels according to the observations. Since the first row contains the response times for the first dose the second column will start with six consecutive values of 1, (i.e. the first dose), the later six rows will be 2 (i.e. the second dose) and so on. After typing all of the observations, the SPSS Data Editor should look like this:

4

Picture 1 The model of Analysis of Variance fitted in the data is the following: yij = µ + τ i + ε ij , (1)

where µ is constant, τ i is the parameter associated with the ith level of the factor and ε ij are the errors, which are assumed to be independent, and follow the N (0, σ 2 ). The i, j indicators refer to the jth observation of the ith level (or treatment) of the factor. The null and alternative hypotheses are these: Ηο: τ 1 = τ 2 = ... = τ α Η 1 : τ i ≠ 0 for at least one i. We can either select Graphs→Legacy Dialogs and then choose Boxplot in order to present a box plot of the data. A scatter plot would fit fine as well but a box plot contains more information about the distributions of the observations within each treatment, along with some limits (the so-called fences) which are helpful in detecting outliers. We will choose the later option and the window of picture 2 will appear on the screen. We select Simple and then Define in order to go to the window of picture 3.

5

Picture 2

Picture 3 In this window, we will define the variables in the axes of the box plot. We transfer the variable that contains the response times on the first white box Variable. The variable representing the levels of the factor will be transferred at the white box below the first one (Category Axis). By pressing OK, the result will be the following:

6

Plot 1: Box plot of the response times As you can see, the horizontal axis represents the four treatments (doses) of the factor. The vertical represents the response times. The upper and lower value of each box represents the upper and lower internal fences. The external fences are the ones above and below each box. The horizontal line within each box represents the median of the observations within each treatment. The above figure provides evidence that the first two doses cause greater response times. The mice that were given the other two doses needed less time to response. The Analysis of Variance to be performed will prove this right. There are two paths to perform one-way Analysis of Variance. The first path is Analyze→Compare Means→One-Way ANOVA and the second is Analyze→General Linear Model→Univariate. The first way to perform Analysis of Variance does not allow for any predicted values and residuals to be saved. It should be used in cases when the assumption of constant variance across the errors is violated. When this violation occurs then instead of a transformation on the dependent variable (i.e. observations) or use of a non-parametric technique, one could perform the Welch or the BrownForsythe test. These tests are robust to deviations from the constant error variance. On the contrary, the first way allows the predicted values and the residuals to be saved but it does not calculate the Welch test. One common element is that post hoc tests are provided in both ways. Tamhane’s test is also available when the variances cannot assumed to be equal. If we try to perform in the first way the window that will appear will look like this:

7

Picture 4 We transferred the Response times on the upper white box and the variable indicating the levels of the factor on the right, at the Factor. By clicking on Post Hoc the window of picture 5 appears on the screen.

Picture 5 The tests are categorized with respect to the equality of variances. There are several tests when this assumption is satisfied and different when it is not. When the assumption of equality of variances is not met, the Tamhane’s test is preferred. When this assumption is satisfied we can choose amongst several. The LSD (Fisher’s Least Significance Difference) is a very strong test in detecting pairs of means that differ if applied only when the F test is significant. The disadvantage of this method (and of many more) is that they fail to keep the error rate low. Bonferroni test is a good choice due to its correction suggested by Carlo Emilio Bonferroni. This correction states that if n independent test are to be applied then the α in each test should be equal to 1/n. Tukey’s method is preferable by many statisticians because it control the overall error rate. More information on this issue can be found in any ANOVA book, such as Douglas C. Montgomery’s Design and Analysis of Experiments. If we clink on Options the following window will appear.

8

Picture 6 We selected all choices except for the Fixed and random effects. After this is done, select Continue, get back to window of picture 4 and click OK. The results produced by SPSS follow.
Descriptives Response times 95% Confidence Interval for Mean N 1.00 2.00 3.00 4.00 Total 6 6 6 6 24 Mean 16.1667 16.8333 11.0000 12.0000 14.0000 Std. Deviation 2.71416 1.32916 2.09762 2.82843 3.37510 Std. Error 1.10805 .54263 .85635 1.15470 .68894 Lower Bound 13.3183 15.4385 8.7987 9.0317 12.5748 Upper Bound 19.0150 18.2282 13.2013 14.9683 15.4252 Minimum 12.00 16.00 8.00 8.00 8.00 Maximum 19.00 19.00 14.00 16.00 19.00

Figure 1: Descriptive statistics Figure 1 contains the descriptive statistics for the response times for each of the four doses. Figure 2 presents the Levene’s test of equality of variances. The significance of the test (p-value) is equal to 0.494. This means that there is evidence to support the hypothesis of equality of variances.
Test of Homogeneity of Variances Response times Levene Statistic .828 df1 3 df2 20 Sig. .494

Figure 2: Levene’s test The next figure presents the result of the Analysis of Variance. The result of the F test is valid only when the normality assumption and the assumption of equality

9

of errors are satisfied. In this case, the assumption of equality of variances is valid. Unfortunately, this way of performing ANOVA does not save the residuals, so we cannot check the normality assumption. The F test is robust to moderate deviations from the normal distribution (and it is usually the case when there are small sample sizes). But still we cannot check if the residuals are not normal or how much do they deviate from the normal distribution. The p-value of the F test is zero; this means that there is evidence to reject the null hypothesis of equality of mean response times across the different doses. The types of doses seem to affect the response time.
ANOVA Response times Sum of Squares Between Groups Within Groups Total 154.333 107.667 262.000 df 3 20 23 Mean Square 51.444 5.383 F 9.556 Sig. .000

Figure 3: F test The next figure contains the results of the Welch and Brown-Forsythe tests. This table should be used when the Levene’s test is significant. This is not the case, therefore not much attention is to be paid (even though the results are the same).
Robust Tests of Equality of Means Response times Statistica Welch Brown-Forsythe 12.150 9.556 df1 3 3 df2 10.569 16.472 Sig. .001 .001

a. Asymptotically F distributed.

Figure 4: Robust tests The next figure is the one with the multiple comparisons using the Bonferroni’s and Tamhane’s method. Bonferronis’s method detects more pairs of mean differences to be statistically significant. The only ones pairs of mean response times that are not statistically significant are those corresponding to dose 1 and dose 2 and dose 3 with dose 4. If you take a look at Tamhane’s detected statistically significant pairs, it becomes clear that there are some differences. This is due to the mathematical calculations used in each test. Since this is not the case of unequal variances, we should not consult Tamhane’s method.

10

Multiple Comparisons Dependent Variable:Response times Mean Difference (I) Types of doses Bonferroni 1.00 (J) Types of doses 2.00 3.00 4.00 2.00 1.00 3.00 4.00 3.00 1.00 2.00 4.00 4.00 1.00 2.00 3.00 Tamhane 1.00 2.00 3.00 4.00 2.00 1.00 3.00 4.00 3.00 1.00 2.00 4.00 4.00 1.00 2.00 3.00 *. The mean difference is significant at the 0.05 level. (I-J) -.66667 5.16667 4.16667
* *

95% Confidence Interval Std. Error 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.23378 1.40040 1.60035 1.23378 1.01379 1.27584 1.40040 1.01379 1.43759 1.60035 1.27584 1.43759 Sig. 1.000 .006 .033 1.000 .002 .011 .006 .002 1.000 .033 .011 1.000 .996 .028 .148 .996 .002 .039 .028 .002 .985 .148 .039 .985 Lower Bound -4.5877 1.2456 .2456 -3.2544 1.9123 .9123 -9.0877 -9.7544 -4.9211 -8.0877 -8.7544 -2.9211 -5.0748 .5267 -1.0594 -3.7415 2.3780 .2393 -9.8066 -9.2887 -5.7866 -9.3927 -9.4273 -3.7866 Upper Bound 3.2544 9.0877 8.0877 4.5877 9.7544 8.7544 -1.2456 -1.9123 2.9211 -.2456 -.9123 4.9211 3.7415 9.8066 9.3927 5.0748 9.2887 9.4273 -.5267 -2.3780 3.7866 1.0594 -.2393 5.7866

.66667 5.83333 4.83333 -5.16667
* * *

-5.83333* -1.00000 -4.16667 -4.83333
* *

1.00000 -.66667 5.16667
*

4.16667 .66667 5.83333 4.83333 -5.16667
* * *

-5.83333* -1.00000 -4.16667 -4.83333
*

1.00000

Figure 5: Multiple comparisons Plot 2 is the mean response times plot for each dose. The means for each dose are represented with the small circles, then a line connects this points. It is obvious again as before that; some doses have different response times. It is clearer in this plot that doses 1 and 2 do not differ much and doses 3 and 4 do not differ much either. Multiple comparisons have already proved this right. As already mentioned via this way, we can only check the assumption of equal error variances. The error normality assumption cannot be checked, simply because the residuals are not calculated. The second (and most popular) way that we will show allows all assumptions to be checked. It does not generate the results of any Welch or Brown-Forshythe tests but it does have an option in multiple comparisons for the case when the assumption of equality of error variances is violated.

11

Plot 2: Means plot 3 One way Analysis of Variance II The (popular) way to perform ANOVA is through Analyze→General Linear Model→Univariate and the window of picture 7 shall appear on the screen. The white boxes at which we transferred the variables are the same as before.

Picture 7 It is obvious now that the first way was the simplest and the less informative. It should be used only when the assumption of the variances is violated (and we cannot “lock” the variances using a transformation). The means plot can be extracted 12

from the Plots selection, where the window of picture 8 will appear. We transferred the factor variable on the Horizontal Axis white box and then we must press the button Add. If you do not click on the Add button, the message of picture 9 will appear on the screen warning you that you have not pressed it. We press Continue to return to the main window, that of picture 7 (the Means Plot is the same as before, therefore we do not show it). The window of picture 10 is the same as in picture 5. It is appeared through the Post Hoc option. We only selected Tukey’s test this time.

Picture 8

Picture 9

13

Picture 10 By clicking the Save option from window of picture 7 we can chose to save the residuals and the predicted values of the model. The window of picture 11 is the following and as you can see, we selected the unstandardized values:

Picture 11 If we click on the Options, the window of picture 12 will appear. We need not transfer the (OVERALL) and Doses on the right white box, because if we want to display the means for the response times for each dose and the overall mean response time we can simply select the Descriptive statistics. We will also select the 14

Parameter estimates, the Homogeneity tests (Levene’s test for the equality of variances) and the Residual plot. We press Continue, return to window of picture 7, then press OK and the results are shown under picture 12.

Picture 12 The first table contains information about the sample sizes within each dose. The following table displays the means, the standard deviations and the sample sizes for the response times within each dose. The next table is the Levene’s test also shown in figure 2. This is a more informative table since it shows a text of the hypothesis that it tests.
Descriptive Statistics Dependent Variable:Response times Types of doses 1.00 2.00 3.00 4.00 Total Mean 16.1667 16.8333 11.0000 12.0000 14.0000 Std. Deviation 2.71416 1.32916 2.09762 2.82843 3.37510 N 6 6 6 6 24

Figure 6: Descriptive statistics

15

Levene's Test of Equality of Error Variancesa Dependent Variable:Response times F .828 df1 3 df2 20 Sig. .494

Tests the null hypothesis that the error variance of the dependent variable is equal across groups. a. Design: Intercept + Doses

Figure 7: Levene’s test The next figure is of most interest since it is the result of the F test. We only look at the significance referring to the doses (which is equal to zero). The note under the table gives extra information about the correlation of prediction for this model (58.9% of the variance of the data is explained via this Analysis of Variance model). The conclusion is that there is evidence to reject the null hypothesis stated in page 4. Therefore, the mean response times for at least one pair of doses (if not all) differs statistically significant at a level of significance equal to 0.05 (i.e. α=0.05). We can also state that there is evidence that the type of doses affects the response time of the mice.
Tests of Between-Subjects Effects Dependent Variable:Response times Type III Sum of Source Corrected Model Intercept Doses Error Total Corrected Total Squares 154.333a 4704.000 154.333 107.667 4966.000 262.000 df 3 1 3 20 24 23 Mean Square 51.444 4704.000 51.444 5.383 F 9.556 873.808 9.556 Sig. .000 .000 .000

a. R Squared = .589 (Adjusted R Squared = .527)

Figure 8: ANOVA results The next figure shown contains information on the estimated parameters of the model (1). We see that the parameter of dose 4 is equal to zero. This is done by SPSS and it is a restriction on the estimated parameters of the model. This type of constrain is known as “corner point constrain” or “corner point parameterization”. We see that the intercept is se to 12. The interpretation of these parameters is that when the dose 4 is given to mice the expected mean response time is equal to 12. The expected mean response time is decreased by one second (in comparison to dose 4) when mice are exposed to dose 3. The expected mean response times of the mice when exposed to doses 1 and 2 are by 4.167 and 4.83 seconds higher respectively. Using mathematics, we have that
ˆ µ =12 , τ1 = 14 .167 , τ 2 = 16 .833 , τ 3 = 11 and τ 4 = 0 ˆ ˆ ˆ

16

If we look at figure 6, we will see the same numbers.
Parameter Estimates Dependent Variable:Response times 95% Confidence Interval Parameter Intercept [Doses=1.00] [Doses=2.00] [Doses=3.00] [Doses=4.00] B 12.000 4.167 4.833 -1.000 0
a

Std. Error .947 1.340 1.340 1.340 .

t 12.669 3.110 3.608 -.747 .

Sig. .000 .006 .002 .464 .

Lower Bound 10.024 1.372 2.039 -3.794 .

Upper Bound 13.976 6.961 7.628 1.794 .

a. This parameter is set to zero because it is redundant.

Figure 9: Parameter estimates The next figure shows the multiple comparisons using the Tukey method.
Multiple Comparisons Response times Tukey HSD Mean Difference (I) Types of doses 1.00 (J) Types of doses 2.00 3.00 4.00 2.00 1.00 3.00 4.00 3.00 1.00 2.00 4.00 4.00 1.00 2.00 3.00 Based on observed means. The error term is Mean Square(Error) = 5.383. *. The mean difference is significant at the .05 level. (I-J) -.6667 5.1667* 4.1667
*

95% Confidence Interval Std. Error 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 1.33957 Sig. .959 .005 .026 .959 .002 .009 .005 .002 .877 .026 .009 .877 Lower Bound -4.4160 1.4173 .4173 -3.0827 2.0840 1.0840 -8.9160 -9.5827 -4.7494 -7.9160 -8.5827 -2.7494 Upper Bound 3.0827 8.9160 7.9160 4.4160 9.5827 8.5827 -1.4173 -2.0840 2.7494 -.4173 -1.0840 4.7494

.6667 5.8333* 4.8333* -5.1667 -5.8333
* *

-1.0000 -4.1667* -4.8333
*

1.0000

Figure 10: Multiple comparisons Finally, the Residual plot selected from window of picture 12 is shown overleaf. There are six plots in which the axes are the observed and predicted values and the residuals. The six plots are actually three, since the other three are simply the first three with the values in the axes exchanged. From the plot of standardized 17

residuals versus observed values we can see the linear relationship between the types of doses and the response times. From the plot of standardized residuals versus predicted values we can graphically see that the error variances are equal across the treatments (or doses).

Plot 3: Residual plot The reason for which we saved the predicted values along with the residuals was to produce the plot of these two. Needless to do so now, since it is already provided. The residuals on the other hand will be used to check the normality assumption. To do so, go to Analyze→Nonparametric Tests→Legacy Dialogs→1Sample K-S and the window of picture 13 will appear on the screen. We transferred only the residuals on the right white box. If we click on Exact the window of picture 14 will appear.

18

Picture 13

Picture 14 By doing so, we choose to generate the results of the Monte Carlo test as well. The 1 sample Kolmogorov Smirnov test is asymptotically correct, whereas the Monte Carlo test is based on 10000 tests (by default) executed and provides more accurate results. The result of these two methods is shown below in figure 11.

19

One-Sample Kolmogorov-Smirnov Test Residual for Times N Normal Parameters
a,b

24 Mean Std. Deviation Absolute Positive Negative .0000 2.16360 .114 .108 -.114 .557 .916 Sig. 99% Confidence Interval Lower Bound Upper Bound .883c .874 .891

Most Extreme Differences

Kolmogorov-Smirnov Z Asymp. Sig. (2-tailed) Monte Carlo Sig. (2-tailed)

a. Test distribution is Normal. b. Calculated from data. c. Based on 10000 sampled tables with starting seed 2000000.

Figure 11: Kolmogorov Smirnov test The null hypothesis tested via this test is that the residuals follow the normal distribution versus the alternative that they do not. The asymptotic significance (pvalue) of the Kolmogorov Smirnov test is equal to 0.916, whereas the significance based upon the Monte Carlo simulations is equal to 0.883 with a 99% confidence interval of (0.874 , 0.891). The conclusion is obvious; there is evidence to support the normality assumption of the residuals. 4 Nonparametric Analysis of Variance (Kruskal-Wallis test) In order to perform Analysis of Variance, certain assumptions must be satisfied. These are independency and normality of the residuals and equality of the error variances. We saw a way to deal with the violation of the equality of the variances. Theory states that the F-test is robust to slight deviations from the normal distribution. This is the case in small sample sizes where small deviations from the normal distribution are reasonable to occur. If we cannot assume normality of the residuals then nonparametric techniques have to be used instead of the Analysis of Variance (parametric) technique. This technique is called Kruskal-Wallis test and it uses the ranks of the observations. This nonparametric alternative is easier to conduct in SPSS as it needs no assumptions to be satisfied. The way to this in SPSS is the following: Analyze→Nonparametric→Tests→Legacy Dialogs→K Independent Samples and the window of picture 15 shall appear.

20

Picture 15 We transferred the dependent variable (response time) on the right white box (Test Variable List) and the factor (Doses) to the white box below (Grouping Variable). There is a selection option (Define Range) below this white box. We click on it and the window of picture 16 will appear. We have four different types of doses coded as 1 through 4. As you can see from the picture below, we typed 1 in the Minimum and 4 in the Maximum. If we did not do this, SPSS would not provide any results because it would not “know” which are the categories whose treatments means are to be compared. By pressing Continue we return to the main window of picture 15. If we select Exact, we can choose to conduct the Monte Carlo test. The results generated for the same data follow overleaf.

Picture 16

21

Test Statisticsb,c Response times Chi-Square Df Asymp. Sig. Monte Carlo Sig. Sig. 99% Confidence Interval Lower Bound Upper Bound a. Based on 10000 sampled tables with starting seed 299883525. b. Kruskal Wallis Test c. Grouping Variable: Types of doses 13.816 3 .003 .000a .000 .001

Figure 12: Non parametric analysis of variance Comparing the p-value obtained by the non-parametric test with the p-value generated by the parametric test, we see that the results are the same. There is evidence to reject the null hypothesis that the response times are equal for all types of doses. The alternative test to the multiple comparisons techniques is the MannWhitney test for two independent samples. This is actually the alternative of the two samples t-test. The Bonferroni adjustment must be done in order to obtain the new alpha (divide the usual 0.05 by the number of tests necessary to be executed). 5 Analysis of variance for dependent samples Repeated-Measures ANOVA We will now see how to approach the same problem seen before but with a major difference. We allow the samples to be dependent. For instance, like in the following example we measure the sales of some products in a particular market along 4 weeks. The data used are testmaket.sav from the SPSS database. The data have this format and we will transfer them to SPSS as they are: No 1 2 3 4 5 6 7 8 9 10 11 12 Week1 18 19 14 16 12 18 16 18 16 19 16 16 Week2 14 12 10 12 8 10 10 8 12 16 14 12 Week3 12 8 6 10 6 5 8 4 6 10 10 8 Week4 6 4 2 4 2 1 4 1 2 8 9 8

Table 2: Sales measures over a 4 week-period

22

The goal is to see if the means of the measurements along the 4 weeks are the same or not. The conduction of the hypothesis testing in SPSS is as follows: Analyze→General Linear Model→Repeated Measures and the window of picture 17 will appear. We filled the upper white box (Within-Subject Factor Name:) with a name, it is the factor. In the box below it (Number of Levels:) we put the number of the repeated measures, in our case, we have measures from 4 weeks. The box Measure Name: can be filled in by the name of the measures. In our case that is sales.

Picture 17 Clicking on Add and then Define we will go to the window of picture 18. In the window of picture 18 we will transfer the four columns onto the right white box. By selecting Plots… we can ask for plot of means. Options… produces the the window as in picture 12. There we can choose descriptive statistics to appear. If we click on Save… we can save the residuals (than can be used for the normality assumptions checking) and the estimated values. We can press now OK and the following results will appear.

23

Picture 18 The sphericity test checks an assumption regarding the variances of the residuals, but not the equality across the repeated samples. We want the p-value of this test to be more than 0.05, in other word we do not want this assumption to be rejected. In our case the p-value (Sig.) is equal to 0.112. The table in figure 13 contains 4 different hypothesis test statistics for the same purpose. The first one assumes that the sphericity assumption is satisfied. We are in this case now. If Mauchly’s test of sphericity rejects this assumption then we can use the other 3 tests.
Mauchly's Test of Sphericityb Measure: sales Epsilona Approx. ChiWithin Subjects Effect Week Mauchly's W .398 Square 8.957 Df 5 Sig. .112 GreenhouseGeisser .622 Huynh-Feldt .744 Lower-bound .333

Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is proportional to an identity matrix. a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are displayed in the Tests of Within-Subjects Effects table. b. Design: Intercept Within Subjects Design: week

Figure 13: Mauchly’s test of sphericity

24

Tests of Within-Subjects Effects Measure: sales Type III Sum of Source Week Sphericity Assumed Greenhouse-Geisser Huynh-Feldt Lower-bound Error(week) Sphericity Assumed Greenhouse-Geisser Huynh-Feldt Lower-bound Squares 991.500 991.500 991.500 991.500 85.500 85.500 85.500 85.500 df 3 1.865 2.231 1.000 33 20.512 24.536 11.000 Mean Square 330.500 531.709 444.504 991.500 2.591 4.168 3.485 7.773 F 127.561 127.561 127.561 127.561 Sig. .000 .000 .000 .000

Figure 14: Tests for the equality of the means We can see from the above table that the assumption of the equality of the means is rejected at a 5% level of significance. This means that one or more means differ. To detect the pairs which are significantly different we can perform many paired t-tests. If we repeat the same procedure we described before and in the window of picture 18 select Options… this will take us to the window of picture 19 (which is the same as that in picture 12).

Picture 19

25

We will transfer the factor on the right box and underneath of it we will click on Compare main effects and below we will select Bonferroni. The Bonferroni correction will attain the overall type I error at the 5% level for all tests. The results are given in the following table.
Pairwise Comparisons Measure:sales 95% Confidence Interval for Mean Difference (I) week 1 (J) week 2 3 4 2 1 3 4 3 1 2 4 4 1 2 3 (I-J) 5.000 8.750
* *

Differencea Std. Error .663 .799 .906 .663 .429 .494 .799 .429 .515 .906 .494 .515 Sig.a .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 Lower Bound 2.873 6.187 9.345 -7.127 2.375 5.664 -11.313 -5.125 1.848 -15.155 -8.836 -5.152 Upper Bound 7.127 11.313 15.155 -2.873 5.125 8.836 -6.187 -2.375 5.152 -9.345 -5.664 -1.848

12.250* -5.000 3.750 7.250
* * *

-8.750* -3.750 3.500 -12.250
* * *

-7.250* -3.500
*

Based on estimated marginal means *. The mean difference is significant at the .05 level. a. Adjustment for multiple comparisons: Bonferroni.

Figure 15: Multiple hypothesis tests 6 Non-parametric analysis of variance for dependent samples We will now show how to perform the same test as before but using nonparametric statistics this time. This test like most of non-parametric statistics refers to the medians and not the means of the dependent groups. It is however more simple and easier to conduct. We choose Analyze→Nonparametric Tests→Legacy Dialogs→K Related samples and the window of picture 20 shall appear on the screen. We will transfer the four columns again on the right white box. By pressing Exact… we can ask for the p-value to be calculated through Monte-Carlo as well. The results appear in figure 16.

26

Picture 20
Test Statisticsa N Chi-Square Df Asymp. Sig. Monte Carlo Sig. Sig. 99% Confidence Interval Lower Bound Upper Bound a. Friedman Test 12 12.000 1 .001 .000 .000 .001

Figure 16: Friedman test The conclusion is the same as before, we have evidence to say that the medians of the sales are not the same across the four weeks at α=5%.

27

Sign up to vote on this title
UsefulNot useful