Load the libraries

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

import the dataset

Dataset6.3 <- read_excel("/Users/komakechivan/Downloads/Dataset6.3.xlsx")

Separate Data & Calculate Differences

Before <- Dataset6.3$Stress_Pre
After <- Dataset6.3$Stress_Post
Differences <- After - Before

Calculate Descriptive Stats

mean_pre <- mean(Before, na.rm = TRUE); sd_pre <- sd(Before, na.rm = TRUE)
mean_post <- mean(After, na.rm = TRUE); sd_post <- sd(After, na.rm = TRUE)

Create the long-format dataframe early to avoid “object not found” errors

df_long <- data.frame(
  id = rep(1:length(Before), 2),
  time = factor(rep(c("Before", "After"), each = length(Before)), levels = c("Before", "After")),
  score = c(Before, After)
)

Normality Check

hist(Differences, main = "Histogram of Difference Scores", col = "blue", border = "black")

boxplot(Differences, main = "Boxplot of Difference Scores (After - Before)", col = "blue")

shapiro.test(Differences)
## 
##  Shapiro-Wilk normality test
## 
## data:  Differences
## W = 0.95612, p-value = 0.1745

Inferential Test (Dependent T-Test)

t_result <- t.test(Before, After, paired = TRUE)
print(t_result)
## 
##  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)

eff_size <- cohens_d(score ~ time, data = df_long, paired = TRUE)
print(eff_size)
## # A tibble: 1 × 7
##   .y.   group1 group2 effsize    n1    n2 magnitude
## * <chr> <chr>  <chr>    <dbl> <int> <int> <ord>    
## 1 score Before After    0.664    35    35 moderate

Final Report: Mindfulness and Stress

1. Descriptive Statistics

The average stress score decreased following the completion of the mindfulness training program.

  • Before Program: \(M = 65.87\), \(SD = 9.50\)
  • After Program: \(M = 57.91\), \(SD = 10.17\)

2. Normality Testing (Assumption Check)

Normality was assessed by conducting a Shapiro-Wilk test on the difference scores (Post-test minus Pre-test) between the two conditions.

  • Results: \(W = 0.956\), \(p = .175\)
  • Decision: Because \(p > .05\), the assumption of normality was met. Therefore, a Dependent (Paired) Samples T-Test was utilized for the inferential analysis.

3. Inferential Statistics and Effect Size

A paired t-test revealed a statistically significant reduction in stress levels following the mindfulness program:

  • Test Statistic: \(t(34) = 3.93\), \(p < .001\)

Since the results were significant, the effect size was calculated to determine the magnitude of the change. The effect size was found to be moderate to large (Cohen’s \(d = 0.66\)).


4. Conclusion

We reject the null hypothesis. There is strong statistical evidence to suggest that the four-week mindfulness training program significantly reduced student stress levels.