library(readxl)
library(rstatix)
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
A6Q4 <- read_excel("C:/Users/DeSheila Hatcher/OneDrive/AA 5221/Assignment 6/A6Q4.xlsx")

Lift <- A6Q4$Weight[A6Q4$Exercise == "lift"]
NoLift <- A6Q4$Weight[A6Q4$Exercise == "nolift"]

mean(Lift, na.rm = TRUE)
## [1] 120.0824
median(Lift, na.rm = TRUE)
## [1] 115.589
sd(Lift, na.rm = TRUE)
## [1] 53.31766
mean(NoLift, na.rm = TRUE)
## [1] 33.02525
median(NoLift, na.rm = TRUE)
## [1] 40.83897
sd(NoLift, na.rm = TRUE)
## [1] 56.70695
shapiro.test(Lift)
## 
##  Shapiro-Wilk normality test
## 
## data:  Lift
## W = 0.78786, p-value = 0.0001436
shapiro.test(NoLift)
## 
##  Shapiro-Wilk normality test
## 
## data:  NoLift
## W = 0.70002, p-value = 7.294e-06
wilcox.test(Weight ~ Exercise, data = A6Q4, exact = FALSE)
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  Weight by Exercise
## W = 603, p-value = 1.836e-08
## alternative hypothesis: true location shift is not equal to 0
wilcox_effsize(Weight ~ Exercise, data = A6Q4)
## # A tibble: 1 × 7
##   .y.    group1 group2 effsize    n1    n2 magnitude
## * <chr>  <chr>  <chr>    <dbl> <int> <int> <ord>    
## 1 Weight lift   nolift   0.797    25    25 large

A Wilcoxon rank-sum test was conducted to determine whether body weight differed between participants who regularly lift weights and those who do not. Participants in the weightlifting group (Mdn = 115.59) had a significantly higher body weight than participants in the no-weightlifting group (Mdn = 40.84), W = 603, p < .001. The effect size was large, r = .797.