Two (or more) factors, say A and B, with a and b levels, respectively.

Similar documents
Part 5 Introduction to Factorials

ANOVA Situation The F Statistic Multiple Comparisons. 1-Way ANOVA MATH 143. Department of Mathematics and Statistics Calvin College

FACTORIAL DESIGNS and NESTED DESIGNS

Lecture 10. Factorial experiments (2-way ANOVA etc)

Lec 5: Factorial Experiment

More about Single Factor Experiments

Factorial designs. Experiments

Math 141. Lecture 16: More than one group. Albyn Jones 1. jones/courses/ Library 304. Albyn Jones Math 141

1-Way ANOVA MATH 143. Spring Department of Mathematics and Statistics Calvin College

2-way analysis of variance

ANOVA: Analysis of Variation

Statistics for EES Factorial analysis of variance

MAT3378 (Winter 2016)

Biostatistics for physicists fall Correlation Linear regression Analysis of variance

Multiple Pairwise Comparison Procedures in One-Way ANOVA with Fixed Effects Model

Multiple Predictor Variables: ANOVA

One-Way Analysis of Variance: ANOVA

Design & Analysis of Experiments 7E 2009 Montgomery

Straw Example: Randomized Block ANOVA

Lecture 11 Analysis of variance

One-way analysis of variance

Statistics - Lecture 05

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S. Duration - 3 hours. Aids Allowed: Calculator

3. Design Experiments and Variance Analysis

Design of Engineering Experiments Chapter 5 Introduction to Factorials

Factorial and Unbalanced Analysis of Variance

Booklet of Code and Output for STAC32 Final Exam

Cuckoo Birds. Analysis of Variance. Display of Cuckoo Bird Egg Lengths

Inference for Regression

Joint Probability Distributions

Analysis of Variance

Analysis of Variance II Bios 662

COMPARISON OF MEANS OF SEVERAL RANDOM SAMPLES. ANOVA

Regression. Marc H. Mehlman University of New Haven

Contents. TAMS38 - Lecture 6 Factorial design, Latin Square Design. Lecturer: Zhenxia Liu. Factorial design 3. Complete three factor design 4

Workshop 7.4a: Single factor ANOVA

Garvan Ins)tute Biosta)s)cal Workshop 16/7/2015. Tuan V. Nguyen. Garvan Ins)tute of Medical Research Sydney, Australia

Chapter 16: Understanding Relationships Numerical Data

Multiple Regression: Example

Statistics 512: Solution to Homework#11. Problems 1-3 refer to the soybean sausage dataset of Problem 20.8 (ch21pr08.dat).

STAT22200 Spring 2014 Chapter 5

Analysis of Covariance. The following example illustrates a case where the covariate is affected by the treatments.

Booklet of Code and Output for STAC32 Final Exam

Residual Analysis for two-way ANOVA The twoway model with K replicates, including interaction,

Multi-Way Analysis of Variance (ANOVA)

Two-Way Factorial Designs

ANOVA (Analysis of Variance) output RLS 11/20/2016

STAT 525 Fall Final exam. Tuesday December 14, 2010

Analysis of Variance and Design of Experiments-I

Contents. 2 2 factorial design 4

