FACTORIAL DESIGNS and NESTED DESIGNS

Similar documents
COMPARISON OF MEANS OF SEVERAL RANDOM SAMPLES. ANOVA

ANOVA: Analysis of Variation

2-way analysis of variance

Biostatistics for physicists fall Correlation Linear regression Analysis of variance

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

Example: Poisondata. 22s:152 Applied Linear Regression. Chapter 8: ANOVA

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

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

Booklet of Code and Output for STAC32 Final Exam

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

Part 5 Introduction to Factorials

Booklet of Code and Output for STAC32 Final Exam

SPH 247 Statistical Analysis of Laboratory Data

MODELS WITHOUT AN INTERCEPT

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

Statistics for EES Factorial analysis of variance

Multiple Predictor Variables: ANOVA

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

Statistics Lab #6 Factorial ANOVA

MAT3378 (Winter 2016)

Food consumption of rats. Two-way vs one-way vs nested ANOVA

1 Use of indicator random variables. (Chapter 8)

Factorial and Unbalanced Analysis of Variance

Inference for Regression

More about Single Factor Experiments

Multiple Regression: Example

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

Factorial designs. Experiments

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

Stat 412/512 TWO WAY ANOVA. Charlotte Wickham. stat512.cwick.co.nz. Feb

Experimental Design and Statistical Methods. Workshop LOGISTIC REGRESSION. Jesús Piedrafita Arilla.

3. Design Experiments and Variance Analysis

Regression. Marc H. Mehlman University of New Haven

Biostatistics 380 Multiple Regression 1. Multiple Regression

One-way analysis of variance

Extensions of One-Way ANOVA.

Two-Way Factorial Designs

Comparing Nested Models

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

1 Multiple Regression

Design of Engineering Experiments Chapter 5 Introduction to Factorials

Chapter 4: Randomized Blocks and Latin Squares

Stat 401B Exam 2 Fall 2015

Homework 9 Sample Solution

Section 4.6 Simple Linear Regression

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

Analysis of variance. Gilles Guillot. September 30, Gilles Guillot September 30, / 29

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

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

Design & Analysis of Experiments 7E 2009 Montgomery

Stat 5303 (Oehlert): Analysis of CR Designs; January

Tests of Linear Restrictions

STAT22200 Spring 2014 Chapter 8A

Regression on Faithful with Section 9.3 content

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

Straw Example: Randomized Block ANOVA

Variance Decomposition and Goodness of Fit

Analysis of Variance

MODULE 4 SIMPLE LINEAR REGRESSION

Topic 9: Factorial treatment structures. Introduction. Terminology. Example of a 2x2 factorial

Stat 5303 (Oehlert): Balanced Incomplete Block Designs 1

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

COMPLETELY RANDOM DESIGN (CRD) -Design can be used when experimental units are essentially homogeneous.

Orthogonal contrasts for a 2x2 factorial design Example p130

One-Way Analysis of Variance: ANOVA

Statistics - Lecture 05

These are multifactor experiments that have

Chapter 16: Understanding Relationships Numerical Data

Lecture 11 Analysis of variance

13 Simple Linear Regression

DESAIN EKSPERIMEN BLOCKING FACTORS. Semester Genap 2017/2018 Jurusan Teknik Industri Universitas Brawijaya

Stat 401B Final Exam Fall 2015

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

Linear Model Specification in R

> nrow(hmwk1) # check that the number of observations is correct [1] 36 > attach(hmwk1) # I like to attach the data to avoid the '$' addressing

Workshop 7.4a: Single factor ANOVA

General Linear Statistical Models - Part III

STAT 3022 Spring 2007

Recall that a measure of fit is the sum of squared residuals: where. The F-test statistic may be written as:

R 2 and F -Tests and ANOVA

Model Modifications. Bret Larget. Departments of Botany and of Statistics University of Wisconsin Madison. February 6, 2007

Ch. 5 Two-way ANOVA: Fixed effect model Equal sample sizes

Practical Statistics for the Analytical Scientist Table of Contents

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

Workshop 9.3a: Randomized block designs

Stat 6640 Solution to Midterm #2

Allow the investigation of the effects of a number of variables on some response

610 - R1A "Make friends" with your data Psychology 610, University of Wisconsin-Madison

Design and Analysis of Experiments

BIOL 458 BIOMETRY Lab 9 - Correlation and Bivariate Regression

The Statistical Sleuth in R: Chapter 5

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

