0% found this document useful (0 votes)
8 views22 pages

Understanding the F-Distribution in ANOVA

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views22 pages

Understanding the F-Distribution in ANOVA

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Analysis of Variance

1
Analysis of Variance
1. The F-distribution and the F-test

It may seem surprising to you that if we are testing H0 : σ12 = σ22 against an alternative H1 : σ12 6= σ22
(or σ12 > σ22 or σ12 < σ22) the test statistic is not based on s21-s22. Instead it is based on the ratio
s21
of the two sample variances, .
s22

In general, ratios tend to be awkward quantities in Statistics, while sums and differences are easily
handled. To see the truth of this remark try the following optional exercise in Excel:

(1) From the Data tab click on Data Analysis. If you have no Data Analysis option you will
need to select:
(a) Click on File
(b) Click on Options
(c) Click on Add-Ins
(d) Select Analysis ToolPak and click on Go
(e) Check the Analysis ToolPak box and click OK
(2) Select Random Number Generation and click OK.
(3) Use the Random Number Generation dialogue window to simulate 100 observations from a
N (0; 1) distribution and put these observations in column A.
(4) Repeat Step 3 to obtain a second independent sample of 100 observations from the same
distribution. Place these observations in column B.
(5) Now use formulae to calculate the entries in two new columns, C and D. Column C should
contain the difference between columns B and A while column D should contain the ratio of
the two.
(6) Theory tells us that the entries in column C will resemble those from a N (0; 2) distribution.
Produce a histogram of the entries in column C. Does it look normal?
(7) Produce a histogram of the entries in column D. Does it look normal?

The reason why the ratio is so badly behaved in this simulation is because whenever the denomi-
nator is close to zero, and that is where most of the values of a N (0; 1) distribution are found, the
ratio can be huge unless the numerator is also near zero.
In the Analysis of Variance, which is where we encounter the F -distribution in this course, we
perform single-tail tests and since the numerator and denominator are sample variances and not
individual values the ratio is likely to be of moderate size.

The F -distribution

The F -distribution is an asymmetric continuous distribution that is defined over the interval [0,
infinity). The curve has a mode not far to the right of 0, and then gradually approaches the
horizontal axis as F gets larger.

2
0 Fcrit

Figure 1.2: Graphical representation of the F -distribution

The F -distribution approaches, but never quite touches , the horizontal axis. Refer to Figure
1.2.
The probability density function f (x) for the F -distribution is well-known but it is mathematically
awkward and cannot readily be integrated to find areas under the curve, so it is not shown here
or in Introstat. The F -distribution has two parameters called the degrees of freedom, one for
the numerator and one for the denominator. If the numerator was based on a sample of size n1
and the denominator on a sample of size n2 then the degrees of freedom for the distribution are
n1-1 and n2-1. For each combination of these degrees of freedom there
is a different F -distribution. The F -distribution is most dispersed when the degrees of
freedom are small.
Since there are so many F -distributions, the F -tables are rather bulky and organised slightly
differently to the t-tables or z-tables, for example. Turn to Introstat pp. 328 to 335. The table
you see is suitable for a single-tail test at the 5% level, in other words the area shown as a in
the diagram is equal to 0.05. Suppose we have 8 numerator and 11 denominator degrees of
freedom. Confirm that the critical value Fcrit is equal to 2.95. If the test statistic exceeds 2.95 we
will reject the null hypothesis that the two populations have the same variance at the 5% level
in favour of the alternative hypothesis that the first population is more variable than the
second. If the alternative hypothesis was a two-sided one, we would look at the 2.5% F -tables.
Now study Examples 14A and 15B, Introstat p. 212 to 213.

3
Glossary
Experimental Design We are concerned with the analysis of data generated from an experiment.
It is wise to take time and effort to organise the experiment properly to ensure that the right
type of data, and enough of it, is available to answer the questions of interest as clearly and
efficiently as possible. This process is called experimental design.
The specific questions that the experiment is intended to answer must be clearly identified
before carrying out the experiment. We should also attempt to identify known or expected
sources of variability in the experimental units since one of the main aims of a designed
experiment is to reduce the effect of these sources of variability on the answers to questions
of interest. That is, we design the experiment in order to improve the precision of our answers.
Treatment In experiments, a treatment is something that researchers administer to experimental
units. For example, a corn field is divided into four, each part is treated with a different
fertiliser to see which produces the most corn; a teacher practises different teaching methods
on different groups in her class to see which yields the best results; a doctor treats a patient
with a skin condition with different creams to see which is most effective.
Treatments are administered to experimental units by level, where level implies amount or
magnitude. For example, if the experimental units were given in 5 mg, 10 mg, 15 mg of a
medication, those amounts would be three levels of the treatment. Level is also used for
categorical variables, such as Drugs A, B, and C, where the three are different kinds of drug,
and not different amounts of the same thing.
Factor A factor of an experiment is a controlled independent variable, a variable whose levels are
set by the experimenter.
A factor is a general type or category of treatments. Different treatments constitute different
levels of a factor. For example, three different groups of runners are subjected to different
training methods. The runners are the experimental units and the training methods the
treatments, where the three types of training methods constitute three levels of the factor
‘type of training’.
One-way Analysis of Variance The one-way analysis of variance allows us to compare several
groups of observations, all of which are independent but possibly have a different mean for
each group. A test of great importance is whether or not all the means are equal.
The observations all arise from one of several different groups (or have been exposed to one
of several different treatments in an experiment). We are classifying one-way according to
the group or treatment.
Completely Randomised Design The structure of the experiment in a completely randomised
design is assumed to be such that the treatments are allocated to the experimental units
completely at random.
Two Way Analysis of Variance Two Way Analysis of Variance is a way of studying the effects
of two factors separately (their main effects) and (sometimes) together (their interaction
effect).
Randomised Complete Block Design The randomised complete block design is a design in
which the subjects are matched according to a variable which the experimenter wishes to con-
trol. The subjects are put into groups (blocks) of the same size as the number of treatments.
The members of each block are then randomly assigned to different treatment groups.

