2 Way Analysis of Variance (ANOVA) Peter Shaw RU.

Slides:



Advertisements
Similar presentations
Prepared by Lloyd R. Jaisingh
Advertisements

Multiple-choice question
ANOVA Two Factor Models Two Factor Models. 2 Factor Experiments Two factors can either independently or together interact to affect the average response.
1 Way Analysis of Variance (ANOVA) Peter Shaw RU.
 Population multiple regression model  Data for multiple regression  Multiple linear regression model  Confidence intervals and significance tests.
Analysis of Variance (ANOVA) ANOVA methods are widely used for comparing 2 or more population means from populations that are approximately normal in distribution.
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:
The Two Factor ANOVA © 2010 Pearson Prentice Hall. All rights reserved.
ANOVA: ANalysis Of VAriance. In the general linear model x = μ + σ 2 (Age) + σ 2 (Genotype) + σ 2 (Measurement) + σ 2 (Condition) + σ 2 (ε) Each of the.
Analysis of Variance: Inferences about 2 or More Means
Lesson #23 Analysis of Variance. In Analysis of Variance (ANOVA), we have: H 0 :  1 =  2 =  3 = … =  k H 1 : at least one  i does not equal the others.
ANCOVA Psy 420 Andrew Ainsworth. What is ANCOVA?
Intro to Statistics for the Behavioral Sciences PSYC 1900
Chapter 10 - Part 1 Factorial Experiments.
Introduction to Probability and Statistics Linear Regression and Correlation.
Chapter 9 - Lecture 2 Computing the analysis of variance for simple experiments (single factor, unrelated groups experiments).
Comparing Several Means: One-way ANOVA Lesson 14.
Analysis of Variance Introduction The Analysis of Variance is abbreviated as ANOVA The Analysis of Variance is abbreviated as ANOVA Used for hypothesis.
Chap 10-1 Analysis of Variance. Chap 10-2 Overview Analysis of Variance (ANOVA) F-test Tukey- Kramer test One-Way ANOVA Two-Way ANOVA Interaction Effects.
Chapter 12: Analysis of Variance
Analysis of Variance. ANOVA Probably the most popular analysis in psychology Why? Ease of implementation Allows for analysis of several groups at once.
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.
One-Factor Experiments Andy Wang CIS 5930 Computer Systems Performance Analysis.
Calculations of Reliability We are interested in calculating the ICC –First step: Conduct a single-factor, within-subjects (repeated measures) ANOVA –This.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Comparing Three or More Means 13.
© 1998, Geoff Kuenning General 2 k Factorial Designs Used to explain the effects of k factors, each with two alternatives or levels 2 2 factorial designs.
Chapter 11 HYPOTHESIS TESTING USING THE ONE-WAY ANALYSIS OF VARIANCE.
Sociology 5811: Lecture 14: ANOVA 2
Two-way ANOVA Introduction to Factorial Designs and their Analysis.
CHAPTER 12 Analysis of Variance Tests
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.
Chapter 9 Analyzing Data Multiple Variables. Basic Directions Review page 180 for basic directions on which way to proceed with your analysis Provides.
Psychology 301 Chapters & Differences Between Two Means Introduction to Analysis of Variance Multiple Comparisons.
Testing Hypotheses about Differences among Several Means.
Introduction to Probability and Statistics Thirteenth Edition Chapter 12 Linear Regression and Correlation.
Chapter 10: Analyzing Experimental Data Inferential statistics are used to determine whether the independent variable had an effect on the dependent variance.
MGS3100_04.ppt/Sep 29, 2015/Page 1 Georgia State University - Confidential MGS 3100 Business Analysis Regression Sep 29 and 30, 2015.
INTRODUCTION TO ANALYSIS OF VARIANCE (ANOVA). COURSE CONTENT WHAT IS ANOVA DIFFERENT TYPES OF ANOVA ANOVA THEORY WORKED EXAMPLE IN EXCEL –GENERATING THE.
Comparing Three or More Means ANOVA (One-Way Analysis of Variance)
ANALYSIS OF VARIANCE (ANOVA) BCT 2053 CHAPTER 5. CONTENT 5.1 Introduction to ANOVA 5.2 One-Way ANOVA 5.3 Two-Way ANOVA.
© Copyright McGraw-Hill Correlation and Regression CHAPTER 10.
Chapter 14 Repeated Measures and Two Factor Analysis of Variance
Previous Lecture: Phylogenetics. Analysis of Variance This Lecture Judy Zhong Ph.D.
Chapter 10: Analysis of Variance: Comparing More Than Two Means.
Introduction to Basic Statistical Tools for Research OCED 5443 Interpreting Research in OCED Dr. Ausburn OCED 5443 Interpreting Research in OCED Dr. Ausburn.
Analysis and Interpretation: Analysis of Variance (ANOVA)
Chapter 12 Introduction to Analysis of Variance PowerPoint Lecture Slides Essentials of Statistics for the Behavioral Sciences Eighth Edition by Frederick.
Chapter 13 Repeated-Measures and Two-Factor 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.
Smith/Davis (c) 2005 Prentice Hall Chapter Fifteen Inferential Tests of Significance III: Analyzing and Interpreting Experiments with Multiple Independent.
Statistics for Political Science Levin and Fox Chapter Seven
Sociology 5811: Lecture 13: ANOVA Copyright © 2005 by Evan Schofer Do not copy or distribute without permission.
Introduction to ANOVA Research Designs for ANOVAs Type I Error and Multiple Hypothesis Tests The Logic of ANOVA ANOVA vocabulary, notation, and formulas.
Chapter 9 More Complicated Experimental Designs. Randomized Block Design (RBD) t > 2 Treatments (groups) to be compared b Blocks of homogeneous units.
Factorial Design of Experiments. An Economy of Design Two or more levels of each factor (variable) are administered in combination with the two or more.
©2013, The McGraw-Hill Companies, Inc. All Rights Reserved Chapter 4 Investigating the Difference in Scores.
F73DA2 INTRODUCTORY DATA ANALYSIS ANALYSIS OF VARIANCE.
Two-Way Analysis of Variance Chapter 11.
Factorial Experiments
Comparing Three or More Means
Chapter 10: Analysis of Variance: Comparing More Than Two Means
Statistics for the Social Sciences
Correlation and Regression
Statistics review Basic concepts: Variability measures Distributions
Chapter 13 Group Differences
Chapter 14: Two-Factor Analysis of Variance (Independent Measures)
One way Analysis of Variance (ANOVA)
MGS 3100 Business Analysis Regression Feb 18, 2016
STATISTICS INFORMED DECISIONS USING DATA
Presentation transcript:

