In this homework you will use Wilcoxon sum rank test, Wilcoxon sign rank test, paired t-test and ANOVA as well as getting some JMP practice.

April 1, 2017 | Author: Corey Kennedy | Category: N/A
Share Embed Donate


Short Description

1 Homework 8 Solutions In this homework you will use Wilcoxon sum rank test, Wilcoxon sign rank test, paired t-test and ...

Description

Homework 8 Solutions In this homework you will use Wilcoxon sum rank test, Wilcoxon sign rank test, paired t-test and ANOVA as well as getting some JMP practice. (1) Nutritionists are studying the effect a calorie controlled diet may have on the life expectancy of mice. They randomly sampled 12 mice and put 6 on a calorie controlled diet and the other 6 on a typical mouse diet. The life time of each mouse was monitored and the results are given below. Let 1 indicate the mice was on a calorie controlled diet and 0 indicate it was put on a usual diet. (a) State the null and alternative that the nutritionist wants to investigate. H0 : µ1 − µ0 = 0, HA : µ1 − µ0 6= 0 (since it is unknown how a calorie control diet may effect the mice) µ0 is a mean life time of mice being put on an usual diet. µ1 is a mean life time of mice being put on a calorie controlled diet. (b) State the test you would do and why? The Wilcoxon sum rank test is appropriate because the sample size is extremely small and there appears to be an outlier (2.8 in Group 1). Moreover, since the group is assigned randomly, we can assume two groups are independent. (c) Do the test at the 5% level. Looking Table 5 (Wilcoxon sum rank table, n1 = 6 and n2 = 6, twosided at 5%) we get the interval [26, 52]. Since T = 32 ∈ [26, 52], we cannot reject H0 at the 5% level (the p-value will be greater than 2.5%)

(2) A group of ornithologists want to investigate whether cell phone masts have increased the number of eggs laid by birds nesting near by. To see whether there is an increase, the ornithologists locate 8 permanent nests and count the number eggs laid in the spring before the masts were constructed and then count the number of eggs after the masts were constructed. The data is collected below (you can do the calculations below in either JMP or by hand). (i) State the null and alternative that the ornithologists want to investigate. H0 : µ1 − µ0 ≤ 0, HA : µ1 − µ0 > 0 µ0 is a mean number of eggs before the masts were constructed. µ1 is a mean number of eggs after the masts were constructed. (ii) Make a scatter plot of the Before masts against the After masts, from the plots do you see a association between the location and the number of eggs (are the points ‘random’ or do they appear to have a pattern?).

1

They appear to have a linear pattern and a few outliers, suggesting there is an association between the location and the number of eggs. Therefore it is advisable to do a paired test rather than an independent sample test to remove the additional variability caused by this association. (iii) Do you think the assumptions to do a paired t-test are satisfied? No. The sample size is too small and it seems to have outliers. (iv) Explain why it is best to use a Wilcoxon sign rank test. As discussed in (iii), the assumptions of a paired t-test are not satisfied and therefore a nonparametric Wilcoxon approach should be used. Also two groups have a linear pattern as shown in (ii), that is, they are not independent, and therefore a Wilcoxon sign rank test is the best to use rather than Wilcoxon sum rank test. (v) Do the test at the 10% level. This can either be done by hand our using JMP. By hand you get that T+ = 7. In JMP you get:

p = 0.0781 < 0.10 or using the tables (n=8, 10% one-sided) gives the value 8, and 7 < 8 Reject the null, H0 at the 10% level. (vi) What happens if I do the test at the 5% level? p = 0.0781 > 0.05 or using the tables (n=8, 5% one-sided) gives the value 5, 2

and 7 > 5 Cannot reject the null, H0 at the 5% level. This means the p-value lies between 5 and 10%. Though there is some evidence to reject the null, may be because of the small sample size or simply that there is actually no difference in the egg behaviour, this evidence is not overwhelming. (vii) Do the paired t-test at the 10% level. Explain any differences in the results between the paired t-test and the Wilcoxon sign rank test.