4
Example 1-1 A researcher is carrying out a study of the effectiveness of four different
skin creams for the treatment of a certain skin disease. He has eighty subjects and plans
to divide them into 4 treatment groups of twenty subjects each. Using a randomised block
design, the subjects are assessed and put in blocks of four according to how severe their skin
condition is; the four most severe cases are the first block, the next four most severe cases
are the second block, and so on to the twentieth block. The four members of each block are
then randomly assigned, one to each of the four treatment groups.
Factorial Design A factorial design is used to evaluate two or more factors simultaneously. The
treatments are combinations of levels of the factors. The advantages of factorial designs over
one-factor-at-a-time experiments is that they are more efficient and they allow interactions
to be detected.

Interaction An interaction is the variation among the differences between means for different
levels of one factor over different levels of the other factor.

Example 1-2 A cholesterol reduction clinic has two diets and one exercise regime. It
was found that exercise alone was effective, and diet alone was effective in reducing cholesterol
levels (main effect of exercise and main effect of diet). Also, for those patients who didn’t
exercise, the two diets worked equally well (main effect of diet); those who followed diet A
and exercised got the benefits of both (main effect of diet A and main effect of exercise).
However, it was found that those patients who followed diet B and exercised got the benefits
of both plus a bonus, an interaction effect (main effect of diet B, main effect of exercise plus
an interaction effect).

2. One Way Analysis of Variance

The following example is intended to show you a typical one way analysis of variance problem and
the simple calculations by means of which conclusions may be drawn from such a study.

Example 1-3 Three groups of students, 5 in each group, were receiving therapy for severe test
anxiety. Group 1 received 5 hours of therapy, group 2 received 10 hours and group 3 received 15
hours. At the end of therapy each subject completed an evaluation of test anxiety (the dependent
variable in the study). Did the amount of therapy have an effect on the level of test anxiety?
The three groups of students received the scores on the Test Anxiety Index (TAI) at the end of
treatment shown in Table 1.1. Table 1.2 contains the quantities we need to calculate the means
for the three groups, the sum of squares, and the degrees of freedom.

Group 1 Group 2 Group 3


48 55 51
50 52 52
53 53 50
52 55 53
50 53 50

Table 1.1: TAI Scores for Three Groups of Students

The mean for group 1 is 253/5 = 50.6, the mean for group 2 is 268/5 = 53.6, and the mean for
group 3 is 256/5 = 51.2.
Are the differences between these three means significant? W e c an u se a nalysis o f v ariance to
answer that question. Since we only have one independent variable, amount of therapy, we will use

5
Group 1 Group 2 Group 3
48 55 51
50 52 52
53 53 50
52 55 53
P 50 P 53 P 50
P x = 253 P x = 268 P x = 256
x ∗ x = 12817 x ∗ x = 14372 x ∗ x = 13114

Table 1.2: Worksheet for Test Anxiety Study

one-way analysis of variance. If we were concerned with the effect of two independent variables on
the dependent variable, then we would use two-way analysis of variance.
First we will calculate SSB, the sum of squares between groups, where X1 is a score from Group 1,
X2 is a score from Group 2, X3 is a score from Group 3, n1 is the number of subjects in group 1, n2
is the number of subjects in group 2, n3 is the number of subjects in group 3, GT is the grand total
of scores for the whole experiment and n is the total number of subjects in all groups.

2.1 Completely Randomised Design


‘Let us consider an experiment designed to test for differences
between t treatment means; i.e. we have t samples. Furthermore suppose that each sample is of size
r; i.e. the number of replications of each treatment within the experiment are equal.
Consider the following where yij represents the jth observation of the ith treatment, yi0 the ith
treatment mean, and ȳ the overall (or general) mean of the experiment:

Treatment 1 Treatment 2 ... Treatment t


y11 y21 yt1
y12 y22 yt2
y13 y23 yt3
.. .. ..
. . .
y1r y2r ytr
Means: y10 y10 ... y10 ȳ P
Totals: Y10 Y10 ... Y10 GT (i.e. Grand Total = Yi0 )

If we now regard the above data as consisting of a single sample, then the sum of squares (SS) for
this sample, called the Total Sum of Squares (Total SS), is given by
XX
Total SS = (yij − ȳ)2 .

This SS, divided by the appropriate degrees of freedom, will provide an estimate of variance of all
the data. However, closer examination of the above dataset will reveal two identifiable sources of
variation: between treatment means and within treatments.
This partitioning of the Total SS may be represented algebraically as follows:
t X
X r t
X t X
X r
2 2
(yij − ȳ)) = r (yi0 − ȳ) + (yij − yi0 )2
i j i i j

i.e. Total SS = Between Treatment SS + Within Treatment SS

6
In practice, the Total SS, Treatment SS, and Error SS (Within Samples SS) are calculated as
follows:
t X
r
X
2 GT2
Total SS = yij −
i j
n

