You are on page 1of 26

Design of Experiments

and ANOVA
Dr. Tanvir Ahmad
Department of Statistics
Government College University Faisalabad

Dr Tanvir Ahmad 8/24/2019


Design of experiments

Basic Principles
Randomization
Replication
Blocking or Local Control

Dr Tanvir Ahmad 8/24/2019


Design

 Completely Randomized Design (CRD)


 Complete Block Design
 Randomized Complete Block Design (RCBD)
 Latin Squares design
 Graeco Latin Squares Design
 Factorial Design
 Response Surface Design

Dr Tanvir Ahmad 8/24/2019


CRD RCBD
Four Treatments (A, B, C, D) Four Treatments (A, B, C, D), 3 Blocks

C A B D Block 1 D B A C

C B C A Block 2 A C B D

A D D B Block 3 B D C A

Model Model

Y=μ+τi+ϵ Yij=μ+τi+βj +ϵij

Dr Tanvir Ahmad 8/24/2019


Latin Squares Design Graeco Latin Squares Design
Treatments (A, B, C, D) Two Extraneous variables
Treatments (A, B, C, D) Three Extraneous variables

Column Variable Column Variable

1 2 3 4 1 2 3 4
Row Variable

Row Variable
1 D B A C 1 Aα Bβ Cϒ Dф
2 A C B D 2 Bϒ Aф Dα Cβ
3 B D C A 3 Cф Dϒ Aβ Bα
4 D B A C 4 Dβ Cα Bф Aϒ
Model
Model
Yijk=μ+τi+αj+βk+ϵijk Yijkl=μ+τi+αj+βk+θl+ϵijkl
Dr Tanvir Ahmad 8/24/2019
ANOVA
Assumptions:
1. Dependent variable should be measured at the continuous level (i.e.,
they are interval or ratio variables). Examples of continuous variables
include revision time (measured in hours), intelligence (measured
using IQ score), exam performance (measured from 0 to 100), weight
(measured in kg), and so forth.
2. Independent variable/s should consist of two or more categorical,
independent groups. Typically, a one-way ANOVA is used when we
have three or more categorical, independent groups. For example
ethnicity (e.g., 3 groups: Asian, European and Hispanic), temperature
level (e.g., 4 groups: sedentary, low, moderate and high), profession
(e.g., 5 groups: surgeon, doctor, nurse, dentist, therapist), and so
forth.

Dr Tanvir Ahmad 8/24/2019


One-Way ANOVA Test
Testing multiple levels of a factor
 One-variable-of-classification ANOVA: Data is divided into k classes on
the basis of single criterion. Technical term for a class is ‘Treatment’.
 k treatments(or k levels of a treatment), selected randomly and
independently from k normal populations with means μ1, μ2, . . ., μk and
common variance.
 Applied on k experimental units and response were observed as
dependent variable

Dr Tanvir Ahmad 8/24/2019


Example-1
These are the earnings of three
salesmen for five consecutive
Salesman 1 Salesman 2 Salesman 3 weeks.
140 170 145 Research question:

150 185 138


Test whether difference between
average earning of salesmen is
160 196 160 statistically significant.
165 180 142 H0 : μ1 = μ2 = μ3 (No difference)
H1 : Not all averages are equal

Dr Tanvir Ahmad 8/24/2019


ANOVA Table
Source of Degree of Sum of Mean
F-ratio P-value
variation freedom squares Squares

Between P<α
a-1 SSTreat MSTreat MSTreat / MSError
Treatments significant

Within
Treatments a(N-1) SSError MSError
(Error)

Total Na-1 SSTotal


Dr Tanvir Ahmad 8/24/2019
SPSS
Demonstration
One-Way ANOVA

Dr Tanvir Ahmad 8/24/2019


Two-Way ANOVA
 Each observation is classified according to two
criteria (or variables) of classification.
 Two independent sources of variation
 Treatment
 One extraneous source of variation

Dr Tanvir Ahmad 8/24/2019


Four breeds of cattle B1, B2, B3 and
Example 2 B4 were fed on three different
rations R1 , R2 and R3. Gains in
B1 B2 B3 B4 weight in pounds over a specified
period were recorded in the table.

R1 46.5 62.0 41.0 45.0


Research Hypothesis:
R2 47.5 41.5 22.0 31.5 There is no difference in the mean
gains in weight for

R3 50.0 40.0 25.5 28.5 H01 : All four breeds


