






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Brian Habing – University of South Carolina Last Updated: July 20, 2001
The F -test from the ANOVA table allows us to test the null hypothesis “The population means of all of the groups/treatments are equal.” The alternate hypothesis is simply that “At least two are not equal.” Often this isn’t what we want to know!
Say we are comparing 20 possible treatments for a disease. The ANOVA F -test (sometimes called the omnibus test), could only tell us that at least one of the treatments worked differently than the others. We might, however, want to be able to rank the 20 from best to worst, and say which of these differences are significant. We might want to compare all the treatments produced by one company to those of another, or maybe all the treatments based on one idea to those based on another.
An obvious suggestion in each of these cases would be to simply do a large number of t-tests. To rank the 20 from best to worst, we could simply do a separate t-test for each possible comparison (there are 190 of them). To compare the two companies or two ideas, we could simply group all of the observations from the related methods together and use t-tests to see if they differ. One difficulty with this is that the α-level (probability of a Type I error) may no longer be what we want it to be.
Sidak’s Formula
Stepping back from the ANOVA setting for a minute, say we wish to conduct one-sample t-tests on twenty completely independent populations. If we set α=0.05 for the first test, that means that:
0.05 = α = P[reject H 0 for test one | H 0 is true for test one]
We could write the same for the other nineteen populations as well. If we are concerned about all twenty populations though, we might be more interested in the probability that we reject a true null hypothesis at all. That is,
αT = P[reject H 0 for test one ∪ reject H 0 for test two ∪ · · · ∪ reject H 0 for test 20 | H 0 is true for all tests]
We call this quantity the family-wise (or experiment-wise ) error rate. The α for each individual test is called the comparison-wise error rate. The family (or experiment), in this case, is made up of the twenty individual comparisons.
Using the rules of probability, and the fact that we assumed the tests were independent for this example, we can calculate what αT would be if we used α=0.05 for the comparison-wise rate.
αT = P[reject H 0 for 1 ∪ reject H 0 for 2 ∪ · · · ∪ reject H 0 for 20 | H 0 is true for all tests]
= 1 − P[fail to reject H 0 for 1 ∩ · · · ∩ fail to reject H 0 for 20| H 0 is true for all tests] = 1 − P[fail to reject H 0 for 1| H 0 is true for all tests] · · · P[fail to reject H 0 for 2| H 0 is true for all tests] = 1 − (1−α)(1−α) · · · (1−α) = 1 − (1−α)^20 = 1 − (1−0.05)^20 = 1 - 0.95 20 ≈ 0.
The chance of making at least one error (αT ) isn’t 5%, it’s nearly 64%!
If we replace the twenty tests with k tests, we get Sidak’s formula :
αT = 1 − (1−α)k
when the tests are independent. If we know what αT we want, we can solve for the needed α, to get:
α = 1 − (1−αT )1/k
If we wanted αT = 0.05, this formula would show us that we need to use an α of 0.00256 for each individual comparison!
Bonferroni’s Formula
In the case of ANOVA, the various tests will often not be independent. If we want to conduct the t-tests to compare 20 possible medical treatments to each other, then clearly the comparison of 1 to 2, and 1 to 3 will not be independent; they both contain treatment 1!
The diagram below illustrates three possible situations that could occur for three tests:
The Holm Test
The Holm test is a method for dealing with the fact that the Bonferroni procedure is too conservative. The main idea comes from noticing that we always used the condition “H 0 is true for all tests”, instead of using the condition that it was true only for the specific test we were doing. The procedure behind the Holm test is to first find all of the p-values for all of the individual tests we were performing, and then rank them from smallest to largest. Compare the smallest to α=αT / k. If you fail to reject the null hypothesis for the first step, then you stop here. If you do reject, then compare the next smallest to α=αT/( k -1). Again, if you fail to reject the null hypothesis then you stop here; if you do reject continue on and use α=αT /( k -2). (You do not need to check the omnibus F-test first, thus avoiding the first problem with Fisher’s LSD.)
For example, say you have five hypotheses you are testing, you wanted αT =0.05, and you observed p- values of 0.011, 0.751, 0.020, 0.030, and 0.001 respectively
Test Number P-value Compare To Conclusion 5 0.001 0.05/5=0.01 reject H 0 for test 5 1 0.011 0.05/4=0.0125 reject H 0 for test 1 3 0.020 0.05/3=0.0166 fail to reject for test 3 4 0.030 no comparison made fail to reject for test 4 2 0.751 no comparison made fail to reject for test 2
Notice that Bonferonni’s test would only have rejected for test 5. Using αT = α would have rejected for tests 5, 1, 3, and 4. Thus the power of the Holm test is somewhere in between that of the Bonferroni procedure and Fisher’s LSD.
While it is more powerful than Bonferroni’s method (it rejects more false H 0 ’s) it still makes sure that αT is held to the desired level (unlike Fisher’s LSD). Notice that if all the null hypotheses are true, we make an error if we reject any of them. The chance that we reject any is the same as the chance that we reject the first, which is αT/ k. We are thus safe for the same reason that Bonferroni’s formula works. Now assume that we rejected the first null hypothesis because it was false. There are only k-1 tests left, and so when we go to the second test we can start as if we were using Bonferroni’s formula with k-1 instead of k. And we continue in this way. While this argument is not a proof that the Holm Test protects the family- wise error rate αT, it should make the general idea fairly clear.
While there are many other methods for making multiple comparisons (see pages 307-313), the Holm test performs fairly well compared to all of them, controls αT at the desired level, and is fairly easy to understand. Because of this, it will be the method that we will focus on.
Contrasts
In order to perform any of these tests though, we must be able to tell SAS what we want done. The building blocks for many of the SAS procedures that we will have SAS use are called contrasts.
A contrast is simply a linear function of the various treatment/group means whose coefficients sum to zero. Consider the example presented in Table 7-4 on pages 296-298. Here we have three groups: 1=healthy, 2=nonmelancholic-depressed, and 3=melancholic-depressed. Each of these three groups has an associated parameter: μ 1 = μh , μ 2 = μnonm-dep , and μ 3 = μm-dep. Examples of contrasts here would include:
L 1 = 0·μ 1 + 1 ·μ 2 - 1·μ 3 written in SAS as 0 1 - L 2 = 1·μ 1 + 0 ·μ 2 - 1·μ 3 1 0 - L 3 = 1·μ 1 - 1 ·μ 2 + 0·μ 3 1 -1 0 L 4 = 1·μ 1 - ½ ·μ 2 - ½·μ 3 1 -0.5 -0.
Notice that in each case the coefficients sum to 0: 0+1-1=0, 1+0-1=0, 1+0-1=0, 1-½-½=0. The theory says that we can estimate the contrasts using:
=
k i
L aiyi 1
k i (^) i
i L res n
a MS 1
where the a i are the coefficients for the contrast, and the estimate L ˆ^ is normally distributed if the ANOVA assumptions are met. Since we have the standard error for L ˆ^ , we could make a confidence interval for L , or test the null hypothesis that L =0. The question though, is “why would we want to?”
If we look at L 1 we simply have the difference of the means of the second and third groups (the non- melancholic depressed and the melancholic depressed). It thus appears as if the contrast L 1 is simply comparing the means of those two groups. If we use the estimate of L and its standard error to construct a t-test of the hypothesis L 1 =0, we get:
2 3
2 3
n
n
y y t res res
df N k
This is exactly the two-sample t-test for H 0 : μ 1 - μ 2 =0 except that we are using MSres instead of the pooled variance estimate! There is also an F-test for this contrast that tests exactly the same hypothesis (the F- value will always be the square of the t-value.)
If we return to the other three contrasts, L 2 is simply testing whether the non-depressed and melancholic depressed differ. Similarly L 3 is simply testing whether the healthy and nonmelancholic-depressed differ. The last contrast is somewhat more complicated. It is comparing the mean of the healthy to the average of the means of the two depressed groups. That is, it is comparing non-depressed to depressed.
Independence, Orthogonal Contrasts and the Holm-Sidak Test (an aside-note)
Two contrasts are said to be orthogonal if the dot-product of their coefficient vectors is zero. So, two
k i
L ai i 1
=
k i
L bi i 1
1
=
k i
a (^) i bi In the above example then,
L 1 and L 4 would be orthogonal, but no other pair of these contrasts would be. The reason to care if two contrasts are orthogonal is that the estimates that go with a set of orthogonal contrasts are independent. The test statistics will not be, however, as they both contain the MS (^) res in the denominator. There is a modification of the Holm test that uses Sidak’s formula instead of Bonferroni’s. However, because the statistics won’t be independent, and there really isn’t much difference between the values given by Bonferroni’s formula and Sidak’s formula, we will just use the basic Holm test.
INPUT group $ cort @@;
Check the Assumptions Using PROC INSIGHT and the Modified Levene’s test
PROC INSIGHT; OPEN tab7p4; FIT cort=group; RUN;
PROC GLM DATA=tab7p4 ORDER=DATA; CLASS group; MODEL cort=group; MEANS group / HOVTEST=BF; RUN;
The GLM Procedure
Brown and Forsythe's Test for Homogeneity of cort Variance ANOVA of Absolute Deviations from Group Medians
Sum of Mean Source DF Squares Square F Value Pr > F
group 2 6.5816 3.2908 0.48 0. Error 53 365.9 6.
From the residual vs. predicted plot, the means for each of the three groups seem to be near zero (they must always be for a one-way ANOVA). However, it is not clear from the residual vs. predicted plot if the variances of the errors for the three groups are the same. Using the modified Levene test we fail to reject that they are different with a p-value of 0.6234. Finally, from the Q-Q plot of the residuals it appears that the distribution of the errors is approximately normally distributed with the possible exception of two outliers.
Assuming the experimental design satisfies the independence assumption, then all four assumptions for the ANOVA are met in this case.
10 11 12 13 P_cort
0
10 R _ c o r t
-2 0 2 RN_cort
0
10 R _ c o r t
Possible Question 2: One example of specific contrasts.
Say that we have two research questions:
The two null hypotheses would thus be
Hypothesis 1- H 0 : μh = (μnonm-dep3 + μm-dep )/ Hypothesis 2- H 0 : μnonm-dep3 = μm-dep
These would correspond to contrasts 4 and 1 above. Note that it is important that the data was entered in the correct order, and that we use the ORDER=DATA command.
PROC GLM DATA=tab7p4 ORDER=DATA; CLASS group; MODEL cort=group; ESTIMATE ‘h vs. (n and m)’ group 1 -0.5 -0.5; ESTIMATE ‘n vs. m’ group 0 1 -1; RUN;
Standard Parameter Estimate Error t Value Pr > |t|
h vs. (n and m) -2.90000000 1.04537094 -2.77 0. n vs. m -2.80000000 1.12156130 -2.50 0.
As we have two tests, we compare the smallest p-value to αT/2=0.05/2=0.025. In this case it is the p- value for healthy vs. depressed, and the p-value of 0.0076 is smaller. We thus reject the null hypothesis for this test and conclude that the mean cortisol level for healthy individuals is different from the average of the mean cortisol levels for the two types of depressed individuals. In fact, we can estimate this difference and find that the healthy tend to have a cortisol level of 2.9 less than the average of the means for the other two groups. (Compare to the bottom of Table 7-4 on page 297).
Since we rejected the null hypothesis for the smallest p-value, we continue to the second of the two tests. We now compare the p-value of 0.0157 to αT/1=0.05/1 = 0.05. We can thus conclude that the nonmelancholic and melancholic individuals have significantly different mean cortisol levels. We estimate that the nonmelancholic individuals level is 2.8 lower than that of the melancholic individuals.
Possible Question 3: What is the order of the group means, and which are
significantly different from each other?
We will use PROC MULTTEST to conduct this procedure. (In reading the output, note that SAS also calls the Holm test the Stepdown Bonferroni test). To compare the means for all of the groups, we first need to enter all of the contrasts for comparing the means. There will always be ( k choose 2) of them. Because there are only k =3 groups in this example, there will only be 3 such contrasts. For k=10, there would have been 45. We could also have entered these in PROC GLM, but PROC MULTTEST will automatically adjust all of the α levels, so that we don’t have to!
PROC MULTTEST DATA=tab7p4 ORDER=DATA HOLM; CLASS group; CONTRAST 'h vs. n' 1 -1 0; CONTRAST 'h vs. m' 1 0 -1; CONTRAST 'n vs. m’ 0 1 -1; TEST mean(cort); RUN;
Continuous Variable Tabulations Standard Variable group NumObs Mean Deviation
cort h 16 9.2000 2. cort n 22 10.7000 2. cort m 18 13.5000 4.
p-Values Stepdown Variable Contrast Raw Bonferroni
cort h vs. n 0.2014 0. cort h vs. m 0.0008 0. cort n vs. m 0.0157 0.
We could use the column labeled Raw, and compare the values to αΤ /3, αΤ /2, and αΤ/1. Instead, however, the column labeled Stepdown Bonferroni has already been adjusted so that we can just compare those values directly to αΤ. Thus, we would reject the null hypotheses for healthy vs. melancholic, and nonmelancholic vs. melancholic. We do not, however, have significant evidence to reject the null hypothesis for healthy vs. nonmelancholic.
What way of presenting this would be to list the groups in order of their means, and have them share letters if they cannot be said to be significantly different.
Group Mean Cortisol Groupings Healthy 9.2 A Nonmelancholic Depressed 10.7 A Melancholic Depressed 13.5 B
Note: It is possible in some cases to have the groups overlap!! If nonmelancholic were more in the middle, we might not be able to say for certain it differed from either healthy or melancholic, even though melancholic and healthy clearly differed.