library(readxl)
library(ggpubr)
library(effsize)
library(rstatix)

Team1Data <- read_excel("C:/Users/eboni/Downloads/Team1Data.xlsx")
Team1vTeam2 <- read_excel("C:/Users/eboni/Downloads/Team1vTeam2.xlsx")

Research Question 1

Did communication effectiveness increase for Team 1 after the workshop?

Before <- Team1Data$BeforeComm
After <- Team1Data$AfterComm

Differences <- After - Before

mean(Before)
## [1] 64.48
sd(Before)
## [1] 10.42189
median(Before)
## [1] 65
mean(After)
## [1] 75.12
sd(After)
## [1] 11.90644
median(After)
## [1] 76
hist(Differences,
     main = "Histogram of Difference Scores",
     xlab = "After - Before")

shapiro.test(Differences)
## 
##  Shapiro-Wilk normality test
## 
## data:  Differences
## W = 0.95856, p-value = 0.003177
wilcox.test(After, Before,
            paired = TRUE,
            exact = FALSE)
## 
##  Wilcoxon signed rank test with continuity correction
## 
## data:  After and Before
## V = 4443, p-value < 2.2e-16
## alternative hypothesis: true location shift is not equal to 0
Team1Long <- data.frame(
  ID = rep(Team1Data$ID, 2),
  Time = rep(c("Before", "After"), each = nrow(Team1Data)),
  CommScore = c(Team1Data$BeforeComm, Team1Data$AfterComm)
)

wilcox_effsize(
  Team1Long,
  CommScore ~ Time,
  paired = TRUE
)
## # A tibble: 1 × 7
##   .y.       group1 group2 effsize    n1    n2 magnitude
## * <chr>     <chr>  <chr>    <dbl> <int> <int> <ord>    
## 1 CommScore After  Before   0.850   100   100 large

A Wilcoxon Signed-Rank Test was conducted to determine whether communication effectiveness increased for Team 1 after the workshop.

Communication effectiveness after the workshop (Mdn = 76) was significantly higher than communication effectiveness before the workshop (Mdn = 65), V = 4443, p < .001.

The effect size was large, r = .85.

These results indicate that communication effectiveness significantly increased for Team 1 after the workshop.

Research Question 2

After the workshop, is there still a difference in communication effectiveness between Team 1 and Team 2?

Team1 <- Team1vTeam2$CommScore[Team1vTeam2$Team == 1]

Team2 <- Team1vTeam2$CommScore[Team1vTeam2$Team == 2]

length(Team1)
## [1] 100
length(Team2)
## [1] 100
mean(Team1)
## [1] 75.12
sd(Team1)
## [1] 11.90644
median(Team1)
## [1] 76
mean(Team2)
## [1] 73.1
sd(Team2)
## [1] 11.96079
median(Team2)
## [1] 76
hist(Team1,
     main = "Team 1 Communication Scores",
     xlab = "Communication Score")

hist(Team2,
     main = "Team 2 Communication Scores",
     xlab = "Communication Score")

shapiro.test(Team1)
## 
##  Shapiro-Wilk normality test
## 
## data:  Team1
## W = 0.98466, p-value = 0.2999
shapiro.test(Team2)
## 
##  Shapiro-Wilk normality test
## 
## data:  Team2
## W = 0.96301, p-value = 0.006629
wilcox.test(Team1, Team2,
            paired = FALSE,
            exact = FALSE)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Team1 and Team2
## W = 5422, p-value = 0.3021
## alternative hypothesis: true location shift is not equal to 0
Team1vTeam2$Team <- factor(Team1vTeam2$Team)

wilcox_effsize(
  Team1vTeam2,
  CommScore ~ Team
)
## # A tibble: 1 × 7
##   .y.       group1 group2 effsize    n1    n2 magnitude
## * <chr>     <chr>  <chr>    <dbl> <int> <int> <ord>    
## 1 CommScore 1      2       0.0731   100   100 small

A Mann-Whitney U test was conducted to determine whether there was a difference in communication effectiveness between Team 1 and Team 2 after the workshop.

Team 1 communication scores (Mdn = 76) were not significantly different from Team 2 communication scores (Mdn = 76), W = 5422, p > .05.

The effect size was small, r = .07.

These results indicate that after the workshop, there was not a statistically significant difference in communication effectiveness between Team 1 and Team 2.

Research Question 3

Is there an association between perceived workshop effectiveness and gender?

WorkshopTable <- table(
  Team1Data$Gender,
  Team1Data$Effective
)

WorkshopTable
##        
##         No Yes
##   Man    6  51
##   Woman 11  32
barplot(
  WorkshopTable,
  beside = TRUE,
  legend = rownames(WorkshopTable),
  main = "Workshop Effectiveness by Gender",
  xlab = "Perceived Workshop Effectiveness",
  ylab = "Count"
)

ChiResult <- chisq.test(WorkshopTable)

ChiResult$expected
##        
##           No   Yes
##   Man   9.69 47.31
##   Woman 7.31 35.69
ChiResult
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  WorkshopTable
## X-squared = 2.9425, df = 1, p-value = 0.08628
rcompanion::cramerV(WorkshopTable)
## Cramer V 
##   0.1984

A Chi-Square Test of Independence was conducted to determine if there was an association between gender and perceived workshop effectiveness.

The results showed that there was not a statistically significant association between gender and perceived workshop effectiveness, χ²(1) = 2.94, p > .05.

The effect size was small, Cramer’s V = .20.

These results indicate that perceived workshop effectiveness was not significantly associated with gender.

Research Question 4

Is job satisfaction positively related to communication effectiveness after the workshop?

Satisfaction <- Team1Data$Satisfaction
AfterCommunication <- Team1Data$AfterComm

mean(Satisfaction)
## [1] 6.8
sd(Satisfaction)
## [1] 1.901621
median(Satisfaction)
## [1] 7
mean(AfterCommunication)
## [1] 75.12
sd(AfterCommunication)
## [1] 11.90644
median(AfterCommunication)
## [1] 76
hist(Satisfaction,
     main = "Job Satisfaction",
     xlab = "Satisfaction Score")

hist(AfterCommunication,
     main = "Communication Effectiveness After Workshop",
     xlab = "Communication Score")

shapiro.test(Satisfaction)
## 
##  Shapiro-Wilk normality test
## 
## data:  Satisfaction
## W = 0.84717, p-value = 9.333e-09
shapiro.test(AfterCommunication)
## 
##  Shapiro-Wilk normality test
## 
## data:  AfterCommunication
## W = 0.98466, p-value = 0.2999
cor.test(
  Satisfaction,
  AfterCommunication,
  method = "spearman",
  exact = FALSE
)
## 
##  Spearman's rank correlation rho
## 
## data:  Satisfaction and AfterCommunication
## S = 130127, p-value = 0.02847
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
##       rho 
## 0.2191592
ggscatter(
  Team1Data,
  x = "Satisfaction",
  y = "AfterComm",
  add = "reg.line",
  xlab = "Job Satisfaction",
  ylab = "Communication Effectiveness After Workshop"
)

A Spearman correlation was conducted to test the relationship between job satisfaction (Mdn = 7) and communication effectiveness after the workshop (Mdn = 76).

There was a statistically significant relationship between the two variables, ρ = .22, p = .028.

The relationship was positive and weak.

As job satisfaction increased, communication effectiveness after the workshop increased.