STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Factorial Designs Merlise Clyde Design of Experiments: Chapter 6 - - PowerPoint PPT Presentation
Factorial Designs Merlise Clyde Design of Experiments: Chapter 6 - - PowerPoint PPT Presentation
Factorial Designs Merlise Clyde Design of Experiments: Chapter 6 Duke University March 2, 2016 STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TIME: timing of
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900} TIME: timing of onset of LIGHT treatment
Late (at Photoperiod Floral Induction (PFI)) Early (24 days before PFI)
Response variable: FLOWERS, the average number of flowers produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
Late (at Photoperiod Floral Induction (PFI)) Early (24 days before PFI)
Response variable: FLOWERS, the average number of flowers produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI))
Early (24 days before PFI)
Response variable: FLOWERS, the average number of flowers produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
Response variable: FLOWERS, the average number of flowers produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
▶ Response variable: FLOWERS, the average number of flowers
produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
▶ Response variable: FLOWERS, the average number of flowers
produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But Which TIME to use for testing the INTENSITY effects? Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
▶ Response variable: FLOWERS, the average number of flowers
produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But
▶ Which TIME to use for testing the INTENSITY effects?
Which INTENSITY to use for testing the TIME effects? T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
▶ Response variable: FLOWERS, the average number of flowers
produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But
▶ Which TIME to use for testing the INTENSITY effects? ▶ Which INTENSITY to use for testing the TIME effects?
T
- compare different INTENSITY x TIME combinations we need to
do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Meadow Foam Data
Interested in flower production of MeadowFoam in response to 2 factors:
▶ INTENSITY: light intensity at 6 levels: {150, 300, 450, 600, 750,
900}
▶ TIME: timing of onset of LIGHT treatment
▶ Late (at Photoperiod Floral Induction (PFI)) ▶ Early (24 days before PFI)
▶ Response variable: FLOWERS, the average number of flowers
produced by the seedlings Possible Experimental Designs: Perform two separate CRD experients, one to test for effects of INENSITY and the other for TIMING. But
▶ Which TIME to use for testing the INTENSITY effects? ▶ Which INTENSITY to use for testing the TIME effects?
To compare different INTENSITY x TIME combinations we need to do experiments with all 12 treatment combinations.
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late
L 150 L 300 L 450 L 600 L 750 L 900
Early
E 150 E 300 E 450 E 600 E 750 E 900
This type of design is called a factorial design. It is a 2 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 × 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 × 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 × 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Experimental Design
Each of the 12 combinations assigned to a group of 10 plants, replicated twice Layout TIME 150 300 450 600 750 900 Late yL,150 yL,300 yL,450 yL,600 yL,750 yL,900 Early yE,150 yE,300 yE,450 yE,600 yE,750 yE,900 This type of design is called a factorial design. It is a 2 × 6 two factor design with 2 replicates per treatment combination Factor Categories of treatments Levels of a factor The different treatments in a category levels(mf$Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Marginal Plots
150 300 450 600 750 900 30 40 50 60 70 Intensity Flowers 1 2 30 40 50 60 70 Time Flowers
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conditional Plots
coplot(Flowers ∼ Intensity | Time, data=mf)
- 150
300 450 600 750 900 30 40 50 60 70
- 150
300 450 600 750 900
Intensity Flowers
1 2
Given : factor(Time)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Goals
▶ What is the effect of differing light conditions?
What is the effect of timing on flower production? (one CRD) Does the effect of light intensity depend on the timing? What is the best combination?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Goals
▶ What is the effect of differing light conditions? ▶ What is the effect of timing on flower production? (one CRD)
Does the effect of light intensity depend on the timing? What is the best combination?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Goals
▶ What is the effect of differing light conditions? ▶ What is the effect of timing on flower production? (one CRD) ▶ Does the effect of light intensity depend on the timing?
What is the best combination?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Goals
▶ What is the effect of differing light conditions? ▶ What is the effect of timing on flower production? (one CRD) ▶ Does the effect of light intensity depend on the timing? ▶ What is the best combination?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Possible Analyses
Lets try to analyize the data with our existing tools: Two One-Factor ANOVAS just looking at Time, the experiment is a one-factor ANOVA with 2 treatment levels and 12 reps per treatment. just looking at Intensity, the experiment is a one-factor ANOVA with 6 treatment levels and 4 reps per treatment. > anova(lm(Flowers ~ Time, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Time 1 887 886.95 5.6543 0.02653 * Residuals 22 3451 156.86 > anova(lm(Flowers ~ Intensity, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.5 536.70 5.8393 0.002244 ** Residuals 18 1654.4 91.91
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Possible Analyses
Lets try to analyize the data with our existing tools: Two One-Factor ANOVAS
▶ just looking at Time, the experiment is a one-factor ANOVA
with 2 treatment levels and 12 reps per treatment. just looking at Intensity, the experiment is a one-factor ANOVA with 6 treatment levels and 4 reps per treatment. > anova(lm(Flowers ~ Time, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Time 1 887 886.95 5.6543 0.02653 * Residuals 22 3451 156.86 > anova(lm(Flowers ~ Intensity, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.5 536.70 5.8393 0.002244 ** Residuals 18 1654.4 91.91
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Possible Analyses
Lets try to analyize the data with our existing tools: Two One-Factor ANOVAS
▶ just looking at Time, the experiment is a one-factor ANOVA
with 2 treatment levels and 12 reps per treatment.
▶ just looking at Intensity, the experiment is a one-factor ANOVA
with 6 treatment levels and 4 reps per treatment. > anova(lm(Flowers ~ Time, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Time 1 887 886.95 5.6543 0.02653 * Residuals 22 3451 156.86 > anova(lm(Flowers ~ Intensity, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.5 536.70 5.8393 0.002244 ** Residuals 18 1654.4 91.91
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Possible Analyses
Lets try to analyize the data with our existing tools: Two One-Factor ANOVAS
▶ just looking at Time, the experiment is a one-factor ANOVA
with 2 treatment levels and 12 reps per treatment.
▶ just looking at Intensity, the experiment is a one-factor ANOVA
with 6 treatment levels and 4 reps per treatment. > anova(lm(Flowers ~ Time, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Time 1 887 886.95 5.6543 0.02653 * Residuals 22 3451 156.86 > anova(lm(Flowers ~ Intensity, data=mf)) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.5 536.70 5.8393 0.002244 ** Residuals 18 1654.4 91.91
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
And Another Oneway ANOVA
A one-factor ANOVA with 2 × 6 = 12 treatments: > anova(lm(Flowers ~ Intensity:Time, data=mf)) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity:Time 11 3682.0 334.73 6.1238 0.002028 ** Residuals 12 655.9 54.66
- >
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
And Another Oneway ANOVA
A one-factor ANOVA with 2 × 6 = 12 treatments: > anova(lm(Flowers ~ Intensity:Time, data=mf)) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity:Time 11 3682.0 334.73 6.1238 0.002028 ** Residuals 12 655.9 54.66
- >
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA? In the third ANOVA, can we assess the effects of Time and Intensity separately? Can you think of a situation where the F-stats in the first and second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA?
▶ In the third ANOVA, can we assess the effects of Time and
Intensity separately? Can you think of a situation where the F-stats in the first and second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA?
▶ In the third ANOVA, can we assess the effects of Time and
Intensity separately?
▶ Can you think of a situation where the F-stats in the first and
second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA?
▶ In the third ANOVA, can we assess the effects of Time and
Intensity separately?
▶ Can you think of a situation where the F-stats in the first and
second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA?
▶ In the third ANOVA, can we assess the effects of Time and
Intensity separately?
▶ Can you think of a situation where the F-stats in the first and
second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Why might these be insufficient?
▶ What are the SSE and MSE representing in the first two
ANOVAS? Why are they bigger than the value in the third ANOVA?
▶ In the third ANOVA, can we assess the effects of Time and
Intensity separately?
▶ Can you think of a situation where the F-stats in the first and
second ANOVAs would be “small”, but the F-stat in the third ANOVA “big”? The first and second may mischaracterize the data and sources of variation. The third is valid, but we would like a more specific result: which factors are sources of variation and the relative magnitude of their effects If the effects of one factor are consisten across levels of the other maybe we do not need to have a separate parameter for each of the 12 treatment combinations
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects
jk j k jk jk is the population mean in group with Time at level j and
Intensity at level k
- verall mean
j j
1 2 additive effects of Time of PFI
k k
1 2 6 additive effects of Intensity i 1 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects µjk = µ + αj + βk + γjk
jk is the population mean in group with Time at level j and
Intensity at level k
- verall mean
j j
1 2 additive effects of Time of PFI
k k
1 2 6 additive effects of Intensity i 1 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects µjk = µ + αj + βk + γjk
▶ µjk is the population mean in group with Time at level j and
Intensity at level k
- verall mean
j j
1 2 additive effects of Time of PFI
k k
1 2 6 additive effects of Intensity i 1 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects µjk = µ + αj + βk + γjk
▶ µjk is the population mean in group with Time at level j and
Intensity at level k
▶ µ overall mean ▶ αj j = 1, 2 additive effects of Time of PFI k k
1 2 6 additive effects of Intensity i 1 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects µjk = µ + αj + βk + γjk
▶ µjk is the population mean in group with Time at level j and
Intensity at level k
▶ µ overall mean ▶ αj j = 1, 2 additive effects of Time of PFI ▶ βk k = 1, 2, . . . , 6 additive effects of Intensity
i 1 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two Way Additive Effects Model
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects µjk = µ + αj + βk + γjk
▶ µjk is the population mean in group with Time at level j and
Intensity at level k
▶ µ overall mean ▶ αj j = 1, 2 additive effects of Time of PFI ▶ βk k = 1, 2, . . . , 6 additive effects of Intensity ▶ i = 1, 2 (replicate)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
set
1 1
0 (set to zero side condition) or; set
j j
0,
k k
0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
there are J1 J2 groups or treatment combinations a full model fits a population mean separately for each treatment combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or;
set
j j
0,
k k
0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
there are J1 J2 groups or treatment combinations a full model fits a population mean separately for each treatment combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
there are J1 J2 groups or treatment combinations a full model fits a population mean separately for each treatment combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
there are J1 J2 groups or treatment combinations a full model fits a population mean separately for each treatment combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
▶ there are J1 × J2 groups or treatment combinations
a full model fits a population mean separately for each treatment combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
▶ there are J1 × J2 groups or treatment combinations ▶ a full model fits a population mean separately for each treatment
combination this would require J1 J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
▶ there are J1 × J2 groups or treatment combinations ▶ a full model fits a population mean separately for each treatment
combination
▶ this would require J1 × J2 parameters
In contrast the additive model has only 1 J1 1 J2 1 J1 J2 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Commments on Parameterization
- 1. Side conditions: As with the oneway model, we need only Jf − 1
parameters to differentiate between Jf means so in Rwe usually
▶ set α1 = β1 = 0 (set to zero side condition) or; ▶ set ∑
j αj = 0, ∑ k βk = 0 (sum to zero side condition)
- 2. Model Limitations: The additive mmodel is a Reduced Model
▶ there are J1 × J2 groups or treatment combinations ▶ a full model fits a population mean separately for each treatment
combination
▶ this would require J1 × J2 parameters
In contrast the additive model has only 1 + (J1 − 1) + (J2 − 1) = J1 + J2 − 1 parameters
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parameter Estimation
yijk = ¯ y... + (¯ y.j. − ¯ y...) + (¯ y..k − ¯ y...) + (yijk − ¯ y.j. − ¯ y..k + ¯ y...) These are the OLS or MLE estimates with the sum-to-zero constraints The fitted value in each group: Yijk
j k
Note the fitted values do not change with the model parameterization
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parameter Estimation
yijk = ¯ y... + (¯ y.j. − ¯ y...) + (¯ y..k − ¯ y...) + (yijk − ¯ y.j. − ¯ y..k + ¯ y...) These are the OLS or MLE estimates with the sum-to-zero constraints The fitted value in each group: Yijk
j k
Note the fitted values do not change with the model parameterization
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parameter Estimation
yijk = ¯ y... + (¯ y.j. − ¯ y...) + (¯ y..k − ¯ y...) + (yijk − ¯ y.j. − ¯ y..k + ¯ y...) These are the OLS or MLE estimates with the sum-to-zero constraints The fitted value in each group: ˆ Yijk = ˆ µ + ˆ αj + ˆ βk Note the fitted values do not change with the model parameterization
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sum of Squares
Yijk − ˆ µ = ˆ αj + ˆ βk + ˆ ϵijk ∑
i
∑
j
∑
k(Yijk−ˆ
µ)2 = ∑
i
∑
j
∑
k ˆ
α2
j +∑ i
∑
j
∑
k ˆ
β2
k+∑ i
∑
j
∑
k(Yijk−ˆ
ϵijk)2 SST
- tal = SSTime + SSIntensity + SSE (Balanced case)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sum of Squares
Yijk − ˆ µ = ˆ αj + ˆ βk + ˆ ϵijk ∑
i
∑
j
∑
k(Yijk−ˆ
µ)2 = ∑
i
∑
j
∑
k ˆ
α2
j +∑ i
∑
j
∑
k ˆ
β2
k+∑ i
∑
j
∑
k(Yijk−ˆ
ϵijk)2 SSTotal = SSTime + SSIntensity + SSE (Balanced case)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ANOVA Main Effects
> mf.lmmain = lm(Flowers ~ Intensity + Time, data=mf) > anova(mf.lmmain) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ANOVA has decomposed the variance in the data into the variance
- f
Additive Intensity effects Additive Time Effects residuals Does this adequately represent what is going on in the data?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ANOVA Main Effects
> mf.lmmain = lm(Flowers ~ Intensity + Time, data=mf) > anova(mf.lmmain) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ANOVA has decomposed the variance in the data into the variance
- f
▶ Additive Intensity effects
Additive Time Effects residuals Does this adequately represent what is going on in the data?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ANOVA Main Effects
> mf.lmmain = lm(Flowers ~ Intensity + Time, data=mf) > anova(mf.lmmain) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ANOVA has decomposed the variance in the data into the variance
- f
▶ Additive Intensity effects ▶ Additive Time Effects
residuals Does this adequately represent what is going on in the data?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ANOVA Main Effects
> mf.lmmain = lm(Flowers ~ Intensity + Time, data=mf) > anova(mf.lmmain) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ANOVA has decomposed the variance in the data into the variance
- f
▶ Additive Intensity effects ▶ Additive Time Effects ▶ residuals
Does this adequately represent what is going on in the data?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ANOVA Main Effects
> mf.lmmain = lm(Flowers ~ Intensity + Time, data=mf) > anova(mf.lmmain) Analysis of Variance Table Response: Flowers Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
ANOVA has decomposed the variance in the data into the variance
- f
▶ Additive Intensity effects ▶ Additive Time Effects ▶ residuals
Does this adequately represent what is going on in the data?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E Y I 150 Time 1
1 1
E Y I 150 Time 2
1 2
the diffference between Time 1 and Time 2 is
1 2 regardless
- f Intensity
Full model will allow the effect of Time to vary across intensity levels Reduced or Additive model says differences are constant across Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2 the diffference between Time 1 and Time 2 is
1 2 regardless
- f Intensity
Full model will allow the effect of Time to vary across intensity levels Reduced or Additive model says differences are constant across Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2 the diffference between Time 1 and Time 2 is
1 2 regardless
- f Intensity
Full model will allow the effect of Time to vary across intensity levels Reduced or Additive model says differences are constant across Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2
▶ the diffference between Time 1 and Time 2 is β1 − β2 regardless
- f Intensity
Full model will allow the effect of Time to vary across intensity levels Reduced or Additive model says differences are constant across Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2
▶ the diffference between Time 1 and Time 2 is β1 − β2 regardless
- f Intensity
▶ Full model will allow the effect of Time to vary across intensity
levels Reduced or Additive model says differences are constant across Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2
▶ the diffference between Time 1 and Time 2 is β1 − β2 regardless
- f Intensity
▶ Full model will allow the effect of Time to vary across intensity
levels
▶ Reduced or Additive model says differences are constant across
Intensity H0 ? How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction?
▶ What do we mean by additive? Assuming the model is correct
we have E[Y | I = 150, Time = 1] = µ + α1 + β1 E[Y | I = 150, Time = 2] = µ + α1 + β2
▶ the diffference between Time 1 and Time 2 is β1 − β2 regardless
- f Intensity
▶ Full model will allow the effect of Time to vary across intensity
levels
▶ Reduced or Additive model says differences are constant across
Intensity
▶ H0 ?
How can we test this?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction
No Interaction the effect of light intensity on the number of flowers is the same for both early and late times. The effect of timing on flower production is the same for all levels of light intensity Interaction the difference in average floral production at late and early times depends on the level of light intensity Address this with linear models
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction
No Interaction the effect of light intensity on the number of flowers is the same for both early and late times. The effect of timing on flower production is the same for all levels of light intensity Interaction the difference in average floral production at late and early times depends on the level of light intensity Address this with linear models
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interaction
No Interaction the effect of light intensity on the number of flowers is the same for both early and late times. The effect of timing on flower production is the same for all levels of light intensity Interaction the difference in average floral production at late and early times depends on the level of light intensity Address this with linear models
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS”
jk j k jk jk interaction terms = deviations from additivity
The interaction term is a correction for non-additivity of the factor effects This is the full model which fits a separate mean to each of the 12 groups interaction = fitted under full - fitted under additive
jk
y jk y j y k y is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
jk interaction terms = deviations from additivity
The interaction term is a correction for non-additivity of the factor effects This is the full model which fits a separate mean to each of the 12 groups interaction = fitted under full - fitted under additive
jk
y jk y j y k y is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
▶ γjk interaction terms = deviations from additivity
The interaction term is a correction for non-additivity of the factor effects This is the full model which fits a separate mean to each of the 12 groups interaction = fitted under full - fitted under additive
jk
y jk y j y k y is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
▶ γjk interaction terms = deviations from additivity ▶ The interaction term is a correction for non-additivity of the
factor effects This is the full model which fits a separate mean to each of the 12 groups interaction = fitted under full - fitted under additive
jk
y jk y j y k y is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
▶ γjk interaction terms = deviations from additivity ▶ The interaction term is a correction for non-additivity of the
factor effects
▶ This is the full model which fits a separate mean to each of the
12 groups interaction = fitted under full - fitted under additive
jk
y jk y j y k y is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
▶ γjk interaction terms = deviations from additivity ▶ The interaction term is a correction for non-additivity of the
factor effects
▶ This is the full model which fits a separate mean to each of the
12 groups
▶ interaction = fitted under full - fitted under additive
ˆ γjk = ¯ y.jk − (¯ y.j. + ¯ y..k − ¯ y...) is variance explained by the
jk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Two-way Anova Model with Interaction
Model Yijk = µjk + ϵijk Rewrite mean as “MAIN” effects plus “INTERACTIONS” µjk = µ + αj + βk + γjk
▶ γjk interaction terms = deviations from additivity ▶ The interaction term is a correction for non-additivity of the
factor effects
▶ This is the full model which fits a separate mean to each of the
12 groups
▶ interaction = fitted under full - fitted under additive
ˆ γjk = ¯ y.jk − (¯ y.j. + ¯ y..k − ¯ y...)
▶ is variance explained by the ˆ
γjk large or not?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Output from lm
> mf.lmint = lm(Flowers ~ Intensity*Time, data=mf) > summary(mf.lmint) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 69.850 5.228 13.361 1.45e-08 *** Intensity300
- 15.100
7.393
- 2.042
0.06372 . Intensity450
- 14.100
7.393
- 1.907
0.08072 . Intensity600
- 27.300
7.393
- 3.693
0.00308 ** Intensity750
- 31.750
7.393
- 4.294
0.00104 ** Intensity900
- 30.500
7.393
- 4.125
0.00141 ** Time2 6.850 7.393 0.927 0.37244 Intensity300:Time2 11.950 10.456 1.143 0.27536 Intensity450:Time2 1.450 10.456 0.139 0.89200 Intensity600:Time2 8.150 10.456 0.779 0.45080 Intensity750:Time2 8.000 10.456 0.765 0.45897 Intensity900:Time2 2.300 10.456 0.220 0.82959 Residual standard error: 7.393 on 12 degrees of freedom Multiple R-squared: 0.8488,^^IAdjusted R-squared: 0.7102 F-statistic: 6.124 on 11 and 12 DF, p-value: 0.002028
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0
Alternative hypothesis Ha at least on
jk
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F Residual SS Residual Degrees of Freedom
2 Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F = ∆ Residual SS/∆Residual Degrees of Freedom ˆ σ2
Ha
- 4. F has an F distribution with
residual df (numerator) and residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extra Sum of Squares (Partial) F-Test
Test for interaction:
▶ Null hyposthesis Ho : γ22 = γ23 = . . . γ26 = 0 ▶ Alternative hypothesis Ha : at least on γjk ̸= 0
Because the hypothesis involves several coefficients, it is more appropriate to use an F test rather than individual t-tests.
- 1. Fit Complex model (under alternative hypothesis)
- 2. Fit Simpler model (under null hypothesis)
- 3. Compare reduction in residual Sum of Squares, “Extra SS” due
to the additional parameters in Ha F = ∆ Residual SS/∆Residual Degrees of Freedom ˆ σ2
Ha
- 4. F has an F distribution with ∆ residual df (numerator) and
residual df under Ha (denominator)
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
Notice 767 47 111 55 655 92 that is SSE SS SSEFull 17 5 12 Degrees of freedom df df dfFull degrees of freedom treeatment and SS are unchanged Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
▶ Notice 767.47 = 111.55 + 655.92 that is
SSEreduced = SSγ + SSEFull 17 5 12 Degrees of freedom df df dfFull degrees of freedom treeatment and SS are unchanged Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
▶ Notice 767.47 = 111.55 + 655.92 that is
SSEreduced = SSγ + SSEFull
▶ 17 = 5 + 12 Degrees of freedom dfreduced = dfγ + dfFull
degrees of freedom treeatment and SS are unchanged Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
▶ Notice 767.47 = 111.55 + 655.92 that is
SSEreduced = SSγ + SSEFull
▶ 17 = 5 + 12 Degrees of freedom dfreduced = dfγ + dfFull ▶ degrees of freedom treeatment and SS are unchanged
Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
▶ Notice 767.47 = 111.55 + 655.92 that is
SSEreduced = SSγ + SSEFull
▶ 17 = 5 + 12 Degrees of freedom dfreduced = dfγ + dfFull ▶ degrees of freedom treeatment and SS are unchanged ▶ Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R code
> anova(mf.lmmain) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 11.888 4.63e-05 *** Time 1 886.95 886.95 19.646 0.0003649 *** Residuals 17 767.47 45.15 > anova(mf.lmint) Df Sum Sq Mean Sq F value Pr(>F) Intensity 5 2683.51 536.70 9.8189 0.0006388 *** Time 1 886.95 886.95 16.2266 0.0016745 ** Intensity:Time 5 111.55 22.31 0.4081 0.8341569 Residuals 12 655.92 54.66
▶ Notice 767.47 = 111.55 + 655.92 that is
SSEreduced = SSγ + SSEFull
▶ 17 = 5 + 12 Degrees of freedom dfreduced = dfγ + dfFull ▶ degrees of freedom treeatment and SS are unchanged ▶ Which is a better estimate of the within group variance?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R Code
anova(mf.lmmain, mf.lmint) Analysis of Variance Table Model 1: Flowers ~ Intensity + Time Model 2: Flowers ~ Intensity * Time Res.Df RSS Df Sum of Sq F Pr(>F) 1 17 767.47 2 12 655.92 5 111.55 0.4081 0.8342 >
▶ If H0 is not true
E MSEFull
2
E MSE
2
r 2
2
if H0 is true then MSE Full and MSE are both independent estimates of
- 2. We should combine them to improve our
estimate of
2
Conclusion?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R Code
anova(mf.lmmain, mf.lmint) Analysis of Variance Table Model 1: Flowers ~ Intensity + Time Model 2: Flowers ~ Intensity * Time Res.Df RSS Df Sum of Sq F Pr(>F) 1 17 767.47 2 12 655.92 5 111.55 0.4081 0.8342 >
▶ If H0 is not true
▶ E[MSEFull = σ2
E MSE
2
r 2
2
if H0 is true then MSE Full and MSE are both independent estimates of
- 2. We should combine them to improve our
estimate of
2
Conclusion?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R Code
anova(mf.lmmain, mf.lmint) Analysis of Variance Table Model 1: Flowers ~ Intensity + Time Model 2: Flowers ~ Intensity * Time Res.Df RSS Df Sum of Sq F Pr(>F) 1 17 767.47 2 12 655.92 5 111.55 0.4081 0.8342 >
▶ If H0 is not true
▶ E[MSEFull = σ2 ▶ E[MSEγ = σ2 + rτ 2
γ > σ2
if H0 is true then MSE Full and MSE are both independent estimates of
- 2. We should combine them to improve our
estimate of
2
Conclusion?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R Code
anova(mf.lmmain, mf.lmint) Analysis of Variance Table Model 1: Flowers ~ Intensity + Time Model 2: Flowers ~ Intensity * Time Res.Df RSS Df Sum of Sq F Pr(>F) 1 17 767.47 2 12 655.92 5 111.55 0.4081 0.8342 >
▶ If H0 is not true
▶ E[MSEFull = σ2 ▶ E[MSEγ = σ2 + rτ 2
γ > σ2
▶ if H0 is true then MSE Full and MSEγ are both independent
estimates of σ2. We should combine them to improve our estimate of σ2 Conclusion?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Factors versus Quantatative Variables
Plots suggest that the response decreases linearly with light intensity Restriction on the means Hypothesis that
jk is linear in INTENSITY levels can be
expressed as a one degree of freedom contrast (see chapter 8) Extra Sum of Squares F test: compare the model with Intensity as a factor to the model with Intensity as a numeric variable
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Factors versus Quantatative Variables
Plots suggest that the response decreases linearly with light intensity
▶ Restriction on the means
Hypothesis that
jk is linear in INTENSITY levels can be
expressed as a one degree of freedom contrast (see chapter 8) Extra Sum of Squares F test: compare the model with Intensity as a factor to the model with Intensity as a numeric variable
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Factors versus Quantatative Variables
Plots suggest that the response decreases linearly with light intensity
▶ Restriction on the means ▶ Hypothesis that µjk is linear in INTENSITY levels can be
expressed as a one degree of freedom contrast (see chapter 8) Extra Sum of Squares F test: compare the model with Intensity as a factor to the model with Intensity as a numeric variable
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Factors versus Quantatative Variables
Plots suggest that the response decreases linearly with light intensity
▶ Restriction on the means ▶ Hypothesis that µjk is linear in INTENSITY levels can be
expressed as a one degree of freedom contrast (see chapter 8)
▶ Extra Sum of Squares F test: compare the model with Intensity
as a factor to the model with Intensity as a numeric variable
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Test for Linearity
> mf.lm = lm(Flowers ~ Intensity + factor(Time), data=case0901) > mf.lmmain = lm(Flowers ~ factor(Intensity) + factor(Time), data=case0901) > anova(mf.lm, mf.lmmain) Analysis of Variance Table Model 1: Flowers ~ Intensity + factor(Time) Model 2: Flowers ~ factor(Intensity) + factor(Time) Res.Df RSS Df Sum of Sq F Pr(>F) 1 21 871.24 2 17 767.47 4 103.76 0.5746 0.6848
Conclusion?
STA 643 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Final Model
> summary(mf.lm) lm(formula = Flowers ~ Intensity + factor(Time), data = case0901) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 71.305833 3.273772 21.781 6.77e-16 *** Intensity
- 0.040471
0.005132
- 7.886 1.04e-07 ***