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)
library(tidyr)
A6Q4 <- read_excel("C:/Users/raadrish/Downloads/A6Q4.xlsx")
A6Q4_long <- A6Q4 %>%
pivot_longer(cols = c(nolift, lift),
names_to = "Lift",
values_to = "BodyWeight_kg")
A6Q4_long %>%
group_by(Lift) %>%
summarise(
Mean = mean(BodyWeight_kg, na.rm = TRUE),
Median = median(BodyWeight_kg, na.rm = TRUE),
SD = sd(BodyWeight_kg, na.rm = TRUE),
N = n()
)
## # A tibble: 2 × 5
## Lift Mean Median SD N
## <chr> <dbl> <dbl> <dbl> <int>
## 1 lift 33.0 40.8 56.7 25
## 2 nolift 120. 116. 53.3 25
hist(A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "nolift"],
main = "Histogram of nolift BodyWeight_kg",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "black",
breaks = 10)
hist(A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "lift"],
main = "Histogram of lift BodyWeight_kg",
xlab = "Value",
ylab = "Frequency",
col = "lightgreen",
border = "black",
breaks = 10)
Group 1: No Lift (nolift)
The first variable looks abnormally distributed.
The data is positively skewed (most data is on the left, tail stretches right).
The data does not have a proper bell curve.
Group 2: Lift
The second variable looks abnormally distributed.
The data is negatively skewed (most data is on the right, tail stretches left).
The data does not have a proper bell curve.
ggboxplot(A6Q4_long, x = "Lift", y = "BodyWeight_kg",
color = "Lift",
palette = "jco",
add = "jitter")
Boxplot 1: No Lift (nolift)
There are dots outside the boxplot.
The dots are not close to the whiskers.
The dots are very far away from the whiskers.
The outliers are not balanced.
Based on these findings, the boxplot is not normal.
Boxplot 2: Lift (lift)
There are dots outside the boxplot.
The dots are not close to the whiskers.
The dots are very far away from the whiskers.
The outliers are not balanced.
Based on these findings, the boxplot is not normal.
shapiro.test(A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "nolift"])
##
## Shapiro-Wilk normality test
##
## data: A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "nolift"]
## W = 0.78786, p-value = 0.0001436
shapiro.test(A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "lift"])
##
## Shapiro-Wilk normality test
##
## data: A6Q4_long$BodyWeight_kg[A6Q4_long$Lift == "lift"]
## W = 0.70002, p-value = 7.294e-06
Group 1: nolift
The first group is abnormally distributed, p < .05
Group 2: lift
The second group is abnormally distributed, p < .05
The data’s overall normality is abnormal
wilcox.test(BodyWeight_kg ~ Lift, data = A6Q4_long)
##
## Wilcoxon rank sum exact test
##
## data: BodyWeight_kg by Lift
## W = 22, p-value = 7.132e-11
## alternative hypothesis: true location shift is not equal to 0
mw_effect <- cliff.delta(BodyWeight_kg ~ Lift, data = A6Q4_long)
print(mw_effect)
##
## Cliff's Delta
##
## delta estimate: -0.9296 (large)
## 95 percent confidence interval:
## lower upper
## -0.9969233 -0.0729899
A Mann-Whitney U test was conducted to determine if there was a difference in body weight (kg) between participants who lift weights and those who do not lift weights.
The lift group scores (Mdn = 40.84) were significantly different from the nolift group scores (Mdn = 115.59), U = 22.00, p < .001.
The effect size was large, Cliff’s Delta = .93.