Review. One-way ANOVA, I. What s coming up. Multiple comparisons

Similar documents
Your schedule of coming weeks. One-way ANOVA, II. Review from last time. Review from last time /22/2004. Create ANOVA table

Multiple t Tests. Introduction to Analysis of Variance. Experiments with More than 2 Conditions

10/31/2012. One-Way ANOVA F-test

Two-Sample Inferential Statistics

Introduction to the Analysis of Variance (ANOVA)

Calculating Fobt for all possible combinations of variances for each sample Calculating the probability of (F) for each different value of Fobt

Introduction to the Analysis of Variance (ANOVA) Computing One-Way Independent Measures (Between Subjects) ANOVAs

Difference in two or more average scores in different groups

8/23/2018. One-Way ANOVA F-test. 1. Situation/hypotheses. 2. Test statistic. 3.Distribution. 4. Assumptions

Independent Samples ANOVA

PSYC 331 STATISTICS FOR PSYCHOLOGISTS

The One-Way Repeated-Measures ANOVA. (For Within-Subjects Designs)

CHAPTER 17 CHI-SQUARE AND OTHER NONPARAMETRIC TESTS FROM: PAGANO, R. R. (2007)

COMPARING SEVERAL MEANS: ANOVA

Analysis of Variance (ANOVA)

One-way between-subjects ANOVA. Comparing three or more independent means

Variance Estimates and the F Ratio. ERSH 8310 Lecture 3 September 2, 2009

Lecture 10: F -Tests, ANOVA and R 2

The One-Way Independent-Samples ANOVA. (For Between-Subjects Designs)

OHSU OGI Class ECE-580-DOE :Design of Experiments Steve Brainerd

The t-test: A z-score for a sample mean tells us where in the distribution the particular mean lies

Sampling Distributions: Central Limit Theorem

An Old Research Question

One-way between-subjects ANOVA. Comparing three or more independent means

Factorial Analysis of Variance

One-way Analysis of Variance. Major Points. T-test. Ψ320 Ainsworth

Hypothesis testing: Steps

One-Way ANOVA Cohen Chapter 12 EDUC/PSY 6600

Hypothesis testing: Steps

The independent-means t-test:

Mathematical Notation Math Introduction to Applied Statistics

Sampling distribution of t. 2. Sampling distribution of t. 3. Example: Gas mileage investigation. II. Inferential Statistics (8) t =

Analysis of Variance

One-factor analysis of variance (ANOVA)

In a one-way ANOVA, the total sums of squares among observations is partitioned into two components: Sums of squares represent:

ONE FACTOR COMPLETELY RANDOMIZED ANOVA

Comparing Several Means: ANOVA

Psych 230. Psychological Measurement and Statistics

Chapter 10: Chi-Square and F Distributions

Introduction to Analysis of Variance. Chapter 11

Keppel, G. & Wickens, T.D. Design and Analysis Chapter 2: Sources of Variability and Sums of Squares

Advanced Experimental Design

Statistical Inference. Why Use Statistical Inference. Point Estimates. Point Estimates. Greg C Elvers

1 Descriptive statistics. 2 Scores and probability distributions. 3 Hypothesis testing and one-sample t-test. 4 More on t-tests

Statistical Techniques II EXST7015 Simple Linear Regression

Single Sample Means. SOCY601 Alan Neustadtl

Question. Hypothesis testing. Example. Answer: hypothesis. Test: true or not? Question. Average is not the mean! μ average. Random deviation or not?

Keppel, G. & Wickens, T. D. Design and Analysis Chapter 4: Analytical Comparisons Among Treatment Means

STAT Chapter 8: Hypothesis Tests

INTRODUCTION TO ANALYSIS OF VARIANCE

Summary of Chapter 7 (Sections ) and Chapter 8 (Section 8.1)

Analysis of Variance

One-Way ANOVA Source Table J - 1 SS B / J - 1 MS B /MS W. Pairwise Post-Hoc Comparisons of Means

Chapter 9 Inferences from Two Samples

An inferential procedure to use sample data to understand a population Procedures

Lecture 7: Hypothesis Testing and ANOVA

One-way ANOVA. Experimental Design. One-way ANOVA

One-way ANOVA (Single-Factor CRD)

Chapter 7. Inference for Distributions. Introduction to the Practice of STATISTICS SEVENTH. Moore / McCabe / Craig. Lecture Presentation Slides

