STATS 1060 Analysis of variance: ANOVA READINGS: Chapters 28 of your text book (DeVeaux, Vellman and Bock); on-line notes for ANOVA; on-line practice problems for ANOVA NOTICE: You should print a copy of both (1) problems and (2) F- tables, and bring them with you to class. Solutions will be reviewed in class and you will have trouble keeping up if you do not have a copy of them with you.
Learning objectives: Even though you will explore ANOVA in the most simple setting, you will gain insights that will allow you to carry out one-way ANOVA when it is appropriate, you will be able to interpret published results of ANOVA (e.g., in biology and medicine), and you will have a base from which you can delve deeper into this important statistical method. For this part of the course, your specific objectives are: 1. To understand and be able to explain how ANOVA works. 2. To be able to construct an ANOVA Table, and interpret the statistics contained in that table. 3. To be able to use the F distribution to test the null hypothesis that all treatment means are equal. 4. To be able to answer ANOVA problems 1 to 8 that are provided on-line.
ANOVA: tests if means of different groups are equal One-way ANalysis Of VAriance (ANOVA) is used to compare 3 or more group means, where the groups are defined in just one way. 1. EXPERIMENTAL DATA: Do different treatments have the same mean? 2. OBSERVATIONAL DATA: Do different populations have the same mean? Group 1 Group 2 Group 3 sample mean
ANOVA compares variation within and between groups mean GPA of a dormitory (dorm) variation between dorm means (a) variation within dorms (b) Dorm C Dorm B a/b < 1 Dorm A Dorm GPA scores mean A 0.60 3.82 4.00 2.22 1.46 2.91 2.20 1.60 0.89 2.30 2.2 B 2.12 2.00 1.03 3.47 3.70 1.72 3.15 3.93 1.26 2.62 2.5 C 3.65 1.57 3.36 1.17 2.55 3.12 3.60 4.00 2.85 2.13 2.8
ANOVA compares variation within and between groups mean GPA of a dormitory (dorm) variation between dorm means (a) variation within dorms (b) Dorm F Dorm E a/b > 1 Dorm D Dorm GPA scores mean D 2.16 2.23 2.09 2.17 2.25 2.19 2.24 2.28 2.25 2.14 2.2 E 2.45 2.34 2.58 2.49 2.60 2.42 2.55 2.62 2.45 2.50 2.5 F 2.80 2.75 2.93 2.68 2.88 2.75 2.87 2.81 2.73 2.80 2.8 GPA
ANOVA: a conceptual overview ANOVA uses two measures of sample variability that do not depend on the null or alternative hypotheses: (a) The variability between group means (b) The variability within each group ANOVA compares a and b (as ratio a/b): If same means, expect: a/b < 1 If different means, expect: a/b > 1 But, how do we know when a/b is large enough?
The mathematical model for ANOVA Observation = grand mean (µ) + treatment effect (τ) + residual (ε) mean of group 1 mean of group 2 grand mean µ = grand mean!! "!! " µ 1 µ µ 2 y 1,2! 2! 1,2 µ j = mean of j th group! j = µ j + µ " i, j = y i, j! u j (treatment effect) (residual) y i, j = µ +! j +" i, j
The mathematical model for ANOVA Observations = grand mean + treatment effect + residual y i, j = µ +! j +" i, j (true parameters) y i, j = y + ˆ! j + e i, j (sample statistics) y ˆ! j STATISTICS, and e ij are estimators of PARAMETERS, and µ! j! ( ) ( ) y i, j = y + y j! y!" # $# + y i, j! y!# " $# j ˆ! j e ij = a = b y y j y i, j grand mean mean of group j the i th obs in j th group * now we have a way to measure a and b
Summarize variability with a mean square (MS) statistic ( ) ( ) y i, j = y + y j! y!" # $# + y! y i, j j!# " $# between groups within groups MEAN SQUARED TREATMENT (MSTR) measures the variability between groups (treatments): MSTR = SSTR df 1 = " n j ( y j! y) 2 k!1 MEAN SQUARED ERROR (MSE) measures the variability within groups: MSE = SSE df 2 = ""( y i, j! y ) 2 j n! k
The F-ratio of ANOVA is a ratio of mean squares F-ratio = variation between group means variation within groups = "a" "b" F df1, df 2 = F k!1, n!k = MSTR MSE If same means, expect: F < 1 If different means, expect: F > 1 The F-ratio computed from a sample is called F DATA
ANOVA without a computer Calculations are organized in an ANOVA table Source df Sum of Squares Mean Square F DATA Treatment df 1 = k-1 SSTR MSTR MSTR/MSE Error df 2 = n-k SSE MSE Total df 3 = n-1 SST = SSTR + SSE To compute MSTR: The easiest way to compute MSTR = SSTR/df 1 is to use the following short cut for compudng the grand- mean of the sample : y = n 1 y 1 + n 2 y 2 + n k y k n 1 + n 2 + n k The value n j is the size of the j th group and accounts for different sized groups. To compute MSE: The easiest way to compute MSE = SSE/ df 2 is to compute SSE from the sample variance (s 2 ) as follows: 2 SSE = "( n j!1) s j This formuladon avoids having to compute e ij for all observadons (i) and groups (j).
We need to know when the F-ratio is larger than expected by chance when the null hypothesis is true H 0 : µ 1 = µ 2 = = µ k (this is equivalent to τ 1 = τ 2 = τ k = 0) H A : At least one of the means is different F has a distribudon with df 1 and df 2!" # $%$&'$!" & $%$&($!" # $%$)'$!" & $%$#*$!" # $%$+'$!" & $%$,&$ F follows this distribution if the means are the same (i.e., H 0 is true) Total area under curve = 1 F is always positive, so curve always starts at 0 and is right skewed The curve has df 1 and df 2 because MSTR and MSE of the F-ratio have different dfs There is a different curve for each pair of dfs
Use the F-distribution to test the null hypothesis 1- α (non-critical region) (critical region) F F CRIT (boundary value of F) F F CRITICAL VALUE: The value of a random variable (in this case, F) at the BOUNDARY between the acceptance region and the rejection region of a hypothesis test.
Use the CRITICAL VALUE METHOD to test the null: Step 1: State the null hypothesis and rejection rule H 0 : µ 1 = µ 2 = = µ k Reject H 0 if F DATA > F CRIT Step 2: Determine the critical (boundary) value of F (F CRIT ) Obtain CRITICAL VALUE from an F-table Step 3: Compute ANOVA statistics and F-ratio for the data (F DATA ) Display statistics in an ANOVA table Step 4: Compare F DATA to F CRIT Accept or reject H 0
Be careful to avoid drawing the wrong conclusions Rejection of H 0 takes only one mean among k to be different! The most you can conclude for H A is that at least one mean is different You CANNOT determine which group(s) is(are) responsible for rejecting the null by looking at the estimated means! You must carry out POST TESTS. Lastly you must verify that the requirements for ANOVA have been met Independence Normality Equal Variances
Practice problems The in-class practice problems are distributed on-line via the course web site (through Dal s Online Web Learning, or OWL, resource). Additional problems, and real-time solutions, are provided on line in the form of screencasts. The additional problems are also provided in PDF form via a link on that site. You are strongly encouraged to try working those problems before watching the screencasts. The additional problems will NOT be covered during class time. Primary URL: http://awarnach.mathstat.dal.ca/~joeb/stats1060_webcasts/ Part_2.html Alternate URL: http://web.me.com/cadair_idris/stats1060/part_2.html On-line supplements ANOVA Fall 2011