Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. (60 points) Two-sample permutation test. A biologist examined the effect of a

ID: 3042729 • Letter: 2

Question

2. (60 points) Two-sample permutation test. A biologist examined the effect of a fungal infection on the eating behavior of rodents. Among twelve rodents, eight are randomly chosen and provided with infected apples (Experiment) and the rest four are provided with sterile apples (Control). The amounts consumed (grams of apple/kilogram of body weight) are listed in the following table. Experimental Group Control Group 11, 33, 48, 34, 112, 369, 64, 44 177, 80, 141, 332 Let 1 and 2 be the population mean consumption of the experimental group and control group, respectively. We would like to conduct the hypothesis test H0 : | vs Ha : 2 at 0.05 significance level. Perform the permutation test for each of the following six test statistics. For each test statistic, use R to get the permutation distribution of the statistic, state how the p-value shall be computed, report the exact p-value, and draw your conclusion. (a) Mean difference of the two groups. (b) Sum of the experimental group. (c) Median difference of the two groups. (d) Rank the pooled data from both groups and use mean difference based on the ranks. (e) Rank the pooled data from both groups and use sum of ranks in the experimental group. (f) The Mann-Whitney statistic: the number of pairs (Xi, YS) for which XK Y.

Explanation / Answer

R code:

a)  a=c(11,33,48,34,112,369,64,44)
> b=c(177,80,141,332)
> mean(a)
[1] 89.375
> mean(b)
[1] 182.5
> c=mean(a)-mean(b)
> c
[1] -93.125

b)  sum(a)
[1] 715

c) d=median(a)-median(b)
> d
[1] -113

Two sample t test :

t.test(a,b,alternative="less")

Welch Two Sample t-test

data: a and b
t = -1.3746, df = 6.6069, p-value = 0.107
alternative hypothesis: true difference in means is less than 0
95 percent confidence interval:
-Inf 36.38339
sample estimates:
mean of x mean of y
89.375 182.500

Where a=experimental group

b= control group.

Mann whiteney wilcoxon test :

wilcox.test(a,b)

Wilcoxon rank sum test

data: a and b
W = 5, p-value = 0.07273
alternative hypothesis: true location shift is not equal to 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote