Académique Documents
Professionnel Documents
Culture Documents
By
Prof. Dr. H.M. Edi Armanto Faculty of Agrotechnology and Food Science, UMT - Malaysia
Describe factorial ANOVA technique. Conduct and interpret factorial ANOVA. Describe two-way interaction effects. Report factorial ANOVA results appropriately.
In the last lecture I suggested that analysis of variance was more powerful than t-tests because it enabled you to compare more than two groups. However, in one-way ANOVA, all of the groups represent levels of the same experimental variable (e.g. outside weather conditions had three levels raining, snowing and sunny). What happens if you want to examine the effect of more than one independent variable?
Measurements (e.g.)
1) Survey score in agricultural market study 2) Plant size at time x for agricultural study
Example 1:
Factorial Experiment
We wanted to know how girls & boys from single sex or mixed schools do in a maths test. We might be interested in whether there were differences in performance due to gender, or differences in performance due to type of school. Two (2) independent variables
We wanted to know how gender (boy/girl) & schooling (mixed/single sex) affects maths problemsolving. We tested the maths problem-solving ability of 4 groups of school children. Boys in mixed schools Boys in single sex schools. Girls in mixed schools. Girls in single sex schools. Subjects were given 30 minutes to solve as many maths problems as possible.
Entering data In Variable View, enter variables: Gender, School, Scores. Gender & School variables are assigned values for each of their levels.
Entering data In Data View, for each subject enter their gender type (girl or boy), School type (single or mixed) and score.
Calculating 2-way independent samples ANOVA: Go to Analyze, select GLM, and selection Univariate.
Homogeneity of Variance test If p < 0.05, the samples have different variances and you must use correction. If p > 0.05, the samples do not differ and you can continue with the ANOVA.
If the significance obtained > 0.05 , so the variance of each sample is homogeneous. If the significance obtained < 0.05 , so the variance of each sample is not homogeneous.
p e s n e e c a a d o u F a i f g a
b
0 3 0 0 1 0 6
I n 0 1 0 0 0 0 0 0 1 0 0 0 0 6 0 1 0 0 0 0 0
0 1 0 0 0 0 0 *
0 6 0 T 0 0
0 9 T a b
Reporting results
Table 1: mean problems solved (with standard deviations) by girls and boys in mixed and single sex schools.
gender boys school mixed single 15 (2) 15 (2) girls 18 (2) 18 (2)
We used a between subjects design to examine maths problem-solving in girls and boys from single and mixed sex schools. Mean problems solved in is shown in Table 1. Data were analysed using a 2 (gender) x 2 (school) ANOVA. There was a significant main effect of gender, F(1, 36) = 22.50, p<0.01. More problems were solved by girls than by boys. There was no significant main effect of school, F(1,36) = 0.00, p > 0.05, and no interaction of gender and school, F(1,36) = 0.00, p > 0.05.
What do I mean by interactions? Three possible outcomes in experiments containing 2 independent variable. 1 One variable causes differences in scores, and other variable has no effect. 1 Both variables have separate effects on the scores. 3 Scores might be determined by an interaction of the two variables.
mixed
single
mixed
single
mixed
single
Same experiment. We examined problem solving in boys and girls from mixed and single sex schools.
We enter and analyse the data in exactly the same way as was done in the first example.
First examine descriptive statistics Then homogeneity of variance (this was ok!).
t i
p e s n e e c a a d o u F a i f g a
b
0 3 0 0 1 0 6
I n 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0
0 1 0 0 0 0 6 *
0 6 0 T 0 0
0 9 T a b
Reporting results Say what you did in experiment. Present mean results in text or table or graph (but not all 3). State main effects and interaction obtained from ANOVA giving df, F-ratio & p-value.
We used a between subjects design to examine maths problem-solving in girls and boys from single and mixed sex schools. The mean problems solved is shown in Table 1. Data were analysed using a 2 (gender) x 2 (school) ANOVA. There was no significant main effect of gender, F(1,36) = 0.00, p > 0.05, and no significant main effect of school, F(1,36) = 0.00, p > 0.05. However, there was a significant interaction of gender and school, F(1,36) = 22.50, p < 0.05. More problems were solved by boys in single sex than mixed sex schools, and more problems were solved by girls in mixed than single sex schools.
Table 1: mean problems solved (with standard deviations) by girls and boys in mixed and single sex schools.
gender boys school mixed single 15 (2) 18 (2) girls 18 (2) 15 (2)
What if your 2 (or more) variables have a different number of levels? This would be an error on your part. You must use variables with the same number of levels. Otherwise you cant analyse the results. What about post hoc tests? These are used when you variables have more than 2 levels. You can use bonferroni, or other appropriate tests. Although, its always best to consult the text book before using them.
Final things I havent told you What happens if the same subject contributes scores to all levels of the experimental variables? This is called a repeated measures design and is covered in the next lecture. What happens if different subjects contribute scores to different levels of one variable (say gender), but contribute scores to all levels of another variable?
This is called a mixed or split-plot design, and is covered in the next lecture.
Example 2:
Factorial Experiment
TABLE 1
Two Hypothetical Sets of 2 x 2 Factorial Data: One with, and Another without, Interaction between Two Factors (Variety and nitrogen Rate)
Rice Yield, t/ha Variety 0 kg N/ha (N0) 60 kg N/ha (N1) Average
No Interaction X Y Average X Y Average 1.0 2.0 1.5 1.0 2.0 1.5 3.0 4.0 3.5 1.0 4.0 2.5 2.0 3.0 2.5 1.0 3.0 2.0
Interaction Present
Continued
In the same manner, compute the simple effect of factor B at each of the two levels of factor A as: The simple effect of B at a0 = a0b1 a0b0 The simple effect of B at a1 = a1b1 a1b0 For example Table 1. The computation based on data set with two interaction are: Simple effect of variety at N0 = 2.0 1.0 = 1.0 t/ha Simple effect of variety at N1 = 4.0 1.0 = 3.0 t/ha Simple effect of variety at X = 1.0 1.0 = 0.0 t/ha Simple effect of variety at Y = 4.0 2.0 = 2.0 t/ha
Continued
And the computations based on data of the set without interaction are: Simple effect of variety at N0 = 2.0 1.0 = 1.0 t/ha Simple effect of variety at N1 = 4.0 1.0 = 3.0 t/ha Simple effect of variety at X = 1.0 1.0 = 0.0 t/ha Simple effect of variety at Y = 4.0 2.0 = 2.0 t/ha Step 2. Compute the main effect of factor A as the average of the simple effects factor A over all levels of factor B as:
Continued
The main effect of A = (1/2) (simple effect of A at b0 + simple effect of A at b1) = (1/2) [(a1b0 a0b0) + (a1b1 a0b1)] In the same manner, compute main effect of factor B as: The main effect of B = (1/2) (simple effect of B at a0 + simple effect of B at a1) = (1/2) [(a0b1 a0b0) + (a1b1 a1b0)] The computation based on data of the set with interaction are: Main effect of variety = (1/2) (1.0 + 3.0) = 2.0 t/ha Main effect of nitrogen = (1/2) (0.0 + 2.0) = 1.0 t/ha And the computations based on data without interaction are: Main effect of variety = (1/2) (1.0 + 1.0) = 1.0 t/ha Main effect of variety = (1/2) (2.0 + 2.0) = 2.0 t/ha
Continued
Step 3. Compute the interaction effect between factor A and factor B as a function of the difference between the simple effects of A at the two levels of B or the difference between the simple effects of B at the two levels of A: A x B = (1/2) (simple effect of A at b1 simple effect of A at b0) = (1/2) [(a1b1 a0b1) (a1b0 a0b0)] or, A x B = (1/2) (simple effect of B at a1 simple effect of B at a0) = (1/2) [(a1b1 a1b0) (a0b1 a0b0)]
Continued
For example, the computations of the variety x nitrogen interaction effect based on data of the set with interaction are: V x N = (1/2) (simple effect of variety at N1 simple effect of variety at N0) = (1/2) (3.0 1.0) = 1.0 t/ha or, V x N = (1/2) (simple effect of nitrogen of Y simple effect of nitrogen of X) = (1/2) (2.0 0.0) = 2.0 t/ha And the computations of the variety x nitrogen interaction effect based on data of the set without interaction are: V x N = 1/2 (1.0 1.0) = 0.0 t/ha V x N = 1/2 (1.0 1.0) = 0.0 t/ha
Example 3:
Factorial Experiment
Example
1. Experimental units 100 corn with temperature stress 2. Set of factors temperature level (y/n) and fish stress (y/n) 3. Rules - Randomly assign 25 fish to each of the possible combinations in (2). 4. Measurement Beck (respond) fish stress scale
Example - Scenario 1
Both temperature and stress main effects and interaction are equal to 0. Mean score is 28 with a standard deviation of 9.
Example Scenario 2
The temperature main effect is equal to 7. The stress main effect is equal to 4. The interaction effect is equal to 0. Base mean score for corns with neither the temperature nor the stress effect is 28 with a standard deviation of 9.
The null hypothesis that the temperature and stress effects are equal to zero is rejected, but the null hypothesis that the interaction is zero is not rejected.
Example Scenario 3
The temperature main effect is equal to 7. The stress main effect is equal to 4. The interaction effect is equal to 12. Base mean score for corns with neither the temperature nor the stress effect is 28 with a standard deviation of 9.
The null hypotheses that the temperature, stress, and interactions effects are equal to zero is rejected.