where n is the total number of observations in the experiment and GT is the total of all observations.
Let Yi0 be the total of all observations for the ith treatment. Then
t
1 X 2 GT2
Treatment SS = Y − .
r i i0 n

In the event that there are an unequal number of observations per treatment (sample), the Treat-
ment SS is calculated as follows:
t
X Y2 i0 GT2
Treatment SS = − .
i
ri n

Error SS is calculated by subtraction as Total SS less Treatment SS.

The Analysis of Variance (ANOVA) Table

The partitioning of the Total SS can be conveniently summarised in an Anaylsis of Variance Table
as follows:
Source of Variation df SS MS
GT2
1
Pt 2
Between Treatments t−1 r −
i Yi0 n s21
Within Treatments (Error) t(r − 1) (by subtraction) s2
GT2
Pt Pr 2
Total tr − 1 i j yij − n s22

Table 1.3: Analysis of Variance (equal samples)

SS
Note: MS = Mean Square = df ; i.e. an estimate of variance.

The F-Test

One of the objectives of the Analysis of Variance is to test hypotheses concerning the treatment
means. The simplest hypothesis is
H0 : µi = µ for all i, i.e. µ1 = µ2 = . . . = µt = µ

If we have t independent samples from a Normal population, it can be shown that the ratio
s21 Treatment MS Note that you can use [Link] in Excel to
2
= ∼ F(t−1),t(r−1) calculate p-values associated with the F-Test
s Error MS
i.e. a test of H0 is obtained from a single-tail F-test.
Furthermore, provided that the t populations have a common variance, σ 2 , estimated by s2 , then
the F-test is more efficient than a series of t-tests to test for significant differences between successive
pairs of means, since s2 is based on a greater number of degrees of freedom. The ANOVA table
above may now be extended to include the F-test statistic as follows:
s21
The value of s2 is referred to F-tables for (t − 1) and t(r − 1) degrees of freedom.

7
Source of Variation df SS MS F
1
Pt 2 GT2 s21
Between Treatments t−1 r i Yi0 − n s21 s2
2
Within Treatments (Error) t(r − 1) (by subtraction) s
GT2
Pt Pr 2
Total tr − 1 i j yij − n s22

Table 1.4: Analysis of Variance

Example 1-4 The following are the nitrogen content of red clover plants inoculated with
combination cultures of Rhizobium trifoli strains and Rhizobium melitoli, in milligrams:

Strains
3DOK1 3DOK5 3DOK4 3DOK7 3DOK13 Composite
19.4 17.7 17.0 20.7 14.3 17.3
32.6 24.8 19.4 21.0 14.4 19.4
27.0 27.9 9.1 20.5 11.8 19.1
32.1 25.2 11.9 18.8 11.6 16.9
33.0 24.3 15.8 18.6 14.2 20.8
Totals 144.1 119.9 73.2 99.6 66.3 93.5 GT = 596.6
Means 28.8 24.0 14.6 19.9 13.3 18.7

From this we calculate the following values:

GT2 596.62
= = 11864.38
n 30
Total SS = 12994.36 − 11864.38 = 1129.98
2 2 2
144.1 + . . . + 93.5 GT
Treatment SS = − = 847.05
5 n
Error SS = 1129.98 − 847.05 = 282.93.

We can use these to construct the ANOVA table, shown in Table 1.5.

Source of Variation df SS MS F
Between cultures 5 847.05 169.41 14.37
Within cultures (Error) 24 282.93 11.79
Total 29 1129.98
Table 1.5: ANOVA for Example 1-4.

(c.f.: F5,24(5%) = 2.62, F5,24(1%) = 3.90)


Conclusion: There are significant di

erences between the treatment means (p < 0.01).

Techniques for determining differences between treatment means


(1) Least Significant Differences (LSDs) (This method is due to Fisher)
(2) Scheffe’s test
(3) Tukey’s test
(4) Student-Newman-Keuls’ (S-N-K) test
8
(5) Suncan’s Multiple Range test
(6) Dunnet’s test
(7) Bonferroni test

Least Significant Differences (LSDs)

Remember, the mean nitrogen content (in milligrams) of the Red Clover plants for the different
combinations of Rhizobia strains were:
Strains: 3DOK1 3DOK5 3DOK4 3DOK7 3DOK13 Composite
Means 28.8 24.0 14.6 19.9 13.3 18.7

The Error MS (s2 ) was 11.79 with 24 df.


Under these conditions, for two means to be significantly different at the 5% level of significance,
|difference|
tcalculated ≥ 2.064 (α = 0.05), i.e.
SE(difference)
q
Now SE(difference) = 2 11.79 2
5 , since r = 5 (the number of replications) and s = 11.79. Thus, for
significance at the 5% level,
r
11.79
|difference| ≥ 2.064 × 2 = 4.48,
5
and similarly for significance at the 1% level,
r
11.79
|difference| ≥ 2.797 × 2 = 6.07.
5

From the above, we see that difference will be declared significant at the 5% and 1% levels of
significance if they exceed 4.48 or 6.07 respectively. The values 4.48 and 6.07 are called the 5%
and 1% Least Significant Differences. Generally:
r
s2
LSDα = tα × 2 ·
r
where α = 0.05 or 0.01, and we have equal replications for each mean.
Applying these results to the means, we have, in ranked order Table 1.6
Conclusion: At the 5% level, 3DOK1 and 3DOK5 differ significantly. 3 DOK5 a nd 3 DOK7 do
not differ significantly, etc.
Note: In the case where there are an unequal number of replications per treatment, the LSD
method cannot be used effectively. In such cases it is necessary to make comparisons by means of
individual t-tests or similar methods.

