Step 2: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.2 <- read_excel("/Users/sarva/Desktop/Dataset6.2.xlsx")

Step 4:Calculate descriptive statistics for each group

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

Step 5:Create Histograms for each group

hist(dataset6.2$Study_Hours[dataset6.2$Work_Status =="Works"],
     main =  "Working",
     xlab = "Score",
     ylab = "frequency",
     col = "black",
     border = "yellow",
     breaks = 10
     )

hist(dataset6.2$Study_Hours[dataset6.2$Work_Status =="Does_Not_Work"],
     main =  "Does not work",
     xlab = "Score",
     ylab = "frequency",
     col = "black",
     border = "yellow",
     breaks = 10
)

Step 6:Creating Box Plots for each group

ggboxplot(dataset6.2, x = "Work_Status", y = "Study_Hours",
          color = "Work_Status",
          palette = "jco",
          add = "jitter")

Step 7: Shapiro Wilk test of normality

shapiro.test(dataset6.2$Study_Hours[dataset6.2$Work_Status == "Works"])
## 
##  Shapiro-Wilk normality test
## 
## data:  dataset6.2$Study_Hours[dataset6.2$Work_Status == "Works"]
## W = 0.94582, p-value = 0.1305
shapiro.test(dataset6.2$Study_Hours[dataset6.2$Work_Status == "Does_Not_Work"])
## 
##  Shapiro-Wilk normality test
## 
## data:  dataset6.2$Study_Hours[dataset6.2$Work_Status == "Does_Not_Work"]
## W = 0.83909, p-value = 0.0003695

Step 9: 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

```