Basics of ANOVA Why ANOVA Assumptions used in ANOVA Various forms of ANOVA Simple ANOVA tables Interpretation of values in the table Exercises.

Slides:



Advertisements
Similar presentations
1 Chapter 4 Experiments with Blocking Factors The Randomized Complete Block Design Nuisance factor: a design factor that probably has an effect.
Advertisements

Chapter 4 Randomized Blocks, Latin Squares, and Related Designs
Methods for Dummies Isobel Weinberg & Alexandra Westley.
ANOVA example 4 Polychlorinated biphenyls (PCBs) previously used in the manufacture of large electrical transformers and capacitors, are extremely hazardous.
Design of Experiments and Analysis of Variance
Comparing k Populations Means – One way Analysis of Variance (ANOVA)
Maximum likelihood (ML) and likelihood ratio (LR) test
Independent Sample T-test Formula
Basics of ANOVA Why ANOVA Assumptions used in ANOVA Various forms of ANOVA Simple ANOVA tables Interpretation of values in the table Exercises.
Basics of ANOVA Why ANOVA Assumptions used in ANOVA
Part I – MULTIVARIATE ANALYSIS
Basics of ANOVA Why ANOVA Assumptions used in ANOVA
1 Chapter 3 Multiple Linear Regression Ray-Bing Chen Institute of Statistics National University of Kaohsiung.
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.
Chapter 3 Analysis of Variance
PSY 307 – Statistics for the Behavioral Sciences
Intro to Statistics for the Behavioral Sciences PSYC 1900
Design of experiment and ANOVA
Log-linear and logistic models Generalised linear model ANOVA revisited Log-linear model: Poisson distribution logistic model: Binomial distribution Deviances.
Lecture 9: One Way ANOVA Between Subjects
Log-linear and logistic models
Design of experiment: ANOVA and testing hypotheses
Design of experiment I Motivations Factorial (crossed) design
Linear and generalised linear models
PSY 307 – Statistics for the Behavioral Sciences Chapter 19 – Chi-Square Test for Qualitative Data Chapter 21 – Deciding Which Test to Use.
The Kruskal-Wallis Test The Kruskal-Wallis test is a nonparametric test that can be used to determine whether three or more independent samples were.
5-3 Inference on the Means of Two Populations, Variances Unknown
Statistical Methods in Computer Science Hypothesis Testing II: Single-Factor Experiments Ido Dagan.
Introduction to Analysis of Variance (ANOVA)
Chi-Square Tests and the F-Distribution
6.1 - One Sample One Sample  Mean μ, Variance σ 2, Proportion π Two Samples Two Samples  Means, Variances, Proportions μ 1 vs. μ 2.
Analysis of Variance. ANOVA Probably the most popular analysis in psychology Why? Ease of implementation Allows for analysis of several groups at once.
F-Test ( ANOVA ) & Two-Way ANOVA
PS 225 Lecture 15 Analysis of Variance ANOVA Tables.
Inferential Statistics: SPSS
STAT 3130 Statistical Methods I Session 2 One Way Analysis of Variance (ANOVA)
ANOVA Greg C Elvers.
One-Way Analysis of Variance Comparing means of more than 2 independent samples 1.
Chapter 11 HYPOTHESIS TESTING USING THE ONE-WAY ANALYSIS OF VARIANCE.
© Copyright McGraw-Hill CHAPTER 12 Analysis of Variance (ANOVA)
Analysis of variance Petter Mostad Comparing more than two groups Up to now we have studied situations with –One observation per object One.
PSY 307 – Statistics for the Behavioral Sciences Chapter 16 – One-Factor Analysis of Variance (ANOVA)
Testing Multiple Means and the Analysis of Variance (§8.1, 8.2, 8.6) Situations where comparing more than two means is important. The approach to testing.
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.
Copyright © 2004 Pearson Education, Inc.
Chapter 10: Analyzing Experimental Data Inferential statistics are used to determine whether the independent variable had an effect on the dependent variance.
INTRODUCTION TO ANALYSIS OF VARIANCE (ANOVA). COURSE CONTENT WHAT IS ANOVA DIFFERENT TYPES OF ANOVA ANOVA THEORY WORKED EXAMPLE IN EXCEL –GENERATING THE.
One-Way ANOVA ANOVA = Analysis of Variance This is a technique used to analyze the results of an experiment when you have more than two groups.
Orthogonal Linear Contrasts This is a technique for partitioning ANOVA sum of squares into individual degrees of freedom.
Analysis of Variance 1 Dr. Mohammed Alahmed Ph.D. in BioStatistics (011)
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Statistical Testing of Differences CHAPTER fifteen.
ANOVA: Analysis of Variance.
Previous Lecture: Phylogenetics. Analysis of Variance This Lecture Judy Zhong Ph.D.
1 ANALYSIS OF VARIANCE (ANOVA) Heibatollah Baghi, and Mastee Badii.
Comparing k Populations Means – One way Analysis of Variance (ANOVA)
Copyright (C) 2002 Houghton Mifflin Company. All rights reserved. 1 Understandable Statistics S eventh Edition By Brase and Brase Prepared by: Lynn Smith.
ANOVA P OST ANOVA TEST 541 PHL By… Asma Al-Oneazi Supervised by… Dr. Amal Fatani King Saud University Pharmacy College Pharmacology Department.
Experimental Statistics - week 3
One-Way Analysis of Variance Recapitulation Recapitulation 1. Comparing differences among three or more subsamples requires a different statistical test.
The p-value approach to Hypothesis Testing
(c) 2007 IUPUI SPEA K300 (4392) Outline Comparing Group Means Data arrangement Linear Models and Factor Analysis of Variance (ANOVA) Partitioning Variance.
Chapter 14: Analysis of Variance One-way ANOVA Lecture 9a Instructor: Naveen Abedin Date: 24 th November 2015.
381 Introduction to ANOVA QSCI 381 – Lecture 43 (Larson and Farber, Sect 10.4)
Analysis of Variance Yonghui Dong 03/12/2013. Why not multiple t tests comparison? Three Groups comparison: Group 1 vs. Group 2 Group 1 vs. Group 3 Group.
F73DA2 INTRODUCTORY DATA ANALYSIS ANALYSIS OF VARIANCE.
The 2 nd to last topic this year!!.  ANOVA Testing is similar to a “two sample t- test except” that it compares more than two samples to one another.
Chapter 10 – Part II Analysis of Variance
Presentation transcript:

Basics of ANOVA Why ANOVA Assumptions used in ANOVA Various forms of ANOVA Simple ANOVA tables Interpretation of values in the table Exercises

Why ANOVA If we have two samples then under mild conditions we can use t-test to test if difference between means is significant. When there are more than two sample then using t-test might become unreliable. ANalysis Of VAriances – ANOVA is designed to test differences between means in many sample cases. Examples of ANOVA: Suppose that we want test effect of various exercises on weight loss. We want to test 5 different exercises. We recruit 20 men and assign for each exercises four of them. After few weeks we record weight loss. Let us denote i=1,2,3,4,5 as exercise number and j=1,2,3,4 person’s number. Then Y ij is weight loss for jth person on the ith exercise programme. It is one-way balanced ANOVA. One way because we have only one category (exercise programme). Balanced because we have exactly same number of men on each exercise programme. Another example: Now we want to subdivide each exercises into 4 subcategories. For each subcategory of the exercise we recruit four men. We measure weight loss after few weeks. i – exercise category j – exercise subcategory k – kth men. Then Y ijk is weight loss for kth men in the jth subcategory of ith category. Number of observations is 5x4x4 = 80. It is two-fold nested ANOVA. We want to test: a) There is no significant differences between categories; b) there is no significant difference between different subcategories

Examples of ANOVA One more example: We have 5 categories of exercises and 4 categories of diets. We hire for each exercise and category 4 persons. There will be 5x4x4=80 men. It is two way crossed ANOVA. Two-way because we have categorised men in two ways: exercises and diets. This model is also balanced: we have exactly same number of men for each exercise-diet. i – exercise number j – diet number k – kth person Y ijk – kth person in the ith exercise and jth diet. In this case we can have two different type of hypothesis testing. Assume that mean for each exercise-diet combination is  ij. If we assume that model is additive, i.e. effect of exercise and diet adds up then we have:  ij =  i +  j.  i is the effect of ith exercise and  j the effect if diet. Then we want to test following hypotheses: a)  ij does not depend on exercise and b)  ij does not depend on diet. Sometimes we do not want to assume additivity. Then we want to test one more hypothesis: model is additive. If model is not additive then there might be some problems of interpretations with other hypotheses. In this case it might be useful to use transformation to make the model additive. Models used for ANOVA can be made more and more complicated. We can design three, four ways crossed models or nested models. We can combine nested and crossed models together. Number of possible ANOVA models is very large.