2.2 Randomised Complete Block Design

Introduction

When examining possible treatment differences, it is often helpful to remove the effect of excess
variation through the use of blocking. A blocking variable is one that may a
ect the variation of

9
Rank Strain Mean Nitrogen content (mg)
1 3DOK1 28.8
2 3DOK5 24.0
3 3DOK7 19.9
4 Composite 18.7
5 3DOK4 14.6
6 3DOK13 13.3
âŹę Mean: 19.89
LSD (5%) 4.5
LSD (1%) 6.1

Table 1.6: Ordered Mean Nitrogen content

the response, but is unrelated to the primary hypothesis of interest. The desired result is to have
homogeneous experimental units within each block so that when the blocking effect is removed
(in the statistical analysis), all individuals can be considered homogeneous before receiving the
treatments. The error component in the ANOVA should then be smaller than in a design without
blocks. It should thus be easier to detect treatment differences.
The term randomised complete block design usually refers to a design where the number of experi-
mental units in each block is such that within each block each of the treatments can be randomly
assigned the same number of times. In this course we consider only designs in which each treat-
ment occurs exactly once in each block. The number of blocks is thus equal to the number of
replications.
Some examples of a randomised complete block designs follow.

Example 1-5 To compare the immune response of mice to the venom of four poisonous snakes,
venom is taken from adult male coral, copperhead, sidewinder, and pit viper snakes. One mouse
from each of seven litters is randomly assigned to the four snakes. Each receives minute amounts of
the venom of the corresponding snake by injection. The increase in antibody activity as measured
from a blood sample is the response.
The four treatments here are the four snakes of interest. Litter is a blocking variable since it is
not of primary interest to determine if differences in antibody activity exist between litters, but
instead to remove that component of variation that comes with differing litters.

Example 1-6 Before beginning a full-scale operation to promote recycling of metals in a large
county, a recycling agency conducts a study to compare recycling opportunities in the six largest
cities of that county. The primary question of interest is which of the cities should be the major
focus of the agency. To answer this question, the agency wishes to compare the amount of scrap
metal wasted by individuals in each of the cities.
Ten days of the year are randomly selected for scrap metal examination. On each of the ten days,
one randomly chosen garbage truck load (of equal size) from each city is checked for recyclable scrap
metal. The material is then weighed. The six cities are of primary interest. “City” is therefore the
treatment variable. The day of collection is the blocking variable. Any variation between days is
not of primary interest.

Example 1-7 A rice farmer has a choice among four fertilisers. To compare the fertilisers he
randomly selects four rows of his field which have b een planted with the same s eed. The plants on
a particular row can be expected to have identical environmental conditions, i.e. sunlight, water,

10
etc. Each row is divided into four segments. The four fertilisers are randomly assigned to the four
segments of each row.

Segment 1 Segment 2 Segment 3 Segment 4


Row 1 F1 F4 F3 F2
Row 2 F4 F3 F1 F2
Row 3 F4 F1 F3 F2
Row 4 F3 F2 F4 F1

Table 1.7: Randomised complete block design for Example 1-7

The response of interest is the length of the fruiting period, measured in days. The four fertilisers
constitute the primary factor of interest. “Row” is the blocking variable: if differences among rows
exist, then experimental error should be reduced and any possible fertiliser differences should be
easier to detect.

Example 1-8 A hardness testing machine operates by pressing a tip into a metal test “coupon.”
The hardness of the coupon can be determined from the depth of the resulting depression.
Four tip types are being tested to see if they produce significantly different readings. The coupons
might differ slightly in their hardness (for example, if they are taken from ingots produced in
different heats). Within a coupon it is likely that hardness will be fairly constant. Thus coupon
is a factor of secondary interest which can be treated as a blocking factor. Since coupons are
large enough to test four tips on, a RCBD can be used, with one coupon as a block. Four blocks
were used. Within each block (coupon) the order in which the four tips were tested was randomly
determined.
The results (readings on a certain hardness scale) are shown in Table 1.8.

Coupon
Type of Tip 1 2 3 4 Totals
1 9.3 9.4 9.6 10.0 38.3
2 9.4 9.3 9.8 9.9 38.4
3 9.2 9.4 9.5 9.7 37.8
4 9.7 9.6 10.0 10.2 39.5
Totals 37.6 37.7 38.9 39.8 GT = 154

Table 1.8: Results for Example 1-8

Null and alternative hypotheses

In each of the four examples the null hypothesis we are particularly interested in is that of no
treatment differences, i.e.
H0 : µ1 = µ2 = . . . = µt (if there are t treatments) and
H1 : not all the µi are equal

In addition there is a secondary null hypothesis that is usually of little interest in itself but can
show us whether blocking has been effective in reducing error variation:
H0 : µ1 = µ2 = . . . = µr (if there are r blocks) and
H1 : not all the µi are equal.

11
Both null hypotheses can be tested using the same analysis of variance table.

Construction of the ANOVA table

NB: The basic idea here is that the total variation among the observations can be broken up:

SSTotal = SSTreatments + SSBlocks + SSError

It is easy to calculate SSTotal, SSTreatments and SSBlocks, so SSError is usually obtained by


subtraction.
To show how these calculations are performed in general, consider the following typical RCBD
with t = 5 treatments, r = 4 blocks and therefore n = rt = 20 observations as shown in Table 1.9:

