Research Scenario 6.3: Mindfulness Training and Stress
library(readxl)
library(ggpubr)
## Loading required package: ggplot2
library(effectsize)
library(rstatix)
##
## Attaching package: 'rstatix'
## The following objects are masked from 'package:effectsize':
##
## cohens_d, eta_squared
## The following object is masked from 'package:stats':
##
## filter
Dataset6.4 <- read_excel("/Users/asfia/Desktop/Dataset6.4.xlsx")
Pre_Test <- Dataset6.4$Stress_Pre
Post_Test <- Dataset6.4$Stress_Post
Differences <- Post_Test - Pre_Test
print(Differences)
## [1] -8.044361120 -3.529426078 -26.350753567 -6.276567859 -3.701374633
## [6] -15.552084134 -4.356073741 -3.647770620 -0.008788193 -5.302543769
## [11] -8.806996646 -3.200139192 -1.385585292 -19.179181634 3.899627158
## [16] -6.612429249 -2.533382079 -1.317457905 -0.782853924 -32.441286182
## [21] -4.132848699 -6.536275900 -6.896524983 -5.238701383 -36.697172771
## [26] -28.957287115 -9.817187881 -10.508880209 -19.386322836 -10.616491219
## [31] -13.700632408 -7.433337532 -20.087719095 -7.326665368 -15.099150128
STEP 4: DESCRIPTIVE STATISTICS
mean(Pre_Test, na.rm = TRUE)
## [1] 51.53601
median(Pre_Test, na.rm = TRUE)
## [1] 47.24008
sd(Pre_Test, na.rm = TRUE)
## [1] 17.21906
mean(Post_Test, na.rm = TRUE)
## [1] 41.4913
median(Post_Test, na.rm = TRUE)
## [1] 40.84836
sd(Post_Test, na.rm = TRUE)
## [1] 18.88901
STEP 5 & 6: VISUALIZATIONS (Difference Score)
hist(Differences,
main = "Histogram of Difference Scores (Post - Pre)",
xlab = "Change in Stress Levels",
ylab = "Frequency",
col = "purple",
border = "darkblue",
breaks = 15)

Skewness: Negatively skewed , Kurtosis: Bell Curve. So based on
Reports we cannot use the Dependent T-test
Boxplot
boxplot(Differences,
main = "Distribution of Score Differences (Post Stress - Pre Stress)",
ylab = "Change in Stress Levels",
col = "lightblue",
border = "darkblue",
horizontal = FALSE)

The box plot appears to be abnormal as two outliers are out of the
whiskers, so based on Reports we can use the Wilcoxon-Sign Rank
Method 3: Shapiro-Wilk
shapiro.test(Differences)
##
## Shapiro-Wilk normality test
##
## data: Differences
## W = 0.87495, p-value = 0.0008963
The value of p < 0.05 (0.0008963), so the data is not normal, so
based on Reports we use the Wilcoxon Sign Rank
Interpretation: After conducting all three normality tests, it is
clear we must use a Wilcoxon Sign Rank.
Wilcoxon Sign Rank
wilcox.test(Pre_Test, Post_Test, paired = TRUE)
##
## Wilcoxon signed rank exact test
##
## data: Pre_Test and Post_Test
## V = 620, p-value = 2.503e-09
## alternative hypothesis: true location shift is not equal to 0
As the value of p < 0.05 (p = 0.000000002503), this means the
results were SIGNIFICANT.
Calculate the Effect Size
df_long <- data.frame(
id = rep(1:length(Pre_Test), 2),
time = rep(c("Pre", "Post"), each = length(Pre_Test)),
stress = c(Pre_Test, Post_Test)
)
effect_size_result <- wilcox_effsize(df_long, stress ~ time, paired = TRUE)
print(effect_size_result)
## # A tibble: 1 × 7
## .y. group1 group2 effsize n1 n2 magnitude
## * <chr> <chr> <chr> <dbl> <int> <int> <ord>
## 1 stress Post Pre 0.844 35 35 large
As the size of the effect is (0.84), this indiactes the effect is
‘Very Large’.
Report the Results
There was a significant difference in the stress between Pre-Stress
Group (Mdn = 47.24) and Post-Stress (Mdn = 40.84), V = 620, p =
.000000002503 The effect size was very large (r₍rb₎ = .84).