In: Statistics and Probability
Consider the following data on the lengths of 10 randomly selected pygmy blue butterflies in millimeters.
5.0, 3.9, 5.2, 5.5, 2.8, 6.1, 6.4, 2.6, 1.7, 4.3
Using R, can you conclude that median length of pygmy blue butterfly differs significantly from 3.7 mm. Use Wilkoxon signed rank test for a median to test your hypothesis at α = 0.05 level of significance. Marks distribution: 2 (hypothesis statement)+10(testing procedure)+2 (conclusion)
Solution:
The null and alternative hypotheses are as follows:
H0 : M = 3.7 mm i.e. The population median of the length of pygmy blue butterfly is equal to 3.7 mm.
H1 : M ≠ 3.7 mm i.e. The population median of the length of pygmy blue butterfly is not equal to 3.7 mm.
To test the hypothesis we shall use Wilkoxon signed rank test.
We shall perform this test in R. To perform the Wilkoxon signed rank test the R code is given below:
When we execute the above code in R we will get following output:
From the above output we have, p-value for the test statistic is equal to 0.2324.
Now on the basis of p-value we make decision rule as follows:
If p-value is greater than the significance level, then we fail to reject the null hypothesis (H0) at given significance level.
If p-value is less than the significance level, then we reject the null hypothesis (H0) at given significance level.
We have, p-value = 0.2324 and significance level = 0.05
(0.2324 > 0.05)
Since, p-value is greater than significance level of 0.05, therefore we shall be fail to reject the null hypothesis (H0) at 0.05 significance level.
Conclusion: At significance level of 0.05, there is not enough evidence to conclude that median length of pygmy blue butterfly differs significantly from 3.7 mm.