2 Way Analysis of Variance (ANOVA) Peter Shaw RU

n ANOVA - a recapitulation. n This is a parametric test, examining whether the means differ between 2 or more populations. n It generates a test statistic F, which can be thought of as a signal:noise ratio. Thus large Values of F indicate a high degree of pattern within the data and imply rejection of H0. n It is thus similar to the t test - in fact ANOVA on 2 groups is equivalent to a t test [F = t 2 ]

How to do an ANOVA: table 1: Calculate total Sum of Squares for the data Ss tot = Σ i (x i - μ ) 2  = Σ i ( x i 2 ) – CF  where CF = Correction factor = ( Σ i x i * Σ i x i ) /N n 2: calculate Treatment Sum of Squares SS trt = Σ t (X t. *X t. )/r - CF u where X t. = sum of all values within treatment t n 3: Draw up ANOVA table

ANOVA tables n Exact layout varies somewhat - I dislike SPSS’s version! n Learn as parrots: n Source DF SS MS F SourcedfSSMSF Treatment(T-1)SS trtSStrt / (T-1)MStrt / MSerr ErrorSserr by subtraction =SS err / DF err TotalN-1Ss totVariance

One way ANOVA’s limitations n This technique is only applicable when there is one treatment used. n Note that the one treatment can be at 3, 4,… many levels. Thus fertiliser trials with 10 concentrations of fertiliser could be analysed this way, but a trial of BOTH fertiliser and insecticide could not.

