• Home
  • University of Queensland
  • Analysis Of Scientific Data
  • Two-Sample T-Test and Rank Sum Analysis

Two-Sample T-Test and Rank Sum Analysis

STAT1201 exam solution 2020 semester 2 Tautara Mass 1. The researchers looked for any differences between these populations. They would like to test Ho : HA = UB against H1 : HA # HB, where uA is the mean mass of tuataras at location A and UB is the mean mass of tuataras at location B. 2. The difference in mean mass between locations A and B is JA - IB = 617.7 - 585.8 = 31.9 3. The standard error of the difference between the sample means in Question 2 is s.e. (JA - TB) = V NA SB = nB 1 9 38.672 + 14 23.392 = 14.32585 4. The t statistic used to compare the two population means is = 2.226744 S.e. (IA - IB) (TA-TB) - 0 14.32585 31.9 5. To do a t test by hand, we can use the minimum degrees of freedom from the two samples. Here the degrees of freedom to be used is min(NA -1,nB -1) = min(14-1,9-1) = min(13,8) =8 6. For this question we need to compute the p-value. We compare our test statistic from Q4 to a t-distribution with the degrees freedom from Q5. As the alternative hypothesis is two-sided, the p-value is given by p-value=2x min(P(T8?2.227),P(T8?2.227))=2×P(T8?2.227). We compute this in R as 2*(1 - pt(2.227,df=8))which gives a p-value of 0.0565 7. For the margin of error in a 95% confidence interval for the mean difference we need the standard error from Q3 and the critical value. We are told to use the degrees of freedom from Q5. The critical value for a 95% confidence interval is computed in R as qt(0.975, df = 8) which is 2.306. The margin of error is then 2.306 x 14.32585 = 33.03547. 8. The two sample t-test assumes normal variability. Note that this assumption can be relaxed for larger sample sizes. 9. Outliers are flagged in a boxplot using the 1.5 x IQR rule. The interquartile range for this data is IQR = 621.6 - 597.8 = 23.8. The largest value that would not be flagged by this rule is Q3+1.5×IQR=621.6+1.5×23.8 = 657.3. The largest value in the sample is 714.5 (greater than 657.3) so at least one observation to the right would be flagged. Note also that the smallest value that would not be flagged by the 1.5xIQR rule is Q1-1.5×IQR = 597.8-1.5×23.8 = 562.1. The smallest observation in the sample is 578.8 (greater than 562.1) so no observation on the left would be flagged. 10. To answer this question we need the expected value of the rank sum statistic assuming the null hypothesis is true. This is E(W) = NA(NA+NB + 1) = _9x(9+14 +1) = 108 2 2 11. The standard deviation of the rank sum statistic assuming the null hypothesis is true is: NANB(NA+nB + 1) = 1 9×14×(9+14+1) sd(W) = 1 12 = 15.87451 12 12. We need to compare the observed rank sum statistic 145 with a N(108, 15.87) distribution. As the alternative is two