Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.1 Lecture 9: Multiple-classification ANOVA What is it, and why use it?

Slides:



Advertisements
Similar presentations
Tests of Hypotheses Based on a Single Sample
Advertisements

Randomized Complete Block and Repeated Measures (Each Subject Receives Each Treatment) Designs KNNL – Chapters 21,
Chapter 11 Analysis of Variance
2  How to compare the difference on >2 groups on one or more variables  If it is only one variable, we could compare three groups with multiple ttests:
LSU-HSC School of Public Health Biostatistics 1 Statistical Core Didactic Introduction to Biostatistics Donald E. Mercante, PhD.
Analysis of variance (ANOVA)-the General Linear Model (GLM)
Generalized Linear Models (GLM)
Université d’Ottawa / University of Ottawa 2001 Bio 8100s Allied Multivariate Biostatistics L6.1 Lecture 6: Single-classification multivariate ANOVA (k-group.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L10.1 CorrelationCorrelation The underlying principle of correlation analysis.
N-way ANOVA. Two-factor ANOVA with equal replications Experimental design: 2  2 (or 2 2 ) factorial with n = 5 replicate Total number of observations:
© 2010 Pearson Prentice Hall. All rights reserved The Complete Randomized Block Design.
EPIDEMIOLOGY AND BIOSTATISTICS DEPT Esimating Population Value with Hypothesis Testing.
Part I – MULTIVARIATE ANALYSIS
Chapter 3 Analysis of Variance
Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness.
8. ANALYSIS OF VARIANCE 8.1 Elements of a Designed Experiment
Analysis of variance (2) Lecture 10. Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram.
Inferences About Process Quality
Chapter 14 Inferential Data Analysis
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 8 Tests of Hypotheses Based on a Single Sample.
Biostatistics-Lecture 9 Experimental designs Ruibin Xi Peking University School of Mathematical Sciences.
University of Ottawa - Bio 4158 – Applied Biostatistics © Antoine Morin and Scott Findlay 14/08/2015 3:33 AM 1 Multiple-classification ANOVA What is it,
Chapter 12 Inferential Statistics Gay, Mills, and Airasian
Psy B07 Chapter 1Slide 1 ANALYSIS OF VARIANCE. Psy B07 Chapter 1Slide 2 t-test refresher  In chapter 7 we talked about analyses that could be conducted.
AM Recitation 2/10/11.
QNT 531 Advanced Problems in Statistics and Research Methods
1 1 Slide © 2005 Thomson/South-Western Chapter 13, Part A Analysis of Variance and Experimental Design n Introduction to Analysis of Variance n Analysis.
STA291 Statistical Methods Lecture 31. Analyzing a Design in One Factor – The One-Way Analysis of Variance Consider an experiment with a single factor.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Comparing Three or More Means 13.
PROBABILITY & STATISTICAL INFERENCE LECTURE 6 MSc in Computing (Data Analytics)
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 21/09/2015 7:46 PM 1 Two-sample comparisons Underlying principles.
Hypothesis tests III. Statistical errors, one-and two sided tests. One-way analysis of variance. 1.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
© Copyright McGraw-Hill CHAPTER 12 Analysis of Variance (ANOVA)
Chapter 10 Analysis of Variance.
Correlation and Regression Used when we are interested in the relationship between two variables. NOT the differences between means or medians of different.
Psychology 301 Chapters & Differences Between Two Means Introduction to Analysis of Variance Multiple Comparisons.
1 Chapter 13 Analysis of Variance. 2 Chapter Outline  An introduction to experimental design and analysis of variance  Analysis of Variance and the.
Testing Hypotheses about Differences among Several Means.
Repeated Measurements Analysis. Repeated Measures Analysis of Variance Situations in which biologists would make repeated measurements on same individual.
University of Ottawa - Bio 4118 – Applied Biostatistics © Antoine Morin and Scott Findlay 23/10/2015 9:22 PM 1 Two-sample comparisons Underlying principles.
INTRODUCTION TO ANALYSIS OF VARIANCE (ANOVA). COURSE CONTENT WHAT IS ANOVA DIFFERENT TYPES OF ANOVA ANOVA THEORY WORKED EXAMPLE IN EXCEL –GENERATING THE.
Intermediate Applied Statistics STAT 460 Lecture 17, 11/10/2004 Instructor: Aleksandra (Seša) Slavković TA: Wang Yu
Chapter 9 Three Tests of Significance Winston Jackson and Norine Verberg Methods: Doing Social Research, 4e.
Educational Research Chapter 13 Inferential Statistics Gay, Mills, and Airasian 10 th Edition.
Previous Lecture: Phylogenetics. Analysis of Variance This Lecture Judy Zhong Ph.D.
Experimental Research Methods in Language Learning Chapter 10 Inferential Statistics.
Supplementary PPT File for More detail explanation on SPSS Anova Results PY Cheng Nov., 2015.
1 ANALYSIS OF VARIANCE (ANOVA) Heibatollah Baghi, and Mastee Badii.
Chapter Seventeen. Figure 17.1 Relationship of Hypothesis Testing Related to Differences to the Previous Chapter and the Marketing Research Process Focus.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 14 Comparing Groups: Analysis of Variance Methods Section 14.3 Two-Way ANOVA.
Copyright © Cengage Learning. All rights reserved. 12 Analysis of Variance.
IE241: Introduction to Design of Experiments. Last term we talked about testing the difference between two independent means. For means from a normal.
One-Way Analysis of Variance Recapitulation Recapitulation 1. Comparing differences among three or more subsamples requires a different statistical test.
Introduction to ANOVA Research Designs for ANOVAs Type I Error and Multiple Hypothesis Tests The Logic of ANOVA ANOVA vocabulary, notation, and formulas.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L14.1 Lecture 14: Contingency tables and log-linear models Appropriate questions.
ANOVA Overview of Major Designs. Between or Within Subjects Between-subjects (completely randomized) designs –Subjects are nested within treatment conditions.
HYPOTHESIS TESTING FOR DIFFERENCES BETWEEN MEANS AND BETWEEN PROPORTIONS.
Educational Research Inferential Statistics Chapter th Chapter 12- 8th Gay and Airasian.
Statistical Decision Making. Almost all problems in statistics can be formulated as a problem of making a decision. That is given some data observed from.
Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L12.1 Lecture 12: Generalized Linear Models (GLM) What are they? When do.
University of Ottawa - Bio 4158 – Applied Biostatistics © Antoine Morin and Scott Findlay 06/07/2016 6:16 AM 1 Single classification analysis of variance.
Statistical Core Didactic
Comparing Three or More Means
Elements of a statistical test Statistical null hypotheses
Lecture 7: Single classification analysis of variance (ANOVA)
Analysis of Variance ANOVA.
Chapter 10 – Part II Analysis of Variance
Presentation transcript:

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.1 Lecture 9: Multiple-classification ANOVA What is it, and why use it? Multiple-classification ANOVA models Multiple-classification ANOVA designs The general multiple-classification ANOVA model Hypothesis testing and multiple comparisons in: n factorial designs n nested designs n repeated measures designs n blocked designs n non-parametric ANOVA What is it, and why use it? Multiple-classification ANOVA models Multiple-classification ANOVA designs The general multiple-classification ANOVA model Hypothesis testing and multiple comparisons in: n factorial designs n nested designs n repeated measures designs n blocked designs n non-parametric ANOVA

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.2 What is multiple classification ANOVA? Extension of single classification ANOVA but with several (instead of one) independent factors E.g. 2-way ANOVA examines effects of nitrogen (factor 1) and phosphorous (factor 2) addition on corn yield. Unlike single-classification, in multi-way ANOVA’s there are several H 0 ’s which can be tested. Extension of single classification ANOVA but with several (instead of one) independent factors E.g. 2-way ANOVA examines effects of nitrogen (factor 1) and phosphorous (factor 2) addition on corn yield. Unlike single-classification, in multi-way ANOVA’s there are several H 0 ’s which can be tested. Cell entries are means of N = 5 plots, in tonnes/acre.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.3 The advantage of multi-way ANOVAs I: controlling  e We can run a single experiment which tests the effects of several different factors without increasing  e. E.g. in 1-way design, we would need 3 experiments to test for a nitrogen effect, one for each phosphorous level. Probability of accepting true H 0 in all experiments is (.95) 3 =.86, so probability of rejecting at least one true H 0 is  e =.14. We can run a single experiment which tests the effects of several different factors without increasing  e. E.g. in 1-way design, we would need 3 experiments to test for a nitrogen effect, one for each phosphorous level. Probability of accepting true H 0 in all experiments is (.95) 3 =.86, so probability of rejecting at least one true H 0 is  e =.14. Experiment 1 Experiment 2 Experiment 3

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.4 The advantage of multi-way ANOVAs II: testing interactions We can run a single experiment which allows us to test whether the effect of one factor depends on another. E.g. 1-way design would allow us to test for the effect of nitrogen given a certain level of phosphorous, but we cannot test whether this effect varies among different phosphorous levels. We can run a single experiment which allows us to test whether the effect of one factor depends on another. E.g. 1-way design would allow us to test for the effect of nitrogen given a certain level of phosphorous, but we cannot test whether this effect varies among different phosphorous levels. Experiment 1 Experiment 2 Experiment 3

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.5 Model I multiple-classification ANOVA: effects of temperature and acidity on trout growth Treatment levels for temperature and pH are set by investigator. Dependent variable is growth rate ( ); factors are temperature and pH. Since factors are controlled, we can estimate the effect of a unit increase in temperature and pH on  the  effect size  …and can predict  at other temperatures and pH’s. Treatment levels for temperature and pH are set by investigator. Dependent variable is growth rate ( ); factors are temperature and pH. Since factors are controlled, we can estimate the effect of a unit increase in temperature and pH on  the  effect size  …and can predict  at other temperatures and pH’s. pH = 6.5 pH = 4.5 Water temperature (°C) Growth rate (cm/day)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.6 Model II multiple-classification ANOVA: size variation in Norops townsendi in the Cocos archipelago Dependent variable is snout- vent length; factors are Island (random) and elevation (random). Even if size differs between islands or elevations within islands, we have no idea what factors are controlling this variability... … so we cannot predict size at other islands or at other elevations on a given island. Dependent variable is snout- vent length; factors are Island (random) and elevation (random). Even if size differs between islands or elevations within islands, we have no idea what factors are controlling this variability... … so we cannot predict size at other islands or at other elevations on a given island. Sea level Mid elevation Peak Isla Manuelita Island Cocos Snout-vent length (mm)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.7 Model III multiple-classification ANOVA: sexual and geographical variation in body size of black bears Dependent variable is body size; factors are sex (fixed) and location (random). Even if locations differ, we have no idea what factors are controlling this variability. So we cannot predict body size of each sex at other locations... …but we can (perhaps) predict the difference between the sexes. Dependent variable is body size; factors are sex (fixed) and location (random). Even if locations differ, we have no idea what factors are controlling this variability. So we cannot predict body size of each sex at other locations... …but we can (perhaps) predict the difference between the sexes. Body size (kg) Riding Mountain Kluane Algonquin males females

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.8 Fixed versus random factors in ANOVA

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.9 Types of multiple classification ANOVA I: Factorial designs Levels of each factor are common to all levels of all other factors, i.e. the levels of each factor have consistent properties across other factors. e.g. effect of age (factor 1) and sex (factor 2) on size of lizards Levels of each factor are common to all levels of all other factors, i.e. the levels of each factor have consistent properties across other factors. e.g. effect of age (factor 1) and sex (factor 2) on size of lizards Observation

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.10 Types of ANOVA II: Nested designs Levels of at least one factor are random subset of the set of all possible levels, with levels not necessarily having consistent properties across other factors. e.g. effect of island (A, B) on size of lizards, with two random sites per island Levels of at least one factor are random subset of the set of all possible levels, with levels not necessarily having consistent properties across other factors. e.g. effect of island (A, B) on size of lizards, with two random sites per island Observation

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.11 Types of ANOVA III: Balanced versus unbalanced designs Observation BalancedUnbalanced

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.12 Types of ANOVA IV: Replicated versus unreplicated designs Temperature measurement Unreplicated Replicated

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.13 Choosing the appropriate design/model Type of model: Model I, Model II or Model III Factorial versus nested Balanced versus unbalanced Replicated versus unreplicated Note: calculations differ among different designs and models, so make sure you choose the right one! Type of model: Model I, Model II or Model III Factorial versus nested Balanced versus unbalanced Replicated versus unreplicated Note: calculations differ among different designs and models, so make sure you choose the right one!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.14 The general multiple- classification ANOVA model The general model for a two- factor ANOVA is ANOVA algorithms fit the above model (by least squares) to estimate  i,  j and (  ) ij. The general model for a two- factor ANOVA is ANOVA algorithms fit the above model (by least squares) to estimate  i,  j and (  ) ij. H 01 : all  i = 0 H 02 : all  j = 0 H 03 : (  ij = 0 For random effects, replace  i,  j with A i, B j. For three-factor ANOVA, the model extends to:

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.15 The two-factor model: effects of age and sex on lizard body size Size Juvenile females Juvenile males Adult females Adult males

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.16 The two-factor model: effects of age and sex on lizard body size  Size Adult females Juvenile females Juvenile males Adult males

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.17 The two-factor model: effects of age and sex on lizard body size Size Juvenile females Juvenile males Adult females Adult males   

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.18 The two-factor model: effects of age and sex on lizard body size Size Juvenile females Juvenile males Adult females Adult males     

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.19 The two-factor model: effects of age and sex on lizard body size Size Juvenile females Juvenile males Adult females Adult males            

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.20 The two-factor model: effects of age and sex on lizard body size Size Juvenile females Juvenile males Adult females Adult males              

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.21 Hypothesis testing in multiple classification ANOVA Proceeds in the same manner as single- classification ANOVA by partitioning the total sums of squares into components due to each factor and their interactions.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.22 The one-way ANOVA table Source of Variation Sum of Squares Mean Square Degrees of freedom F Total Error n - 1 n - k SS/df Groupsk - 1SS/df MS groups MS error i1 k ij j1 n 2 ( Y Y ) i    i i i k n Y Y()    1 2 i1 k i j1 n 2 ( Y Y i)i) i    j

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.23

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.24 Hypothesis testing in 2-factor factorial design ANOVA H 01 : age has no effect on size: all  i ’s = 0 H 02 : sex has no effect on size: all  j ’s = 0 H 03 : The effects of size and age are independent (no interaction): (  ) ij = 0 H 01 : age has no effect on size: all  i ’s = 0 H 02 : sex has no effect on size: all  j ’s = 0 H 03 : The effects of size and age are independent (no interaction): (  ) ij = 0

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.25 Possible outcomes of two-factor ANOVA Decision: accept all H 0 ’s. Inference: body size in lizards is not influenced by sex or age. Decision: accept all H 0 ’s. Inference: body size in lizards is not influenced by sex or age. Size Juvenile Adult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.26 Possible outcomes of two-factor ANOVA Decision: reject H 01, accept other H 0 ’s. Inference: body size in lizards depends on age but not sex. Decision: reject H 01, accept other H 0 ’s. Inference: body size in lizards depends on age but not sex. Size Juvenile Adult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.27 Possible outcomes of two-factor ANOVA Decision: reject H 02, accept other H 0 ’s. Inference: body size in lizards depends on sex, but not age. Decision: reject H 02, accept other H 0 ’s. Inference: body size in lizards depends on sex, but not age. Size Juvenile Adult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.28 Possible outcomes of two-factor ANOVA Decision: reject all H 0 ’s. Inference: body size in lizards is influenced by both age and sex, but the effect of age varies between the sexes (or the effect of sex varies between the ages). Decision: reject all H 0 ’s. Inference: body size in lizards is influenced by both age and sex, but the effect of age varies between the sexes (or the effect of sex varies between the ages). Size Juvenile Adult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.29 Possible outcomes of two-factor ANOVA Decision: reject H 03, accept other H 0 ’s. Inference: there is an effect of sex, but it depends on age (or vice versa); overall, different sexes or different ages do not differ. Decision: reject H 03, accept other H 0 ’s. Inference: there is an effect of sex, but it depends on age (or vice versa); overall, different sexes or different ages do not differ. Size JuvenileAdult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.30 Possible outcomes of two-factor ANOVA Decision: reject H 02 and H 03, accept H 01. Inference: there is an effect of sex, but it depends on age (or vice versa); overall, different sexes differ in size but different ages do not. Decision: reject H 02 and H 03, accept H 01. Inference: there is an effect of sex, but it depends on age (or vice versa); overall, different sexes differ in size but different ages do not. Size Juvenile Adult Male Female

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.31 Possible results from two-factor ANOVA no effects of any factor effect of sex only effect of age only effect of sex and age, no interaction effect of sex and interaction, no age effect of age and interaction, no sex effect of sex, age, and interaction effect of interaction, no effect of sex or age no effects of any factor effect of sex only effect of age only effect of sex and age, no interaction effect of sex and interaction, no age effect of age and interaction, no sex effect of sex, age, and interaction effect of interaction, no effect of sex or age

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.32 Significance testing in 2-factor ANOVA: Model I factorial design Test MS effect over Ms error. Then compare resulting F values to critical values with appropriate degrees of freedom. Test MS effect over Ms error. Then compare resulting F values to critical values with appropriate degrees of freedom.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.33 Significance testing in 2-factor ANOVA: Model II, III factorial design Test MS I over MS error. If H 0I rejected, test MS effect over MS interaction. Note: in Model III, some authors recommend testing random effect over MS error. Test MS I over MS error. If H 0I rejected, test MS effect over MS interaction. Note: in Model III, some authors recommend testing random effect over MS error.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.34 Significance testing in 2-factor ANOVA: Model II, III factorial design Test MS I over MS error. If H 0I accepted, then either (1) test MS effect over MS interaction or (2) pool MS error and MS interaction to get pooled “error” MS E’ with increased df. Test MS I over MS error. If H 0I accepted, then either (1) test MS effect over MS interaction or (2) pool MS error and MS interaction to get pooled “error” MS E’ with increased df.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.35 Important note If interaction is present, it is not clear whether one should even test main effects! This decision usually depends on the biological hypothesis being tested, NOT on the resulting statistics! If interaction is present, it is not clear whether one should even test main effects! This decision usually depends on the biological hypothesis being tested, NOT on the resulting statistics!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.36 Lab example: effects of sex and location on sturgeon size Note: F-tests assume (incorrectly) Model I ANOVA!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.37 Multiple comparisons: factorial design If interaction exists, pairwise contrasts usually done across different levels of one factor (e.g. B) within a level of another factor (e.g. A). E.g. for 2-factor ANOVA, each with 3 levels, there are 9 possible contrasts. If interaction exists, pairwise contrasts usually done across different levels of one factor (e.g. B) within a level of another factor (e.g. A). E.g. for 2-factor ANOVA, each with 3 levels, there are 9 possible contrasts.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.38 Multiple comparisons: factorial design If interaction does not exist, pairwise contrasts are done between treatments for significant effects, pooling over other factor. E.g. compare treatment means of B pooled over factor A (so 3 possible contrasts). If interaction does not exist, pairwise contrasts are done between treatments for significant effects, pooling over other factor. E.g. compare treatment means of B pooled over factor A (so 3 possible contrasts).

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.39 Nested ANOVA: effects of genotype on dessication resistance in fruit flies 3 genotypes (groups, fixed factor) 3 chambers per group (sub-groups, random factor) 5 larvae per chamber, dependent variable is survival in hours. 3 genotypes (groups, fixed factor) 3 chambers per group (sub-groups, random factor) 5 larvae per chamber, dependent variable is survival in hours.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.40 Significance testing in 2-factor ANOVA: Model II, III nested design Test MS subgroups over Ms error. Test MS groups over Ms subgroups. Note: for nested design, there are only two hypotheses to be tested (versus three in factorial design). Test MS subgroups over Ms error. Test MS groups over Ms subgroups. Note: for nested design, there are only two hypotheses to be tested (versus three in factorial design).

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.41 Nested ANOVA: effects of genotype on dessication resistance in fruit flies

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.42 Multiple comparisons: nested design If H 0subgroups is accepted, do pairwise contrasts between groups pooling over subgroups. If H 0subgroups is rejected, be careful! E.g. if factor A (subgroups) is non- significant, then compare pooled (over subgroups) group means (3 possible contrasts). If H 0subgroups is accepted, do pairwise contrasts between groups pooling over subgroups. If H 0subgroups is rejected, be careful! E.g. if factor A (subgroups) is non- significant, then compare pooled (over subgroups) group means (3 possible contrasts).

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.43 Unreplicated designs Each cell has only a single observation, so cannot compute within-group MS (MS error in replicated designs). So MS interaction becomes MS error. So there is no way of testing for interactions; statistical inferences are based on the assumption (which may not be valid) that no interaction is present. Each cell has only a single observation, so cannot compute within-group MS (MS error in replicated designs). So MS interaction becomes MS error. So there is no way of testing for interactions; statistical inferences are based on the assumption (which may not be valid) that no interaction is present. Observation

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.44 Significance testing in 2-factor ANOVA: unreplicated Model I factorial design Test MS effect over Ms error... … but remember any inference from this test depends critically on the no interaction assumption! Test MS effect over Ms error... … but remember any inference from this test depends critically on the no interaction assumption!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.45 Significance testing in 2-factor ANOVA: unreplicated Model II factorial design Test MS effect over MS error. Inference(s) from this test are valid whether an interaction is present or not. Test MS effect over MS error. Inference(s) from this test are valid whether an interaction is present or not.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.46 Significance testing in 2-factor ANOVA: unreplicated Model III factorial design Test MS effect over Ms error. For random factor, inferences from this test are valid whether an interaction is present or not. For fixed factor, inferences are valid only if an interaction is not present. Test MS effect over Ms error. For random factor, inferences from this test are valid whether an interaction is present or not. For fixed factor, inferences are valid only if an interaction is not present.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.47 Repeated measures ANOVA Used when the same sampling units (individuals, plots etc.) are used in different “treatments”. e.g. blood pressure of patients before, 1 month and 2 months after treatment with anti-hypertensive drug. Can consider this a special Model III ANOVA, with time (factor 1) fixed and patient (factor 2) random serving as replicates within time blocks. Used when the same sampling units (individuals, plots etc.) are used in different “treatments”. e.g. blood pressure of patients before, 1 month and 2 months after treatment with anti-hypertensive drug. Can consider this a special Model III ANOVA, with time (factor 1) fixed and patient (factor 2) random serving as replicates within time blocks.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.48 CovarianceCovariance The sample covariance between two variables X and Y is: Cov(X,Y) = 0 if X and Y are independent, 0 if they are positively correlated. The sample covariance between two variables X and Y is: Cov(X,Y) = 0 if X and Y are independent, 0 if they are positively correlated. A covariance matrix is a matrix whose diagonal elements are variances and off-diagonal elements are covariances. Variance Covariance

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.49 Assumptions of repeated measures ANOVA All standard ANOVA assumptions plus… …data must be compound symmetric, i.e. diagonal elements of the covariance matrix must be equal, as must all the off- diagonal elements. if this assumption is not met, use Greenhouse- Geisser or Huyndh-Feldt test statistics. All standard ANOVA assumptions plus… …data must be compound symmetric, i.e. diagonal elements of the covariance matrix must be equal, as must all the off- diagonal elements. if this assumption is not met, use Greenhouse- Geisser or Huyndh-Feldt test statistics. Variance Covariance A compound symmetric covariance matrix

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.50 Example: changes in head dimensions of female children with age Sums of squares are partitioned into a within-individuals among ages (MS age ) component and an among individuals within-age component MS error. H 0 : F = MS age /MS error = 1 Sums of squares are partitioned into a within-individuals among ages (MS age ) component and an among individuals within-age component MS error. H 0 : F = MS age /MS error = 1 Age (yrs) 567 Face width (cm)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.51 Lab example: influence of age on face width of girls

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.52 Non-parametric multiple- classification ANOVA Effect of temperature (fixed) and plant type (fixed) on net primary production (g C/m 2 /day), 4 replicate plots per treatment Calculate ranks, and do 2-factor Model I ANOVA on ranks. Effect of temperature (fixed) and plant type (fixed) on net primary production (g C/m 2 /day), 4 replicate plots per treatment Calculate ranks, and do 2-factor Model I ANOVA on ranks.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.53 Significance testing in 2-factor non- parametric ANOVA Test H = SS effect over MS total. Compare H to  2 distribution with appropriate degrees of freedom. Test H = SS effect over MS total. Compare H to  2 distribution with appropriate degrees of freedom.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.54 Effects of sex and location on sturgeon round weight

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.55 Multiple-classification ANOVA: the randomized block design In factorial designs (completely randomized design) each observation is assumed independent of all other observations. But in some designs (randomized block designs) one observation in one treatment is related in some way to one observation in all other treatments. The set of “related” observations is said to constitute a “block”. In factorial designs (completely randomized design) each observation is assumed independent of all other observations. But in some designs (randomized block designs) one observation in one treatment is related in some way to one observation in all other treatments. The set of “related” observations is said to constitute a “block”.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.56 Completely randomized versus randomized block designs From each of 20 sows, 1 offspring is chosen at random and assigned at random to one of 4 experimental diets. So, observations are completely randomized, and the appropriate model is a Model I single-classification ANOVA. From each of 20 sows, 1 offspring is chosen at random and assigned at random to one of 4 experimental diets. So, observations are completely randomized, and the appropriate model is a Model I single-classification ANOVA.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.57 Completely randomized versus randomized block designs From each of 5 sows, 4 offspring are selected at random. Each offspring is assigned at random to one of 4 experimental diets. Since 4 offspring are related, each set of siblings (litter) constitutes a block and the appropriate model is two-factor Model III ANOVA: diets (fixed) and litters (blocks, random). From each of 5 sows, 4 offspring are selected at random. Each offspring is assigned at random to one of 4 experimental diets. Since 4 offspring are related, each set of siblings (litter) constitutes a block and the appropriate model is two-factor Model III ANOVA: diets (fixed) and litters (blocks, random).

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.58 Randomized blocks: Model III 2-factor ANOVA 2-factor randomized block design is treated as a Model III 2-factor ANOVA without replication, with Factor 1 (fixed) and Factor 2 (blocks) always the random factor.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.59 Example: plant growth under different fertilizer treatments Environmental gradients in temperature, moisture, light etc. may exist in a field or greenhouse, so 5 blocks are created, with 4 plots in each, and plots assigned randomly to one of 4 fertilizer treatments (1,2,3,4)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.60 Example: plant growth under different fertilizer treatments H 0 : growth rate is the same for all treatments. reject H 0 : p(treatment) =.0007 p(blocks) = 0.08, which is suspicious, perhaps indicating environmental variability in the field. H 0 : growth rate is the same for all treatments. reject H 0 : p(treatment) =.0007 p(blocks) = 0.08, which is suspicious, perhaps indicating environmental variability in the field.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.61 Non-parametric randomized blocks If there is evidence that the k levels of the fixed factor do not met parametric assumptions, use Friedman’s test. For a groups (treatments) and b blocks, the test statistic is: R i is the rank sum for group I, and the test statistic is approximately  2 distributed. If there is evidence that the k levels of the fixed factor do not met parametric assumptions, use Friedman’s test. For a groups (treatments) and b blocks, the test statistic is: R i is the rank sum for group I, and the test statistic is approximately  2 distributed.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.62 Example: plant growth under different fertilizer treatments H 0 : R i is the same for all treatments. Therefore, reject H 0 : p(treatment) = H 0 : R i is the same for all treatments. Therefore, reject H 0 : p(treatment) = 0.008

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.63 Power and sample size in Model I two-factor ANOVA Maximal power for given total sample size N is obtained with a balanced design (equal number of observations in each cell). Cell entries are means of N = 5 plots, in tonnes/acre.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.64 Power and sample size in two-factor Model I ANOVA Two factors (A and B), a levels of factor A, b levels of factor B (so k’ = a or b) at specified . Balanced design with n’ observations per cell,  m is cell mean. Given within-group variability s 2 (MS error ), we can calculate  for each factor: Two factors (A and B), a levels of factor A, b levels of factor B (so k’ = a or b) at specified . Balanced design with n’ observations per cell,  m is cell mean. Given within-group variability s 2 (MS error ), we can calculate  for each factor:

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.65 Calculating power given  Given 1 (factor df, e.g. a-1, b-1), 2 (within-cell (error) df),  and , can read 1-  from suitable tables or curves (e.g. Zar (1996), Appendix Figure B.1). 1-  Decreasing 2 1 = 2  =  =  =.05)  =.01)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.66 Model I ANOVA: minimal detectable difference Suppose we want to detect a difference between the two most different sample means of each level of some factor (A, B) at least . To test at the  significance level with 1 -  power, we can calculate the minimal sample size n min required to detect , given a sample group variance s 2, by solving iteratively. Suppose we want to detect a difference between the two most different sample means of each level of some factor (A, B) at least . To test at the  significance level with 1 -  power, we can calculate the minimal sample size n min required to detect , given a sample group variance s 2, by solving iteratively.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.67 Power of the test: main effects If H 0 is accepted, it is good practice to calculate power! Knowing MS factor, s 2 (= MS error ), and k’, we can calculate  for each main effect. If H 0 is accepted, it is good practice to calculate power! Knowing MS factor, s 2 (= MS error ), and k’, we can calculate  for each main effect.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.68 Power of the test: interaction effect If H 0 is accepted, it is good practice to calculate power! Knowing MS interaction and s 2 (= Ms error ) we can calculate  for the interaction. If H 0 is accepted, it is good practice to calculate power! Knowing MS interaction and s 2 (= Ms error ) we can calculate  for the interaction.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.69 Power of the test: an example Effect of hormone treatment on bird plasma concentrations 5 individuals of each sex (Factor B, male (M) or female (F)) with or without hormone treatment (Factor A) H 0 accepted for main effect B (sex) and interaction. Effect of hormone treatment on bird plasma concentrations 5 individuals of each sex (Factor B, male (M) or female (F)) with or without hormone treatment (Factor A) H 0 accepted for main effect B (sex) and interaction.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.70 Power of the test: an example What is the power of the test for a sex effect? So there is about a 71% chance of committing a Type II error. What is the power of the test for a sex effect? So there is about a 71% chance of committing a Type II error.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.71 Power and sample size in Model III two- factor ANOVA: replicated design In Model III ANOVA with replication, we can calculate power with respect to hypotheses concerning the fixed factor by substituting MS interaction for MS error, and using df interaction for 2. Body size (kg) Riding Mountain Kluane Algonquin males females

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.72 Power and sample size in Model III two- factor ANOVA: unreplicated design In Model III ANOVA without replication, we can calculate power with respect to hypotheses concerning the fixed factor by substituting MS remainder for MS error, and using df remainder for 2.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.73 Multi-way ANOVA In principle, the procedures for 2-way ANOVAs can be extended to 3 or more factors, e.g. effect of species (factor 1), temperature (factor 2) and sex (factor 3) on respiration rate in crabs. In practice, higher-order ANOVAs are often difficult to interpret because of the large number of possible null hypotheses. In principle, the procedures for 2-way ANOVAs can be extended to 3 or more factors, e.g. effect of species (factor 1), temperature (factor 2) and sex (factor 3) on respiration rate in crabs. In practice, higher-order ANOVAs are often difficult to interpret because of the large number of possible null hypotheses.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L way Model I factorial ANOVA In 3-way factorial model I ANOVA, there are 7 null hypotheses. All effects MS are tested over MS error. In 3-way factorial model I ANOVA, there are 7 null hypotheses. All effects MS are tested over MS error.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.75 Number of testable hypotheses in multi-way factorial ANOVA As the number of factors increases, the number of possible hypotheses more than doubles.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.76 Multi-way ANOVA: blocked and repeated measures designs Experimental designs with 3 or more factors where one of the factors is a block or a subject upon which repeated measures are taken Analysis proceeds as a factorial ANOVA with the block or repeated factor considered a random- effects factor. Hence, all such designs are Model III. Experimental designs with 3 or more factors where one of the factors is a block or a subject upon which repeated measures are taken Analysis proceeds as a factorial ANOVA with the block or repeated factor considered a random- effects factor. Hence, all such designs are Model III.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.77 Distinguishing blocked and repeated measures designs If each block consists of a number of independent observations (e.g. individuals), then the design is blocked. In a split-plot design, the same block is applied to some - but not all - of the combination of factors. In repeated measures designs, the same individual is exposed to some - but not all - of the combination of factors. If each block consists of a number of independent observations (e.g. individuals), then the design is blocked. In a split-plot design, the same block is applied to some - but not all - of the combination of factors. In repeated measures designs, the same individual is exposed to some - but not all - of the combination of factors.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.78 Effects of diet and exercise on animal body weight: blocked design Body weight measured on 2 diets (D 1, D 2 ) and 2 exercise regimens (E 1, E 2 ), 4 blocks per diet, and 2 animals per block, one animal assigned at random to each of the 2 exercise regimens (16 animals in total). Diet and exercise are fixed factors. Body weight measured on 2 diets (D 1, D 2 ) and 2 exercise regimens (E 1, E 2 ), 4 blocks per diet, and 2 animals per block, one animal assigned at random to each of the 2 exercise regimens (16 animals in total). Diet and exercise are fixed factors.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.79 Effects of diet and exercise on animal body weight: repeated measures design Body weight measured on 2 diets (D 1, D 2 ) and 2 exercise regimens (E 1, E 2 ), 4 subjects per diet, each subject exposed to both exercise regimens (8 animals in total). Diet and exercise are fixed factors. Note that N here is half of the blocked design! Body weight measured on 2 diets (D 1, D 2 ) and 2 exercise regimens (E 1, E 2 ), 4 subjects per diet, each subject exposed to both exercise regimens (8 animals in total). Diet and exercise are fixed factors. Note that N here is half of the blocked design!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.80 Multi-way ANOVA - repeated measures designs Effect of sex (factor 1) and diet (factor 2) on plasma protein levels of turtles (subjects, repeated factor), 8 animals in total

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.81 Variance decomposition Test between (within)-subject effects over between(within) -subjects error, e.g.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.82 Multi-way ANOVA - blocked design Effect of sex (factor 1) and diet (factor 2) on plasma protein levels of turtles, 4 blocks per sex, 3 animals per block (24 animals total)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.83 Variance decomposition: blocked design Test fixed factor MS over remainder MS. Treat test of MS blocks /MS remainder with caution! Test fixed factor MS over remainder MS. Treat test of MS blocks /MS remainder with caution!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.84 Power and sample size in multi-way ANOVA The principles and procedures for two-way ANOVA can be extended quite simply to multi-way ANOVA.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.85 Model I multi-way ANOVA For calculating , k’ is number of levels of (fixed) factor under consideration, n’ is total number of data (i.e. pooled over other factors) in each level of the factor, s 2 is MS error.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.86 Power and sample size in 3-way Model I ANOVA: an example Effect of species, sex and temperature on crab O 2 consumption (crabO2.sys)

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.87 Model I ANOVA: minimal detectable difference Suppose we want to detect a difference between the two most different sample means of each level of sex of at least . For 1 = 1, 2 = 54, to test at the .05 significance level with 1 - .95 (say), we require  = 5.2, giving n min = 1590! Suppose we want to detect a difference between the two most different sample means of each level of sex of at least . For 1 = 1, 2 = 54, to test at the .05 significance level with 1 - .95 (say), we require  = 5.2, giving n min = 1590!

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.88 Power of the test: main effects What is the power of the test for an effect of sex? So there is about a 79% chance of committing a Type II error. What is the power of the test for an effect of sex? So there is about a 79% chance of committing a Type II error.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.89 Power of the test: interaction effect What is the power to detect a sex X temp interaction? So there is about a 75% chance of detecting an interaction. What is the power to detect a sex X temp interaction? So there is about a 75% chance of detecting an interaction.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.90 Model III multi- way ANOVA To estimate power to detect fixed effects in model III ANOVA, use previous procedures, except…...for within-cells effect (s 2 ), substitute the appropriate denominator in the F test for significance of the effect. This is often NOT MS error ! To estimate power to detect fixed effects in model III ANOVA, use previous procedures, except…...for within-cells effect (s 2 ), substitute the appropriate denominator in the F test for significance of the effect. This is often NOT MS error !

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.91 Example: calculating in repeated measures designs Effect of sex (fixed factor 1) and diet (fixed factor 2) on plasma protein levels of turtles (subjects, repeated factor), 8 animals in total

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.92 Power to detect a sex effect To calculate , substitute subjects within sex MS and df for s 2.

Université d’Ottawa / University of Ottawa 2001 Bio 4118 Applied Biostatistics L9.93 Multi-way ANOVA: critical questions How many factors? Model type (I, II, or III)? Model design n factorial? n nested? n blocked? n repeated measures? n mixed? How many factors? Model type (I, II, or III)? Model design n factorial? n nested? n blocked? n repeated measures? n mixed? Replication n balanced/unbalanced? n unreplicated? Parametric or non- parametric? The answers to these questions determines what hypotheses can be tested and what the appropriate test is. So, get them right!