Unformatted text preview: STAT 350 – Spring 2009 Lab #5  Solution 1way ANOVA For the following problems, do the analysis in SAS. All values (test statistics, pvalues, group means and standard deviations, etc) must be calculated in SAS – do not round! Please put all SAS input (contents of the Editor window) and all SAS output (contents of the Output window, NOT the Log window) as an appendix. Nothing pasted directly from SAS should be given as an answer to the questions below! 1. Four formulations of fertilizer (called A, B, C, and D) were tested for their effect on corn yield. The fertilizers were applied to individual 1acre plots and corn yield (in bushels) was measured. Fertilizers B and C were each applied to 20 plots, while fertilizers A and D were each applied to 17 plots. The resulting data are given in the accompanying Excel file on the “fertilizer” worksheet. Conduct an analysis of variance on this data set. a. Present a nice table summarizing the data: the sample size (ni), mean ( xi ) , and standard deviation (si) of the yields for each fertilizer. Fertilizer A B C D ni 17 20 20 17
xi 144.076471 153.085000 159.295000 143.788235 si 11.5830441 15.4839229 11.8159337 10.5040398 b. Give an ANOVA table to summarize the ANOVA results. Make a nice table (as you would do for a report/publication) – do NOT paste in anything from SAS directly! Source Fertilizer Error Total df 3 70 73 Sums of Squares 3147.69690 11120.02324 14267.72014 Mean Square 1049.23230 158.85747 F 6.60 p 0.0005 c. What is the pvalue for the ANOVA? State the null hypothesis for this test and state what your conclusion regarding this hypothesis. The pvalue is 0.0005 The null hypothesis is that there is no difference in the mean yield of corn among the 4 fertilizers. H0: µA = µB = µC = µD Because the pvalue is < α (0.0005 < 0.05), we reject the null hypothesis and conclude that at least one of the fertilizers has a significantly different yield than the others. Lab #5  Solution Page 1 of 1 d. If appropriate, also conduct an appropriate multiple comparison test to determine if any of the fertilizers result in significantly different yields. Present your results (with the means for each level) using the line method discussed in class (you may draw the lines in by hand, but letters are not acceptable). In a few sentences, clearly explain what these results mean (assume you are talking to a farmer/biologist who is not up on his/her statistical jargon). Fertilizer C Fertilizer B Fertilizer A Fertilizer D 159.295 153.085 144.076 143.788 In statistician (technically correct) speak: The mean yield for fertilizer C was significantly different from that of Fertilizers A and D, but not from Fertilizer B. There was no statistically significant difference among Fertilizers B, A, and D. In meremortal speak: Fertilizers B and C are the best, but there’s no real evidence that says that C is better than B. 2. Volunteers were asked to follow one of 6 diets, take dietary supplements, and to walk at least 20 minutes a day at least 5 days a week or one month. Another group of volunteers were not asked to diet, but just to take the supplements and to walk at least 20 minutes a day at least 5 days a week for one month. The researchers are only interested in whether each of the six diets is an improvement over just taking supplements and light exercise; they are not interested in comparing among the diets themselves. All volunteers were weighed at the beginning and the end of the month and were asked to keep diaries on their eating, exercise, and mood for the month. The weight loss (in ounces) for each volunteer was recorded at the end of the month. The data are given in the accompanying Excel file on the “diet” worksheet. Conduct an analysis of variance on this data set. a. Present a nice table summarizing the data: the sample size (ni), mean ( xi ) , and standard deviation (si) of the yields for each treatment level. Treatment No Diet (control) Atkins Grapefruit Jenny Craig Nutrisystem South Beach Weight Watchers ni 15 10 10 12 10 11 12
xi 10.4333333 36.1000000 2.6500000 24.3916667 36.0400000 19.4272727 14.7250000 si 8.2595976 2.6352314 13.3254352 6.6624399 6.4436360 7.0861966 11.5781240 b. Give an ANOVA table to summarize the ANOVA results. Make a nice table (as you would do for a report/publication) – do NOT paste in anything from SAS directly! Source Diet Error Total
Lab #5  Solution df 6 73 79 Sums of Squares 12183.28606 5454.37582 17637.66187 Mean Square 2030.54768 74.71748 F 27.18 p <0.0001 Page 2 of 2 c. What is the pvalue for the ANOVA? State the null hypothesis for this test and state what your conclusion about this hypothesis is. The pvalue <0.0001 The null hypothesis is that there is no difference in the mean weightloss among the 7 treatments. H0: µno diet = µatkins = µgrapefruit = µjenny craig = µnutrisystem = µsouthbeach = µweight wwatchers Because the pvalue is < α, we reject the null hypothesis and conclude that at least one of the treatment levels results in a significantly different average weightloss than the others. d. If appropriate, also conduct an appropriate multiple comparison test. In a few sentences, clearly explain what these results mean (assume you are talking to a friend or relative who wants to lose a little weight is not up on his/her statistical jargon). Note: Dunnett’s test is appropriate here because (1) we have a control group and (2) we are only interested in comparing the diets to the control, not in comparing the various diets to each other. Also, because we are only interested in identifying those diets that result in significantly MORE weight loss than the control, a onetailed Dunnett’s test is appropriate. Answer: Atkins, Nutrisystem, Jenny Craig, and South Beach diets all resulted in significantly more weight loss than the control (no diet). Note: had you done a 2tailed Dunnett’s test, you would have found that the grapefruit diet was also significantly different than the control, but the grapefruit diet actually resulted in less weight loss than the control – so this is not an effective diet! Lab #5  Solution Page 3 of 3 Appendix Do not forget to include your SAS code (contents of the Editor window) and all SAS output (contents of the Output window, NOT the Log window) as an appendix.
data fertilizer; input fert $ corn; cards; A 145.1 A 138.6 A 143.2 A 139.1 A 136.6 A 159.6 A 138.1 A 152.4 A 166.2 A 128.6 A 142.3 A 156.9 A 152.9 A 132.1 A 157.3 A 128.2 A 132.1 B 153.9 B 168.7 B 157.6 B 165.4 B 143.5 B 167.1 B 153.6 B 174.3 B 142.7 B 139.5 B 135.1 B 155.0 B 136.7 B 165.2 B 161.5 B 173.2 B 144.4 B 132.8 B 171.2 B 120.3 C 183.0 C 150.2 C 171.5 C C C C C C C C C C C C C C C C C D D D D D D D D D D D D D D D D D ; 157.2 163.2 148.5 163.2 144.4 156.6 177.1 161.8 152.4 161.7 167.2 156.2 171.2 132.6 146.8 163.4 157.7 147.0 128.2 139.1 131.5 128.8 151.3 146.3 148.1 158.7 159.0 144.8 157.6 134.8 130.0 153.7 139.9 145.6 proc anova data=fertilizer; class fert; model corn = fert; means fert; means fert/lines tukey; run; Lab #5  Solution Page 4 of 4 data weightloss; input diet $ loss; cards; at 38.8 at 35.9 at 34.0 at 39.0 at 30.4 at 35.7 at 35.8 at 39.1 at 36.7 at 35.6 ns 38.7 ns 32.8 ns 31.7 ns 30.5 ns 36.7 ns 39.3 ns 40.0 ns 23.3 ns 44.0 ns 43.4 sb 22.4 sb 23.2 sb 6.2 sb 13.8 sb 23.5 sb 20.6 sb 22.6 sb 9.1 sb 26.9 sb 17.2 sb 28.2 ww 35.9 ww 7.1 ww 21.4 ww 1.2 ww 12.0 ww 7.2 ww 0.8 ww 32.6 ww 22.7 ww 17.8 ww 5.5 ww 12.5 jc jc jc jc jc jc jc jc jc jc jc jc gf gf gf gf gf gf gf gf gf gf nd nd nd nd nd nd nd nd nd nd nd nd nd nd nd ; 28.7 20.6 19.0 28.8 26.5 9.5 18.8 30.1 23.9 22.9 31.8 32.1 15.2 5.5 9.3 3.6 8.6 18.7 9.1 11.9 20.4 15.6 9.4 13.6 15.9 16.3 20.2 5.8 12.8 6.6 5.5 17.0 16.3 8.1 11.1 13.1 14.2 proc anova data=weightloss; class diet; model loss = diet; means diet; means diet/dunnettu ('nd'); run; Lab #5  Solution Page 5 of 5 The SAS System The ANOVA Procedure Class Level Information Class fert Levels 4 Values ABCD 1 Number of Observations Read Number of Observations Used The SAS System The ANOVA Procedure Dependent Variable: corn Sum of Squares 3147.69690 11120.02324 14267.72014 74 74 2 Source Model Error Corrected Total DF 3 70 73 Mean Square 1049.23230 158.85747 F Value 6.60 Pr > F 0.0005 RSquare 0.220617 Coeff Var 8.371431 Root MSE 12.60387 corn Mean 150.5581 Source fert DF 3 Anova SS 3147.696900 Mean Square 1049.232300 F Value 6.60 Pr > F 0.0005 Lab #5  Solution Page 6 of 6 The SAS System The ANOVA Procedure Level of fert A B C D cornMean Std Dev 144.076471 153.085000 159.295000 143.788235 The SAS System The ANOVA Procedure Tukey's Studentized Range (HSD) Test for corn NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than REGWQ. 11.5830441 15.4839229 11.8159337 10.5040398 3 N 17 20 20 17 4 Alpha 0.05 Error Degrees of Freedom 70 Error Mean Square 158.8575 Critical Value of Studentized Range 3.72198 Minimum Significant Difference 10.943 Harmonic Mean of Cell Sizes 18.37838 NOTE: Cell sizes are not equal. Means with the same letter are not significantly different. Tukey Grouping A A A Mean 159.295 153.085 144.076 143.788 N 20 20 17 17 fert C B A D B B B B B Lab #5  Solution Page 7 of 7 The SAS System 5 The ANOVA Procedure Class Level Information Class diet Levels 7 Values at gf jc nd ns sb ww Number of Observations Read Number of Observations Used The SAS System The ANOVA Procedure Dependent Variable: loss Sum of Squares 12183.28606 5454.37582 17637.66187 80 80 6 Source Model Error Corrected Total DF 6 73 79 Mean Square 2030.54768 74.71748 F Value 27.18 Pr > F <.0001 RSquare 0.690754 Coeff Var 45.06446 Root MSE 8.643927 loss Mean 19.18125 Source diet DF 6 Anova SS 12183.28606 Mean Square 2030.54768 F Value 27.18 Pr > F <.0001 Lab #5  Solution Page 8 of 8 The SAS System The ANOVA Procedure Level of diet at gf jc nd ns sb ww lossMean Std Dev 36.1000000 2.6500000 24.3916667 10.4333333 36.0400000 19.4272727 14.7250000 The SAS System The ANOVA Procedure Dunnett's Onetailed t Tests for loss NOTE: This test controls the Type I experimentwise error for comparisons of all treatments against a control. 2.6352314 13.3254352 6.6624399 8.2595976 6.4436360 7.0861966 11.5781240 7 N 10 10 12 15 10 11 12 8 Alpha 0.05 Error Degrees of Freedom 73 Error Mean Square 74.71748 Critical Value of Dunnett's t 2.36425 Comparisons significant at the 0.05 level are indicated by ***. diet Comparison at ns jc sb ww gf nd nd nd nd nd nd Difference Between Means 25.667 25.607 13.958 8.994 4.292 13.083 Simultaneous 95% Confidence Limits 17.324 17.264 6.043 0.882 3.623 21.426 Infinity Infinity Infinity Infinity Infinity Infinity *** *** *** *** Lab #5  Solution Page 9 of 9 ...
View
Full
Document
 Spring '08
 Staff
 Statistics, PValues, Standard Deviation, Statistical hypothesis testing, Type I and type II errors, Multiple comparisons

Click to edit the document details