Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

ANOVA for Statistics 251: Understanding Variation in Group Means, Exams of Design

Statistical AnalysisResearch MethodsExperimental DesignData Analysis

An in-depth analysis of the Analysis of Variance (ANOVA) technique used in statistical methods. ANOVA is a method to determine if there are significant differences among the means of several groups. the sources of variation, sums of squares, degrees of freedom, mean squares, and the F-statistic. It also includes examples and instructions on how to use the F distribution table to find critical values and p-values.

What you will learn

  • What is the purpose of the Analysis of Variance (ANOVA) technique in statistics?
  • What is the role of the F distribution table in ANOVA and how is it used to find critical values and p-values?

Typology: Exams

2021/2022

Uploaded on 09/12/2022

youcangetme
youcangetme 🇬🇧

5

(4)

79 documents

1 / 8

Toggle sidebar

Related documents


Partial preview of the text

Download ANOVA for Statistics 251: Understanding Variation in Group Means and more Exams Design in PDF only on Docsity! Analysis of Variance (ANOVA) Module 13 Statistics 251: Statistical Methods Updated 2019 Analysis of variance (ANOVA or AOV) The methods learned in Modules 7-10 only dealt with comparisons of two means or proportions. The question is, why not just do several 2-sample tests if we have at least two means? The reason is the Type I error, α, α = P (Reject H0|H0 true) (rejecting a true null hypothesis). By doing several 2-sample t-tests simultaneously, since they would not be wholly independent, it increases the Type I error rate. As an example, the number of 2-sample comparisons is the number of factor (treatment) groups choose 2 (as in a combination), ( k 2 ) where k is the number of factor groups and 2 because we are doing 2-sample comparisons. So if we had say k = 4 groups, then the number of comparisons to do in that case would be(4 2 ) = 4! 2!(4−2)! = 6, each having their own Type I error rate of 5%, meaning that the overall Type I error rate for the entire experiment would be 6(0.05) = 0.3. The ANOVA procedure protects the Type I error rate from inflating by doing multiple tests. Hypotheses The hypotheses for a (1-way) ANOVA for CRD (completely randomized design). The hypotheses only state that there are (or are not) differences among the factor group means but does not indicate where the differences are, just if there are some H0 : µ1 = µ2 = · · · = µk Ha : H0 not true (or at least one µi differs) Anova terms I The results of the analysis is displayed in a table. Shown below is the generic version of the table and the following slides will define and give formulas for the values of the ANOVA output table. Source df SS MS F Pr>F Factor k-1 SST MST = MST MSE P (F > Fcalc) (or Treatment) Error n-k SSE MSE Total n-1 TSS Anova terms II Most of the calculations involve figuring out the variation (variances) between groups, within groups, and the total variation. Formulas on next slide. (1) Sources of variation (a) Factor (between) (b) Error (within, residuals) (c) Total 1 (2) Sums of squares (basically numerators of variances) (a) Factor or Treatment (SS(Factor) or SST ): sum of squared distances between each factor mean (yi) and the overall (grand) mean (y.. or y) (b) Error (SS(Error) or SSE): sum of squared distances between each individual observation (yij) and their corresponding factor mean (yi) (c) Total(SS(Total) or TSS): sum of squared distances between each individual observation (yij) and the grand mean (y..) (3) Degrees of freedom (df) (a) Factor: dffactor = k − 1 where k is the number of factor groups (b) Error: dferror = n− k where n is the total number of observations in the experiment (c) Total: dftotal = n− 1 (4) Mean squares (basically variances) (a) Factor (MS(Factor)): variance for factor is sum of squares for factor divided by the factor degrees of freedom (dffactor) (b) Factor (MS(Error)): variance for error is sum of squares for error divided by the error degrees of freedom (dferror); also computed by the sum of each group variance multiplied by each group sample size minus 1 (c) Total: could be calculated in the same manner but is not usually calculated nor used Anova terms III The main goal of anova is to calculate the sums of squares (SS), mean square (MS), and the test statistic. The following are the calculations for all the values needed for the hypothesis test. SS(Factor) = ∑ ni(yi − y..)2 SS(Error) = ∑ (yi − yi)2 = ∑ s2 i (ni − 1) SS(Total) = ∑ (yi − y..)2 = SST + SSE Anova Terms IV Mean squares MST = SST dffactor = SST k − 1 MSE = SSE dferror = SSE n− k There is no calculation of (nor use of) the Total mean square. Anova Terms V Test Statistic: called an F statistic from the F probability distribution. Like the χ2 distribution, F changes shape as df (2 of them) vary. The first df is dffactor and the second is dferror from the ANOVA output table. The rows of the distribution table are dffactor and the columns are dferror. 2 Example I (no software, except graph) A design to study the prices of a fixed basket of goods from different grocery stores in California was conducted. The top 5 major grocery stores were used and prices (in US dollars) over a total of 4 weekly visits per store to check on the fixed basket were collected. Store/Week 1 2 3 4 ni yi s2 i Albertsons 254.26 240.62 231.90 234.13 4 240.23 101.197 Ralphs 256.03 255.65 255.12 261.18 4 256.99 7.923 Vons 267.92 251.55 245.89 254.12 4 254.87 87.509 Alpha Beta 260.71 251.80 246.77 249.45 4 252.18 36.542 Lucky 258.84 242.14 246.80 248.99 4 249.19 49.526 Example I (no software, except graph) Graph of fixed basket prices by store. Albertsons Lucky Vons 24 0 25 0 26 0 Basket Goods Price by Store Example I (no software, except graph) The goal is to create the ANOVA table. One value not given in the table that is required is the overall grand mean, y.., which is the mean of all observations of the experiment (regardless of which treatment group they are in); it is also the overall mean of the group means. There are 5 stores, so k = 5 and 4 observations per store, so n = 4(5) = 20. Is there sufficient evidence that there is at least one store that is different in the price of basket goods? H0 : µ1 = µ2 = µ3 = µ4 = µ5 and Ha : H0 not true y.. = ∑ yi n = ∑ yi k = 240.23+256.99+254.87+252.18+249.19 5 = 250.6935 SST = ∑ ni(yi − y..)2 = 4[(240.23− 250.69)2 + (256.99− 250.69)2 + (254.87− 250.69)2 + (252.18− 250.69)2 + (249.19− 250.69)2] = 684.63733 SSE = ∑ (yi − yi)2 = ∑ s2 i (ni − 1) = (4− 1)(101.197 + 7.923 + 87.509 + 36.542 + 49.526) = 848.093125 TSS = ∑ (yi − y..)2 = SST + SSE = 684.63733 + 848.093125 = 1532.730455 dftreatment = df1 = k − 1 = 5− 1 = 4, dferror = n− k = 20− 5 = 15, dftotal = n− 1 = 20− 1 = 19 MST = SST df1 = 684.63733 4 = 171.1593325 5 MSE = SSE df2 = 684.63733 15 = 56.5395417 No Total mean square calculated. F = MST MSE = 171.1593325 56.5395417 = 3.0272501 Example I The ANOVA table: Source df SS MS F Treatment 4 684.64 171.16 3.0273 Error 15 848.09 56.54 Total 19 1532.73 Example I Now to figure out if we will reject the null hypothesis. We can reject H0 if pvalue ≤ α (pvalue approach) or if Fcalc ≥ Fα,df1,df2 (critical value approach). Since we computed by hand, we will use the second method (critical value method). Using statdistributions.com, we need Fα,df1,df2 = F0.05,4,15. Input ‘p− value : ‘0.05, ‘numeratord.f. : ‘4, and ‘denominatord.f. : ‘4. F0.05,4,15 = 3.056 F with alpha=5%, df1=4,df2=15 Since 3.0273  3.056 (barely!), we cannot reject H0. There are no significant differences in the fixed basket prices by store. Example II (with software output) Learning to read the output from a statistical software program. The following example will use output from the program R. Washing hands is supposed to remove potentially harmful (and definitely gross) bacteria from your hands, thus minimizing the spread of illness and other random goobers (not the goofy kind). A completely randomized design was used to study different hand-washing methods to determine if there are differences in the amount of bacteria left on hands based on method. A total of 32 subjects were randomly assigned to one of 4 methods: water only (W), regular soap (S), antibacterial soap (ABS), and alcohol spray (AS). Is there sufficient evidence that at least one hand-washing method differs in the amount of bacteria left on the hand? Example II (with software output) H0 : µ1 = µ2 = µ3 = µ4, Ha : H0 not true boxplot(Bacteria~Method,data=Hw,main='Bacteria left by Method') 6 ABS AS S W 0 50 10 0 20 0 Bacteria left by Method fit=lm(Bacteria~Method,data=Hw) anova(fit) Analysis of Variance Table Response: Bacteria Df Sum Sq Mean Sq F value Pr(>F) Method 3 29882 9960.7 7.0636 0.001111 ** Residuals 28 39484 1410.1 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Notice all the df , SS, MS, F , and pvalue is all input into a table of output. The main things of interest are the F value and pvalue. F = 7.0636 with pvalue = 0.001111. Since pvalue = 0.001111 ≤ α(0.05), H0 is rejected. There is at least one hand-washing method is better at removing bacteria from the hands. Multiple Comparisons Multiple comparisons are only to be done if and only if (iff) the null hypothesis of ANOVA is rejected. (If the null is not rejected, you are saying there are no differences, so why would you try and find where the non-existent differences are?!?) So now that we have seen an example of rejecting the null hypothesis of an ANOVA problem, we can just look and see if there are differences, right? Nope! That would be too easy, wouldn’t it? Remember an earlier slide from this lecture that stated the Type I error rate would increase, depending on how many 2-sample comparisons we do? That is why. The hand-washing example with k = 4 would require ( k 2 ) = (4 2 ) = 6 2-sample comparisons, and the larger k is, the more comparisons to do and the larger Type I error without a modified procedure to execute the comparisons. There are many different multiple comparisons, we will learn one of the more commonly used ones called Tukey’s Honest Significant Difference (Tukey’s HSD). Tukey’s (not turkey) HSD This is a modified 2-sample CI that uses a different statistical distribution called the Studentized Range distribution, denoted as qα(k, df2). You will not have to use the distribution, just interpret the output from the comparison. 7
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved