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(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ lubridate 1.9.5 ✔ tibble 3.3.1
## ✔ purrr 1.2.1 ✔ tidyr 1.3.2
## ✔ readr 2.2.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
D4 <- read_excel("A6Q4.xlsx")
D4 <- pivot_longer(D4,cols = c(nolift, lift), names_to = "label", values_to = "weight")
D4 %>%
group_by(label) %>%
summarise(
Mean = mean(weight, na.rm = TRUE),
Median = median(weight, na.rm = TRUE),
SD = sd(weight, na.rm = TRUE),
N = n()
)
## # A tibble: 2 × 5
## label 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(D4$weight[D4$label == "nolift"],
main = "Histogram of No lift Weights",
xlab = "Value",
ylab = "Frequency",
col = "lightblue",
border = "pink",
breaks = 10)
hist(D4$weight[D4$label == "lift"],
main = "Histogram of lift weights",
xlab = "Value",
ylab = "Frequency",
col = "lightgreen",
border = "pink",
breaks = 10)
The first variable looks abnormally distributed. The data is negatively sqewed. The data has a high kurtosis.
The second variable looks abnormally distributed. The data is negatively skewed. The data has a high kurtosis.
ggboxplot(D4, x = "label", y = "weight",
color = "label",
palette = "jco",
add = "jitter")
There are dots outside the boxplot. The dots are not close to the whiskers. The dots are very far away from the whiskers. Based on these findings, the boxplot is abnormal.
There are dots outside the boxplot. The dots are not close to the whiskers. The dots are very far away from the whiskers. Based on these findings, the boxplot is abnormal.
shapiro.test(D4$weight[D4$label == "nolift"])
##
## Shapiro-Wilk normality test
##
## data: D4$weight[D4$label == "nolift"]
## W = 0.78786, p-value = 0.0001436
shapiro.test(D4$weight[D4$label == "lift"])
##
## Shapiro-Wilk normality test
##
## data: D4$weight[D4$label == "lift"]
## W = 0.70002, p-value = 7.294e-06
The first group is abnormally distributed, (p < 0.001).
The second group is abnormally distributed, (p < 0.001).
wilcox.test(weight ~ label, data = D4)
##
## Wilcoxon rank sum exact test
##
## data: weight by label
## W = 22, p-value = 7.132e-11
## alternative hypothesis: true location shift is not equal to 0
mw_effect <- cliff.delta(weight ~ label, data = D4)
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 weightlifters and non weight lifters. nolift scores (Mdn = 116.000) were significantly different from lifter scores (Mdn =40.800), U = 0.700, p < 0.001. The effect size was LARGE, Cliff’s Delta = -0.93.