160k views
2 votes
Problem 3. [Statistics competition] ls there a difference in statistics prowess between STA 130B students and STA 131B students? To settle this debate, the statistics department organizes a competition between students among the two classes. Each class sends 5 representatives, and all of them take a standardized exam out of 100 points. Their scores are reported below. STA 130B STA 131B 67 59 35 64 46 49 71 60 Based on this sample, is there a difference in performance between STA 130B and STA 131B students? To answer this question, perform a Mann-Whitney test with a 0.01, using the following three methods: (a) Computing the exact p-value by assessing the rank configurations. (b) Computing the test statistic R and comparing it to the critical value in the table. (c) Using the Gaussian approximation to the Mann-Whitney rank sum.

User Harin
by
8.3k points

2 Answers

4 votes

Answer:

> #the null hypothesis H0: same for both population.

> ##the alternative hypothesis H1 : not same.

> ##Hypothesis for given problem:

> ## H0: there is NO difference exist between STA 130B and STA 131B students.

> ## H1: difference exist in performance between STA 130B and STA 131B students.

> STA_130B=c(67,88,71,60,77)

> STA_131B=c(59,35,64,46,49)

> Score=c(STA_130B,STA_131B)

> Score #Combined (n1+n2) scores

[1] 67 88 71 60 77 59 35 64 46 49

> R=rank(Score) #Ranks assigned to combined scores

> R

[1] 7 10 8 5 9 4 1 6 2 3

> W1=sum(R[1:5]) ##the total Sum of ranks of scores of STA_130B

> W1

[1] 39

> W2=sum(R[6:10]) ##the total Sum of ranks of scores of STA_131B

> W2

[1] 16

> n1=5

> n2=5

> U1=W1-((n1)*(n1+1)/2)

> U1

[1] 24

> U2=W2-((n2)*(n2+1)/2)

> U2

[1] 1

> U=min(U1,U2)

> U

[1] 1

> ##independent 2-group Mann-Whitney U Test in R is wilcoxon rank sum test.

> ##wilcox.test(y,x) ;where y and x are numeric

> wilcox.test(STA_131B,STA_130B,exact=TRUE,conf.level=0.99,paired=FALSE)

Wilcoxon rank sum test

data: STA_131B and STA_130B

W = 1, p-value = 0.01587

the substitute hypothesis: true location shift is not equal to 0

> ##p-value=0.01587 > aplha=0.01, Accept H0.

> ##Calculated value of U=1

> ##From Statistical Tables,Critical value of Mann-Whitney U test at alpha=0.01,n1=n2=5 is 0.

> ### Calculated U=1 > Tabulated U=0, Accept H0.

> ##Normal/ GAUSSIAN approximation:

> EU=(n1*n2)/2 ##Expected value of U

> EU

[1] 12.5

> VarU=(n1*n2*(n1+n2+1))/12 ##Variance value of U

> VarU

[1] 22.91667

> Z=(U-EU)/sqrt(VarU)

> Z

[1] -2.402272

> qnorm(1-0.01/2)

[1] 2.575829

> ## qnorm(1-0.01/2)= 2.575829

> ##Z follows Normal(0,1)

> ##If calculated |Z| > tabulatedZ, then Reject H0 at alpha % l.o.s.

> ##Here, calculated |Z|= 2.402272< tabulatedZ= 2.575829, thus Accept H0 at 1% l.o.s

> ### NO difference in performance between STA 130B and STA 131B students.

User Dean Putney
by
8.1k points
5 votes

Answer:

Check the explanation

Explanation:

[USED R-Software]

> ##General Hypothesis:

> ##the null hypothesis H0 : the distributions of both populations are same.

> ##the alternative hypothesis H1 : the distributions are not same.

> ##Hypothesis for given problem:

> ## H0: there is NO difference in performance between STA 130B and STA 131B students.

> ## H1: there is difference in performance between STA 130B and STA 131B students.

> STA_130B=c(67,88,71,60,77)

> STA_131B=c(59,35,64,46,49)

> Score=c(STA_130B,STA_131B)

> Score #Combined (n1+n2) scores

[1] 67 88 71 60 77 59 35 64 46 49

> R=rank(Score) #Ranks assigned to combined scores

> R

[1] 7 10 8 5 9 4 1 6 2 3

> W1=sum(R[1:5]) ##the total Sum of ranks of scores of STA_130B

> W1

[1] 39

> W2=sum(R[6:10]) ##the total Sum of ranks of scores of STA_131B

> W2

[1] 16

> n1=5

> n2=5

> U1=W1-((n1)*(n1+1)/2)

> U1

[1] 24

> U2=W2-((n2)*(n2+1)/2)

> U2

[1] 1

> U=min(U1,U2)

> U

[1] 1

> ##independent 2-group Mann-Whitney U Test in R is wilcoxon rank sum test.

> ##wilcox.test(y,x) ;where y and x are numeric

> wilcox.test(STA_131B,STA_130B,exact=TRUE,conf.level=0.99,paired=FALSE)

Wilcoxon rank sum test

data: STA_131B and STA_130B

W = 1, p-value = 0.01587

the substitute hypothesis: true location shift is not equal to 0

> ##p-value=0.01587 > aplha=0.01, Accept H0.

> ##Calculated value of U=1

> ##From Statistical Tables,Critical value of Mann-Whitney U test at alpha=0.01,n1=n2=5 is 0.

> ### Calculated U=1 > Tabulated U=0, Accept H0.

> ##Normal/ GAUSSIAN approximation:

> EU=(n1*n2)/2 ##Expected value of U

> EU

[1] 12.5

> VarU=(n1*n2*(n1+n2+1))/12 ##Variance value of U

> VarU

[1] 22.91667

> Z=(U-EU)/sqrt(VarU)

> Z

[1] -2.402272

> qnorm(1-0.01/2)

[1] 2.575829

> ## qnorm(1-0.01/2)= 2.575829

> ##Z follows Normal(0,1)

> ##If calculated |Z| > tabulatedZ, then Reject H0 at alpha % l.o.s.

> ##Here, calculated |Z|= 2.402272< tabulatedZ= 2.575829, thus Accept H0 at 1% l.o.s

> ### There is NO difference in performance between STA 130B and STA 131B students.

User Gabriel Llorico
by
8.7k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.