Blocks
Treatment 1 2 3 4 Treatment Means Totals
1 y11 y12 y13 y14 y10 T1
2 y21 y22 y23 y24 y10 T2
3 y31 y32 y33 y34 y10 T3
4 y41 y42 y43 y44 y10 T4
5 y51 y52 y53 y54 y10 T5
Means: y01 y02 y03 y04 ȳ GT
Totals B1 B2 B3 B4

Table 1.9: RCBD with t = 5, r = 4 and n = 20

Source of variation P 2SS 1 d.f.


1 2
Treatments r
1
P Ti2 − n1 GT 2 t−1
Blocks t Bi − n GT r−1
Error by subtraction (r − 1)(t − 1)
P 2 GT 2
Total x − n rt − 1 = n − 1

Table 1.10: Construction of ANOVA table

Let us apply this approach to the data of the RCBD described in Example 1-9.

Example 1-9 ANOVA for RCBD We wish to test

H0 : All tips give the same mean reading against the alternative
H1 : At least two tips give different mean readings

Of secondary importance is the test of:

H0 : All coupons give the same mean reading against the alternative
H1 : At least two coupons give different mean readings.

We carry out the necessary calculations:


X
x2 = 1483.54

We then construct the ANOVA table shown in Table 1.11:

12
Total SS 1483.54 − 1542 /16 = 1.290
Treatments SS (Tips) (38.32 + . . . + 39.52)/4 − 1542/16 = 0.385
Blocks SS (Coupons) (37.62 + . . . + 39.82)/4 − 1542/16 = 0.825
Error SS 1.290 − 0.385 − 0.825 = 0.080

Source of variation SS d.f. MS


Tips 0.385 t−1=4−1=3 0.12833
Coupons 0.825 r−1=4−1=3 0.27500
Error/Residual 0.080 (r − 1)(t − 1) = 9 0.00889
Total 1.290 15

Table 1.11: ANOVA for Example 1-9

As usual we use F-tests to test the null hypotheses of interest:


To test for treatment (tip) differences:
M STips
F = = 14.44 with 3 and 9 d.f.
M SError
Therefore p < 0.01 (from 1% F-tables), so reject H0 : the tip means are not all identical.
To test for block (coupon) differences:
M SCoupons
F = = 30.94 with 3 and 9 d.f.
M SError
Therefore p < 0.01 (from 1% F-tables) so reject H0 : coupon means are not all identical.
Note from the conclusion that there were highly significant differences between coupons. We can see
that including blocks (coupons) in the design and analysis was worthwhile – doing so significantly
reduced the error.
In the same way we can tackle the following experiment in which six different seeding rates of rice
were compared using four geographically defined blocks. The variable measured was yield.

Seeding Rate (kg/ ha)


25 50 75 100 125 150 Total
Block 1 5.1 5.3 5.3 5.2 4.8 5.3 31.0
Block 2 5.4 6.0 5.7 4.8 4.8 4.5 31.2
Block 3 5.3 4.7 5.5 5.0 4.4 4.9 29.8
Block 4 4.7 4.3 4.7 4.4 4.7 4.1 26.9
Total 20.5 20.3 21.2 19.4 18.7 18.8 GT=118.9

Table 1.12: Data for Example 1-10.

Example 1-10 We wish to test, using the data in Table 1.12.


H0 : All seeding rates give the same mean yield
H1 : At least two seeding rates give different mean yields

Of secondary importance is the test of:


H0 : All blocks produce the same mean yield
H1 : At least two blocks produce different mean yields

13
We carry out the necessary calculations:
X
x2 = 594.07

Total SS 594.07 − 118.92 /24 = 5.0200


Treatments SS (Rates) (20.52 + . . . + 18.82 )/4 − 118.92 /24 = 1.2675
Blocks SS (31.02 + . . . + 26.92 )/6 − 118.92 /24 = 1.9650
Error SS 5.0200 − 1.2675 − 1.9650 = 1.7875

Table 1.13: SS calculations for Example 1-10

We then construct the ANOVA table shown in Table 1.14:


Source of variation SS d.f. MS
Treatments 1.2675 t−1=6−1=5 0.2535
Blocks 1.9650 r−1=4−1=3 0.6550
Error/Residual 1.7875 (r − 1)(t − 1) = 15 0.1192
Total 5.0200 23

Table 1.14: Anova for Example 1-10

We again use F-tests to test the three null hypotheses of interest:


To test for treatment (seeding rate) differences:
M STreatments
F = = 2.127 with 5 and 15 d.f.
M SError
Therefore p > 0.05 (from 5% F-tables) so cannot reject H0 : the seeding rate means could well be
identical.
To test for block differences:
M SBlocks
F = = 5.495 with 3 and 15 d.f.
M SError
Therefore p < 0.01 (from 1% F-tables) so reject H0 : block means are not all identical.
Although blocks had a significant effect here, it still turned out to be impossible to detect any
treatment differences.

Example 1-11 This is intended to illustrate once more the possible benefits of blocking.
The ANOVA in Table 1.15 presents the results from a study which was carried out to look at the
difference in relative humidity in three different types of forest. In this study, the researchers used
a randomised complete block design, the blocks being based on the distance from the edge of the
forest. A statistical package has computed the P-values.
a) How many blocks did the researchers use?
b) Was the use of the randomised complete block design valuable? Explain.
c) What conclusions can be reached by these researchers about differences in the mean relative
humidity between the three forest types?
d) Below is the partially completed ANOVA that would have been found if the design had been
completely random instead of blocked, i.e. the ten measurements made in each forest type were at
randomly chosen points:

