1. In order to assess the efficacy of a new antidepressant drug, ten clinically depressed patients are randomly assigned to one of two groups. Five patients are assigned to Group 1, which is administered the antidepressant drug for a period of six months. The other five patients are assigned to Group 2, which is administered a placebo during the same six-month period. Assume that prior to introducing the experimental treatments, the experimenter confirmed that the level of depression in the two groups was equal. After six months elapse all ten subjects are rated by a psychiatrist (who is blind with respect to a subject’s experimental condition) on their level of depression. The psychiatrist’s depression ratings for the five subjects in each group follow (the higher the rating, the more depressed a subject).
library(readxl)
Mann_Whitney <- read_excel("D:/MARV BS MATH/4th year, 2nd sem/Nonparametric Statistics/Final Exam/Mann-Whitney.xlsx")
Mann_Whitney
# A tibble: 5 × 2
  antidepressantdrug placebo
               <dbl>   <dbl>
1                 11      11
2                  1      11
3                  0       5
4                  2       8
5                  0       4

The following assumptions must be met in order to run a Mann-Whitney U test:

  1. Treatment groups are independent of one another. Experimental units only receive one treatment and they do not overlap. Answer: Yes.
  2. The response variable of interest is ordinal or continuous. Answer: Yes.
  3. Both samples are random.Answer: Yes.
normality_check <- shapiro.test(Mann_Whitney$antidepressantdrug)
if (normality_check$p.value > 0.05){
  print("The data comes from a population that is normally distributed. Please check the result of two sample t test.")
} else {
  print("The data is not normally distribued. Please check the result of Mann-Whitney U test.")
}
[1] "The data is not normally distribued. Please check the result of Mann-Whitney U test."
normality_check <- shapiro.test(Mann_Whitney$placebo)
if (normality_check$p.value > 0.05){
  print("The data comes from a population that is normally distributed. Please check the result of two sample t test.")
} else {
  print("The data is not normally distribued. Please check the result of Mann-Whitney U test.")
}
[1] "The data comes from a population that is normally distributed. Please check the result of two sample t test."

Null Hypothesis: The level of depression of depressed patients which is administered by antidepressant drug is different from the placebo group.

Alternative Hypothesis: The level of depression of depressed patients which is administered by antidepressant drug is not different from the placebo group.

head(Mann_Whitney)
# A tibble: 5 × 2
  antidepressantdrug placebo
               <dbl>   <dbl>
1                 11      11
2                  1      11
3                  0       5
4                  2       8
5                  0       4
library(psych)
Warning: package 'psych' was built under R version 4.2.3
str(Mann_Whitney)
tibble [5 × 2] (S3: tbl_df/tbl/data.frame)
 $ antidepressantdrug: num [1:5] 11 1 0 2 0
 $ placebo           : num [1:5] 11 11 5 8 4
summary(Mann_Whitney)
 antidepressantdrug    placebo    
 Min.   : 0.0       Min.   : 4.0  
 1st Qu.: 0.0       1st Qu.: 5.0  
 Median : 1.0       Median : 8.0  
 Mean   : 2.8       Mean   : 7.8  
 3rd Qu.: 2.0       3rd Qu.:11.0  
 Max.   :11.0       Max.   :11.0  
wilcox.test(Mann_Whitney$antidepressantdrug, Mann_Whitney$placebo)

    Wilcoxon rank sum test with continuity correction

data:  Mann_Whitney$antidepressantdrug and Mann_Whitney$placebo
W = 4, p-value = 0.08969
alternative hypothesis: true location shift is not equal to 0

Since the p-value is 0.08969 which is greater than the significance level 0.05, we do not have sufficient evidence to say that the level of depression of depressed patients which is administered by antidepressant drug is different from the placebo group.

Do the data indicate that the antidepressant drug is effective?

wilcox.test(Mann_Whitney$antidepressantdrug, Mann_Whitney$placebo, alternative = "less")
Warning in wilcox.test.default(Mann_Whitney$antidepressantdrug,
Mann_Whitney$placebo, : cannot compute exact p-value with ties

    Wilcoxon rank sum test with continuity correction

data:  Mann_Whitney$antidepressantdrug and Mann_Whitney$placebo
W = 4, p-value = 0.04484
alternative hypothesis: true location shift is less than 0

Since the p value is 0.04484 which is less than the significance level 0.05,

We have sufficient evidence to say that the level of depression of depressed patients administered by antidepressant drug was less than that of the patients in the placebo group. Hence, antidepressant drug is effective.