Part II { Oneway Anova, Simple Linear Regression and ANCOVA with R

Lecture 6 Multiple Linear Regression, cont.

T-test: means of Spock's judge versus all other judges 1 12:10 Wednesday, January 5, judge1 N Mean Std Dev Std Err Minimum Maximum

STATISTICS 368 AN EXPERIMENT IN AIRCRAFT PRODUCTION Christopher Wiens & Douglas Wiens

These are multifactor experiments that have

1 Use of indicator random variables. (Chapter 8)

Design and Analysis of Experiments

Handout 4: Simple Linear Regression

SPH 247 Statistical Analysis of Laboratory Data

2. Outliers and inference for regression

3. Factorial Experiments (Ch.5. Factorial Experiments)

STAT 3022 Spring 2007

STAT22200 Spring 2014 Chapter 8A

CSCI 688 Homework 6. Megan Rose Bryant Department of Mathematics William and Mary

Outline. 1 Preliminaries. 2 Introduction. 3 Multivariate Linear Regression. 4 Online Resources for R. 5 References. 6 Upcoming Mini-Courses

Chapter 5 Introduction to Factorial Designs Solutions

Comparing Nested Models

Stat 6640 Solution to Midterm #2

Booklet of Code and Output for STAD29/STA 1007 Midterm Exam

Analysis of Variance (ANOVA) Cancer Research UK 10 th of May 2018 D.-L. Couturier / R. Nicholls / M. Fernandes

A Handbook of Statistical Analyses Using R. Brian S. Everitt and Torsten Hothorn

Orthogonal contrasts for a 2x2 factorial design Example p130

Addition of Center Points to a 2 k Designs Section 6-6 page 271

Lecture 9: Factorial Design Montgomery: chapter 5

Unit 8: 2 k Factorial Designs, Single or Unequal Replications in Factorial Designs, and Incomplete Block Designs

STAT22200 Spring 2014 Chapter 13B

Suppose we needed four batches of formaldehyde, and coulddoonly4runsperbatch. Thisisthena2 4 factorial in 2 2 blocks.

BIOL Biometry LAB 6 - SINGLE FACTOR ANOVA and MULTIPLE COMPARISON PROCEDURES

Chapter 5 Introduction to Factorial Designs

R 2 and F -Tests and ANOVA

23. Fractional factorials - introduction

Analytics 512: Homework # 2 Tim Ahn February 9, 2016

Solution to Series 3

STATISTICS 479 Exam II (100 points)

Multiple comparisons The problem with the one-pair-at-a-time approach is its error rate.

STAT 215 Confidence and Prediction Intervals in Regression

Model Building Chap 5 p251

Homework 9 Sample Solution

Multiple Predictor Variables: ANOVA

Multiple Linear Regression

1 Introduction to Minitab

22s:152 Applied Linear Regression. Chapter 8: 1-Way Analysis of Variance (ANOVA) 2-Way Analysis of Variance (ANOVA)

Regression on Faithful with Section 9.3 content

The Statistical Sleuth in R: Chapter 5

Extensions of One-Way ANOVA.

UNIVERSITY OF TORONTO SCARBOROUGH Department of Computer and Mathematical Sciences Midterm Test, October 2013

Biostatistics 380 Multiple Regression 1. Multiple Regression

STAT 572 Assignment 5 - Answers Due: March 2, 2007

Extensions of One-Way ANOVA.

Written Exam (2 hours)

Transcription:

Factorial Designs ST 516 Two (or more) factors, say A and B, with a and b levels, respectively. A factorial design uses all ab combinations of levels of A and B, for a total of ab treatments. When both (all) factors have 2 levels, we have a 2 2 (2 k ) design. 1 / 22 Factorial Designs Definitions and Principles

E.g. a 2 2 experiment: Factor A Low High Factor B High 30 52 Low 20 40 Main effect of A is Average response for high level of A = Similarly, main effect of B is 11. Average response for low level of A 40 + 52 20 + 30 = 21 2 2 2 / 22 Factorial Designs Definitions and Principles

Interaction The simple effect of A at B is 40 20 = 20, and the simple effect of A at B + is 52 30 = 22. The difference between these simple effects is the interaction AB (actually, one half the difference). Graphical presentation: the interaction plot. 3 / 22 Factorial Designs Definitions and Principles

In R; lines are parallel if interaction is 0: twobytwo <- data.frame(a = c("-", "+", "-", "+"), B = c("+", "+", "-", "-"), y = c(30, 52, 20, 40)) interaction.plot(twobytwo$a, twobytwo$b, twobytwo$y) # or, saving some typing: with(twobytwo, interaction.plot(a, B, y)) ST 516 mean of y 20 30 40 50 B + + A 4 / 22 Factorial Designs Definitions and Principles

The other way; lines are still parallel if interaction is 0: with(twobytwo, interaction.plot(b, A, y)) mean of y 20 30 40 50 A + + B 5 / 22 Factorial Designs Definitions and Principles

Interaction with Two Quantitative Factors Write the general level of factor A as x 1, the general level of factor B as x 2, and the response as y. Code x 1 so that x 1 = 1 at A and x 1 = +1 at A +, and x 2 similarly. Estimate the regression model representation y = β 0 + β 1 x 1 + β 2 x 2 + β 1,2 x 1 x 2 + ɛ. 6 / 22 Factorial Designs Definitions and Principles

Least squares estimates of the β s can be found from the main effects and interaction. For the simple example: twobytwo$x1 <- ifelse (twobytwo$a == "+", 1, -1) twobytwo$x2 <- ifelse (twobytwo$b == "+", 1, -1) summary(lm(y ~ x1 * x2, twobytwo)) from which we get ŷ = 35.5 + 10.5x 1 + 5.5x 2 + 0.5x 1 x 2. A graph of ŷ versus x 1 and x 2 is called a response surface plot. 7 / 22 Factorial Designs Definitions and Principles

yhat ST 516 50 40 30 20 1.0 0.5 0.0 x1 0.5 0.5 1.0 1.0 1.0 0.5 0.0 x2 8 / 22 Factorial Designs Definitions and Principles

Making the Response Surface Plot in R Use expand.grid() to set up a grid of values of x 1 and x 2, use the predict() method to evaluate ŷ on the grid, and use persp() to make a surface plot of it: ngrid <- 20 x1 <- with(twobytwo, seq(min(x1), max(x1), length = ngrid)) x2 <- with(twobytwo, seq(min(x2), max(x2), length = ngrid)) grid <- expand.grid(x1 = x1, x2 = x2) yhat <- predict(lm(y ~ x1 * x2, twobytwo), grid) yhat <- matrix(yhat, length(x1), length(x2)) persp(x1, x2, yhat, theta = 25, expand = 0.75, ticktype = "detailed") 9 / 22 Factorial Designs Definitions and Principles

A Two-Factor Example Battery life data; A = Material, a = 3, B = Temperature, b = 3, replications n = 4 (battery-life.txt): Material Temperature Life 1 15 130 1 15 155... 1 125 20... 2 15 150... 2 125 45 3 15 138... 3 125 60 10 / 22 Factorial Designs Two-Factor Design

boxplot(life ~ factor(material) * factor(temperature), batterylife) 50 100 150 1.15 2.15 3.15 1.70 2.70 3.70 1.125 2.125 3.125 11 / 22 Factorial Designs Two-Factor Design

Statistical model y i,j,k = µ + τ i + β j + (τβ) i,j + ɛ i,j,k is the response for Material i, Temperature j, replicate k. τ s, β s, and (τβ) s satisfy the usual constraints (natural or computer). Hypotheses No differences among Materials; H 0 : τ i = 0, all i; No effect of Temperature; H 0 : β j = 0, all j; No interaction; H 0 : (τβ) i,j = 0, all i and j. 12 / 22 Factorial Designs Two-Factor Design

R command batterylife <- read.table("data/battery-life.txt", header = TRUE) summary(aov(life ~ factor(material) * factor(temperature), batterylife)) Output Df Sum Sq Mean Sq F value Pr(>F) factor(material) 2 10684 5342 7.9114 0.001976 ** factor(temperature) 2 39119 19559 28.9677 1.909e-07 *** factor(material):factor(temperature) 4 9614 2403 3.5595 0.018611 * Residuals 27 18231 675 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 13 / 22 Factorial Designs Two-Factor Design

Interaction plots Can be made in two ways: Lifetime versus Temperature, with one curve for each type of Material; Lifetime versus Material, with one curve for each level of Temperature. Same information either way, but usually easier to interpret with a quantitative factor on the X-axis. Here Temperature is quantitative, but Material is qualitative. 14 / 22 Factorial Designs Two-Factor Design

with(batterylife, interaction.plot(temperature, Material, Life, type = "b")) mean of Life 60 80 100 120 140 160 2 3 3 1 2 3 1 1 2 Material 3 1 2 3 1 2 15 70 125 Temperature 15 / 22 Factorial Designs Two-Factor Design

with(batterylife, interaction.plot(material, Temperature, Life, type = "b")) mean of Life 60 80 100 120 140 160 1 23 1 2 3 12 3 Temperature 2 1 3 70 15 125 1 2 3 Material 16 / 22 Factorial Designs Two-Factor Design

Pairwise comparisons TukeyHSD(aov(Life ~ factor(material) * factor(temperature), batterylife)) Output Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = Life ~ factor(material) * factor(temperature), data = batterylife) $ factor(material) diff lwr upr p adj 2-1 25.16667-1.135677 51.46901 0.0627571 3-1 41.91667 15.614323 68.21901 0.0014162 3-2 16.75000-9.552344 43.05234 0.2717815 $ factor(temperature) diff lwr upr p adj 70-15 -37.25000-63.55234-10.94766 0.0043788 125-15 -80.66667-106.96901-54.36432 0.0000001 125-70 -43.41667-69.71901-17.11432 0.0009787 17 / 22 Factorial Designs Two-Factor Design

$ factor(material):factor(temperature) diff lwr upr p adj 2:15-1:15 21.00-40.823184 82.823184 0.9616404 3:15-1:15 9.25-52.573184 71.073184 0.9998527 1:70-1:15-77.50-139.323184-15.676816 0.0065212 2:70-1:15-15.00-76.823184 46.823184 0.9953182 3:70-1:15 11.00-50.823184 72.823184 0.9994703 1:125-1:15-77.25-139.073184-15.426816 0.0067471 2:125-1:15-85.25-147.073184-23.426816 0.0022351 3:125-1:15-49.25-111.073184 12.573184 0.2016535 3:15-2:15-11.75-73.573184 50.073184 0.9991463 1:70-2:15-98.50-160.323184-36.676816 0.0003449 2:70-2:15-36.00-97.823184 25.823184 0.5819453 3:70-2:15-10.00-71.823184 51.823184 0.9997369 1:125-2:15-98.25-160.073184-36.426816 0.0003574 2:125-2:15-106.25-168.073184-44.426816 0.0001152 3:125-2:15-70.25-132.073184-8.426816 0.0172076 1:70-3:15-86.75-148.573184-24.926816 0.0018119 2:70-3:15-24.25-86.073184 37.573184 0.9165175... 18 / 22 Factorial Designs Two-Factor Design

Residual Plots plot(aov(life ~ factor(material) * factor(temperature), batterylife)); Residuals vs Fitted 4 Residuals 60 40 20 0 20 40 9 3 60 80 100 120 140 160 Fitted values aov(life ~ factor(material) * factor(temperature)) 19 / 22 Factorial Designs Two-Factor Design

2 1 0 1 2 2 1 0 1 2 Theoretical Quantiles Standardized residuals aov(life ~ factor(material) * factor(temperature)) Normal Q Q 3 4 9 20 / 22 Factorial Designs Two-Factor Design

60 80 100 120 140 160 0.0 0.5 1.0 1.5 Fitted values Standardized residuals aov(life ~ factor(material) * factor(temperature)) Scale Location 3 4 9 21 / 22 Factorial Designs Two-Factor Design

Constant Leverage: Residuals vs Factor Levels Standardized residuals 3 2 1 0 1 2 4 3 9 factor(material) : 1 2 3 Factor Level Combinations 22 / 22 Factorial Designs Two-Factor Design