Research Scenario 6.3: Mindfulness Program

Research Question

Do students show a difference in stress levels before versus after completing a four-week mindfulness program?

Hypotheses

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 Required Packages

install.packages(“readxl”) install.packages(“ggpubr”) install.packages(“effectsize”) install.packages(“rstatix”)


Open Packages

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

Import Dataset

Dataset6_3 <- read_excel('/Users/sharathnallaganti/Desktop/3rd sem/applied analytics/Dataset6.3.xlsx')

Separate the Data by Condition

Before <- Dataset6_3$Stress_Pre
After  <- Dataset6_3$Stress_Post

Since this is a dependent design, the same students were measured twice.


Create Difference Scores

Differences <- After - Before

Difference scores allow us to check the normality assumption required for a Dependent t-test.


Descriptive Statistics

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.


Histogram of Difference Scores

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 of Difference Scores

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-Wilk Test of Normality

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.


Dependent 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

Effect Size (Cohen’s d)

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]

Final Statistical Conclusion

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).


Final Interpretation

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.