H02 : All three rations

Dr Tanvir Ahmad 8/24/2019


SPSS
Demonstration
Two-Way ANOVA

Dr Tanvir Ahmad 8/24/2019


Two-Way ANOVA Table

Source of Degree of Sum of Mean


F-ratio P-value
variation freedom squares Squares

Between MSRowTreat / P<α


r-1 SSRowTreat MSTreat
Rows MSError significant

Between SSColumnTreat MSColumnTreat / P<α


c-1 MSTreat
Columns MSError significant

Error (r-1)(c-1) SSError MSError

Total
Dr Tanvir Ahmad
rc-1 SSTotal 8/24/2019
Repeated Measure ANOVA
 Repeated measures ANOVA is equivalent to the
one-way ANOVA, but for related, not
independent groups, and is the extension of
the paired t-test. Also referred to as a within-
subjects ANOVA or ANOVA for correlated
samples.
 This particular test requires one
categorical/grouping variable (either nominal
or ordinal) and one dependent variable which
needs to be continuous (interval or ratio).
Dr Tanvir Ahmad 8/24/2019
Two types of study for a repeated measures ANOVA.
Studies that investigate either

1. Changes in mean scores over three or more time points.


You might be investigating the effect of a 6-month exercise
training program on blood pressure and want to measure
blood pressure at 3 separate time points (pre-, midway and
post-exercise intervention), which would allow you to
develop a time-course for any exercise effect.

Dr Tanvir Ahmad 8/24/2019


Dr Tanvir Ahmad 8/24/2019
OR

2. Differences in mean scores under three or more


different conditions.

You might get the same subjects to eat different types of


cake (chocolate, caramel and lemon) and rate each one for
taste, rather than having different people flavour each
different cake.
The important point with these two study designs is that
the same people are being measured more than once on the
same dependent variable (that is why called repeated
measures).
Dr Tanvir Ahmad 8/24/2019
Dr Tanvir Ahmad 8/24/2019
Repeated-Measures ANOVA in SPSS
Correct data formatting for a repeated-measures ANOVA in SPSS involves
having a single line of data for each participant, with the repeated
measures entered as separate variables on that same line (in this example,
they are called “trial1,” “trial2,” “trial3,” and “trial4”).
 Use the first pop-up dialog box to define your repeated-measures factor
– this is how you tell SPSS that the four different “trial” variables are
really all a single person’s scores over time on one variable. Give your
variable a name (like “trial”), and specify how many different levels it
has (i.e., how many times the observation was repeated). Be sure to
then hit the “Add” button so that the new variable appears on a list.
You can create multiple repeated-measures variables at this step if you
need to.
Dr Tanvir Ahmad 8/24/2019
 Then click on “Define.”
 Select the columns in your dataset that represent the various levels of
the repeated-measures variable, and use the arrow button to move
them into the “blanks” in the right-hand column.
 Next, specify your model. The within-subjects factors represent scores
on the Dummy Variables at each trial. For predictors, enter grouping
variables (e.g., treatment vs. control) as “between-subjects factors,”
and other interval/ratio-level predictors as “covariates.”
 Use the “Options” button to open this window, and click on the check-
box to select “Homogeneity Tests.” This will allow you to test the
homogeneity of variance assumption for the repeated-measures
dependent variable.

Dr Tanvir Ahmad 8/24/2019


 This window also shows you all the different interactions that will be
tested as part of your analysis. If you don’t want all of these results,
you can select just specific main effects and interactions by using the
“Model” button in the main dialog window. Click “Continue” to go on.
 This approach assumes that there is some change from each time period
to the next on the repeated measure.
 The significant p-values show an effect of time (trial) on the dependent
variable – a within-subjects effect reflected by the repeated measures.
All four multivariate tests also show a significant interaction between
trial and anxiety level, meaning that the level of anxiety induced in the
participant had a significant effect on their performance over time. The
effect of tension, by contrast, did not reach conventional levels of
statistical The effect of tension, by contrast, did not reach conventional
levels of statistical significance.
Dr Tanvir Ahmad 8/24/2019
Real life example
Consider the example of a 6-month exercise-training
intervention where six subjects had their fitness level
measured on three occasions: pre-, 3 months, and post-
intervention. Their data is shown below along with some
initial calculations:
Dr Tanvir Ahmad 8/24/2019
Dr Tanvir Ahmad 8/24/2019
Dr Tanvir Ahmad 8/24/2019

You might also like