Loading Libraries

library(readxl)
library(ggpubr)
## Loading required package: ggplot2
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
library(effectsize)
library(effsize)

Research Question: Do tutoring vs. no tutoring groups differ in exam scores?

Loading Dataset

DatasetRQ1 <- read_excel("DatasetRQ1.xlsx")

Checking Data and Dataset Structure

head(DatasetRQ1)
## # A tibble: 6 × 2
##   Group    Exam_Score
##   <chr>         <dbl>
## 1 Tutoring       73.5
## 2 Tutoring       76.2
## 3 Tutoring       90.5
## 4 Tutoring       78.6
## 5 Tutoring       79.0
## 6 Tutoring       91.7
str(DatasetRQ1)
## tibble [80 × 2] (S3: tbl_df/tbl/data.frame)
##  $ Group     : chr [1:80] "Tutoring" "Tutoring" "Tutoring" "Tutoring" ...
##  $ Exam_Score: num [1:80] 73.5 76.2 90.5 78.6 79 ...

Calculate descriptive statistics for each group

DatasetRQ1 %>%
  group_by(Group) %>%
  summarise(
    Mean = mean(Exam_Score),
    Median = median(Exam_Score),
    SD = sd(Exam_Score),
    N = n()
  )
## # A tibble: 2 × 5
##   Group        Mean Median    SD     N
##   <chr>       <dbl>  <dbl> <dbl> <int>
## 1 No Tutoring  71.9   71.5  7.68    40
## 2 Tutoring     78.4   78.7  7.18    40

Check normality

Method 1: Histograms

hist(DatasetRQ1$Exam_Score[DatasetRQ1$Group == "Tutoring"],
     main = "Histogram of Exam Scores - Tutoring Group",
     xlab = "Exam Score",
     ylab = "Frequency",
     col = "lightblue",
     border = "blue",
     breaks = 10)

cat("Skewness: symmetrical ,", "Kurtosis: Proper Bell Curve")
## Skewness: symmetrical , Kurtosis: Proper Bell Curve
hist(DatasetRQ1$Exam_Score[DatasetRQ1$Group == "No Tutoring"],
     main = "Histogram of Exam Scores - No Tutoring Group",
     xlab = "Exam Score",
     ylab = "Frequency",
     col = "lightgreen",
     border = "darkgreen",
     breaks = 10)

cat("Skewness: symmetrical ,", "Kurtosis: Proper Bell Curve")
## Skewness: symmetrical , Kurtosis: Proper Bell Curve
print("For Tutoring group: the data appears symmetrical, and the kurtosis appears normal (Bell Shaped)")
## [1] "For Tutoring group: the data appears symmetrical, and the kurtosis appears normal (Bell Shaped)"
print("For Non-Tutoring group: the data appears symmetrical, and the kurtosis appears normal (Bell Shaped)")
## [1] "For Non-Tutoring group: the data appears symmetrical, and the kurtosis appears normal (Bell Shaped)"
print("Based on Reports we can use the independent T-test")
## [1] "Based on Reports we can use the independent T-test"

Method 2: Boxplots

ggboxplot(DatasetRQ1, x = "Group", y = "Exam_Score",
          color = "Group",
          palette = c("blue", "green"),
          add = "jitter",
          title = "Exam Scores by Group",
          xlab = "Group",
          ylab = "Exam Score")

print("For Tutoring group: the box plot appears to be normal and the data appears to be within whiskers")
## [1] "For Tutoring group: the box plot appears to be normal and the data appears to be within whiskers"
print("For Non-Tutoring group: there are some outliers but are balanced on both sides so the data is somewhat normal")
## [1] "For Non-Tutoring group: there are some outliers but are balanced on both sides so the data is somewhat normal"
print("Based on Reports we can use the independent T-test")
## [1] "Based on Reports we can use the independent T-test"

Method 3: Shapiro-Wilk

shapiro.test(DatasetRQ1$Exam_Score[DatasetRQ1$Group == "Tutoring"])
## 
##  Shapiro-Wilk normality test
## 
## data:  DatasetRQ1$Exam_Score[DatasetRQ1$Group == "Tutoring"]
## W = 0.98859, p-value = 0.953
shapiro.test(DatasetRQ1$Exam_Score[DatasetRQ1$Group == "No Tutoring"])
## 
##  Shapiro-Wilk normality test
## 
## data:  DatasetRQ1$Exam_Score[DatasetRQ1$Group == "No Tutoring"]
## W = 0.98791, p-value = 0.9398
print("For Tutoring group: the value of p > 0.05, so the data is normal")
## [1] "For Tutoring group: the value of p > 0.05, so the data is normal"
print("For Non-Tutoring group: the value of p > 0.05, so the data is normal")
## [1] "For Non-Tutoring group: the value of p > 0.05, so the data is normal"
print("Based on Reports we can use the independent T-test")
## [1] "Based on Reports we can use the independent T-test"

Interpretation: After conducting all three normality tests, it is clear we must use a Independent T-test.

Conducting Independent T-Test

t.test(Exam_Score ~ Group, data = DatasetRQ1, var.equal = TRUE)
## 
##  Two Sample t-test
## 
## data:  Exam_Score by Group
## t = -3.8593, df = 78, p-value = 0.000233
## alternative hypothesis: true difference in means between group No Tutoring and group Tutoring is not equal to 0
## 95 percent confidence interval:
##  -9.724543 -3.105845
## sample estimates:
## mean in group No Tutoring    mean in group Tutoring 
##                  71.94627                  78.36147
print("As the value of p < 0.05 (p = 0.000233), this means the results were SIGNIFICANT.")
## [1] "As the value of p < 0.05 (p = 0.000233), this means the results were SIGNIFICANT."

Calculate the Effect Size (Cohen’s D for Independent T-Test)

cohens_d_result <- cohens_d(Exam_Score ~ Group, data = DatasetRQ1, pooled_sd = TRUE)
print(cohens_d_result)
## Cohen's d |         95% CI
## --------------------------
## -0.86     | [-1.32, -0.40]
## 
## - Estimated using pooled SD.
print("As the size of the effect is (-0.86), this means the effect is 'Large'.")
## [1] "As the size of the effect is (-0.86), this means the effect is 'Large'."

Report the Results

cat("No-Tutoring Group (M = 71.94, SD = 7.67) were significantly different from Tutoring Group (M = 78.36, SD = 7.1) in exam scores, t(78) = -3.85, p = .0002. The effect size was large (Cohen’s d = -0.86).")
## No-Tutoring Group (M = 71.94, SD = 7.67) were significantly different from Tutoring Group (M = 78.36, SD = 7.1) in exam scores, t(78) = -3.85, p = .0002. The effect size was large (Cohen’s d = -0.86).