Vous êtes sur la page 1sur 51

Factorial Experiment (2)

(Interaction between Two Factors)

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?

Parts of Experimental Design


1) Set of experimental units. 2) Set of treatments. 3) Rules by which treatments are assigned to experimental units. 4) Measurements made on experimental units following application of treatment.

Experimental Units (e.g.)


1) 2) 3) 4) Corn seeds in an agricultural study Paddy in the fields Fish in the lake or ponds Corn seed in an agricultural research

Types of Treatment Structures


1) 2) 3) 4) One-Way Treatment Structure Two-Way Treatment Structure Factorial Arrangement Treatment Structure Fractional Factorial Arrangement Treatment Structures

Measurements (e.g.)
1) Survey score in agricultural market study 2) Plant size at time x for agricultural study

Experimental versus Observational


1) In observational studies the assignment of treatments to experimental units is not under the control of the researcher 2) Disadvantage of observational studies lies in the difficulty in recognizing causal relationships.
e.g. effects of herbicide treatment on grass growth

Definition of Factorial Design (1)


1) n experiment in which the effects of multiple factors are investigated simultaneously. 2) The treatments consist of all combinations that can be formed from the different factors. e.g. an experiment with the 2-level factors would result in 32 treatments.

Definition of Factorial Design (2)


1) The treatments are assigned randomly to the pool of experimental units with an equal number of units in each treatment. 2) The number of experimental units assigned to each treatment is referred to as the number of replications.

2 Factor Model Specification


Yi = B0 + B1X1i + B2X2i + B3X1iX2i + ei
Yi Outcome for ith unit B0 Intercept coefficient B1 Effect 1 coefficient B2 Effect 2 coefficient B3 Interaction coefficient X1i Level of factor 1 for ith unit X2i Level of factor 2 for ith unit ei Error term for ith unit

Analysis of Factorial Experiments


1) Main Effects effects of each factor independent of the remaining factors. 2) Interaction Effects 2- to n-way interaction effects between all combinations of factors. 3) The factorial provides a lot more information than a single factor experiment with potentially not much more work.

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

Gender: girl or boy School: single sex or mixed.

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.

boys mixed single 12 15 17 12 14 13 13 14 15 17 17 16 15 13 13 18 18 15 16 17

girls mixed single 15 19 20 21 17 16 16 18 18 20 20 18 18 16 16 17 21 20 19 15

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.

In post-hoc select bonnferoni test. In Options select descriptive statistics.

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

Say what you did.


Present means in table or graph (but not both). State main effects & interaction obtained from ANOVA giving df, F-ratio & p-value.

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.

girls girls boys boys girls boys

mixed

single

mixed

single

mixed

single

Consider a slightly different example:

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.

boys mixed single 12 15 17 20 14 17 13 16 15 18 17 20 15 18 13 16 18 21 16 19

girls mixed single 15 19 12 21 13 16 14 18 17 20 16 18 13 16 18 17 15 20 17 15

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)

Things I havent told you . . .

What happens when there are more than 2 independent variables?


This is OK. You can generalise factorial ANOVA to deal with any number of variables. However, you should always remember that the more variables you have, then the more difficult it is to analyse the interactions. For instance, imagine you had a 4x4x4x4 design and had to analyse the 4 way interaction. This could be very hard to interpret.

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

Example The Computation of Three Types of Effects


1) Consider the two sets of data presented in Table 1. for two varieties X and Y and two nitrogen rates N0 and N1; one set with no interaction and another with interaction. 2) Step 1, Compute the simple effect of factor A as the difference between its two levels at a given level of factor B. 3) The simple effect of A at b0 = a1b0 a0b0 4) The simple effect of A at b1 = a1b1 a0b1

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 1 (cont.)


No Yes p-value Temperature 28.9 29.0 0.462 Stress 28.9 29.0 0.993 Interaction 27.7 0.398 As expected the null hypothesis that the temperature, stress, and interaction effects are equal to zero cannot be rejected.

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.

Example Scenario 2 (cont.)


Temperature Stress Interaction
No 28.9 28.9 Yes 36.0 36.0 38.7 p-value 0.002 0.015 0.398

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.

Example Scenario 3 (cont.)


Temperature Stress Interaction
No 28.9 28.9 Yes 36.0 36.0 50.7 p-value 0.002 0.015 0.005

The null hypotheses that the temperature, stress, and interactions effects are equal to zero is rejected.

Billahi Taufiq Walhidayah, Wassalamualaikum Wr. Wb

Many thanks for your attention


See you in other occasions

Vous aimerez peut-être aussi