14
Source df SS MS F P-value
Forest Type 2 1663.6668 831.8334 3.608 0.0481
Distance 9 10877.1093 1208.5677 5.241 0.0014
Error 18 4150.4616 230.5812
Total 29 16691.2377

Table 1.15: ANOVA of Forest Relative Humidities

Source df SS MS F P-value
Forest Type 2 1663.6668 831.8334
Error
Total 29 16691.2377

Table 1.16: Incomplete ANOVA of Forest Relative Humidities

Complete the ANOVA and determine whether the conclusions reached by the previous researchers
would have been the same if the design had been completely random (CRD) instead of randomised
complete block (RCBD).
In STA2020F the emphasis is placed on interpretation, so you should feel comfortable about inter-
preting output from a spreadsheet or statistical package.

Example 1-12 A researcher conducted an experiment to compare the effects of three different
insecticides on a variety of string beans. To obtain a sufficient amount of data, it was necessary
to use four different plots of land. Since the plots had somewhat different soil fertility, drainage
characteristics, and sheltering from winds, the researcher decided to conduct a randomized complete
block design with plots serving as blocks. The response of interest was the number of seedlings
that emerged. A portion of output is shown in Table 1.17.

Source DF SS MS F P-val
Insecticide 2 1832 916.000 211.38
Plot 3 438 146.000 33.69
Error 6 26 4.333
Total 11 2296

Table 1.17: Output for Example 1-12

Write a brief summary of the conclusions that can be reached here, with p-values presented as
accurately as possible given the limitations of the F-tables.

Example 1-13 A taste-testing experiment has been designed so that four brands A to D
of Columbian coffee are to be rated by nine experts. The tasting sequence of the four brands
is randomly determined for each of the nine expert tasters until a rating on a 7-point scale (1
= extremely unpleasing, 7 = extremely pleasing) is given for each of four characteristics: taste,
aroma, richness, and acidity. Table 1.18 displays the ratings summed over all four characteristics.
The grand total is 847. The following incomplete output has been produced:
a) How was the value of 79.639 for SS Brands calculated?
b) What conclusions can be drawn about brands?
c) Were there significant differences between the expert tasters?

15
Blocks (Experts) A B C D Totals
E.B. 24 26 25 22 97
N.B. 27 27 26 24 104
M.D. 19 22 20 16 77
M.H. 24 27 25 23 99
B.J. 22 25 22 21 90
R.J. 26 27 24 24 101
B.K. 27 26 22 23 98
B.M. 25 27 24 21 97
J.S. 22 23 20 19 84
Totals 216 230 208 193 847

Table 1.18: Ratings of Columbian coffee brands

Source df SS MS F P-val
Coffee Brand 3 79.639
Expert 8 153.222
Error 24 24.111
Total 35 256.972

Randomized Block ANOVA Assumptions


(1) Each block has received all of the treatments assigned in a random order.
(2) The observations, i.e. values observed for a particular treatment in a particular block, come
from distributions that are normal.
(3) The variances of these normal distributions are all equal.

In the case of Example 1-13 above, then, we assume that there are 36 normal populations out
there, from each of which a value was observed in the experiment. Furthermore we assume these
populations have equal variance.
Note: the last two assumptions are hard to check since in this course each block-treatment combi-
nation always contains only one observation.

2.3 Two-way Analysis of Variance and Factorial Designs


In addition to being able to analyse an experiment with one independent variable, ANOVA can
be used for factorial designs (or designs which employ more than one independent variable). Note
that, in this context, independent variables are often referred to as factors. The values or categories
that each factor can assume are called levels. The factorial design is very popular in the social
sciences, biology, agricultural research and industrial experimentation. It has a few advantages
over single variable designs. The most important of these is that it can provide some unique
and relevant information about how variables interact or combine in the effect they have on the
dependent variable.

Assumptions
• The populations from which the samples were obtained must be normally or approximately
normally distributed.

16
• The samples must be independent.
• The variances of the populations must be equal.

When these assumptions do not hold, the analysis described below is not strictly valid. A researcher
might try transforming the data or using a nonparametric test.

Examples

Example 1-14 The first example comes from a study of the effects of alcohol consumption by
female rats on the learning ability of their offspring. Some female rats had access to chocolate milk
in their diet, others alcohol. Learning ability of the offspring was measured either when adolescent
or adult. The table below shows the design:

Age (Factor B)
Adolescent Adult
Maternal Diet Chocolate Milk 5 rats 5 rats
(Factor A) Alcohol 5 rats 5 rats

We call this a 2 × 2 factorial design (two independent variables or factors, each with two categories
or levels) with 5 replications (five offspring measured for each combination of levels).
The types of information this design can yield are:
Factor A: addresses whether maternal diet affects learning ability of offspring
Factor B: addresses whether learning ability of offspring varies with age
A×B interaction: addresses whether the effects of maternal diet on learning ability are the same
for adolescent and adult offspring.

Example 1-15 As another example consider planting maize. The type of maize seed and type
of fertilizer are the two factors being considered in this example. This is a 3 × 5 factorial design
with two replications.

Fert I Fert II Fert III Fert IV Fert V


Seed A-402 106, 110 95, 100 94, 107 103, 104 100, 102
Seed B-894 110, 112 98, 99 100, 101 108, 112 105, 107
Seed C-952 94, 97 86, 87 98, 99 99, 101 94, 98

Table 1.19:

Here we are concerned with possible differences in yield among types of seed, among types of
fertilizer and the possibility that the two factors may interact.
NB: For two-way ANOVA the method rests on the following algebraic result:
Total SS = Factor A SS + Factor B SS + Interaction SS + Error SS

It is not difficult to calculate these sums of squares by hand along with the degrees of freedom
corresponding to each, as shown in Table 1.20.
Note that you will only encounter balanced designs in this course, i.e. those where the number of
observations per cell is constant.
To show how these calculations are done in practice, consider a third example:

17
Source of Variation SS P 2 df
P Ta2i ( x)
Factor A ni − P N = SSA a−1
P Tb2j ( x)
2

Factor B nj − PN = SSB b−1


2
P Cl2 ( x )
Interaction nl − N − SSA − SSB = SSI (a − 1)(b − 1)
Error Total SS − SSA − SSB − SSI ab(nl − 1)
P 2 ( x)2
P
Total x − N N −1

where

N = total number of observations


a = number of levels of Factor A
b = number of levels of Factor B
Tai = totals for the ith level of Factor A
Tbj = totals for the j th level of Factor B
C1 = totals for cells
ni = number of observations in the ith level of Factor A
nj = number of observations in the j th level of Factor B
nl = number of observations per cell (number of replications)

Table 1.20: Two-way Analysis of Variance

Example 1-16 Three counts (numbers of individuals per 10 m2 ) in four seasons for two dif-
ferent species of stick insect were determined with the results in Table 1.21. Analyse and interpret
these data.
There are three sets of null and alternative hypotheses:

H0 : Species has no effect on numbers of stick insects i.e. means are same for both species
H1 : Mean numbers are not the same for both species

H0 : Season has no effect on numbers of stick insects i.e. season means are equal
H1 : Mean numbers are not the same for all species

H0 : There is no interaction between season and species on stick insect numbers


H1 : The two factors interact

Calculations:
We can then construct the following ANOVA table:
As usual we use F-tests to test the three null hypotheses of interest:
To test for significant interaction:
MSI 242.49
F = = = 60.62 with 3 and 16 d.f.
MSError 4.00
Therefore p < 0.01 (from 1% F-tables) so reject H0 : there is a significant i nteraction between
species and season on stick insect numbers.

18
Season Stick insect species Total
Megacrania sp Extatosoma sp
Spring 15 13
18 (55) 12 (36) 91
22 11
Summer 12 15
14 (42) 19 (55) 97
16 21
Autumn 10 23
11 (30) 25 (74) 104
9 26
Winter 6 30
8 (21) 29 (90) 111
7 31
148 255 403

Table 1.21: Data for Example 1-16

x2 = 8073
P
P 2 ( x) 2
P
2
Total SS x − N = 8073 − 403 24 = 8073 − 6767.04 = 1305.96
P 2 P 2
Ti ( x) 2
+2552
Species SS n − N = 148 12 − 6767.04 = 477.04
Pi 2 P 2
Bj ( x) 912 +972 +1042 +1112
Season SS − N = − 6767.04 = 37.46
Pnj 2 P 2 6
Cl ( x)
Interaction SS nl − N − T ra SS − T rb SS
2 2 2 2 2
+552 +742 +902
= 55 +42 +30 +21 +36 3 − 477.04 − 37.46 = 727.46
Error SS Total SS − SSA − SSB − SSI
= 1305.96 − 477.04 − 37.46 − 727.46 = 64.00

Table 1.22: Calculations for Example 1-16

Source of Variation SS df MS
Species 477.04 a−1=2−1=1 477.04
Season 37.46 b−1=4−1=3 12.49
Interaction 727.46 (a − 1)(b − 1) = 3 242.49
Residual 64.00 ab(nI − 1) = 2 × 4(3 − 1) = 16 4.00
Total 1305.96 23

Table 1.23: Anova table for Example 1-16

19
Effect of Species:
MSA 477.04
F = = = 119.26 with 1 and 16 d.f.
MSError 4.00
Therefore p < 0.01, so reject H0 : species has a significant effect on stick insect numbers.
Effect of season:
MSB 12.49
F = = = 3.13 with 3 and 16 d.f.
MSError 4.00
Therefore p > 0.05, so accept H0 : season has no effect on stick insect numbers.
Interpretation:
The easiest way to interpret an interaction is to graph the cell means, as seen in Figure 1.3.

30

20
Mean Number

Species
1:
2:

10

1 2 3 4
(Spring) (Summer) (Autumn) (Winter)

Season

Figure 1.3: Plot of cell means for Example 1-16.

• For Megacrania, the numbers of individuals decreases from Spring to Winter, but for Extato-
soma numbers of individuals increases from Spring to Winter.
• There is a greater number of Extatosoma than Megacrania.

20
Note: when a significant interaction is present (as in this example), the interaction effect is usually
of much greater interest than the effects of Factor A and Factor B, and the latter should be
interpreted with caution.
In STA2020F we are more concerned with interpretation than with the detailed calculations. Most
ANOVA is performed using a spreadsheet or statistical package and you should be able to under-
stand and interpret output from such packages. Consider Example 1-15. A spreadsheet was used
to analyse the data and the following output was obtained:

Source of Variation SS df MS F P-value F-crit


Seed 512.8667 2 256.4333 28.283 0.000008 3.682
Fertilizer 449.4667 4 112.3667 12.393 0.000119 3.056
Interaction 143.1333 8 17.8917 1.973 0.122090 2.641
Within 136.0000 15 9.0667
Total 1241.4667 29