Note: k = the # of conditions n = # of data points in a condition N = total # of data points

The legacy of Sir Ronald A. Fisher. Fisher s three fundamental principles: local control, replication, and randomization.

CBA4 is live in practice mode this week exam mode from Saturday!

R 2 and F -Tests and ANOVA

Chapter 26: Comparing Counts (Chi Square)

What Is ANOVA? Comparing Groups. One-way ANOVA. One way ANOVA (the F ratio test)

Statistics: revision

Using SPSS for One Way Analysis of Variance

CIVL /8904 T R A F F I C F L O W T H E O R Y L E C T U R E - 8

An Analysis of College Algebra Exam Scores December 14, James D Jones Math Section 01

Analysis of Variance (ANOVA)

Unbalanced Designs & Quasi F-Ratios

The t-statistic. Student s t Test

One-Way Analysis of Variance. With regression, we related two quantitative, typically continuous variables.

Assignment #7. Chapter 12: 18, 24 Chapter 13: 28. Due next Friday Nov. 20 th by 2pm in your TA s homework box

Last few slides from last time

Lecture 3: Analysis of Variance II

Hypothesis Testing, Power, Sample Size and Confidence Intervals (Part 2)

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Lecture 21: October 19

Factorial Analysis of Variance

T.I.H.E. IT 233 Statistics and Probability: Sem. 1: 2013 ESTIMATION AND HYPOTHESIS TESTING OF TWO POPULATIONS

Questions 3.83, 6.11, 6.12, 6.17, 6.25, 6.29, 6.33, 6.35, 6.50, 6.51, 6.53, 6.55, 6.59, 6.60, 6.65, 6.69, 6.70, 6.77, 6.79, 6.89, 6.

Introduction to Business Statistics QM 220 Chapter 12

Module 03 Lecture 14 Inferential Statistics ANOVA and TOI

Regression, part II. I. What does it all mean? A) Notice that so far all we ve done is math.

Hypothesis T e T sting w ith with O ne O One-Way - ANOV ANO A V Statistics Arlo Clark Foos -

How do we compare the relative performance among competing models?

Hypothesis Testing. We normally talk about two types of hypothesis: the null hypothesis and the research or alternative hypothesis.

Chapter 8 Student Lecture Notes 8-1. Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance

Factorial Independent Samples ANOVA

STA Module 10 Comparing Two Proportions

Deciphering Math Notation. Billy Skorupski Associate Professor, School of Education

Regression With a Categorical Independent Variable

Unit 27 One-Way Analysis of Variance

psyc3010 lecture 2 factorial between-ps ANOVA I: omnibus tests

ANOVA Analysis of Variance

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

Difference between means - t-test /25

Department of Economics. Business Statistics. Chapter 12 Chi-square test of independence & Analysis of Variance ECON 509. Dr.

Section 9.4. Notation. Requirements. Definition. Inferences About Two Means (Matched Pairs) Examples

Transcription:

Review One-way ANOVA, I 9.07 /15/00 Earlier in this class, we talked about twosample z- and t-tests for the difference between two conditions of an independent variable Does a trial drug work better than a placebo? Drug vs. placebo are the two conditions of the independent variable, treatment Multiple comparisons We often need a tool for comparing more than two sample means What s coming up In the next two lectures, we ll talk about a new parametric statistical procedure to analyze experiments with two or more conditions of a single independent variable Then, in the two lectures after that, we ll generalize this new technique to apply to more than one independent variable 1

ANalysis Of Variance = ANOVA A very popular inferential statistical procedure It can be applied to many different experimental designs Independent or related samples An independent variable with any number of conditions, or levels Any number of independent variables Arguably it is sometimes over-used. We ll talk more about this later. An example Suppose we want to see whether how well people perform a task depends upon how difficult they believe the task will be We give 15 easy math problems to 3 groups of 5 subjects Before we give them the test, we tell group 1 that the problems are easy, group that the problems are of medium difficulty, and group 3 that the problems will be difficult Measure # of correctly solved problems within an allotted time. How do we analyze our results? We could do 3 t-tests: H 0 : µ easy = µ medium, H 0 : µ medium = µ difficult, H 0 : µ difficult = µ easy But this is non-ideal With α=0.05, the probability of a Type I error in a single t-test is 0.05 Here, we can make a Type I error in any of the 3 tests, so our experiment-wise error rate is (1-0.953 ) = 0.1 We perform ANOVA because it keeps the experiment-wise error rate equal to α This is much larger than our desired error rate Furthermore, the 3 tests aren t really independent, which cranks up p even more

ANOVA ANOVA is the general-purpose tool for determining whether there are any differences between means If there are only two conditions of the independent variable, doing ANOVA is the same as running a (two-tailed) two-sample t-test. Same conclusions Same Type I and Type II error rates Terminology Recall from our earlier lecture on experimental design: A one-way ANOVA is performed when there is only one independent variable When an independent variable is studied by having each subject only exposed to one condition, it is a between-subjects factor, and we will use a between-subjects ANOVA. When it is studied using related samples (e.g. each subject sees each condition ), we have a withinsubjects factor, and run a within-subjects ANOVA. One-way, between-subjects ANOVA We talk about this for starters. The concepts behind ANOVA are very much like what we have talked about in terms of the percent of the variance accounted for by a systematic effect. One thing this means is we will be looking for a significant difference in means, but we ll do it by looking at a ratio of variances. Assumptions of the one-way, between-subjects ANOVA The dependent variable is quantitative The data was derived from a random sample The population represented in each condition is distributed according to a normal distribution The variances of all the populations are homogenous (also referred to as the sphericity assumption) It is not required that you have the same number of samples in each group, but ANOVA will be more robust to violations of some of its other assumptions if this is true. 3

ANOVA s hypotheses ANOVA tests only two-tailed hypotheses H 0 : µ 1 = µ = = µ k H a : not all µ s are equal Typical strategy Run ANOVA to see if there are any differences. If there are, do some additional work to see which means are significantly different: Post-hoc comparisons Note that you perform post-hoc comparisons only when ANOVA tells you there are significant differences between at least two of the means. An exception: if there are only two means to begin with, and ANOVA tells you there is a difference in means, you already know that the two means must differ no need to do any additional work. Analysis of variance ANOVA gets its name because it is a procedure for analyzing variance Though we are interested in testing for a difference in means, we can do so by analyzing variance This has to do with what we ve talked about before: proportion of the variance accounted for by an effect How much do I reduce my uncertainty about the response, if I know the condition? In other words, what proportion of the Total variance variance is accounted for by the systematic effect? ( The effect : the means of the red, blue, and green groups are significantly different) Variance unaccounted for

Keeping the variance within each group the same, the bigger the difference in means, the greater the proportion of the variance accounted for So, while we re interested in a difference in means, we can get at it by looking at a ratio of variances the proportion of variance accounted for Total variance Variance unaccounted for Partitioning the variance Before, when we talked about proportion of the variance accounted for, we partitioned the variance in the data this way: Total variance = (variance not accounted for) + (variance accounted for) As shown in the previous picture, the variance not accounted for is essentially the variance within groups. So, the more traditional description of the partitioning of the variance is: Total variance = (variance within groups) + (variance between groups) MS bn MS wn m m 1 M (the grand mean of the entire experiment) m 3 5

MS M total Within- and between-group variance Essentially, the total variance in the data comes from two sources: Scores may differ from each other even when the participants are in the same condition. This is withingroup variance. It is essentially a measure of the basic variation or noise in the system. Scores may differ because they are from different conditions. This is the between-groups variance. This is essentially the signal in the system. ANOVA is about looking at the signal relative to the noise ANOVA and the signal-to-noise ratio We want to see if the between-group variance, the signal, is comparable to the within-group variance, the noise. If the signal is comparable to the noise, don t reject H0 If the signal is large relative to the noise, reject H 0 in favor of H a From the sample data, we will calculate each of these variances (between & within groups) But rather than calling them variances, we will call them mean squares (short for mean square deviations) Mean square within groups Mean square between groups 6