Assumptions ANOVA models are special cases of the linear models. We can write the model as: Where Y is the observation vector,  -is vector of the means composed of the treatement means and  is the error vector. Basic assumptions in ANOVA models are: 1.Expected values of the errors are 0 2.Variance of all errors are equal to each other 3.Errors are independent 4.Errors are normally distributed All ANOVA treatments are very sensitive to assumptions 1)-3). F-tests meant to be robust against the assumption 4). If assumptions 1)-3) are valid then 4) will always be valid at least asymptotically. I.e. for large number of the observations

ANOVA tables Standard ANOVA tables look like Where v 1,,,v p are values we want to test if they are 0. df is degrees of freedom corresponding to this value. SSh is sum of the squares corresponding to this value (h denotes hypothesis). F is F-value we want to test. Its degrees of freedom is (d i,d e ). Prob is corresponding probability. If probability is very low then we reject hypothesis that this value is 0. If the value for prob is high enough then we do not reject null-hypothesis that this value is 0. These values are calculated using likelihood ratio test. Let us say we want to test hypothesis: H 0: v i =0 vs H 1 :v i  0 Then we maximise likelihood under null hypothesis find corresponding variance then we maximise the likelihood under alternative hypothesis and find corresponding variance. Then we calculate sum of the squares for null and alternative hypothesis find F-statistics effectdfSShMSFprob v1v1 d1d1 SS 1 MS 1 =SS 1 /d 1 MS 1 /MS e pr 1... vpvp dpdp SS p MS p =SS p /d p MS p /MS e pr p errordede SS e MS e =SS e /d e totalNSS t

LR test for ANOVA Suppose variances are: Then mean sum of the squares for the null and alternative hypotheses as: Since first sum of squares is  2 with degrees of freedom dfh and the second sum of squares is  2 with degrees of freedom dfe and they are independent then their ratio has F-distribution with degrees of freedom (dfh,dfe). Degrees of freedom of hypothesis is found using number of elements in the category-1 in the simplest case. Using this type of ANOVA tables we can only tell if there is significant differences between means. It does not tell which one is significantly different. This ratio has F distribution if null-hypothesis is true. Otherwise it has non-central F-distribution.

Example: Two way ANOVA Let us consider an example taken from Box, Hunter and Hunter. Experiment was done on animals. Survival times of the animals for various poisons and treatment was tested. Table is: treatment A B C D poisons I II III

ANOVA table ANOVA table produced by R: Df Sum Sq Mean Sq F value Pr(>F) pois e-07 *** treat e-06 *** pois:treat Residuals Most important values are F and Pr(>F). In SPSS Pr is replaced by sig. In this table we have tests for pois. and treat. Moreover we have “interaction” between these two categories. Interaction means that it would be difficult to separate effects of these two categories. They should be considered simultaneously. Pr. for interaction is not very small and it is not large enough to discard interaction effects. In these situations transformation of the variables might help. Let us consider ANOVA table for the transformed observations. Let us use transformation 1/y. Now ANOVA table looks like: Df Sum Sq Mean Sq F value Pr(>F) pois e-13 *** treat e-09 *** pois:treat Residuals

ANOVA table According to this table Pr. corresponding to the interaction term is high. It means that interaction for the transformed variables is not significant. We could reject interaction terms. We can build the ANOVA table without the interactions. It will look like: Df Sum Sq Mean Sq F value Pr(>F) pois e-14 *** treat e-10 *** Residuals Now we can say that there is significant differences between poisons and treatments. Sometimes it is wise to use transformation to reduce effect of interactions. For this several different transformations (inverse, inverse square, log) could be used. For each of them ANOVA tables could be built. Then by inspection you can decide which transformation gives better results. Following argument could be used to justify transformation. If effects of two different categories is multiplicative then log of them will have additive effect. It is easier to interpret additive effects than others.