The null H0 cannot be rejected for the paired t-test at the 10% level test, while it is rejected for the Wilcoxon sign rank test. This is because the Wilcoxon test is robust to outliers and looking at the data we can see a few values which can have large influence on the sample mean (and the sample standard deviation too). (3) Import the calf weight data into JMP. It is believed that the weight of a newborn animal in general drops immediately after they are born and only after a few weeks does the weight get back to the birth weight and above. We want to investigate whether the calf weight data suggests this to be true. Look at this data in JMP. The column with Wt 0 contains all the weights at birth. Wt 0.5 contains the weights at week 0.5, Wt 1 the weights at week 1 etc. (a) Make a scatter plot of the week 0 weights against the week 1 weights and from this explain why a paired t-test should be used (rather than an independent sample t-test) to compare the mean weight of a calf at different weeks.

3

(b) Do the following tests at the 5% level. Let µ0 = mean weight at week 0, µ1 = mean weight at week 1, µ2 = mean weight at week 2, µ3 = mean weight at week 3, µ4 = mean weight at week 4, (i) Do a paired t-test to test whether the weight has dropped between week 0 and week 1. H0 : µ1 − µ0 ≥ 0, HA : µ1 − µ0 < 0 Since p < 0.0001, reject the null, H0 . (ii) Do a paired t-test to test whether the weight has dropped between week 0 and week 2. H0 : µ2 − µ0 ≥ 0, HA : µ2 − µ0 < 0 Since p < 0.0001, reject the null, H0 . (iii) Do a paired t-test to test whether the weight has dropped between week 0 and week 3. H0 : µ3 − µ0 ≥ 0, HA : µ3 − µ0 < 0 Since p = 0.7258, not reject the null, H0 . (iv) Do a paired t-test to test whether the weight has dropped between week 0 and week 4. H0 : µ4 − µ0 ≥ 0, HA : µ4 − µ0 < 0 Since p = 1.0000, not reject the null, H0 . (iii) Do a paired t-test to test whether the weight has increased between week 0 and week 3. H0 : µ3 − µ0 ≤ 0, HA : µ3 − µ0 > 0 Since p = 0.2742, not reject the null, H0 . (iv) Do a paired t-test to test whether the weight has increased between week 0 and week 4. H0 : µ4 − µ0 ≤ 0, HA : µ4 − µ0 > 0 Since p < 0.0001, reject the null, H0 . (c) Based on your results in (b) summarize the mean behavior of calf weights from week 0 to week 4. Write this as a mini report (say about 5 lines) summarising how you came to your conclusions. Since there is an evidence that the weight at week 1 and 2 has dropped from week 0, this supports the view that calf weights drops immediately after they are born. However, at week 3 there is not enough evidence to suggest either a weight gain or loss, this very tenatively (because we cannot usually accept the null) that at week 3 the average calf is back to his birth weight. Finally, from week 4 onwards there is evidence to support the view that the average calf is now increasing above his or her birth weight.

4

(d) Why should we be a little cautious about doing multiple tests (in the way that we have done above). As the number of tests we do increases, so does the chance of rejecting the null when the null is true (falsely detecting an effect when there isn’t one). This is called a false positive or a false discovery, and the chance of this increases with the number of tests.

(4) Import the calf weight data into JMP. Investigate whether treatment (denoted as TRT) has an impact on the mean weight of a calf at week 8. Write this as a mini report (say about 7 lines), stating your null and alternative, the ANOVA table, the distribution used (including the number of degrees of freedom) and the p-value (do the test at the 5% level). Also comment about the confidence intervals of the mean weight for the 4 treatments. H0 : µA = µB = µC = µD , HA : at least one mean is different. Source DF TRT 3 Error 40 Total 43

Sum of Squares Mean Square 475.774 158.591 12109.021 302.726 12584.795

F Ratio 0.5239

p value 0.6684

Since p = 0.6684 > 0.05, we cannot reject the null, H0 . This means there isn’t any evidence to reject the null. As usualy we cannot accept the null but if we make a CI of the means in all the groups we see that: Level Lower 95% Upper 95% A 127.78 150.02 B 128.94 150.15 C 133.85 155.06 D 136.52 156.82

Since all the confidence intervals overlap (recalling that a CI is used to locate the mean), this suggests that all the groups could have the same mean.

5

View more...

Comments

Copyright � 2017 SILO Inc.