Linear models.. n Although rather worrying-looking, these equations formally define the ANOVA model being used. (By understanding these equations you can readily derive all of ANOVA from scratch) n The formal model underlying 1-Way ANOVA with Treatment A and r replicates: n X ir = μ + A i + Err ir n X ir is the rth replicate of Treatment A applied at level i n A i is the effect of treatment i (= difference between μ and mean of all data in treatment i. n Err tr is the unexplained error in Observation X tr Note that ΣA i = Σerr ir = 0

μ Trt 1 Trt 2 n Basic model: Data are deviations from the global mean: n X ir = μ + Err ir n Sum of vertical deviations squared = SS tot Trt 1 Trt 2 n 1 way model: Data are deviations from treatment means: n X ir = μ + A i + Err ir n Sum of vertical deviations squared = SS err A1 A2

μ μ A1 No model n X ir just is! n H0 model: n X ir = μ + Err ir 1 way anova model: X ir = μ + A i + Err ir

Two-way ANOVA n Allows two different treatments to be examined simultaneously. n In its simplest form it is all but identical to 1 way, except that you calculate 2 different treatment sums of squares: Calculate total Sum of Squares Ss tot = Σ i ( x i 2 ) – CF Calculate Sum of Squares for treatment A SS A = Σ A (X A. *X A. )/r - CF Calculate Sum of Squares for treatment B SS B = Σ B (X B. *X B. )/r - CF

2 Way ANOVA table SourcedfSSMSF Treatment A(N A -1)SS A SS A / (N A -1)MS A / MS err Treatment B(N B -1)SS B SS B / (N B -1)MS B / MS err ErrorByBy Subtraction SubtractionSS err / DF err TotalN-1SS totVariance

The 2 way Linear model n The formal model underlying 2-Way ANOVA, with 2 treatments A and B n X ikr = μ + A i + B k + err ikr n X ikr is the rth replicate of Treatment A level i and treatment B level k n A i is the effect of the i th level of treatment A (= difference between μ and mean of all data in this treatment. n B k is the effect of the k th level of treatment B (= difference between μ and mean of all data in this treatment. n Err ijr is the unexplained error in Observation X ijr Note that ΣA i = ΣB k = Σerr ikr = 0

To take a worked example (Steel & Torrie p. 343). Effect of 2 treatments on blood phospholipids in lambs. 1 was a handling treatment, one the time of day. A1B1A1B2A2B1A2B totals:

2 Way ANOVA on these data: Start by a preliminary eyeballing of the data: They are continuous, plausibly normally distributed. There are 2 handling treatments and 2 time treatments, which are combined in a factorial design so that each of the 4 combinations is replicated 5 times. Get the basics: n = 20 Σx = Σx^2 = CF = ^2 / 20 = SS = cf =

Now get totals for treatments A and B A1A2Σ B B Σ Hence the sums of squares for A and B can be calculated: SSA = ^2/ ^2 / 10 - CF = SSB = ^2/ ^2/10 - CF = 8.712

A alone SourceDfSSMSF A ** error total B alone SourceDfSSMSF B NS error total Pooled (the correct format) SourceDfSSMSF A ** B NS error total

Note that we have reduced error variance and DF by incorporating 2 treatments into one table. This is not just good practice but technically required - by including only one treatment in the table you are implicitly calling the effects of the other treatment random noise, which is incorrect. ANOVA tables can have many different treatments included. The skill in ANOVA is not working out the sums of squares, it is the interpretation of ANOVA tables. The clues to look for are always in the DF column. A treatment with N levels has N-1 DF - this always applies and allows you to infer the model a researcher was using to analyse data.

A B Your turn! These data come from a factorial experiment with 2 treatments applied at 3 levels each, with 2 replicates of each treatment. Hence the design contains 3 (A)*3 (B)*2(reps) = 18 data points. They are specially contrived to make the calculations easy for ANOVA Remember the sequence: Get: n, Σx, Σx^2 Calculate CF then SS tot Get the totals for each treatment: A1, A2, A3, B1, B2 and B3 hence get SS A and SS B

These model data: n N = 18 n Σx = n Σx^2 = n CF = n SS tot = =

Totals for each treatment: n A1A2A3Σ n B n B n B n Σ

Sums of squares: n SSa = 200^2/ ^2/ ^2/6 - CF = n SSb = 180^2/ ^2/ ^2/6 - CF = n SourceDfSSMSF n A NS n B ** n error n Σ

Interaction terms n We now meet a unique, powerful feature of ANOVA. It can examine data for interactions between treatments - synergism or antagonism. n No other test allows this, while in ANOVA it is a standard feature of any 2 way table. n Note that this interaction analysis is only valid if the design is perfectly balanced. Unequal replication or missing data points make this invalid (unlike 1 way, which is robust to imbalance).

Synergism and antagonism n Some treatments intensify each others’ effects: n The classic examples come from pharmacology. n Alcohol alone is lethal at the unit range. Barbiturates are lethal. Together they are a vastly more lethal combination, as the 2 drugs synergise. (In fact most sedatives and depressants show similar dangerous synergism). n In ecology, SO2 + NO2 is more damaging than the additive effects of each gas alone - a synergism.

Antagonism. n is the opposite - 2 treatments nullifying each other. n Drought antagonises effects of air pollution on plants, as drought leads to closed stomata excluding the noxious gas.

123 Treatment A I I I1 Treatment B Response 123 Treatment A I I I Response 123 I I I I I I 2 No interaction I I I Synergism I I I Antagonism

How to do this? n Easy! We work out a sum of squares caused by ALL treatments at ALL levels. Thus for a 3*3 design there are really 9 treatments, etc. Call this SS trt n Now we can partition this Sum of squares: SStrt = SS A + SS B + SS Interaction n We know SSA, we know SSB, so we get SS interaction by subtraction. n To get SStrt we just add up all data in each treatment, square this total, divide by replicates, add up and remove CF.

For the lamb blood data: n We have 4 separate treatments: A1B1, A1B2, A2B1, A2B2 n The data within these 4 groups add to: 66.39, , 96.80, There are 5 replicates n SStrt = 66.39^2/ ^2/ ^2/ ^2/5 - CF =

n SourceDfSSMSF n All trts *********** n A * n B NS n A*B ** n error Σ Way anova table with interaction

Interpreting the interaction term The hardest part of 2 way anova is trying to explain what a significant interaction term means, in terms that make sense to most people! Formally it is easy; you are testing H0: Ms for interaction term is same population as MS for error. In English let’s try “It means that you can’t reliably predict the effect of Treatment A at level m with B at level n, knowing only the effect of A m and B n on their own.”

Treatment A – big effect (A2>A1) Treatment B – mean (B1) is v close to mean (B2) so no effect Interaction: When A=1, B1 B2 A1B1 A1B2 A2B1 A2B2