Download presentation
Presentation is loading. Please wait.
Published byKristopher Cobb Modified over 9 years ago
1
Chapter 15 The Analysis of Variance
2
2 A study was done on the survival time of patients with advanced cancer of the stomach, bronchus, colon, ovary or breast when treated with ascorbate 1. In this study, the authors wanted to determine if the survival times differ based on the affected organ. 1 Cameron, E. and Pauling, L. (1978) Supplemental ascorbate in the supportive treatment of cancer: re-evaluation of prolongation of survival time in terminal human cancer. Proceedings of the National Academy of Science, USA, 75, 4538-4542. A Problem
3
3 A comparative dotplot of the survival times is shown below. A Problem
4
4 The hypotheses used to answer the question of interest are H 0 : stomach = bronchus = colon = ovary = breast H a : At least two of the ’s are different The question is similar to ones encountered in chapter 11 where we looked at tests for the difference of means of two different variables. In this case we are interested in looking a more than two variable. A Problem
5
5 A single-factor analysis of variance (ANOVA) problems involves a comparison of k population or treatment means 1, 2, …, k. The objective is to test the hypotheses: H 0 : 1 = 2 = 3 = … = k H a : At least two of the ’s are different Single-factor Analysis of Variance (ANOVA)
6
6 The analysis is based on k independently selected samples, one from each population or for each treatment. In the case of populations, a random sample from each population is selected independently of that from any other population. When comparing treatments, the experimental units (subjects or objects) that receive any particular treatment are chosen at random from those available for the experiment. A comparison of treatments based on independently selected experimental units is often referred to as a completely randomized design. Single-factor Analysis of Variance (ANOVA)
7
7 Single-Factor Analysis of Variance (ANOVA) Notice that in the comparative dotplot on the left, the differences in the treatment means is large relative to the variability within the samples while with the comparative dotplot on the right, the differences in the sample means is relative to the sample variability is not so clear cut. ANOVA techniques will allow us to determined if those differences are significant.
8
8 ANOVA Notation
9
9 Assumptions for ANOVA 1. Each of the k populations or treatments, the response distribution is normal. 1 = 2 = … = k (The k normal distributions have identical standard deviations. 3. The observations in the sample from any particular one of the k populations or treatments are independent of one another. 4. When comparing population means, k random samples are selected independently of one another. When comparing treatment means, treatments are assigned at random to subjects or objects.
10
10 Definitions
11
11 Definitions The error df comes from adding the df’s associated with each of the sample variances: (n 1 - 1) + (n 2 - 1) + …+ (n k - 1) = n 1 + n 2 … + n k - 1 - 1 - … - 1 = N - k
12
12 Example Three filling machines are used by a bottler to fill 12 oz cans of soda. In an attempt to determine if the three machines are filling the cans to the same (mean) level, independent samples of cans filled by each were selected and the amounts of soda in the cans measured. The samples are given below. Machine 1 12.03311.98512.00912.009 12.03312.02512.05412.050 Machine 2 12.03111.98511.99811.992 11.98512.02711.987 Machine 3 12.03412.02112.03812.058 12.00112.02012.02912.011 12.021
13
13 Example
14
14 Example
15
15 Comments Both MSTr and MSE are quantities that are calculated from sample data. As such, both MSTr and MSE are statistics and have sampling distributions. More specifically, when H 0 is true ( 1 = 2 = 3 = … = k ), MSTr = MSE. However, when H 0 is false, MSTr = MSE and the greater the differences among the ’s, the larger MSTr will be relative to MSE.
16
16 The Single-Factor ANOVA F Test
17
17 The Single-Factor ANOVA F Test When H 0 is true and the ANOVA assumptions are reasonable, F has an F distribution with df 1 = k - 1 and df 2 = N - k. Values of F more contradictory to H 0 than what was calculated are values even farther out in the upper tail, so the P-value is the area captured in the upper tail of the corresponding F curve.
18
18 Example Consider the earlier example involving the three filling machines. Machine 1 12.03311.98512.00912.00912.03312.02512.05412.050 Machine 2 12.03111.98511.99811.99211.98512.02711.987 Machine 3 12.03412.02112.03812.05812.00112.02012.02912.011 12.021
19
19 Example
20
20 Example 6. Looking at the comparative dotplot, it seems reasonable to assume that the distributions have the same ’s. We shall look at the normality assumption on the next slide. * *When the sample sizes are large, we can make judgments about both the equality of the standard deviations and the normality of the underlying populations with a comparative boxplot.
21
21 Example 6. (continued) Looking at normal plots for the samples, it certainly appears reasonable to assume that the samples from Machine’s 1 and 2 are samples from normal distributions. Unfortunately, the normal plot for the sample from Machine 2 does not appear to be a sample from a normal population. So as to have a computational example, we shall continue and finish the test, treating the result with a “grain of salt.”
22
22 Example
23
23 Example
24
24 Example 9. Conclusion: Since P-value > = 0.01, we fail to reject H 0. We are unable to show that the mean fills are different and conclude that the differences in the mean fills of the machines show no statistically significant differences.
25
25 Total Sum of Squares The relationship between the three sums of squares is SSTo = SSTr + SSE which is often called the fundamental identity for single-factor ANOVA. Informally this relation is expressed as Total variation = Explained variation + Unexplained variation
26
26 Single-factor ANOVA Table The following is a fairly standard way of presenting the important calculations from an single-factor ANOVA. The output from most statistical packages will contain an additional column giving the P-value.
27
27 Single-factor ANOVA Table The ANOVA table supplied by Minitab One-way ANOVA: Fills versus Machine Analysis of Variance for Fills Source DF SS MS F P Machine 2 0.003016 0.001508 3.84 0.038 Error 21 0.008256 0.000393 Total 23 0.011271
28
28 Another Example A food company that sells iced tea, produces 4 different flavored sweetened iced teas (lemon, raspberry, peach, green tea). A dietician working for the company needed to determine if the current formulations gave the same mean sodium levels for the four flavors. In order to determine if the four flavors had the same sodium levels, 15 bottles of each flavor were randomly (and independently) obtained and the sodium content in milligrams (mg) per 12 ounce serving was measured. The sample data are given on the next slide. Use the data to perform an appropriate hypothesis test at the 0.05 level of significance.
29
29 Another Example Flavor 1 35.035.634.139.635.632.336.634.5 35.233.836.737.234.033.835.8 Flavor 2 37.337.438.334.939.036.536.937.6 34.940.437.533.538.234.634.5 Flavor 3 35.233.434.538.136.235.438.531.5 36.735.636.739.336.831.533.2 Flavor 4 35.435.731.434.534.131.237.537.3 31.733.233.835.8
30
30 Another Example
31
31 6. Looking at the following comparative boxplot, it seems reasonable to assume that the distributions have the same ’s as well as the samples being samples from normal distributions (i.e., It is reasonable to assume that the distributions of sodium content per 12 ounce serving are normal for each of the four flavors. Another Example
32
32 Another Example
33
33 Another Example
34
34 Another Example 8. P-value: F = 4.27 with df numerator = 3 and df denominator = 56 4.27 Using df = 60 (the closest entry to 56 in the table) we find 0.001 < P-value < 0.01
35
35 Another Example 9. Conclusion: Since P-value < = 0.05, we reject H 0. We can conclude that the mean sodium content is different for at least two of the flavors. We need to learn how to interpret the results and will spend some time on developing techniques to describe the differences among the ’s.
36
36 Multiple Comparisons A multiple comparison procedure is a method for identifying differences among the ’s once the hypothesis of overall equality (H 0 ) has been rejected. The technique we will present is based on computing confidence intervals for difference of means for the pairs. Specifically, if k populations or treatments are studied, we would create k(k-1)/2 differences. (i.e., with 3 treatments one would generate confidence intervals for 1 - 2, 1 - 3 and 2 - 3.) Notice that it is only necessary to look at a confidence interval for 1 - 2 to see if 1 and 2 differ.
37
37 The Tukey-Kramer Multiple Comparison Procedure
38
38 The Tukey-Kramer Multiple Comparison Procedure
39
39 Example (continued)
40
40 Example (continued) Notice that the confidence interval for 2 - 4 does not contain 0 so we can infer that the mean sodium content for flavors 2 and 4 differ.
41
41 Example (continued) Notice that the confidence interval for 2 - 4 does not contain 0 so we can infer that the mean sodium content for flavors 2 and 4 differ. We also illustrate the differences with the following listing of the sample means in increasing order with lines underneath those blocks of means that are indistinguishable. Flavor 4 Flavor 1 Flavor 3Flavor 2 33.893 35.32035.50736.767 Notice that the confidence interval for 2 - 4 does not contain 0 so we can infer that the mean sodium content for flavors 2 and 4 differ.
42
42 Minitab Output for Example One-way ANOVA: Sodium versus Flavor Analysis of Variance for Sodium Source DF SS MS F P Flavor 3 62.29 20.76 4.55 0.006 Error 56 255.74 4.57 Total 59 318.02 Individual 95% CIs For Mean Based on Pooled StDev Level N Mean StDev --+---------+---------+---------+---- Flavor 1 15 35.320 1.764 (------*-------) Flavor 2 15 36.767 1.929 (------*------) Flavor 3 15 35.507 2.361 (-------*------) Flavor 4 15 33.893 2.421 (------*------) --+---------+---------+---------+---- Pooled StDev = 2.137 33.0 34.5 36.0 37.5
43
43 Minitab Output for Example Tukey's pairwise comparisons Family error rate = 0.0500 Individual error rate = 0.0106 Critical value = 3.74 Intervals for (column level mean) - (row level mean) Flavor 1 Flavor 2 Flavor 3 Flavor 2 -3.510 0.617 Flavor 3 -2.250 -0.804 1.877 3.324 Flavor 4 -0.637 0.810 -0.450 3.490 4.937 3.677
44
44 Simultaneous Confidence Level The Tukey-Kramer intervals are created in a manner that controls the simultaneous confidence level. For example at the 95% level, if the procedure is used repeatedly on many different data sets, in the long run only about 5% of the time would at least one of the intervals not include that value of what it is estimating. We then talk about the family error rate being 5% which is the maximum probability of one or more of the confidence intervals of the differences of mean not containing the true difference of mean.
45
45 Randomized Block Experiment Suppose that experimental units (individuals or objects to which the treatments are applied) are first separated into groups consisting of k units in such a way that the units within each group are as similar as possible. Within any particular group, the treatments are then randomly allocated so that each unit in a group receives a different treatment. The groups are often called blocks and the experimental design is referred to as a randomized block design.
46
46 Example When choosing a variety of melon to plant, one thing that a farmer might be interested in is the length of time (in days) for the variety to bear harvestable fruit. Since the growing conditions (soil, temperature, humidity) also affect this, a farmer might experiment with three hybrid melons (denoted hybrid A, hybrid B and hybrid C) by taking each of the four fields that he wants to use for growing melons and subdividing each field into 3 subplots (1, 2 and 3) and then planting each hybrid in one subplot of each field. The blocks are the fields and the treatments are the hybrid that is planted. The question of interest would be “Are the mean times to bring harvestable fruit the same for all three hybrids?”
47
47 Assumptions and Hypotheses The single observation made on any particular treatment in a given block is assumed to be selected from a normal distribution. The variance of this distribution is 2, the same for each block-treatment combinations. However, the mean value may depend separately both on the treatment applied and on the block. The hypotheses of interest are as follows: H 0 : The mean value does not depend on which treatment is applied H a : The mean value does depend on which treatment is applied
48
48 Summary of the Randomized Block F Test
49
49 Summary of the Randomized Block F Test Sum of squares and associated df’s are as follows.
50
50 Summary of the Randomized Block F Test
51
51 The ANOVA Table for a Randomized Block Experiment
52
52 Example (Food Prices) In an attempt to measure which of 3 grocery chains has the best overall prices, it was felt that there would be a great deal of variability of prices if items were randomly selected from each of the chains, so a randomized block experiment was devised to answer the question. A list of standard items was developed (typically a fairly large list would be used, but in the interest of providing a small example, 15 items were chosen and the price was suppose to be recorded for each of these items in each of the stores. There were problems with the collection of data so that only 7 items appeared in all the stores. The data is given in the next slide.
53
53 Example (Food Prices)
54
54 ANOVA Table The resulting P-value for the treatments (stores) is 0.000. Our interpretation is that the stores have different means costs for the selected items. We need to do some multiple comparisons to determine the actual differences.
55
55 Multiple Comparisons
56
56 Example
57
57 Example
58
58 Two-Factor ANOVA Notation: k = number of levels of factor A l = number of levels of factor B kl = number of treatments (each one a combination of a factor A level and a factor B level) m = number of observations on each treatment
59
59 Two-Factor ANOVA Example A grocery store has two stocking supervisors, Fred & Wilma. The store is open 24 hours a day and would like to schedule these two individuals in a manner that is most effective. To help determine how to schedule them, a sample of their work was obtained by scheduling each of them for 5 times in each of the three shifts and then tracked the number of cases of groceries that were emptied and stacked during the shift. The data follows on the next slide.
60
60 Two-Factor ANOVA Example
61
61 Interactions There is said to be an interaction between the factors, if the change in true average response when the level of one factor changes depend on the level of the other factor. One can look at the possible interaction between two factors by drawing an interactions plot, which is a graph of the means of the response for one factor plotted against the values of the other factor.
62
62 Two-Factor ANOVA Example A table of the sample means for the 30 observations.
63
63 Two-Factor ANOVA Example Typically, only one of these interactions plots will be constructed. As you can see from these diagrams, there is a suggestion that Fred does better during the day and Wilma is better at night or during the swing shift. The question to ask is “Are these differences significant?” Specifically is there an interaction between the supervisor and the shift.
64
64 Interactions If the graphs of true average responses are connected line segments that are parallel, there is no interaction between the factors. In this case, the change in true average response when the level of one factor is changed is the same for each level of the other factor. Special cases of no interaction are as follows: 1.The true average response is the same for each level of factor A (no factor A main effects). 2.The true average response is the same for each level of factor B (no factor B main effects).
65
65 Basic Assumptions for Two- Factor ANOVA The observations on any particular treatment are independently selected from a normal distribution with variance 2 (the same variance for each treatment), and samples from different treatments are independent of one another.
66
66 Two-Factor ANOVA Table The following is a fairly standard way of presenting the important calculations for an two-factor ANOVA. The fundamental identity is SSTo = SSA + SSB + SSAB +SSE
67
67 Two-Factor ANOVA Example Minitab output for the Two-Factor ANOVA Two-way ANOVA: Cases versus Shift, Supervisor Analysis of Variance for Cases Source DF SS MS F P Shift 2 5437 2719 1.82 0.184 Supervis 1 7584 7584 5.07 0.034 Interaction 2 14365 7183 4.80 0.018 Error 24 35878 1495 Total 29 63265 1.Test of H 0 : no interaction between supervisor and Shift With the p-value of 0.018 there is strong evidence of an interaction. We go no further and draw the conclusion that this is an interactions.
68
68 Two-Factor ANOVA Example Looking at either of the interaction plots it becomes clear that from a practical standpoint, Fred should be scheduled for days and if someone is to be scheduled for the night or swing shifts it should be Wilma, although it appears that Wilma would do best at night.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.