Upcoming SlideShare
×

# One way anova

5,262 views

Published on

9 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
5,262
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
338
0
Likes
9
Embeds 0
No embeds

No notes for slide

### One way anova

1. 1. Analysis of Variance Chapter 12
2. 2. Introduction <ul><li>Analysis of variance compares two or more populations of interval data. </li></ul><ul><li>Specifically, we are interested in determining whether differences exist between the population means. </li></ul><ul><li>The procedure works by analyzing the sample variance. </li></ul>
3. 3. <ul><li>The analysis of variance is a procedure that tests to determine whether differences exits between two or more population means. </li></ul><ul><li>To do this, the technique analyzes the sample variances </li></ul>12.1 One Way Analysis of Variance
4. 4. One Way Analysis of Variance: Example <ul><li>A magazine publisher wants to compare three different styles of covers for a magazine that will be offered for sale at supermarket checkout lines. She assigns 60 stores at random to the three styles of covers and records the number of magazines that are sold in a one-week period. </li></ul>
5. 5. One Way Analysis of Variance: Example <ul><li>How do five bookstores in the same city differ in the demographics of their customers? A market researcher asks 50 customers of each store to respond to a questionnaire. One variable of interest is the customer’s age. </li></ul>
6. 6. Idea Behind ANOVA Graphical demonstration: Employing two types of variability
7. 7. Treatment 1 Treatment 2 Treatment 3 20 16 15 14 11 10 9 The sample means are the same as before, but the larger within-sample variability makes it harder to draw a conclusion about the population means. A small variability within the samples makes it easier to draw a conclusion about the population means. 20 25 30 1 7 Treatment 1 Treatment 2 Treatment 3 10 12 19 9
8. 8. Idea behind ANOVA: recall the two-sample t-statistic <ul><li>Difference between 2 means, pooled variances, sample sizes both equal to n </li></ul><ul><li>Numerator of t 2 : measures variation between the groups in terms of the difference between their sample means </li></ul><ul><li>Denominator: measures variation within groups by the pooled estimator of the common variance. </li></ul><ul><li>If the within-group variation is small, the same variation between groups produces a larger statistic and a more significant result. </li></ul>
9. 9. <ul><li>Example 12.1 </li></ul><ul><ul><li>An apple juice manufacturer is planning to develop a new product -a liquid concentrate. </li></ul></ul><ul><ul><li>The marketing manager has to decide how to market the new product. </li></ul></ul><ul><ul><li>Three strategies are considered </li></ul></ul><ul><ul><ul><li>Emphasize convenience of using the product. </li></ul></ul></ul><ul><ul><ul><li>Emphasize the quality of the product. </li></ul></ul></ul><ul><ul><ul><li>Emphasize the product’s low price. </li></ul></ul></ul>One Way Analysis of Variance: Example
10. 10. <ul><li>Example 12.1 - continued </li></ul><ul><ul><li>An experiment was conducted as follows: </li></ul></ul><ul><ul><ul><li>In three cities an advertisement campaign was launched . </li></ul></ul></ul><ul><ul><ul><li>In each city only one of the three characteristics (convenience, quality, and price) was emphasized. </li></ul></ul></ul><ul><ul><ul><li>The weekly sales were recorded for twenty weeks following the beginning of the campaigns. </li></ul></ul></ul>One Way Analysis of Variance
11. 11. One Way Analysis of Variance Weekly sales Weekly sales Weekly sales
12. 12. <ul><li>Solution </li></ul><ul><ul><li>The data are interval </li></ul></ul><ul><ul><li>The problem objective is to compare sales in three cities. </li></ul></ul><ul><ul><li>We hypothesize that the three population means are equal </li></ul></ul>One Way Analysis of Variance
13. 13. Defining the Hypotheses <ul><ul><ul><li>H 0 :  1 =  2 =  3 </li></ul></ul></ul><ul><ul><ul><li>H 1 : At least two means differ </li></ul></ul></ul><ul><ul><ul><li>To build the statistic needed to test the hypotheses use the following notation: </li></ul></ul></ul><ul><ul><li>Solution </li></ul></ul>
14. 14. Notation Independent samples are drawn from k populations (treatment groups). X 11 x 21 . . . X n1,1 X 12 x 22 . . . X n2,2 X 1k x 2k . . . X nk,k Sample size Sample mean X is the “response variable”. The variables’ value are called “responses”. 1 2 k First observation, first sample Second observation, second sample
15. 15. Terminology <ul><li>In the context of this problem… </li></ul><ul><ul><li>Response variable – weekly sales Responses – actual sale values Experimental unit – weeks in the three cities when we record sales figures. Factor – the criterion by which we classify the populations (the treatments). In this problems the factor is the marketing strategy. </li></ul></ul><ul><ul><li>Factor levels – the population (treatment) names. In this problem factor levels are the 3 marketing strategies: 1) convenience, 2) quality, 3) price </li></ul></ul>
16. 16. Two types of variability are employed when testing for the equality of the population means The rationale of the test statistic
17. 17. The rationale behind the test statistic – I <ul><li>If the null hypothesis is true, we would expect all the sample means to be close to one another (and as a result, close to the grand mean). </li></ul><ul><li>If the alternative hypothesis is true, at least some of the sample means would differ. </li></ul><ul><li>Thus, we measure variability between sample means. </li></ul>
18. 18. Variability between sample means <ul><li>The variability between the sample means is measured as the sum of squared distances between each mean and the grand mean. </li></ul><ul><li>This sum is called the </li></ul><ul><li>S um of S quares for Groups </li></ul><ul><li>SSG </li></ul>In our example treatments are represented by the different advertising strategies.
19. 19. Sum of squares for treatment groups (SSG) There are k treatments The size of sample j The mean of sample j Note: When the sample means are close to one another, their distance from the grand mean is small, leading to a small SSG. Thus, large SSG indicates large variation between sample means, which supports H 1 .
20. 20. <ul><li>Solution – continued Calculate SSG </li></ul>Sum of squares for treatment groups (SSG) = 20(577.55 - 613.07 )2 + + 20(653.00 - 613.07) 2 + + 20(608.65 - 613.07) 2 = = 57,512.23 The grand mean is calculated by
21. 21. <ul><li>Is SSG = 57,512.23 large enough to reject H 0 in favor of H 1 ? See next. </li></ul>Sum of squares for treatment groups (SSG)
22. 22. <ul><li>Large variability within the samples weakens the “ability” of the sample means to represent their corresponding population means. </li></ul><ul><li>Therefore, even though sample means may markedly differ from one another, SSG must be judged relative to the “within samples variability”. </li></ul>The rationale behind test statistic – II
23. 23. <ul><li>The variability within samples is measured by adding all the squared distances between observations and their sample means. </li></ul><ul><li>This sum is called the </li></ul><ul><li>S um of S quares for E rror </li></ul><ul><li>SSE </li></ul>Within samples variability In our example this is the sum of all squared differences between sales in city j and the sample mean of city j (over all the three cities).
24. 24. <ul><li>Solution – continued Calculate SSE </li></ul>Sum of squares for errors (SSE)  (n 1 - 1)s 1 2 + (n 2 -1)s 2 2 + (n 3 -1)s 3 2 = (20 -1)10,774.44 + (20 -1)7,238.61+ (20-1)8,670.24 = 506,983.50
25. 25. <ul><li>Is SSG = 57,512.23 large enough relative to SSE = 506,983.50 to reject the null hypothesis that specifies that all the means are equal? </li></ul>Sum of squares for errors (SSE)
26. 26. The mean sum of squares To perform the test we need to calculate the mean squares as follows: Calculation of MSG - M ean S quare for treatment Groups Calculation of MSE M ean S quare for E rror
27. 27. Calculation of the test statistic with the following degrees of freedom: v 1 =k -1 and v 2 =n-k Required Conditions: 1. The populations tested are normally distributed. 2. The variances of all the populations tested are equal.
28. 28. The F test rejection region And finally the hypothesis test: H 0 :  1 =  2 = …=  k H 1 : At least two means differ Test statistic: R.R: F>F  ,k-1,n-k
29. 29. The F test H o :  1 =  2 =  3 H 1 : At least two means differ Test statistic F= MSG  MSE= 3.23 Since 3.23 > 3.15, there is sufficient evidence to reject H o in favor of H 1 , and argue that at least one of the mean sales is different than the others.
30. 30. <ul><li>Use Excel to find the p-value </li></ul><ul><ul><li>f x Statistical FDIST(3.23,2,57) = .0467 </li></ul></ul>The F test p- value p Value = P(F>3.23) = .0467
31. 31. Excel single factor ANOVA SS(Total) = SSG + SSE
32. 32. Multiple Comparisons <ul><li>When the null hypothesis is rejected, it may be desirable to find which mean(s) is (are) different, and at what ranking order. </li></ul><ul><li>Two statistical inference procedures, geared at doing this, are presented: </li></ul><ul><ul><li>“ regular” confidence interval calculations </li></ul></ul><ul><ul><li>Bonferroni adjustment </li></ul></ul>
33. 33. <ul><li>Two means are considered different if the confidence interval for the difference between the corresponding sample means does not contain 0. In this case the larger sample mean is believed to be associated with a larger population mean. </li></ul><ul><li>How do we calculate the confidence intervals? </li></ul>Multiple Comparisons
34. 34. “ Regular” Method <ul><li>This method builds on the equal variances confidence interval for the difference between two means. </li></ul><ul><li>The CI is improved by using MSE rather than s p 2 (we use ALL the data to estimate the common variance instead of only the data from 2 samples) </li></ul>
35. 35. Experiment-wise Type I error rate (the effective Type I error) <ul><li>The preceding “regular” method may result in an increased probability of committing a type I error. </li></ul><ul><li>The experiment-wise Type I error rate is the probability of committing at least one Type I error at significance level  It is  calculated by: </li></ul><ul><li>experiment-wise Type I error rate = 1-(1 –  ) g where g is the number of pairwise comparisons (i.e. g = k C 2 = k(k-1)/2. </li></ul><ul><li>For example, if  =.05, k=4, then </li></ul><ul><li>experiment-wise Type I error rate =1-.735=.265 </li></ul><ul><li>The Bonferroni adjustment determines the required T ype I error probability per pairwise comparison (   ) , to secure a pre-determined overall  </li></ul>
36. 36. <ul><li>The procedure: </li></ul><ul><ul><li>Compute the number of pairwise comparisons (g) [g=k(k-1)/2], where k is the number of populations. </li></ul></ul><ul><ul><li>Set   =  /g, where  is the true probability of making at least one Type I error (called experiment-wise Type I error). </li></ul></ul><ul><ul><li>Calculate the following CI for  i –  j </li></ul></ul>Bonferroni Adjustment
37. 37. <ul><li>Example - continued </li></ul><ul><ul><li>Rank the effectiveness of the marketing strategies (based on mean weekly sales). </li></ul></ul><ul><ul><li>Use the Bonferroni adjustment method </li></ul></ul><ul><li>Solution </li></ul><ul><ul><li>The sample mean sales were 577.55, 653.0, 608.65. </li></ul></ul><ul><ul><li>We calculate g=k(k-1)/2 to be 3(2)/2 = 3. </li></ul></ul><ul><ul><li>We set   = .05/3 = .0167, thus t .0167  2, 60-3 = 2.467 (Excel). </li></ul></ul><ul><ul><li>Note that s = √ 8894.447 = 94.31 </li></ul></ul>Bonferroni Method
38. 38. Bonferroni Method: The Three Confidence Intervals <ul><ul><li>There is a significant difference between  1 and  2 . </li></ul></ul>
39. 39. Bonferroni Method: Conclusions Resulting from Confidence Intervals <ul><li>Do we have evidence to distinguish two means? </li></ul><ul><li>Group 1 Convenience: sample mean 577.55 </li></ul><ul><li>Group 2 Quality: sample mean 653 </li></ul><ul><li>Group 3 Price: sample mean 608.65 </li></ul><ul><li>List the group numbers in increasing order of their sample means; connecting overhead lines mean no significant difference </li></ul>1 3 2