Mean square within groups A measure of the noise Symbol: MSwn or MSerror MSwn is like the average variability within each condition (level of a factor) We assumed that the variance is the same in each population, so we estimate the variance in each condition, and then pool them to get, an estimate of MS wn σ error Mean square between groups A measure of the signal, i.e. how much the means for different levels of a factor differ from each other Symbol: MSbn An estimate of the differences in scores between the different conditions (different levels in a factor) How much does the mean of each level differ from the overall mean? The relationship between MS wn and MS bn when H 0 is true H 0 true -> all scores from the same population, regardless of condition Means in each condition differ only by chance The same sort of process that leads to different means in the different conditions also leads to difference in the scores within a population So if H is true, MS 0 wn should be very similar to MS bn MSbn estimates the noise in the population just as MS wn does, if H 0 is true The relationship between MS wn and MS bn when H 0 is false H 0 false -> changing conditions causes mean scores to change Treatment variance = differences between scores due to a systematic effect To some extent, our observed differences in means will also be due, in part, to inherent variability in the scores (noise) MSbn is influenced by both treatment variance and noise. It estimates σ error + σ treatment 7

The relationship between MS wn and MS bn when H 0 is false When H 0 is false, MS bn will be larger than MS wn Consider what happens to the ratio of MS bn to MS wn Let Fobt = MS bn / MS wn An estimate of (σ error + σ treatment)/ σ error H 0 true -> F obt -> (σ error + 0)/ σ error = 1 H 0 false -> F obt -> (σ error + σ treatment)/ σ error > 1 The larger the difference in means due to different conditions, the larger F will be obt The F-distribution ANOVA uses a new (to us) distribution, and an associated new test statistic: The F distribution The F statistic As usual, we ll compute Fobt from the data, and compare this with F crit, to see whether or not to reject the null hypothesis The F test The F test is used to compare two or more means. It is used to test the hypothesis that there is (in the population from which we have drawn our or more samples) (a) no difference between the two or more means Or equivalently (b) no relationship between membership in any particular group and score on the response variable. 8

The F distribution The sampling distribution of the values of F obt that occur when the null hypothesis is true: There is no difference between the means of the different populations (represented by the different conditions of the experiment) So our samples are all taken from the same population Approximating the F distribution Suppose you have k conditions in your experiment, and ni samples from each condition In MATLAB, you could take ni samples from a normal distribution, corresponding to each of the k conditions. Then compute Fobt Take all samples from the same distribution! The F distribution is the distribution assuming the null hypothesis is true, i.e. that all k populations are the same. Do this a bunch of times, to get the sampling distribution for F obt Degrees of freedom Like the t- and χ -distributions, the F- distribution actually consists of a family of curves of slightly different shape, depending upon the degrees of freedom The F-distribution, however, has two values of d.f. that determine its shape: d.f. in the numerator (between-groups) d.f. in the denominator (within-groups) F distribution: Keep dfnumerator and df straight! If you swap them you get a very different F curve! F(x) F(x) 3 1 0 0 1 0.5 0 0 Numerator df = 1 3 Numerator df = 100 x 0 1 3 0 Numerator df = 10 x 0 1 3 0 1 6 x 1 3 Numerator df = 500 x 1 3 denominator Denominator df 1 10 100 500 Figure by MIT OCW. 9

Properties of the F distribution The mean of the distribution is 1 There is assumed to be no difference between the different conditions, so on average MSbn will equal MS wn, and F will equal 1 F obt indicates the possibility of a systematic effect of condition only when it is > 1, so we are only interested in the upper tail of this distribution F obt = MS bn /MS wn : Computing MS bn and MS wn Both MS s are variances Note the form of the equation for the variance we re already familiar with: ( ) = x m s x x n 1 Sum of squares (SS) in the numerator Degrees of freedom in the denominator This is the general form for a variance, i.e. a mean square (MS). Computing MS bn and MS wn So, first we ll compute the sum of squares, SS bn and SS wn Then we ll figure out the number of degrees of freedom, df bn and df wn Finally, MS = SS/df MSbn = SS bn /df bn MSwn = SS wn /df wn Then, we ll compute F=MSbn /MS wn ANOVA summary table Report your results in this form on your homework. Source Between Within Total Sum of squares SS bn SS wn SS tot df df bn / = df wn / = df tot Mean square MS bn --------- MS wn = F F obt P p-value 10

