Do undergraduate students who work part-time jobs differ in weekly study hours compared to students who do not work?
Null Hypothesis (H₀):
There is no difference in weekly study hours between students who work
and students who do not work.
Alternative Hypothesis (H₁):
There is a difference in weekly study hours between students who work
and students who do not work.
install.packages(“readxl”) install.packages(“ggpubr”) install.packages(“dplyr”) install.packages(“effectsize”) install.packages(“effsize”)
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)
Dataset6_2 <- read_excel('/Users/sharathnallaganti/Desktop/3rd sem/applied analytics/Dataset6.2-2.xlsx')
unique(Dataset6_2$Work_Status)
## [1] "Works" "Does_Not_Work"
The dataset contains two independent groups: - “Works” - “Does_Not_Work”
These groups are independent because they consist of different students.
Dataset6_2 %>%
group_by(Work_Status) %>%
summarise(
Mean = mean(Study_Hours, na.rm = TRUE),
Median = median(Study_Hours, na.rm = TRUE),
SD = sd(Study_Hours, na.rm = TRUE),
N = n()
)
## # A tibble: 2 × 5
## Work_Status Mean Median SD N
## <chr> <dbl> <dbl> <dbl> <int>
## 1 Does_Not_Work 9.62 8.54 7.45 30
## 2 Works 6.41 5.64 4.41 30
Students who do not work: - Mean = 9.62 - Median = 8.54 - SD = 7.45 - N = 30
Students who work: - Mean = 6.41 - Median = 5.64 - SD = 4.41 - N = 30
On average, non-working students studied more hours per week.
However, the non-working group also shows greater variability (higher
SD).
works_data <- na.omit(Dataset6_2$Study_Hours[Dataset6_2$Work_Status == "Works"])
nonworks_data <- na.omit(Dataset6_2$Study_Hours[Dataset6_2$Work_Status == "Does_Not_Work"])
hist(works_data,
main = "Histogram of Study Hours (Works)",
xlab = "Weekly Study Hours",
col = "lightblue",
border = "black",
breaks = 10)
hist(nonworks_data,
main = "Histogram of Study Hours (Does Not Work)",
xlab = "Weekly Study Hours",
col = "lightgreen",
border = "black",
breaks = 10)
Students who do not work show a wider spread of study hours, including some high values, indicating greater variability.
Students who work show a more concentrated distribution with fewer extreme values.
This suggests possible non-normality in the non-working group.
ggboxplot(Dataset6_2,
x = "Work_Status",
y = "Study_Hours",
color = "Work_Status",
palette = "jco",
add = "jitter")
The non-working group displays more spread and potential extreme
values.
The working group appears more compact.
shapiro.test(works_data)
##
## Shapiro-Wilk normality test
##
## data: works_data
## W = 0.94582, p-value = 0.1305
shapiro.test(nonworks_data)
##
## Shapiro-Wilk normality test
##
## data: nonworks_data
## W = 0.83909, p-value = 0.0003695
Works group: W = 0.946, p = 0.131
Does_Not_Work group: W = 0.839, p = 0.00037
Because both groups must be normal for an Independent t-test, we cannot use a t-test.
Therefore, we proceed with the Mann-Whitney U test.
wilcox.test(Study_Hours ~ Work_Status, data = Dataset6_2)
##
## Wilcoxon rank sum exact test
##
## data: Study_Hours by Work_Status
## W = 569, p-value = 0.07973
## alternative hypothesis: true location shift is not equal to 0
W = 569
p = 0.07973
Since p > .05, the difference is not statistically significant.
Students who work (Mdn = 5.64) were not significantly different from
students who do not work (Mdn = 8.54) in weekly study hours,
U = 569, p > .05.
Although non-working students studied more on average (M = 9.62, SD = 7.45) than working students (M = 6.41, SD = 4.41), this difference was not statistically significant.
There is insufficient evidence to conclude that weekly study time differs between undergraduate students who work part-time and those who do not work.
While non-working students appear to study more hours on average, the observed difference may be due to random variation rather than a true difference between groups.