library(readxl)
library(effsize)
library(rstatix)
##
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
##
## filter
library(ggpubr)
## Loading required package: ggplot2
library(effectsize)
##
## Attaching package: 'effectsize'
## The following objects are masked from 'package:rstatix':
##
## cohens_d, eta_squared, omega_squared
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Team1Data <- read_excel("//apporto.com/dfs/SLU/Users/brentgallagher_slu/Desktop/Team1Data.xlsx")
BeforeComm <- Team1Data$BeforeComm
AfterComm <- Team1Data$AfterComm
Differences <- AfterComm - BeforeComm
mean(BeforeComm, na.rm = TRUE)
## [1] 64.48
median(BeforeComm, na.rm = TRUE)
## [1] 65
sd(BeforeComm, na.rm = TRUE)
## [1] 10.42189
# BeforeComm: Mean: 64.48, Median: 65, SD: 10.42
mean(AfterComm, na.rm = TRUE)
## [1] 75.12
median(AfterComm, na.rm = TRUE)
## [1] 76
sd(AfterComm, na.rm = TRUE)
## [1] 11.90644
# AfterComm: Mean: 75.12, Median: 76, SD: 11.90
hist(Differences,
breaks = 15,
col = "blue",
border = "white")

boxplot(Differences,
main = "Differences in Scores",
col = "blue",
border = "darkblue")

# The difference scores boxplot has no outliers.
shapiro.test(Differences)
##
## Shapiro-Wilk normality test
##
## data: Differences
## W = 0.95856, p-value = 0.003177
# W = 0.96, p-value = 0.003177
# The data is not normally distributed. p-value 0.003177 < 0.05
wilcox.test(BeforeComm, AfterComm, paired = TRUE, na.action = na.omit)
##
## Wilcoxon signed rank test with continuity correction
##
## data: BeforeComm and AfterComm
## V = 22, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0
# Data: Before and AfterComm: v = 22, p-value < 2.2e-16.
# Alternative hypothesis: true location shift is not equal to 0.
df_long <- data.frame(id =
rep(1:length(BeforeComm), 2), time =
rep(c("BeforeComm", "AfterComm"), each =
length(BeforeComm)), score = c(BeforeComm,
AfterComm))
wilcox_effsize(df_long, score ~ time,
paired = TRUE)
## # A tibble: 1 × 7
## .y. group1 group2 effsize n1 n2 magnitude
## * <chr> <chr> <chr> <dbl> <int> <int> <ord>
## 1 score AfterComm BeforeComm 0.850 100 100 large
# A tibble: 1 x 7
# Effsize: 0.85, n1: 100, n2: 100, magnitude large
# A Wilcoxon Signed-Rank Test was conducted to determine if there was a difference in communication effectiveness increase in Team 1,after versus before workshop.
# Before scores (Mdn = 65) were significantly different from after scores (Mdn = 76), v = 22, p-value = 2.2 e-16.
# The effect size was large, 0.85.
# Communication effectiveness increased for Team 1 after the workshop.