Stats fest Analysis of variance. Single factor ANOVA. Aims. Single factor ANOVA. Data

Nature vs. nurture? Lecture 18 - Regression: Inference, Outliers, and Intervals. Regression Output. Conditions for inference.

Chapter 8: Correlation & Regression

unadjusted model for baseline cholesterol 22:31 Monday, April 19,

Extensions of One-Way ANOVA.

Lec 5: Factorial Experiment

Variance Decomposition in Regression James M. Murray, Ph.D. University of Wisconsin - La Crosse Updated: October 04, 2017

Introduction to Regression in R Part II: Multivariate Linear Regression

Transcription:

Experimental Design and Statistical Methods Workshop FACTORIAL DESIGNS and NESTED DESIGNS Jesús Piedrafita Arilla jesus.piedrafita@uab.cat Departament de Ciència Animal i dels Aliments

Items Factorial design Concept and interpretation of interaction Nested design Basic commands aov anova summary lm fixed random interaction.plot 2

Factorial designs When we are interested in contrasting the effect of two or more main factors, and the possible joint effect the interaction effect-, we use factorial designs. An example of the simplest 2 2 factorial design is the following: Type C Type V Gastric 39.5 47.4 45.7 43.5 49.8 39.8 50.2 36.1 63.8 41.2 Duodenal 31.2 44.0 33.5 41.2 36.7 47.3 42.0 45.3 38.1 42.7 Data come from an experiment to test the solubility of two types of capsules (C and V) depending upon the juice of the gastrointestinal tract (Gastric or Duodenal). The variable measured as indicator of solubility is the time to observe the first bubbles. 3

Factorial designs model The model for this design is described as follows: yijk i j ij ijk Error term Interaction of CAPSULE by JUICE JUICE effect CAPSULE effect Capsule and juice are said in general main effects. The model can include three or more main effects and their interactions (of two factors, three factors and higher levels). 4

Interaction The dependence of the effect of one factor on the levels of another factor is called interaction. The sum of squares for interaction measures the departure of the subgroup means from the values expected on the basis of additive combinations of the row and column means. Any given combination of levels of factors may result in a positive or negative deviation from the expected value based on the means of the levels of the factors. If this deviation is positive we talk of synergism; if negative, interference. Both tend to magnify the interaction SS. No interaction Quantitative Qualitative interaction interaction 5

Factorial designs summary statistics and boxplots > summary(solub.cap) JUICE CAPSULE SOLUB DUO:10 C:10 Min. :31.20 GAS:10 V:10 1st Qu.:39.15 Median :42.35 Mean :42.95 3rd Qu.:46.10 Max. :63.80 According to the boxplots, there is no evidence of non normality and also no apparent relationship between mean and variance. Observe an outlier in GASxC. boxplot(solub~capsule) boxplot(solub~juice) boxplot(solub~juice*capsule) 6

Factorial designs results (1) - > SOLUB.AOV<-aov(SOLUB~CAPSULE*JUICE) > anova(solub.aov) Analysis of Variance Table Response: SOLUB Note that CAPSULE*JUICE is equivalent to CAPSULE + JUICE + CAPSULE:JUICE Df Sum Sq Mean Sq F value Pr(>F) CAPSULE 1 0.20 0.20 0.0066 0.936055 JUICE 1 151.25 151.25 5.0232 0.039542 * CAPSULE:JUICE 1 320.00 320.00 10.6277 0.004916 ** Residuals 16 481.76 30.11 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 We see that JUICE is significant but CAPSULE is not. Indeed the interaction is significant. Contrast of levels of the significant factor, in this case JUICE must be done within each level of the other factor. When interaction is not significant, it can be removed from the model and run a new model with the two main effects only. 7

Factorial designs results (2) - > summary.lm(solub.aov)... Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) 36.300 2.454 14.792 9.42e-11 *** CAPSULEV 7.800 3.470 2.248 0.03906 * JUICEGAS 13.500 3.470 3.890 0.00130 ** CAPSULEV:JUICEGAS -16.000 4.908-3.260 0.00492 ** --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 Residual standard error: 5.487 on 16 degrees of freedom Multiple R-squared: 0.4946, Adjusted R-squared: 0.3998 F-statistic: 5.219 on 3 and 16 DF, p-value: 0.01054 The model explains 49.46% of the total variability (R 2 = 0.4946) 8

