Sunteți pe pagina 1din 20

TWO-WAY A N O VA

TWO-WAY ANOVA
The two-way analysis of variance is an extension to the
one-way analysis of variance. There are two independent
variables (hence the name two-way).

Assumptions
The populations from which the samples were obtained must be
normally or approximately normally distributed.
The samples must be independent.
The variances of the populations must be equal.
The groups must have the same sample size.
Hypotheses

There are three sets of hypothesis with the two-way ANOVA.

The null hypotheses for each of the sets are given below.
The population means of the first factor are equal. This is like
the one-way ANOVA for the row factor.

The population means of the second factor are equal. This is like
the one-way ANOVA for the column factor.

There is no interaction between the two factors. This is similar to


performing a test for independence with contingency tables.
Factors

The two independent variables in a two-way ANOVA are


called factors. The idea is that there are two variables,
factors, which affect the dependent variable.

Each factor will have two or more levels within it, and
the degrees of freedom for each factor is one less than
the number of levels.
Treatment Groups

Treatment Groups are formed by making all possible


combinations of the two factors. For example, if the first
factor has 3 levels and the second factor has 2 levels, then
there will be 3x2=6 different treatment groups.

As an example, let's assume we're planting corn. The type


of seed and type of fertilizer are the two factors we're
considering in this example. This example has 15 treatment
groups. There are 3-1=2 degrees of freedom for the type of
seed, and 5-1=4 degrees of freedom for the type of
fertilizer. There are 2*4 = 8 degrees of freedom for the
interaction between the type of seed and type of fertilizer.
Main Effect
The main effect involves the independent variables one
at a time. The interaction is ignored for this part. Just
the rows or just the columns are used, not mixed. This
is the part which is similar to the one-way analysis of
variance. Each of the variances calculated to analyze
the main effects are like the between variances

Interaction Effect

The interaction effect is the effect that one factor has


on the other factor. The degrees of freedom here is the
product of the two degrees of freedom for each factor.
Within Variation

The Within variation is the sum of squares within each


treatment group. You have one less than the sample size
(remember all treatment groups must have the same
sample size for a two-way ANOVA) for each treatment
group. The total number of treatment groups is the
product of the number of levels for each factor. The
within variance is the within variation divided by its
degrees of freedom.

The within group is also called the error.


F-Tests

There is an F-test for each of the hypotheses, and the


F-test is the mean square for each main effect and the
interaction effect divided by the within variance. The
numerator degrees of freedom come from each effect,
and the denominator degrees of freedom is the degrees
of freedom for the within variance in each case.
Two-Way ANOVA Table

Sources of Sum of Degress of Mean F value


Variation Squares Freedom Square
Between
Columns SSBc c-1 MSBc MSBc/MSW
Row SSBr r-1 MSBr MSBr/MSW
Interaction (c-1)(r-1) MSBcr/MSW
SSBcr MSBcr

Within SSW N-cr MSW


Total SST N-1
Two-Way ANOVA notation:

x - the individual measurement


c - the number of different samples or treatment in column factor
r - the number of different samples or treatment in row factor
fi - sample i or treatment i of column factor
gi - sample i or treatment i of row factor
Tfi - the sum of values in sample i of column factor
Tgi - the sum of values in sample i of row factor
N - the total number of observations in all samples (column and row
samples)
x - the sum of values in all samples (column and row samples)
x2 - the sum of the squares of the values in all samples (column and
row samples)
Model of A Two-Way ANOVA Design

Column Factor, C

f1 f2 f3
l1 m1 o1
r1 l2 m2 o2
l3 m3 o3
Row Factor, R p1 q1 s1
r1
p2 q2 s2
p3 q3 s3
a1 b1 h1
r3
a2 b2 h2
a3 b3 h3
Calculations
Treatment f1 f2 f3 (xr) (xr2) nr
r1 xl = l1+l2+ = T11 xm = m1+m2+ = T21 xo = o1+o2+ = T31 Tr1 (xr12) nr1
(x1)2 = l12+l22+ (xm)2 = m12+m22+ (xo)2 = o12+o22+
n11 n21 n31
r2 xp = p1+p2+ = T12 xq = q1+q2+ = T22 xs = s1+s2+ = T32 Tr2 (xr22) nr2
(xp)2 = p12+p22+ (xq)2 = q12+q22+ (xs)2 = s12+s22+
n12 n22 n31
r3 xa = a1+a2+ = T13 xb = b1+b2+ = T23 xh = h1+h2+ = T33 Tr3 (xr32) nr3
(xa)2 = a12+a22+ (xb)2 = b12+b22+ (xh)2 = h12+h22+
n13 n23 n33
(xf) Tf1 Tf2 Tf3 xt

(xf2) (xf12) (xf22) (xf32) xt2


nf nf1 nf2 nf3
N
Critical value of F

Source of variation Numerator df Denominator df


Column c-1 N-cr
Row r-1 N-cr
Interaction (c-1)(r-1) N-cr
Example

The table shows data obtained in an animal


experiment designed to study the effects of two
variables on measures of performance of rats in a
maze test. Three strains of rats were used: bright,
mixed, and dull. A group from each strain was
reared under free or restricted environmental
conditions.
Strain
Environme Bright Mixed Dull
nt
Free 26 14 41 82 36 87
41 16 26 86 39 99
28 29 45 59 59 126
92 31 37 27 27 104
Restricted 51 35 39 114 42 133
96 36 104 92 92 124
97 28 130 87 156 68
22 76 122 64 144 142
During development of a multi-residue
supercritical fluid extraction method for the
extraction of benzimidazole residues from
animal liver, Danaher et aL. investigated the
influence on recovery rates of varying several
method parameters, each over two levels. The
percentage recovery results of a replicated study
are shown in the following table for
triclabendazole (TCB). The factors varied were
C02 volume (40,80 L) and Pressure (248, 543
bar). Analyze the data using two-way analysis of
variance.

S-ar putea să vă placă și