Step 1: Open the installed packages
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)
Step 3:Import and name dataset
dataset6.1 <- read_excel("/Users/sarva/Desktop/Dataset6.1.xlsx")
Step 4:Calculate 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
Step 5: Create Histograms for each group
hist(dataset6.1$Exam_Score[dataset6.1$Group =="Tutoring"],
main = "Tutored",
xlab = "Score",
ylab = "frequency",
col = "black",
border = "yellow",
breaks = 10
)
hist(dataset6.1$Exam_Score[dataset6.1$Group =="No Tutoring"],
main = "Not Tutored",
xlab = "Score",
ylab = "frequency",
col = "black",
border = "yellow",
breaks = 10
)
# Group Tutored = Skewness= normal , Kurtosis = Mesokurtic # Group Not
Tutored = Skewness= normal , Kurtosis = Mesokurtic
Step 6: Creating Box Plots for each group
ggboxplot(dataset6.1, x = "Group", y = "Exam_Score",
color = "Group",
palette = "jco",
add = "jitter")
# Data appears to have certain outliers on the no tutoring group, after
visual inspection data appears to be normal. Step 7: 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
Step 8 : Conducting inferrential 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
Step 10: Calculating the effect size
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.
#Group 1 (M = 71.4. SD = 7.6) was significantly different from Group 2 (M = 78.7, SD = ), t(df) = x.xx, p = .xxx. The effect size was large (Cohen’s d = .0.86)