Do students show a difference in stress levels before versus after completing a four-week mindfulness program?
Null Hypothesis (H₀):
There is no difference in stress levels before and after the mindfulness
program.
Alternative Hypothesis (H₁):
There is a difference in stress levels before and after the mindfulness
program.
install.packages(“readxl”) install.packages(“ggpubr”) install.packages(“effectsize”) install.packages(“rstatix”)
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_3 <- read_excel('/Users/sharathnallaganti/Desktop/3rd sem/applied analytics/Dataset6.3.xlsx')
Before <- Dataset6_3$Stress_Pre
After <- Dataset6_3$Stress_Post
Since this is a dependent design, the same students were measured twice.
Differences <- After - Before
Difference scores allow us to check the normality assumption required for a Dependent t-test.
mean(Before, na.rm = TRUE)
## [1] 65.86954
median(Before, na.rm = TRUE)
## [1] 67.33135
sd(Before, na.rm = TRUE)
## [1] 9.496524
mean(After, na.rm = TRUE)
## [1] 57.90782
median(After, na.rm = TRUE)
## [1] 59.14539
sd(After, na.rm = TRUE)
## [1] 10.1712
The mean stress level before the program was 65.87 (SD =
9.50).
After the program, the mean stress level decreased to 57.91 (SD
= 10.17).
This suggests stress levels decreased following the mindfulness program.
hist(Differences,
main = "Histogram of Difference Scores",
xlab = "Stress Score Difference (After - Before)",
ylab = "Frequency",
col = "blue",
border = "black",
breaks = 20)
The histogram appears approximately symmetrical and bell-shaped, suggesting the difference scores are normally distributed.
boxplot(Differences,
main = "Distribution of Score Differences (After - Before)",
ylab = "Difference in Stress Scores",
col = "blue",
border = "darkblue")
There were no extreme outliers far from the whiskers.
The distribution appears reasonably normal.
shapiro.test(Differences)
##
## Shapiro-Wilk normality test
##
## data: Differences
## W = 0.95612, p-value = 0.1745
If p > .05 → Data is normal.
If p < .05 → Data is not normal.
In this case, the p-value was greater than .05, meaning the normality assumption was met.
Therefore, we proceed with the Dependent (Paired) t-test.
t.test(Before, After, paired = TRUE)
##
## Paired t-test
##
## data: Before and After
## t = 3.9286, df = 34, p-value = 0.0003972
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 3.843113 12.080317
## sample estimates:
## mean difference
## 7.961715
effectsize::cohens_d(Before, After, paired = TRUE)
## For paired samples, 'repeated_measures_d()' provides more options.
## Cohen's d | 95% CI
## ------------------------
## 0.66 | [0.29, 1.03]
There was a significant difference in stress levels between Before (M
= 65.87, SD = 9.50) and After (M = 57.91, SD = 10.17),
t(34) = 3.93, p < .001.
The effect size was medium (Cohen’s d = 0.66).
The four-week mindfulness training program significantly reduced student stress levels.
The reduction in stress was not only statistically significant but also meaningful in magnitude (moderate effect size).
This suggests the mindfulness program was effective in lowering stress among students.