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)
  1. Data Source
Dataset6.1 <- read_excel("/Users/alexiaprudencio/Desktop/Applied Analytics 1/Assingment 6/Dataset6.1.xlsx")
  1. Descriptive Statistics for Each Group
Dataset6.1 %>%
  group_by(Group) %>%
  summarise(
    Mean = mean(Exam_Score, na.rm = TRUE),
    Median = median(Exam_Score, na.rm = TRUE),
    SD = sd(Exam_Score, na.rm = TRUE),
    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
  1. Histograms for Each Group
hist(Dataset6.1$Exam_Score[Dataset6.1$Group == "Tutoring"],
     main = "Histogram of Tutoring Group Scores",
     xlab = "Value",
     ylab = "Frequency",
     col = "lightblue",
     border = "darkblue",
     breaks = 10)

hist(Dataset6.1$Exam_Score[Dataset6.1$Group == "No Tutoring"],
     main = "Histogram of No Tutoring Group Scores",
     xlab = "Value",
     ylab = "Frequency",
     col = "lightyellow",
     border = "darkgoldenrod1",
     breaks = 10)

The data on the Tutoring Group Scores appears normally distributed. The data looks symmetrical with most data in the middle. The data also appear to have a proper bell curve. The data on the No Tutoring Group Scores appears symetrical and normaly distributed as well. The kurtosis also appears bell-shaped (normal). We may need to use a Independent t-test.

  1. Boxplots for Each Group
ggboxplot(Dataset6.1, x = "Group", y = "Exam_Score",
          color = "Group",
          palette = "jco",
          add = "jitter")

The Tutoring Group boxplot appears normal. There are no dots past the whiskers; it follows a normal distribution. The No Tutoring Group boxplot also appears normal with all the data points within the reach of the whiskers. We may need to use a Independent t-test.

  1. Shapiro-Wilk Test of Normality
shapiro.test(Dataset6.1$Exam_Score[Dataset6.1$Group == "Tutoring"])
## 
##  Shapiro-Wilk normality test
## 
## data:  Dataset6.1$Exam_Score[Dataset6.1$Group == "Tutoring"]
## W = 0.98859, p-value = 0.953
shapiro.test(Dataset6.1$Exam_Score[Dataset6.1$Group == "No Tutoring"])
## 
##  Shapiro-Wilk normality test
## 
## data:  Dataset6.1$Exam_Score[Dataset6.1$Group == "No Tutoring"]
## W = 0.98791, p-value = 0.9398

The data for the Tutoring Group is normal, p-value = 0.953 > .05. The data for the No Tutoring Group is also normal, p-value = 0.9398 > .05. Since both p-values pass the Shapiro-Wilk Test of Normality. We need to use the Independent t-test to compare the exam scores between the two groups.

  1. Conduct Inferential Test - Independent T-Test
t.test(Exam_Score ~ Group, data = Dataset6.1, 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

The p-value = 0.000233 < .05, this means the results were significant, which means we can calculate the Effect Size to see how big the difference is.

  1. Calculation of the Effect Size - Cohen’s D
cohens_d_result <- cohens_d(Exam_Score ~ Group, data = Dataset6.1, pooled_sd = TRUE)
print(cohens_d_result)
## Cohen's d |         95% CI
## --------------------------
## -0.86     | [-1.32, -0.40]
## 
## - Estimated using pooled SD.

The size of the effect, the difference between the group averages is ± 0.80 to 1.29 = large

  1. Report the Results No Tutoring Group (M=71.95,SD=7.68) was significantly different from Tutoring Group (M=78.36,SD=7.18), t(78)=−3.86,p=.0002. The effect size was large (Cohen’s d=−0.86).