Table 1.24: Spreadsheet output for Example 1-15

Note that differences between seed types and between types of fertilizer are highly significant but
there is insufficient evidence to conclude that these two factors interact.
As an exercise, illustrate the absence of significant interaction by graphing the cell means as was
done in Example 1-16.

Example 1-17 You have been called in as a consultant to help a manufacturer determine the
best method of applying a reflective stripe. There are two ways of applying the stripe (paint or
coated adhesive tape) and three types of flooring to which the stripe must be applied (Linoleum, I
Concrete or II Concrete). You have set up a factorial design with three replications. The dependent
variable is number of errors per 300 m of stripe applied. The results are shown in Table 1.25.

Linoleum I Concrete II Concrete


Paint 10.7 10.8 12.2
10.9 11.1 12.3
11.3 10.7 12.5
Adhesive 11.2 11.9 10.9
11.6 12.2 11.6
10.9 11.7 11.9

Table 1.25: Data for Example 1-17

After statistical analysis, the output in Table 1.26 was obtained.

Source DF SS MS F P
Stripe 1 0.10889 0.10889 1.07 0.321
Flooring 2 1.96000 0.98000 9.64 0.003
Interaction 2 2.83111 1.41556 13.92 0.001
Error 12 1.22000 0.10167
Total 17 6.12000

Table 1.26: Analysis output for Example 1-17

Make sure that:

21
(1) you understand how the degrees of freedom were obtained;

(2) you can calculate SSTotal, SSStripe and SSFlooring;


(3) you can draw the appropriate conclusions about the three null hypotheses of interest to the
manufacturer;
(4) you can illustrate the nature of the interaction graphically.

22

Common questions

Powered by AI

In two-way ANOVA, if a significant interaction effect is present, it means that the effect of one factor on the response variable changes depending on the level of the other factor. This can make the interpretation of the main effects misleading, as it suggests that these effects are not consistent across all levels of the other factor. Thus, interpretations should focus more on interaction effects rather than main effects. When a significant interaction is detected, interpreting the main effects should be done with caution or avoided, as the interaction may provide more insight into the data behavior .

A randomised complete block design reduces variability by accounting for potential sources of variability before treatment assignment. Subjects within each block are similar concerning certain characteristics, which minimizes the impact of these confounding variables. By contrast, a completely randomised design assigns treatments without regard to grouping, which can increase error variability and obscure treatment effects. The use of blocks leads to more precise estimates of treatment effects by effectively isolating and controlling variability from extra-experimental sources .

The calculation of sum of squares (SS) in ANOVA is crucial as it quantifies the total variation in the data, which is divided into components attributable to different sources of variance like treatment and error. Treatment SS represents the variation between group means, while Error SS accounts for variation within groups. The Total SS, a sum of the Treatment SS and Error SS, is used to determine the F-statistic, which tests if the variation between groups is significantly different from zero. This partitioning of variance is central to identifying whether the independent variable has a significant effect .

Degrees of freedom in an ANOVA test represent the number of independent values or quantities that can vary in the calculation of a statistic. It is calculated as the total number of observations minus the number of groups. The importance lies in its role in determining the critical F-value for statistical significance. Proper calculation affects the validity of ANOVA's results, as it influences the estimation of mean squares, F-statistic, and the overall significance of the test. Accurate degrees of freedom are essential for meaningful and reliable interpretation of ANOVA results .

A factorial design investigates the effect of two or more factors simultaneously, allowing for the study of interaction effects between factors, which is not possible in a one-way design. Each factor is set at different levels, and all possible combinations of these levels are tested. This contrasts with a one-way design, where only one independent variable is tested with two or more levels, focusing only on the main effect without considering interactions. The factorial design is more comprehensive and efficient for complex experiments .

Block size significantly impacts the effectiveness of a block design. Smaller block sizes can increase the homogeneity among experimental units, improving the clarity of treatment effects. However, if the block size is too small, it may limit the representation of variability inherent in larger samples, reducing the external validity of the results. Conversely, larger block sizes may contain more variability within blocks, potentially diluting treatment effects. The ideal block size balances mitigating extraneous variability while maintaining sufficient experimental power .

In the treatment-by-flooring study, ANOVA revealed a significant interaction effect between stripe application methods and flooring types (F=13.92, p=0.001). This indicates that the effectiveness of the stripe applications varies across different flooring types. As the interaction effect is significant, it suggests that the choice of application method depends on the type of flooring, emphasizing the importance of considering both factors together when determining the best application method .

In the snake venom study, a randomised complete block design was used to examine the immune response of mice to the venom of four poisonous snakes. Mice from seven different litters were treated as blocks, and each mouse within a block was randomly assigned to one of the four snake venom treatments. This design helped control for variability in antibody activity due to differences in litters, focusing analysis on the effect of venom treatments alone .

One-way ANOVA determines if there are significant differences among group means by comparing the variance between the groups to the variance within the groups. If the variance between the groups is significantly greater than the variance within the groups, it is concluded that not all group means are equal. This method assumes that each group is normally distributed, the groups have equal variances, and the observations are independent .

Blocking in experimental design involves grouping experimental units into blocks that are similar with respect to certain uncontrolled variables. By doing this, the variability due to these uncontrolled variables is removed from the experimental error. The effect of blocking is to reduce the error variance, making it easier to detect treatment differences in statistical analysis. In a randomized complete block design, treatments are assigned randomly to units within each block .

You might also like