












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!













One-way ANOVA examines equality of population means for a quantitative out- come and a single categorical explanatory variable with any number of levels.
The t-test of Chapter 6 looks at quantitative outcomes with a categorical ex- planatory variable that has only two levels. The one-way Analysis of Variance (ANOVA) can be used for the case of a quantitative outcome with a categorical explanatory variable that has two or more levels of treatment. The term one- way, also called one-factor, indicates that there is a single explanatory variable (âtreatmentâ) with two or more levels, and only one level of treatment is applied at any time for a given subject. In this chapter we assume that each subject is ex- posed to only one treatment, in which case the treatment variable is being applied âbetween-subjectsâ. For the alternative in which each subject is exposed to several or all levels of treatment (at different times) we use the term âwithin-subjectsâ, but that is covered Chapter 14. We use the term two-way or two-factor ANOVA, when the levels of two different explanatory variables are being assigned, and each subject is assigned to one level of each factor.
It is worth noting that the situation for which we can choose between one-way ANOVA and an independent samples t-test is when the explanatory variable has exactly two levels. In that case we always come to the same conclusions regardless of which method we use.
The term âanalysis of varianceâ is a bit of a misnomer. In ANOVA we use variance-like quantities to study the equality or non-equality of population means. So we are analyzing means, not variances. There are some unrelated methods,
such as âvariance component analysisâ which have variances as the primary focus for inference.
As an example of application of one-way ANOVA consider the research reported in âMoral sentiments and cooperation: Differential influences of shame and guiltâ by de Hooge, Zeelenberg, and M. Breugelmans (Cognition & Emotion,21(5): 1025- 1042, 2007).
As background you need to know that there is a well-established theory of Social Value Orientations or SVO (see Wikipedia for a brief introduction and references). SVOs represent characteristics of people with regard to their basic motivations. In this study a questionnaire called the Triple Dominance Measure was used to categorize subjects into âproselfâ and âprosocialâ orientations. In this chapter we will examine simulated data based on the results for the proself individuals.
The goal of the study was to investigate the effects of emotion on cooperation. The study was carried out using undergraduate economics and psychology students in the Netherlands.
The sole explanatory variable is âinduced emotionâ. This is a nominal cat- egorical variable with three levels: control, guilt and shame. Each subject was randomly assigned to one of the three levels of treatment. Guilt and shame were induced in the subjects by asking them to write about a personal experience where they experienced guilt or shame respectively. The control condition consisted of having the subject write about what they did on a recent weekday. (The validity of the emotion induction was tested by asking the subjects to rate how strongly they were feeling a variety of emotions towards the end of the experiment.)
After inducing one of the three emotions, the experimenters had the subjects participate in a one-round computer game that is designed to test cooperation. Each subject initially had ten coins, with each coin worth 0.50 Euros for the subject but 1 Euro for their âpartnerâ who is presumably connected separately to the computer. The subjects were told that the partners also had ten coins, each worth 0.50 Euros for themselves but 1 Euro for the subject. The subjects decided how many coins to give to the interaction partner, without knowing how many coins the interaction partner would give. In this game, both participants would earn 10 Euros when both offered all coins to the interaction partner (the
Figure 7.1: Boxplots of cooperation by induced emotion.
side boxplots shown in figure 7.1.
Our initial impression is that cooperation is higher for guilt than either shame or the control condition. The mean cooperation for shame is slightly lower than for the control. In terms of pre-checking model assumptions, the boxplots show fairly symmetric distributions with fairly equal spread (as demonstrated by the comparative IQRs). We see four high outliers for the shame group, but careful thought suggests that this may be unimportant because they are just one unit of measurement (coin) into the outlier region and that region may be âpulled inâ a bit by the slightly narrower IQR of the shame group.
emo-
Technically, the sample group means are unbiased estimators of the population group means when treatment is randomly assigned. The mean- ing of unbiased here is that the true mean of the sampling distribution of any group sample mean equals the corresponding population mean. Fur- ther, under the Normality, independence and equal variance assumptions it is true that the sampling distribution of YÂŻi is N (ÎŒi, Ï^2 /ni), exactly.
The statistical model for which one-way ANOVA is appropriate is that the (quantitative) outcomes for each group are normally distributed with a common variance (Ï^2 ). The errors (deviations of individual outcomes from the population group means) are assumed to be inde- pendent. The model places no restrictions on the population group means.
The term assumption in statistics refers to any specific part of a statistical model. For one-way ANOVA, the assumptions are normality, equal variance, and independence of errors. Correct assignment of individuals to groups is sometimes considered to be an implicit assumption.
The null hypothesis is a point hypothesis stating that ânothing interesting is happening.â For one-way ANOVA, we use H 0 : ÎŒ 1 = · · · = ÎŒk, which states that all of the population means are equal, without restricting what the common value is. The alternative must include everything else, which can be expressed as âat least one of the k population means differs from all of the othersâ. It is definitely wrong to use HA : ÎŒ 1 6 = · · · 6 = ÎŒk because some cases, such as ÎŒ 1 = 5, ÎŒ 2 = 5, ÎŒ 3 = 10, are neither covered by H 0 nor this incorrect HA. You can write the alternative hypothesis as âHA : Not ÎŒ 1 = · · · = ÎŒk or âthe population means are not all equalâ.
One way to correctly write HA mathematically is HA : â i, j : ÎŒi 6 = ÎŒj.
This null hypothesis is called the âoverallâ null hypothesis and is the hypothesis tested by ANOVA, per se. If we have only two levels of our categorical explanatory
variable, then retaining or rejecting the overall null hypothesis, is all that needs to be done in terms of hypothesis testing. But if we have 3 or more levels (k â„ 3), then we usually need to followup on rejection of the overall null hypothesis with more specific hypotheses to determine for which population group means we have evidence of a difference. This is called contrast testing and discussion of it will be delayed until chapter 13.
The overall null hypothesis for one-way ANOVA with k groups is H 0 : ÎŒ 1 = · · · = ÎŒk. The alternative hypothesis is that âthe population means are not all equalâ.
The next step in standard inference is to select a statistic for which we can compute the null sampling distribution and that tends to fall in a different region for the alternative than the null hypothesis. For ANOVA, we use the âF-statisticâ. The single formula for the F-statistic that is shown in most textbooks is quite complex and hard to understand. But we can build it up in small understandable steps.
Remember that a sample variance is calculated as SS/df where SS is âsum of squared deviations from the meanâ and df is âdegrees of freedomâ (see page 69). In ANOVA we work with variances and also âvariance-like quantitiesâ which are not really the variance of anything, but are still calculated as SS/df. We will call all of these quantities mean squares or MS. i.e., M S = SS/df , which is a key formula that you should memorize. Note that these are not really means, because the denominator is the df, not n.
For one-way ANOVA we will work with two different MS values called âmean square within-groupsâ, MSwithin, and âmean square between-groupsâ, MSbetween. We know the general formula for any MS, so we really just need to find the formulas for SSwithin and SSbetween, and their corresponding df.
The F statistic denominator: MSwithin
MSwithin is a âpureâ estimate of Ï^2 that is unaffected by whether the null or alter- native hypothesis is true. Consider figure 7.2 which represents the within-group
where SSwithin =
âk i=1 SSi, and dfwithin =^
âk i=1 dfi^ =^
âk i=1(niâ1) =^ N^ âk.
MSwithin is a good estimate of Ï^2 (from our model) regardless of the truth of H 0. This is due to the way SSwithin is defined. SSwithin (and therefore MSwithin) has N-k degrees of freedom with ni â 1 coming from each of the k groups.
The F statistic numerator: MSbetween
0 20
Group 1
Group 2
Y^ ÂŻ 1 = 4. 25
YÂŻ 2 = 14. 00
YÂŻ = 9. 125
Figure 7.3: Deviations for between-group sum of squares
Now consider figure 7.3 which represents the between-group deviations used in the calculation of MSbetween for the same little 2-group 8-subject experiment as shown in figure 7.2. The single vertical black line is the average of all of the outcomes values in all of the treatment groups, usually called either the overall mean or the grand mean. The colored vertical lines are still the group means. The horizontal black lines are the deviations used for the between-group calculations. For each subject we get a deviation equal to the distance (difference) from that subjectâs group mean to the overall (grand) mean. These deviations are squared and summed to get SSbetween, which is then divided by the between-group df, which is k â 1, to get MSbetween.
MSbetween is a good estimate of Ï^2 only when the null hypothesis is true. In this case we expect the group means to be fairly close together and close to the
grand mean. When the alternate hypothesis is true, as in our current example, the group means are farther apart and the value of MSbetween tends to be larger than Ï^2. (We sometimes write this as âMSbetween is an inflated estimate of Ï^2 â.)
SSbetween is the sum of the N squared between-group deviations, where the deviation is the same for all subjects in the same group. The formula is SSbetween =
â^ k
i=
ni( YÂŻi â YÂŻÂŻ )^2
where YÂŻÂŻ is the grand mean. Because the k unique deviations add up to zero, we are free to choose only k â 1 of them, and then the last one is fully determined by the others, which is why dfbetween = k â 1 for one-way ANOVA.
Because of the way SSbetween is defined, MSbetween is a good estimate of Ï^2 only if H 0 is true. Otherwise it tends to be larger. SSbetween (and therefore MSbetween) has k â 1 degrees of freedom.
The F statistic ratio
It might seem that we only need MSbetween to distinguish the null from the alter- native hypothesis, but that ignores the fact that we donât usually know the value of Ï^2. So instead we look at the ratio
MSbetween MSwithin
to evaluate the null hypothesis. Because the denominator is always (under null and alternative hypotheses) an estimate of Ï^2 (i.e., tends to have a value near Ï^2 ), and the numerator is either another estimate of Ï^2 (under the null hypothesis) or is inflated (under the alternative hypothesis), it is clear that the (random) values of the F-statistic (from experiment to experiment) tend to fall around 1.0 when
0 1 2 3 4 5
F
Density
df=1, df=2, df=3, df=3,
Figure 7.4: A variety of F-distribution pdfs.
The F-distribution is a non-negative distribution in the sense that F values, which are squares, can never be negative numbers. The distribution is skewed to the right and continues to have some tiny probability no matter how large F gets. The mean of the distribution is s/(s â 2), where s is the denominator degrees of freedom. So if s is reasonably large then the mean is near 1.00, but if s is small, then the mean is larger (e.g., k=2, n=4 per group gives s=3+3=6, and a mean of 6/4=1.5).
Examples of F-distributions with different numerator and denominator degrees of freedom are shown in figure 7.4. These curves are probability density functions, so the regions on the x-axis where the curve is high are the values most likely to occur. And the area under the curve between any two F values is equal to the probability that a random variable following the given distribution will fall between those values. Although very low F values are more likely for, say, the
0 1 2 3 4 5
F
Density^ Observed Fâstatistic=2.
shaded area is 0.
Figure 7.5: The F(3,10) pdf and the p-value for F=2.0.
F(1,10) distribution than the F(3,10) distribution, very high values are also more common for the F(1,10) than the F(3,10) values, though this may be hard to see in the figure. The bigger the numerator and/or denominator df, the more concentrated the F values will be around 1.0.
There are two ways to use the null sampling distribution of F in one-way ANOVA: to calculate a p-value or to find the âcritical valueâ (see below).
A close up of the F-distribution with 3 and 10 degrees of freedom is shown in figure 7.5. This is the appropriate null sampling distribution of an F-statistic for an experiment with a quantitative outcome and one categorical explanatory variable (factor) with k=4 levels (each subject gets one of four different possible treatments) and with 14 subjects divided among the 4 groups. A vertical line marks an F-statistic of 2.0 (the observed value from some experiment). The p- value for this result is the chance of getting an F-statistic greater than or equal to
It is often worthwhile to express what we have learned from an experiment in terms of confidence intervals. In one-way ANOVA it is possible to make confidence intervals for population group means or for differences in pairs of population group means (or other more complex comparisons). We defer discussion of the latter to chapter 13.
Construction of a confidence interval for a population group means is usually done as an appropriate âplus or minusâ amount around a sample group mean. We use MSwithin as an estimate of Ï^2 , and then for group i, the standard error of the mean is
â MSwithin/ni. As discussed in sec- tion 6.2.7, the multiplier for the standard error of the mean is the so called âquantile of the t-distributionâ which defines a central area equal to the de- sired confidence level. This comes from a computer or table of t-quantiles. For a 95% CI this is often symbolized as t 0. 025 ,df where df is the degrees of freedom of MSwithin, (N â k). Construct the CI as the sample mean plus or minus (SEM times the multiplier).
In a nutshell: In one-way ANOVA we calculate the F-statistic as the ratio MSbetween/MSwithin. Then the p-value is calculated as the area under the appropriate null sampling distribution of F that is bigger than the observed F-statistic. We reject the null hypothesis if p †α.
To run a one-way ANOVA in SPSS, use the Analyze menu, select Compare Means, then One-Way ANOVA. Add the quantitative outcome variable to the âDependent Listâ, and the categorical explanatory variable to the âFactorâ box. Click OK to get the output. The dialog box for One-Way ANOVA is shown in figure 7.7.
You can also use the Options button to perform descriptive statistics by group, perform a variance homogeneity test, or make a means plot.
Figure 7.7: One-Way ANOVA dialog box.
You can use the Contrasts button to specify particular planned contrasts among the levels or you can use the Post-Hoc button to make unplanned contrasts (cor- rected for multiple comparisons), usually using the Tukey procedure for all pairs or the Dunnett procedure when comparing each level to a control level. See chapter 13 for more information.
The ANOVA table is the main output of an ANOVA analysis. It always has the âsource of variationâ labels in the first column, plus additional columns for âsum of squaresâ, âdegrees of freedomâ, âmeans squareâ, F, and the p-value (labeled âSig.â in SPSS).
For one-way ANOVA, there are always rows for âBetween Groupsâ variation and âWithin Groupsâ variation, and often a row for âTotalâ variation. In one-way ANOVA there is only a single F statistic (MSbetween/MSwithin), and this is shown on the âBetween Groupsâ row. There is also only one p-value, because there is only one (overall) null hypothesis, namely H 0 : ÎŒ 1 = · · · = ÎŒk, and because the p-value comes from comparing the (single) F value to its null sampling distribution. The calculation of MS for the total row is optional.
Table 7.2 shows the results for the moral sentiment experiment. There are several important aspects to this table that you should understand. First, as discussed above, the âBetween Groupsâ lines refer to the variation of the group means around the grand mean, and the âWithin Groupsâ line refers to the variation
correctly). Just from this one-way ANOVA table, we can see that there were 3 treatment groups (because dfBetween is one less than the number of groups). Also, we can calculate that there were 125+1=126 subjects in the experiment.
Finally, it is worth knowing that MSwithin is an estimate of Ï^2 , the variance of outcomes around their group mean. So we can take the square root of MSwithin to get an estimate of Ï, the standard deviation. Then we know that the majority (about 23 ) of the measurements for each group are within Ï of the group mean and most (about 95%) are within 2Ï, assuming a Normal distribution. In this example the estimate of the s.d. is
9 .60 = 3.10, so individual subject cooperation values more than 2(3.10)=6.2 coins from their group means would be uncommon.
You should understand the structure of the one-way ANOVA table including that MS=SS/df for each line, SS and df are additive, F is the ratio of between to within group MS, the p-value comes from the F-statistic and its presumed (under model assumptions) null sampling distribution, and the number of treatments and number of subjects can be calculated from degrees of freedom.
Except for the skewness of the shame group, the skewness and kurtosis statistics for all three groups are within 2SE of zero (see Table 7.1), and that one skewness is only slightly beyond 2SE from zero. This suggests that there is no evidence against the Normality assumption. The close similarity of the three group standard deviations suggests that the equal variance assumption is OK. And hopefully the subjects are totally unrelated, so the independent errors assumption is OK. Therefore we can accept that the F-distribution used to calculate the p-value from the F-statistic is the correct one, and we âbelieveâ the p-value.
With p = 0. 013 < 0 .05, we reject the null hypothesis that all three of the group population means of cooperation are equal. We therefore conclude that differences
in mean cooperation are caused by the induced emotions, and that among control, guilt, and shame, at least two of the population means differ. Again, we defer looking at which groups differ to chapter 13.
(A complete analysis would also include examination of residuals for additional evaluation of possible non-normality or unequal spread.)
The F-statistic of one-way ANOVA is easily calculated by a computer. The p-value is calculated from the F null sampling distribution with matching degrees of freedom. But only if we believe that the assump- tions of the model are (approximately) correct should we believe that the p-value was calculated from the correct sampling distribution, and it is then valid.