The Mann–Whitney U test Lecture 51

 

The Mann–Whitney U test  

Lecture 51

The Mann–Whitney U test is the true nonparametric counterpart of the two-sample independent t test. This test is used when the samples are independent and the observations of both samples are independently randomly selected. It is also used to test the differences between two independent groups or the medians of two populations when the data is either ordinal or continuous of identical shape but not normally distributed.

Procedure to Perform Test:

To carry out the test, arrange the observations of both samples in ascending order of magnitude and assign ranks to them. Assign the average of ranks in case of tied observations. Compute the sum of ranks assigned to sample 1 and sample 2, denoted by R1 and R2, respectively.

The test statistic for small samples, i.e., n1, n2 < 8.

μ = Minimum (μ1, μ2)

Where μ1 and μ2 can be calculated as:
In the case of a two-tailed test, use the upper pair of table values.
Reject H0 when μ ≤ the lower value of the Mann
-Whitney table.
OR
 Reject H0 when μ ≥ the upper value of the Mann-Whitney table.
In the case of a one-tailed test:
Reject H0 when μ ≤ the lower value of the Mann-Whitney table.
In the case of a one-tailed test, use the lower pair of table values.
 Reject H0 when μ ≥ the upper value of the Mann-Whitney table.
Normal Approximation
If the sample or samples are large (
n1, n2 ≥ 8). Then the normal approximation is used, given below:

Where:

Mann – Whitney U test in case of group data:

In the case of grouped data, add the frequencies of both groups and denote by Tj and find the cumulative frequencies of the Tj denoted by c.

Next, find the average rank denoted by rj as:

Compute the total of ranks of group 1, denoted by R1 as:
 Multiplying the average rank by the frequency of group 1.

R1 = rj X fi
The μ1 and μ2 can be computed as:

For small samples, the test statistic is denoted by μ = Minimum (μ₁, μ₂
). Use normal approximation for large samples.



Example 13.8: The doctors are interested to know the timing of recovery from the seasonal flu. The doctors' team selected the two types of patients of approximately the same age and health conditions. The doctors' team divides the group into treated and untreated and records the recovery time (in hours) from the flu of treated and untreated patients given below:

Treated

14

15

15

17

18

23

Untreated

17

24

23

18

19

28

 Use the Mann-Whitney U test to test the hypothesis that the medians of recovery times of treated and untreated are identical at a 5% significance level.

Solution: 

i. State the null and alternative hypotheses as:

H0: Median 1 = Median 2 vs. H1: Median 1 ≠ Median 2

ii. The significance level; α = 0.05

iii. The test statistics: μ = Minimum (μ1, μ2)

iv. Reject H0, when U is lies out side of (5, 31)

v. Computation:

Arrange the observations of both samples in ascending order of magnitude.

R1 = 1 + 2.5 + 2.5 + 4 + 6.5 + 9 = 25.5
R2 = 5 + 6.5 + 8 + 9.5 + 11 + 12 = 52.0


The test statistic for small samples

μ = Minimum (μ1, μ2)
μ = Minimum (31.5, 5)
μ = 5
vi. Remarks: The calculated μ value is within the rejection region; there is insufficient evidence in the sample data to support the null hypothesis that the treated and untreated groups' recovery time medians are the same. The recovery periods of patients who receive treatment and those who do not are therefore found to differ.
Example 13.9: A student investigated whether there were more trichomes (stings) on nettles that were grazed compared with nettles that were ungrazed. He collected two independent random samples of size 9 and 8, respectively. The number of trichomes per cm² on a sample of nettle leaves from each area is given below:

Grazed plants

12

14

15

17

19

22

23

26

21

Ungrazed plants

10

13

14

14

16

20

21

23

 


It is claimed that the number of trichomes on the grazed leaves is significantly higher than those on the ungrazed leaves. The sampled population are identical but non-normal.

Solution:

i. State the null and alternative hypotheses as:

H0: Median 1 = Median 2 vs. H1: Median 1 > Median 2

ii. The significance level; α = 0.05

iii. The test statistics: 

iv. Reject H0, when z > 1.645 

v. Computation


R1 = 2 + 3 + 5 + 7 + 9 + 10 + 14 + 15 + 17 = 82
R2 = 1 + 5 + 5 + 8 + 11 + 12 + 12 + 15 = 69
μ = Minimum (μ1, μ2)
μ = Minimum (36, 48)
μ = 36
vi. Remarks: The z-calculated value falls in the acceptance area; the sample data does not provide sufficient evidence to accept the alternative hypothesis that the number of trichomes on the grazed leaves is significantly higher than those on the ungrazed leaves. 
Example 13.10: The wages of the two factory workers are given below:

Wage

1000 - 1200

1200 - 1400

1400 - 1600

1600 - 1800

1800 - 2000

No. of workers in Factory A

10

15

12

9

6

No. of workers in Factory B

11

13

18

7

5

Apply the Mann-Whitney U test to check whether the medians of wages of the two factories are identical.

Solution:

i. State the null and alternative hypotheses as:

H0: Median 1 = Median 2 vs. H1: Median 1 ≠ Median 2

ii. The significance level; α = 0.05

iii. The test statistics: 

iv. Reject H0, when |z| > 1.96

v. Computation:

μ = Minimum (μ1, μ2)
μ = Minimum (1376, 1432)
μ = 1376


vi. Remarks: The z-calculated value falls in the acceptance area; the sample data does not provide sufficient evidence to reject the null hypothesis. Thus, it is concluded that the medians of wages of the two factories are identical.


No comments:

Post a Comment

Moving Average Models (MA Models) Lecture 17

  Moving Average Models  (MA Models)  Lecture 17 The autoregressive model in which the current value 'yt' of the dependent variable ...