and http://www.uwsp.edu/psych/stat/13/anova-2w.htm
One-Way ANOVA
1.Logic & Functionality:
The reason this analysis is called ANOVA rather than multi-group means analysis (or something like that) is because it compares group means by analyzing comparisons of variance estimates. Consider:
We draw three samples. Why might these means differ? There are two reasons:
- Group Membership (i.e., the treatment effect or IV).
- Differences not due to group membership (i.e., chance or sampling error).
The ANOVA is based on the fact that two independent estimates of the population variance can be obtained from the sample data. A ratio is formed for the two estimates, where:
one is sensitive to ® | treatment effect & error | between groups estimate | ||
and the other to ® | error | within groups estimate |
Given the null hypothesis (in this case HO: m1=m2=m3), the two variance estimates should be equal. That is, since the null assumes no treatment effect, both variance estimates reflect error and their ratio will equal 1. To the extent that this ratio is larger than 1, it suggests a treatment effect (i.e., differences between the groups).
On the other hand, We could do a bunch of between groups t tests. However, this is not a good idea for three reasons.- The amount of computational labor increases rapidly with the number of groups in the study.
Number
GroupsNumber Pairs
of Means3 3 4 6 5 10 6 15 7 21 8 28 - We are interested in one thing -- is the number of people present related to helping behavior? -- thus it would be nice to be able to do one test that would answer this question.
- The type I error rate rises with the number of tests we perform.
2.1. Partitioning the Variance
As noted above, two independent estimates of the population variance can be obtained. Expressed in terms of the Sum of Squares:
To make this more concrete, consider a data set with 3 groups and 4 subjects in each. Thus, the possible deviations for the score X13 are as follows:
As you can see, there are three deviations and:
total within
groupsbetween
groups#3 #1 #2
To obtain the Sum of the Squared Deviations about the Mean (the SS), we can square these deviations and sum them over all the scores.
Thus we have:
Note: nj in formula for the SSBetween means do it once for each deviation.
It is simply the ratio of the two variance estimates:
As usual, the critical values are given by a table. Going into the table, one needs to know the degrees of freedom for both the between and within groups variance estimates, as well as the alpha level.
Two way ANOVA
1. Logic
Simply, we considered there is just one observation result for each combination of levels of the multi-factors in previous post about two way ANOVA, see http://dbigbear.blogspot.com/2007/08/analysis-of-variance-anova.html
But here, we are going to think of a little more complex situation that for each combination of the factors' levels value, we have got n observation result, as the table below:
Thus:
Factor B | A Marginals | |||||
---|---|---|---|---|---|---|
b1 | b2 | bk | bq | |||
Factor A | a1 | Xi11 | Xi12 | Xi1k | Xi1q | |
Xn11 | Xn12 | Xn1k | Xn1q | |||
a2 | Xi21 | Xi22 | Xi2k | Xi2q | ||
Xn21 | Xn22 | Xn2k | Xn2q | |||
aj | Xij1 | Xij2 | Xijk | Xijq | ||
Xnj1 | Xnj2 | Xnjk | Xnjq | |||
ap | Xip1 | Xip2 | Xipk | Xipq | ||
Xnp1 | Xnp2 | Xnpk | Xnpq | |||
B Marginals | ||||||
Grand Mean |
Note: the grand N=npq. Also note that since the calculations become much more difficult with unequal ns, we will only cover the situation of equal ns.
1.2 Advantages of the Factorial Design
There are three important advantages to the factorial design:
- Economy
The design provides more information from the same amount of work. Consider the effects of marijuana on memory. We have an experimental group that receives the drug and a control group that receives a placebo.
Two Group Design Control Experimental n=10 n=10
Factorial Design Control Experimental naive n=5 n=5 experienced n=5 n=5 n=10 n=10 Although the number of subjects is the same in both designs, with the factorial design, we obtain the additional information about the relationship of previous experience with the drug to memory performance.
- Experimental Control & Increased Generality of the Results
Suppose we are interested in the effects of teaching method on student performance. A potential extraneous variable in this case is the IQ of the students. The EV inflates the error term (i.e., the within group variability). One way to deal with this problem is to employ subjects with a homogeneous IQ. A more elegant solution is to include IQ as a factor in the design and thus remove this added source of variability from the error term.
Teaching Method A B C IQ Low Medium High An additional potential advantage of this approach is that the results have more generality (they apply to folks of varying IQs).
- The Interaction
The factorial design is the only way that we can investigate the interactions among IVs. This is particularly important because the effect of an IV rarely occurs in isolation. In the real world, many variables operate simultaneously. Thus, the factorial design allows us to investigate these more realistic situations.
In the two way factorial design, there is one possible interaction. We have discussed the notion of the interaction in detail above. In a three way factorial design, there are four possible interactions, that is: A x B, A x C, B x C, and the triple interaction, A x B x C. Triple interactions are beyond the scope of this course and thus will not be discussed further.
there will be a source of variance for each effect as well as the error term. In terms of the Sum of Squares:
2. Implementation
Thus, there are five deviations involved:
For SSA, we are interested in the deviations of the A marginals about the grand mean. In symbols:
For the actual formula, we need to square and sum these deviations over all subjects.
For SSB, we are interested in the deviations of the B marginals about the grand mean. In symbols:
For the actual formula, we need to square and sum these deviations over all subjects.
For SSwithin, we are interested in the deviations of the individual scores from their cell means. In symbols:
For the actual formula, we need to square and sum these deviations over all subjects.
For SSAxB, we are interested in the deviations of the cell means from the grand mean minus the effects of factors A and B. In symbols:
This reduces to:
For the actual formula, we need to square and sum these deviations over all subjects.
For SST, we are interested in the deviations of the individual scores from the grand mean. In symbols:
For the actual formula, we need to square and sum these deviations over all subjects.
And for the degrees of freedom, we have:
dfA | =p-1 |
dfB | =q-1 |
dfAxB | =(p-1)(q-1) =pq-p-q+1 |
dfwithin | =pq(n-1) =pqn-pq =N-pq |
dfT | =npq-1 =N-1 |
3. Example
Here is the data (i.e., the number of trials to learn PA):
Age -> | Young b1 | Older b2 | ||
---|---|---|---|---|
Maternal Diet -> | 0% a1 | 35% a2 | 0% a1 | 35% a2 |
5 | 18 | 6 | 6 | |
4 | 19 | 7 | 9 | |
3 | 14 | 5 | 5 | |
4 | 12 | 8 | 9 | |
2 | 15 | 4 | 3 | |
18 | 78 | 30 | 32 | |
n=njk | 5 | 5 | 5 | 5 |
3.6 | 15.6 | 6 | 6.4 |
The relevant descriptive statistic is the means, and, in the case of an ANOVA, it is probably best to plot them:
Let's expand on the data grid for the calculations.
Age -> b1 b2 Maternal Diet -> a1 a2 a1 a2 Data X X2 X X2 X X2 X X2 5 25 18 324 6 36 6 36 4 16 19 361 7 49 9 81 3 9 14 196 5 25 5 25 4 16 12 144 8 64 9 81 2 4 15 225 4 16 3 9 18 78 30 32 158T n=njk5 5 5 5 20N 3.6 15.6 6 6.4 70 1250 190 232 1742II The following table helps with computing marginal totals.
b1 b2a1 18 30 48Tj.s a2 78 32 110 96 62 158T.ks T.. Now we will need five quantities. Note, in the interest of saving some space, all intermediate quantities are not shown.
I. | |
---|---|
II. | |
III. | |
IV. | |
V. |
And:
SSA | =III-I | =1440.4-1248.2 | =192.2 |
SSB | =IV-I | =1306.0-1248.2 | =57.8 |
SSAxB | =V+I-III-IV | =1666.4+1248.2- 1440.4-1306.0 | =168.2 |
SSW | =II-V | =1742.0-1666.4 | =75.6 |
SST | =II-I | =1742.0-1248.2 | =493.8 |
We check that the Sum of Squares add up to the total and they do. Thus, remembering that:
and
we can fill in the ANOVA Summary Table.
Source | SS | df | MS | F | p |
---|---|---|---|---|---|
A | 192.2 | 1 | 192.2 | 40.68 | .05 |
B | 57.8 | 1 | 57.8 | 12.23 | .05 |
AxB | 168.2 | 1 | 168.2 | 35.60 | .05 |
Within | 75.6 | 16 | 4.725 | ||
Total | 493.8 | 19 |
- Decision
Since we have three research questions, we also have three decisions to make. Since all three Fobs values are greater than the Fcrit (i.e., 4.49), we reject Ho in each case.- There is a main effect of prenatal alcohol which says that animals receiving alcohol in utero showed impaired passive avoidance learning when compared to controls.
- There is a main effect of age which says that mature animals learned the task more quickly.
- There is an interaction which says that prenatal alcohol produces a deficit in the ability to withhold responding which dissipates as the animal matures.
Note that given this pattern of data (which are fictitious but based upon fact), we would not pay attention to the main effects. The main effect of age is not true for the 0%EDC animals. The main effect of alcohol is not true for the adult animals. Thus, the interaction is what is worth paying attention too in this study.
In the example we have given of the 2x2 ANOVA, the outcome is clear. However, what if we had employed a 3x3 factorial design? That is, we include another control group that receives a normal, Lab Chow (LC) diet and we test the animals at either 30, 80, or 130 days of age. There are two types of analysis that should be mentioned here. I should note that in an effort to keep things simple, I will not ask you to actually perform these analyses. However, they follow logically from what we have been doing and it is certainly worth your while to be aware of their existence.
- Further Analysis of Main Effects
If there was no interaction and a significant main effect, we could do an analysis similar to what we did when using the protected t test with the one way ANOVA. Below is a formula to determine the Least Significant Difference (LSD) between means that is worthy of our attention. The procedure is essentially the same as for the protected t, however, in this case, the main effect is reflected in the marginal means which changes the formula slightly, and we are computing an LSD rather than an F ratio which also shifts things around a bit.
Consider the hypothetical example below:
In this case, the analysis would reveal that the significant main effect of maternal diet is due to the fact that the animals receiving alcohol in utero took longer to learn PA that did controls (which did not differ among themselves).
- Simple Main Effects of the Interaction
If, however, the interaction was significant, we might want to look at the simple main effects of the interaction. This analysis looks at the difference between the cell means for one factor at each of the levels of the other. The least significant difference between the means is computed with a slight modification to the formula we used above, that is:
The hypothetical data presented below (which, in this case, is based on the actual data obtained in the experiment) shows a significant interaction.
Computing the simple main effects of the interaction would show that the animals receiving alcohol in utero took significantly longer to learn PA at 30 days of age. At 80 days, the effect was marginal and at 130 days there was no effect. Furthermore, the analysis would show that the two control groups were not significantly different at any age.
No comments:
Post a Comment