Factorial designs diagnostics - >layout(matrix(c(1,2),1,2)) >plot(solub.aov, which=c(1,2)) which= selects this kind of graphic for an anova object This graphic evaluates the overall residual and predicted values for the interaction effect. There is a random distribution (independence) of residuals among the fitted values. The distribution of residuals does not deviate much of normality. 9

Factorial designs graphic representation of interaction - > interaction.plot(capsule, JUICE, SOLUB) > tapply(solub, + list(capsule,juice),mean) DUO GAS C 36.3 49.8 V 44.1 41.6 This is a clear example of qualitative interaction between the two factors. 10

Comparison of means > TukeyHSD(aov(SOLUB ~ CAPSULE*JUICE)) Tukey multiple comparisons of means 95% family-wise confidence level $CAPSULE diff lwr upr p adj V-C -0.2-5.402197 5.002197 0.9360548 $JUICE diff lwr upr p adj GAS-DUO 5.5 0.2978026 10.7022 0.0395423 $`CAPSULE:JUICE` diff lwr upr p adj V:DUO-C:DUO 7.8-2.129017 17.729017 0.1526843 C:GAS-C:DUO 13.5 3.570983 23.429017 0.0064094 V:GAS-C:DUO 5.3-4.629017 15.229017 0.4452697 C:GAS-V:DUO 5.7-4.229017 15.629017 0.3843072 V:GAS-V:DUO -2.5-12.429017 7.429017 0.8875433 V:GAS-C:GAS -8.2-18.129017 1.729017 0.1251515 Remember that due to the presence of interaction, comparisons between levels of main effects (CAPSULE and JUICE) have no sense. We need to make comparisons between combinations of the levels. 11

Nested design Imagine that we have put our cows in two separate and independent farms, chosen at random, for each treatment. This is a NESTED or hierarchical design, that can be summarized as follows: T1 T2 T3 F1 F2 F3 F4 F5 F6 3.7 3.6 4.5 3.9 4.5 4.4 3.9 3.4 4.3 4.1 4.7 4.1 4.5 4.1 4.7 3.7 4.4 3.9 4.3 4.3 4.8 4.1 4.6 4.0 4.1 4.2 4.3 4.0 4.3 4.4 A less convenient way to present these data is as in our right. This array shows how an analysis similar to the previous one would have given many missing cells. Farm 1 Farm 2 Farm 3 Farm 4 Farm 5 Farm 6 T1 T2 T3 3.7 3.9 4.5 4.3 4.1 3.6 3.4 4.1 4.3 4.2 4.5 4.3 4.7 4.8 4.3 3.9 4.1 3.7 4.1 4.0 4.5 4.7 4.4 4.6 4.3 4.4 4.1 3.9 4.0 4.4 12

Nested designs model - The model for this design is described as follows: yijk ( ) i ij ijk TRT effect Error term FARM (within TRT effect) In some cases, we can be interested in contrasting the farm effects included in the model and then farm is defined as a fixed effect. In another cases, however, we are not interested in the particular effect of each farm and then define farm as a random effect (nuisance factor). In genetic applications, such as the estimation of heritability, both effects are defined as random (not analysed here). 13

Nested designs Boxplots - > boxplot(fat~trt) No obvious deviations from normality are observed. 14

Nested designs results with farm fixed - > summary(fatn.f<-aov(fat~trt/farm)) Farm is defined as fixed effect Df Sum Sq Mean Sq F value Pr(>F) TRT 2 0.5447 0.2723 3.937 0.03320 * TRT:FARM 3 1.1540 0.3847 5.561 0.00482 ** Residuals 24 1.6600 0.0692 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 1 Significant Observe that both TRT and TRT:FARM Mean Sq are contrasted against the Residuals Mean Sq. Treatment effect, as well as farm effect, are significant. 15

Nested designs results with farm random - > summary(fatn.r<-aov(fat ~ TRT + Error(FARM))) Farm is defined as random effect Error: FARM Df Sum Sq Mean Sq F value Pr(>F) TRT 2 0.5447 0.2723 0.708 0.56 Residuals 3 1.1540 0.3847 Error: Within Df Sum Sq Mean Sq F value Pr(>F) Residuals 24 1.66 0.06917 5.56 0.0041 The treatment effects (not significant) are weaker than the between farm variability (significant) Observe that TRT is contrasted with FARM as the error term and that FARM is contrasted with the residual error term. 0.3847 0.06917 > df(5.56166,3,24) [1] 0.004054074 Not in the R output. It can be obtained also from the previous analysis. 16