Title: Two-way Analysis of Variance
1Two-way Analysis of Variance
- Two-way ANOVA is a type of study design with one
numerical outcome variable and two categorical
explanatory variables. - Example In a completely randomised design we
may wish to compare outcome by age, gender or
disease severity. Subjects are grouped by one
such factor and then randomly assigned one
treatment. - Technical term for such a group is block and the
study design is also called randomised block
design
2Randomised Block Design
- Blocks are formed on the basis of expected
homogeneity of response in each block (or group). - The purpose is to reduce variation in response
within each block (or group) due to biological
differences between individual subjects on
account of age, sex or severity of disease.
3Randomised Block Design - 3
- Randomised block design is a more robust design
than the simple randomised design. - The investigator can take into account
simultaneously the effects of two factors on an
outcome of interest. - Additionally, the investigator can test for
interaction, if any, between the two factors.
4Steps in Planning a Randomised Block Design
- Subjects are randomly selected to constitute a
random sample. - Subjects likely to have similar response
(homogeneity) are put together to form a block. - To each member in a block intervention is
assigned such that each subject receives one
treatment. - Comparisons of treatment outcomes are made within
each block
5Analysis in Two-way ANOVA - 1
- The variance (total sum of squares) is first
partitioned into WITHIN and BETWEEN sum of
squares. Sum of Squares BETWEEN is next
partitioned by intervention, blocking and
interaction
SS TOTAL
SS BETWEEN
SS WITHIN
SS INTERVENTION
SS BLOCKING
SS INTERACTION
6Two-way ANOVA
method. And an interaction between gender and
teaching method is being sought. Analysis of
Two-way ANOVA is demonstrated in the slides that
follow. The study is about a n experiment
involving a teaching method in which professional
actors were brought in to play the role of
patients in a medical school. The test scores of
male and female students who were taught either
by the conventional method of lectures, seminars
and tutorials and the role-play method were
recorded. The hypotheses being tested
are Role-play method is superior to conventional
way of teaching. Female students in general have
better test scores than male students. Role-play
method makes a better impact on students of a
particular gender. Thus, there are two factors
gender and teaching method. And an interaction
between teaching method and gender is being
sought.
7Analysis in Two-way ANOVA - 2
- Each Sum of Squares (SS) is divided by its degree
of freedom (df) to get the Mean Sum of Squares
(MS). - The F statistic is computed for each of the three
ratios as - MS INTERVENTION MS WITHIN
- MS BLOCK MS WITHIN
- MS INTERVENTION MS WITHIN
8Analysis of Two-way ANOVA - 3
- Analysis of Variance for score
- Source DF SS MS F
P - sex 1 2839 2839 22.75
0.000 - Tchmthd 1 1782 1782 14.28
0.001 - Error 29 3619 125
- Total 31 8240
-
9Analysis of Two-way ANOVA - 4
- Individual 95 CI
- Sex Mean -------------------------
------------- - 0 58.5
(------------) - 1 39.6 (-------------)
- -------------------------
------------- - 40.0 48.0
56.0 64.0 - Individual 95 CI
- Tchmthd Mean -------------------------
------------- - 0 56.5
(--------------) - 1 41.6 (---------------)
- -------------------------
------------- - 42.0 49.0
56.0 63.0
10Analysis of Tw0-way ANOVA - 5
Analysis of Variance for SCORE Source
DF SS MS F
P SEX 1 2839
2839 22.64 0.000 TCHMTHD 1
1782 1782 14.21 0.001 INTERACTN
1 108 108 0.86
0.361 Error 28 3511
125 Total 31 8240
Interaction is not significant P 0.361
11Analysis of Two-way ANOVA - 6
Individual 95 CI SEX Mean
-------------------------------------- 0
58.5
(------------) 1 39.6
(-------------)
--------------------------------------
40.0 48.0 56.0
64.0 Individual 95
CI TCHMTHD Mean ----------------------
---------------- 0 56.5
(--------------) 1
41.6 (---------------)
--------------------------------------
42.0 49.0 56.0
63.0
12Analysis of Two-way ANOVA by the regression
method (reference coding)
The regression equation is SCORE 65.9 - 18.8
SEX - 14.9 TCHMTHD Predictor Coef
SE Coef T P Constant
65.913 3.420 19.27 0.000 SEX
-18.838 3.950 -4.77
0.000 TCHMTHD -14.925 3.950
-3.78 0.001 S 11.17 R-Sq 56.1
R-Sq(adj) 53.1 Analysis of Variance Source
DF SS MS F
P Regression 2 4620.9
2310.4 18.51 0.000 Residual Error 29
3619.0 124.8 Total 31
8239.8
13Analysis of Two-way ANOVA by the regression
method (effect coding)
The regression equation is SCORE 49.0 - 9.42
EFCT-Sex - 7.46 EFCT-Tchmthd - 1.84
Interaction Predictor Coef SE
Coef T P Constant 49.031
1.980 24.77 0.000 EFCT-Sex
-9.419 1.980 -4.76 0.000 EFCT-Tch
-7.463 1.980 -3.77
0.001 Interact -1.838 1.980
-0.93 0.361 S 11.20 R-Sq 57.4
R-Sq(adj) 52.8
14Reference Coding and Effect Coding - 1
- In both methods, for k explanatory variables k-1
dummy variables are created. - In reference coding the value 1 is assigned to
the group of interest and 0 to all others (e.g.
Female 1 Male 0). - In effect coding the value -1 is assigned to
control group 1 to the group of interest (e.g.
new treatment), and 0 to all others (e.g. Female
1 Male (control group) -1 Role Play 1
conventional teaching (control) -1).
15Reference Coding and Effect Coding - 2
- In reference coding the ß coefficients of the
regression equation provide estimates of the
differences in means from the control (reference)
group for various treatment groups. - In effect coding the ß coefficients provide the
differences from the overall mean response for
each treatment group.