It s probably easiest to see the calculations with an example 3 groups of 5 subjects given 15 math questions each. Group 1 told the questions would be easy, group told they would be of medium difficulty, and group 3 told they would be difficult Here s the data # of questions answered correctly Factor: perceived difficulty Level 1: easy 9 1 8 7 Level : medium 6 8 10 Level 3: difficult 1 3 5 Recall an alternate, computational formula for SS SS = ( x mx ) = x ( x ) We re going to use this version of the formula when we do ANOVA by hand. If you use MATLAB on your homework, use whatever equation is easiest for you. N So, first of all, what is SS total? SS tot = ( x ) tot ( x ) tot N tot This is the sum of squares if you treat the whole experiment as one big sample. So ( Σ x ) tot is the sum of all the x s, and (Σ x) tot is the sum of all the x s We re going to need the sums of the x s and x s for each of the conditions separately, too, so let s compute these sums for each column in the previous table 11

Factor: perceived difficulty Level 1: easy 9 1 8 7 Σx =35 + Σx =0 + Σx =55 = Σx =69 n 1 =5 Level : medium 6 8 10 Level 3: difficult + n 1 =5 + n 1 =5 = Totals Σx=0 + Σx=30 + Σx=15 = Σx=85 1 3 5 N=15 So, fill SS tot into our ANOVA table Source Between Within Total Sum of squares SS bn SS wn 17.33 df df bn df wn df tot Mean square MS bn MS wn F F obt P p-value SS tot = 69 (85) /15 = 17.33 SS bn Next, compute SS bn m 1 SS bn is a weighted sum of the squared differences between the group means and the grand mean, M. Weighted by the number of samples in each group. M m 3 m (the grand mean of the entire experiment) SS bn = # condits i = 1 ni ( mi M ) = n im i M N This is equivalent to the equation in your handout So, it looks like we have some means to compute 1

Factor: perceived difficulty Level 1: easy 9 1 8 7 Σx=0 Σx =35 n 1 =5 m 1 =8 Level : medium 6 8 10 Σx=30 Σx =0 n 1 =5 m 1 =6 SS bn = 5*(6+36+9) 15*(5.67) 63.33 Level 3: difficult 1 3 5 Σx=15 Σx =55 n 1 =5 m 1 =3 Totals Σx=85 Σx =69 N=15 M 5.67 Total So, fill SS bn & SS wn into our ANOVA table Source Between Within Sum of squares 63.33 8.00 17.33 df df bn df wn df tot Mean square MS bn MS wn F F obt P p-value SS wn is easy it s just SS tot SS bn = 8 This is just total variance = sum of component variances. So, we can fill that one in, too. What are the degrees of freedom? Total degrees of freedom = N 1 Usual story we re computing the variance of all the data, but we lost a degree of freedom in computing the mean. Degrees of freedom between groups = k 1 k = number of levels in the factor = # condits We re essentially computing the variance of k numbers m i, but we lose a degree of freedom because Σn i (m i M) = 0 Dfwn = dftot dfbn = N k Filling in nearly the rest of the table Source Between Within Total Sum of squares df 63.33 / = 31.67 ------ 8.00 / 1 = 7.00 17.33 / 1 = Mean square F =.5 P p-value For one-way ANOVA, Fobt is always placed on the Between row, as is the p-value. This is convention, essentially because Between is the signal in our signal-to-noise ratio. Between is essentially what we re testing is the signal large enough for this to be a real effect? 13

Now we just need to find F crit What your table will look like: To do this, look in an F-table, with degrees of freedom = (, 1) = (bn, wn) = (numerator, denominator) I ll have electronic versions of an F-table for you by the end of the day. df (within) = denominator 11 1 α.05.01.05.01 df(between) = numerator 1.8 3.98 9.65 7.0.75 3.88 9.33 6.93 3 3.59 6. 3.9 5.95 F obt =.5 -> p<0.05 13.05.01.67 9.07 3.80 6.70 3.1 5.7 Results, and reporting them So, it seems that there is a significant effect on math scores of how easy people have been told the problems will be. F(, 1) =.5, p<0.05 F( df bn, df wn ) = F obt, p<p-value Results, and reporting them We are confident that there s a real effect in the population, but we don t know whether each increase in perceived difficulty produces a significant drop in performance. Perhaps there s only a difference between easy and difficult. A significant Fobt just means that at least one of our of differences is significant. 1

Next time Next time we ll talk about how to determine which pairs are significantly different, if you get a significant result from the ANOVA. We ll also talk about how, in some cases, you can deal with more than levels of the independent variable without doing an ANOVA. If there s time, we ll also talk about the one-way, within-subjects ANOVA. 15