library(readxl)
library(rstatix)
##
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
##
## filter
library(ggpubr)
## Loading required package: ggplot2
library(effsize)
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
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
hist(NoLift,
breaks = 15,
col = "skyblue",
border = "white")
hist(Lift,
breaks = 15,
col = "firebrick",
border = "white")
ggboxplot(A6Q4, x = "Exercise", y = "Weight",
color = "Exercise",
palette = "jco",
add = "jitter")
# I added the missing histograms and boxplot.
# My original analysis did not include these graphs.
# I added them to examine the distributions and
# identify potential outliers, as shown in the answer key.
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)
##
## Wilcoxon rank sum exact test
##
## data: Weight by Exercise
## W = 603, p-value = 7.132e-11
## alternative hypothesis: true location shift is not equal to 0
mw_effect <- cliff.delta(Weight ~ Exercise, data = A6Q4)
print(mw_effect)
##
## Cliff's Delta
##
## delta estimate: 0.9296 (large)
## 95 percent confidence interval:
## lower upper
## 0.7993841 0.9764036
# I corrected my effect-size calculation.
# My original code calculated Wilcoxon's effect size (r).
# The answer key uses Cliff's Delta instead.
# I replaced wilcox_effsize with cliff.delta to match
# the effect-size calculation used in the answer key.
# I updated my written interpretation to match the answer key.
# I changed the effect size from r = .797 to
# Cliff's Delta = .930 and rounded the group medians.
A Wilcoxon rank-sum test (Mann-Whitney U 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 = 116) had a significantly higher body weight than participants in the no-weightlifting group (Mdn = 40.8), W = 603, p < .001. The effect size was large, Cliff’s Delta = .930.