1 One-Way Analysis of Variance Comparing means of more than 2 independent samples KNR 445 Statistics ANOVA (1w) Slide 2 1 1. 2 2. 3 3. 4 4. 4 Why not multiple t-tests? # comparisons = k(k-1)/2, where k is the # of groups. In other words, when there are many more than 2 groups, the number of comparisons is large In each separate comparison, you only use information within that pair – but information within other pairs may increase power If you do multiple tests, you have multiple answers, not just one With many tests, type 1 error rates increase radically KNR 445 Statistics ANOVA (1w) Slide 3 ANalysis Of VAriance 1-way ANOVA Grouping variable = factor = independent variable 1 2 The variable will consist of a number of levels If 1-way ANOVA is being used, the number will be >2. E.G. What type of program has the greatest 3 impact on aggression? Violent movies, soap operas, or “infomercials”? Type of program is the independent variable or factor, while soap operas is one level of the factor, & aggression is the dependent variable KNR 445 Statistics ANOVA (1w) Slide 4 1-way ANOVA: Hypotheses Null: 1 H0 : 1 2 k Alternative (experimental): 2 3 H1 : not H0 Note: no directional hypothesis; Null may be false in many different ways KNR 445 Statistics ANOVA (1w) Slide 5 1 2 1-way ANOVA: Logic Change in test statistic Recall with t-tests, test statistic is difference between sample means t difference expected due to chance (error) But with ANOVA, test statistic is variance (differenc e) between sample means F variance (differenc e) expected due to chance (error) KNR 445 Statistics ANOVA (1w) Slide 6 1-way ANOVA: Logic Return to our example… 1 2 3 TV Movie Soap Opera Infomercial 1 6 10 3 8 13 4 10 5 5 4 9 2 12 8 X Movie= 3 X soap = 8 X sales= 9 4 KNR 445 Statistics ANOVA (1w) Slide 7 1-way ANOVA: Logic Variance between sampling means 1 2 X Movie= 3 X soap= 8 X sales= 9 Known as “between group variance” Think of what could cause these means to differ (vary) from each other Treatment effect: differences due to the different ways the groups were treated (systematic variation) Chance: Individual differences, experimental error (unsystematic, unexplained variation) KNR 445 Statistics ANOVA (1w) Slide 8 1-way ANOVA: Logic Variance expected by chance (error) 1 TV Movie Soap Opera Infomercial 1 6 10 3 8 13 4 10 5 5 4 9 2 12 8 Known as “within group variance” Think of what could cause the scores within the groups to differ from each other Chance: Individual differences, experimental error (unsystematic, unexplained variation) KNR 445 Statistics ANOVA (1w) Slide 9 1-way ANOVA: Logic Partitioning the variance Total variance Between group variance: • Treatment • Chance = 1 + Within group variance • Chance 3 2 KNR 445 Statistics ANOVA (1w) Slide 10 1-way ANOVA: Logic The test statistic for the 1-way ANOVA The F-ratio between group variance 1 F within group variance If null is true 0 chance F 1 chance 2 If null is false treatment.effect chance F 1 chance 3 KNR 445 Statistics ANOVA (1w) Slide 11 1-way ANOVA: Logic More on the F-statistic F is a statistic that represents ratio of two variance estimates Denominator of F is called “error term” When no treatment effect, F 1 If treatment effect, observed F will be > 1 How large does F have to be to conclude there is a treatment effect (to reject H0)? 1 Compare observed F to critical values based on sampling distribution of F A family of distributions, each with a pair of degrees of freedom KNR 445 Statistics ANOVA (1w) Slide 12 The F-distribution As with t-distribution, a Probability family of curves Shape of distribution 0 1 F values 1 changes with df Region of rejection 2 3 4 5 6 F.05 = 5.14 2 If null is true, F≈1 “p” largest at 1 “p” tapers as F > 1 7 8 F-values always positive (variance can’t be negative) KNR 445 Statistics ANOVA (1w) Slide 13 1 Hypothesis Testing with ANOVA 1. Research question Does the type of programming affect levels of aggression? 2. Statistical hypotheses H0: 1 = 2 = ... = K H1: At least 2 means are significantly different 3. Decision rule (critical value) 4. Compute observed F-ratio from data 5. Make decision to reject or fail to reject H0 6. If H0 rejected, conduct multiple comparisons as needed KNR 445 Statistics ANOVA (1w) Slide 14 1 2 Computing ANOVA For those interested (?!) we’ll cover the steps and do an example (not necessary if you understand the concept…but it may help) If you’re really confident, skip to slide 21 Steps to completion 1. Compute SS (sums of squares) 2. Compute df 3. Compute MS (mean squares) 4. Compute F 3 KNR 445 Statistics ANOVA (1w) Slide 15 Computing ANOVA Vocabulary/Symbols: k = Number of groups nj = Sample size of the jth group (n1, n2,…nj,…nk) N = Total sample size X j = Mean of the jth group X 1 , X 2 ,... X j ,... X k X T = Grand (overall) mean SS (Sum of squares) = Sum of squared deviations around a mean 1 KNR 445 Statistics ANOVA (1w) Slide 16 1 Computing ANOVA Step 1: Compute Sums of Squares (SS) Need total, group, and error sums of squares These are combined with appropriate df to give variance calculations, & then generate F-ratio 2 KNR 445 Statistics ANOVA (1w) Slide 17 Computing ANOVA Step 1: Compute Sums of Squares (SS) Total sum of squares (looks a little daunting, 2 but it’s really not) 4 3 1 SS total i 1 i N x X 2 i 1. This is just the sum of the squared deviations of each observation from the overall mean T ( X ) X N 2 2 2. The second part of the formula is the one we’ll use in the calculations, as it’s easier to work with. The first one is easier to conceptualize. KNR 445 Statistics ANOVA (1w) Slide 18 Computing ANOVA Step 1: Compute Sums of Squares (SS) Group sum of squares 1 SS group j 1 n ( X X ) j j T j k 1. This is the sum of the squared deviations of each group mean from the overall mean (multiplied by each sample’s size) 2 KNR 445 Statistics ANOVA (1w) Slide 19 Computing ANOVA Step 1: Compute Sums of Squares (SS) Error sum of squares 1 Total variance is composed of SSgroup & SSerror SStotal = SSgroup + SSerror Rearrange this formula to get: 2 SSerror= SStotal – SSgroup 1. To calculate, take the sum of squares of each observation within a group from its group mean, for all groups 3 KNR 445 Statistics ANOVA (1w) Slide 20 Computing ANOVA Step 2: Compute degrees of freedom (Used to adjust SS to variance estimates) df group: df k 1 1 group df total: df total N 1 2 df error (or “what’s left over”): df error N k 3 KNR 445 Statistics ANOVA (1w) Slide 21 Computing ANOVA Step 3: Compute Mean Squares (MS) & F- ratio 1 Mean Square = variance SS group MSgroup df group SSerror MSerror df error 2 F 3 MS group MS error MS between MS within KNR 445 Statistics ANOVA (1w) Slide 22 Computing ANOVA The ANOVA summary table (may help you understand where it comes from in SPSS) all the processes are alluded to above Source Sum of DF Squares MS F sig. Between SSgroup Groups dfgroup SSgp/dfgp=MSB MSB/MSW p-value Within Groups SSerror dferror Total SStotal dftotal Sse/dfe=MSW 1