── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ purrr 1.0.2
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.1 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.1
── 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
library(janitor)
Attaching package: 'janitor'
The following objects are masked from 'package:stats':
chisq.test, fisher.test
library(dplyr)library(ggplot2)library(lubridate)
setwd("~/Documents/Desktop - Jade’s MacBook Air/OneDrive - Teesside University/MSc Strength and Conditioning for Performance and Rehabilitation/Research Project/Data Analysis")strength_data <-read_csv("forceframe-test-export-16_02_2024.csv") %>%mutate(ID =str_replace_all(Name, " ", ""))
Rows: 310 Columns: 25
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (7): Name, Date UTC, Device, Mode, Test, Direction, Position
dbl (15): L Reps, R Reps, L Max Force (N), R Max Force (N), Max Imbalance, ...
lgl (2): ExternalId, Notes
time (1): Time UTC
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# A tibble: 6 × 3
ID Leg_dominance Group
<chr> <chr> <chr>
1 RTC29 left Land
2 RTC84 left Land
3 ETC03 left Land
4 ETC15 left Land
5 RTC85 right Land
6 RTC89 right Land
pre_long<-pivot_longer(Pre, cols =c(3:7), names_to ="Trial", values_to ="FPPA")pre_meanFFPA <-mean(pre_long$FPPA)pre_sd_FFPA <-sd(pre_long$FPPA)# Remove rows containing outliers from the Five variablethreshold <-2* pre_sd_FFPA pre_long_clean <- pre_long[abs(pre_long$FPPA - pre_meanFFPA) < threshold, ]
FPPA_Hip<-left_join(FPPA_ready, strength_data, by =c("id"))head(FPPA_Hip)
# A tibble: 6 × 9
id right left Leg_dominance date_utc l_Pull l_Squeeze r_Pull r_Squeeze
<chr> <dbl> <dbl> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
1 ETC02 12.2 4.59 right 16/02/2024 214. 205 194. 221
2 ETC03 8.33 12.7 left 16/02/2024 142. 152. 138. 142.
3 ETC05 7.81 8.21 right 16/02/2024 220 222. 230. 231.
4 ETC06 12.4 12.0 right 23/02/2024 192 231. 197. 234.
5 ETC07 9.94 8.41 right 16/02/2024 179. 227. 190. 216.
6 ETC08 13.2 9.81 right 16/02/2024 181. 229 193 228.
#Checking data to find out why there is missing dataunique_FPPAs <-unique(FPPA_ready$id)unique_strength <-unique(strength_data$id)# Check the intersection of IDscommon_ids <-intersect(unique_FPPAs, unique_strength)print(length(common_ids)) # Number of common IDs
[1] 56
print(setdiff(unique_FPPAs, unique_strength)) # IDs in FPPA_ready not in strength_data
character(0)
print(setdiff(unique_strength, unique_FPPAs)) # IDs in strength_data not in FPPA_ready
character(0)
participant_data <-read_csv ("jade.csv")
Rows: 110 Columns: 23
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): ID, Group, Date, DOB, category
dbl (18): Height, Mass, IFT, Sit_height, x10m, x20m, x30m, Maturity_offset, ...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
all <-left_join(participant_data, FPPA_Hip,by =c("id"))head(all)
# A tibble: 6 × 14
id group height mass maturity_offset dob right left Leg_dominance
<chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl> <dbl> <chr>
1 ETC02 u12s 148 37.6 -0.370 03/05/2012 12.2 4.59 right
2 ETC03 u12s 142 32.4 -0.686 04/08/2012 8.33 12.7 left
3 ETC05 u12s 151 45.5 -0.559 25/04/2013 7.81 8.21 right
4 ETC06 u12s 154 38.6 -0.0285 19/03/2012 12.4 12.0 right
5 ETC07 u12s 160 41.5 0.764 01/11/2011 9.94 8.41 right
6 ETC08 u12s 157 44.6 0.641 16/09/2011 13.2 9.81 right
# ℹ 5 more variables: date_utc <chr>, l_Pull <dbl>, l_Squeeze <dbl>,
# r_Pull <dbl>, r_Squeeze <dbl>
#Normalising hip strength data to body massall_norm <- all %>%group_by(id) %>%mutate(l_Pull = l_Pull / mass,l_Squeeze = l_Squeeze / mass,r_Pull = r_Pull / mass,r_Squeeze = r_Squeeze / mass ) %>%rename(FPPA_r = right,FPPA_l = left )head(all_norm)
# A tibble: 6 × 14
# Groups: id [6]
id group height mass maturity_offset dob FPPA_r FPPA_l Leg_dominance
<chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl> <dbl> <chr>
1 ETC02 u12s 148 37.6 -0.370 03/05/20… 12.2 4.59 right
2 ETC03 u12s 142 32.4 -0.686 04/08/20… 8.33 12.7 left
3 ETC05 u12s 151 45.5 -0.559 25/04/20… 7.81 8.21 right
4 ETC06 u12s 154 38.6 -0.0285 19/03/20… 12.4 12.0 right
5 ETC07 u12s 160 41.5 0.764 01/11/20… 9.94 8.41 right
6 ETC08 u12s 157 44.6 0.641 16/09/20… 13.2 9.81 right
# ℹ 5 more variables: date_utc <chr>, l_Pull <dbl>, l_Squeeze <dbl>,
# r_Pull <dbl>, r_Squeeze <dbl>
shapiro.test(all_norm$FPPA_r)
Shapiro-Wilk normality test
data: all_norm$FPPA_r
W = 0.97252, p-value = 0.2288
shapiro.test(all_norm$r_Pull)
Shapiro-Wilk normality test
data: all_norm$r_Pull
W = 0.96948, p-value = 0.1664
shapiro.test(all_norm$r_Squeeze)
Shapiro-Wilk normality test
data: all_norm$r_Squeeze
W = 0.96872, p-value = 0.1535
shapiro.test(all_norm$FPPA_l)
Shapiro-Wilk normality test
data: all_norm$FPPA_l
W = 0.97624, p-value = 0.3332
shapiro.test(all_norm$l_Pull)
Shapiro-Wilk normality test
data: all_norm$l_Pull
W = 0.96762, p-value = 0.1367
shapiro.test(all_norm$l_Squeeze)
Shapiro-Wilk normality test
data: all_norm$l_Squeeze
W = 0.96941, p-value = 0.1653
library(dplyr)library(stringr)# Capitalize group namesall_norm <- all_norm %>%mutate(group =str_to_title(group)) # Capitalizes the first letter of each word#Graph showing FPPA vs Groin Squeeze for Right leg grouped by age grouplibrary(ggrepel)library(viridis) # For larger color palettes
Loading required package: viridisLite
smooth_r_Squeeze <- all_norm %>% dplyr::group_by(group) %>% dplyr::summarize(FPPA_mid =mean(FPPA_r, na.rm =TRUE),Squeeze_mid =mean(r_Squeeze, na.rm =TRUE),label =case_when(first(group) =="U12s"~"U12s",first(group) =="U14s"~"U14s",first(group) =="U16s"~"U16s", ))# Define distinct colors for groupsgroup_colors <-c("U12s"="#4c72b0", "U14s"="#e08214", "U16s"="#6a0c70")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_norm$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, group_colors), c(unique(all_norm$id), unique(all_norm$group)))# Create the plotggplot(all_norm, aes(r_Squeeze, FPPA_r, group = group)) +geom_point(aes(color = id, shape = group), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = group), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed lines#geom_label_repel(# data = smooth_r_Squeeze,#aes(label = label, x = Squeeze_mid, y = FPPA_mid, color = group),#size = 3,# segment.color = "transparent",# direction = "both",# box.padding = 0.5, # Adjusted for better readability# point.padding = 0.5,# min.segment.length = 0.5,# nudge_x = 2,# nudge_y = 0,# show.legend = FALSE # Hide legend for labels# ) + labs(x ="Hip Adduction Max Force (N•kg-1)",y ="FPPA (degrees)", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("U12s"=19, "U14s"=17, "U16s"=15)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="none" ) +labs(shape ="Groups") +facet_wrap(~group)
ggsave("Figure6.png")
Saving 7 x 5 in image
#Graph showing FPPA vs Groin Squeeze for Left leg grouped by age grouplibrary(ggrepel)library(viridis) # For larger color palettes#smooth_l_Squeeze <- all_norm %>%# dplyr::group_by(group) %>%#dplyr::summarize(# FPPA_mid = mean(FPPA_l, na.rm = TRUE),#Squeeze_mid = mean(l_Squeeze, na.rm = TRUE),#first(group) == "u12s" ~ "u12s",# label = case_when(#first(group) == "u14s" ~ "u14s",# first(group) == "u16s" ~ "u16s",# ))# Define distinct colors for groupsgroup_colors <-c("U12s"="#4c72b0", "U14s"="#e08214", "U16s"="#6a0c70")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_norm$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, group_colors), c(unique(all_norm$id), unique(all_norm$group)))# Create the plotggplot(all_norm, aes(l_Squeeze, FPPA_l, group = group)) +geom_point(aes(color = id, shape = group), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = group), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed lines#geom_label_repel(# data = smooth_l_Squeeze,# aes(label = label, x = Squeeze_mid, y = FPPA_mid, color = group),# size = 3,#segment.color = "transparent",#direction = "both",#box.padding = 0.5, # Adjusted for better readability#point.padding = 0.5,#min.segment.length = 0.5,#nudge_x = 0,#nudge_y = 0,#show.legend = FALSE # Hide legend for labels#) + labs(x ="Hip Adduction Max Force (N•kg-1)",y ="FPPA (degrees)", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("U12s"=19, "U14s"=17, "U16s"=15)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="none"# Adjust position of the legend ) +labs(shape ="Groups") +facet_wrap(~group)
ggsave("Figure5.png")
Saving 7 x 5 in image
#Graph showing FPPA vs Groin Pull for Right leg grouped by age grouplibrary(ggrepel)library(viridis) # For larger color palettes#smooth_r_Pull <- all_norm %>%# dplyr::group_by(group) %>%#dplyr::summarize(# FPPA_mid = mean(FPPA_r, na.rm = TRUE),# Pull_mid = mean(r_Pull, na.rm = TRUE),# label = case_when(# first(group) == "u12s" ~ "u12s",# first(group) == "u14s" ~ "u14s",# first(group) == "u16s" ~ "u16s",# ))# Define distinct colors for groupsgroup_colors <-c("U12s"="#4c72b0", "U14s"="#e08214", "U16s"="#6a0c70")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_norm$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, group_colors), c(unique(all_norm$id), unique(all_norm$group)))# Create the plotggplot(all_norm, aes(r_Pull, FPPA_r, group = group)) +geom_point(aes(color = id, shape = group), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = group), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed lines# geom_label_repel(# data = smooth_r_Pull,# aes(label = label, x = Pull_mid, y = FPPA_mid, color = group),# size = 3,# segment.color = "transparent",# direction = "both",# box.padding = 0.5, # Adjusted for better readability# point.padding = 0.5,# min.segment.length = 0.5,# nudge_x = 0,# nudge_y = 0,# show.legend = FALSE # Hide legend for labels# ) + labs(x ="Hip Abduction Max Force (N•kg-1)",y ="FPPA (degrees)", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("U12s"=19, "U14s"=17, "U16s"=15)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="none"# Adjust position of the legend ) +labs(shape ="Groups") +facet_wrap(~group) # Add label for the shape legend
ggsave("Figure3.png")
Saving 7 x 5 in image
#Graph showing FPPA vs Groin Pull for Left leg grouped by age grouplibrary(ggrepel)library(viridis) # For larger color palettes#smooth_l_Pull <- all_norm %>%# dplyr::group_by(group) %>%#dplyr::summarize(# FPPA_mid = mean(FPPA_l, na.rm = TRUE),# Pull_mid = mean(l_Pull, na.rm = TRUE),# label = case_when(# first(group) == "u12s" ~ "u12s",# first(group) == "u14s" ~ "u14s",# first(group) == "u16s" ~ "u16s",# ))# Define distinct colors for groupsgroup_colors <-c("U12s"="#4c72b0", "U14s"="#e08214", "U16s"="#6a0c70")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_norm$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, group_colors), c(unique(all_norm$id), unique(all_norm$group)))# Create the plotggplot(all_norm, aes(l_Pull, FPPA_l, group = group)) +geom_point(aes(color = id, shape = group), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = group), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed lines#geom_label_repel(# data = smooth_l_Pull,#aes(label = label, x = Pull_mid, y = FPPA_mid, color = group),#size = 3,# segment.color = "transparent",# direction = "both",# box.padding = 0.5, # Adjusted for better readability# point.padding = 0.5,# min.segment.length = 0.5,# nudge_x = 0,# nudge_y = 0,# show.legend = FALSE # Hide legend for labels# ) + labs(x ="Hip Abduction Max Force (N•kg-1)",y ="FPPA (degrees)", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("U12s"=19, "U14s"=17, "U16s"=15)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="none"# Adjust position of the legend ) +labs(shape ="Groups") +facet_wrap(~group) # Add label for the shape legend
ggsave("Figure2.png")
Saving 7 x 5 in image
#Not used in study#Graph showing FPPA vs Groin Squeeze for Right leg grouped by leg dominancesmooth_r_Squeezedom <- all_norm %>% dplyr::group_by(Leg_dominance) %>% dplyr::summarize(FPPA_mid =mean(FPPA_r, na.rm =TRUE),Squeeze_mid =mean(r_Squeeze, na.rm =TRUE),label =case_when(first(Leg_dominance) =="right"~"right",first(Leg_dominance) =="left"~"left", ))# Define distinct colors for groupsleg_colors <-c("right"="#4c72b0", "left"="#e08214")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_norm$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, leg_colors), c(unique(all_norm$id), unique(all_norm$Leg_dominance)))# Create the plotggplot(all_norm, aes(r_Squeeze, FPPA_r, group = Leg_dominance)) +geom_point(aes(color = id, shape = Leg_dominance), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = Leg_dominance), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed linesgeom_label_repel(data = smooth_r_Squeezedom,aes(label = label, x = Squeeze_mid, y = FPPA_mid, color = Leg_dominance),size =3,segment.color ="transparent",direction ="both",box.padding =-0.5, # Adjusted for better readabilitypoint.padding =0.5,min.segment.length =0.5,nudge_x =0,nudge_y =0,show.legend =FALSE# Hide legend for labels ) +labs(x ="Groin Squeeze Strength",y ="Frontal Plane Projection Angle", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("right"=19, "left"=17)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="right"# Adjust position of the legend ) +labs(shape ="Leg Dominance") # Add label for the shape legend
# A tibble: 6 × 16
id group height mass maturity_offset dob right left Leg_dominance
<chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl> <dbl> <chr>
1 ETC02 u12s 148 37.6 -0.370 03/05/2012 12.2 4.59 right
2 ETC03 u12s 142 32.4 -0.686 04/08/2012 8.33 12.7 left
3 ETC05 u12s 151 45.5 -0.559 25/04/2013 7.81 8.21 right
4 ETC06 u12s 154 38.6 -0.0285 19/03/2012 12.4 12.0 right
5 ETC07 u12s 160 41.5 0.764 01/11/2011 9.94 8.41 right
6 ETC08 u12s 157 44.6 0.641 16/09/2011 13.2 9.81 right
# ℹ 7 more variables: date_utc <chr>, l_Pull <dbl>, l_Squeeze <dbl>,
# r_Pull <dbl>, r_Squeeze <dbl>, pull_asym <dbl>, squeeze_asym <dbl>
#not used in study# Count the number of positive and negative pull_asym valuespull_asym_counts <- all_asym %>% dplyr::summarize(left_stronger_pull =sum(pull_asym >0),right_stronger_pull =sum(pull_asym <0),no_asym_pull =sum(pull_asym ==0))# Count the number of positive and negative pull_asym valuessqueeze_asym_counts <- all_asym %>% dplyr::summarize(left_stronger_squeeze =sum(squeeze_asym >0),right_stronger_squeeze =sum(squeeze_asym <0),no_asym_squeeze =sum(squeeze_asym ==0))asym_counts <-cross_join(pull_asym_counts, squeeze_asym_counts)head(asym_counts)
#not used in study# Add pull and squeeze asymmetry direction to your dataall_asym <- all_asym %>% dplyr::mutate(pull_asym_direction =case_when( pull_asym >0~"left_stronger", pull_asym <0~"right_stronger",TRUE~"no_asym" ),squeeze_asym_direction =case_when( squeeze_asym >0~"left_stronger", squeeze_asym <0~"right_stronger",TRUE~"no_asym" ) )
# Not used in study# Logistic regression for pull asymmetrypull_asym_model <-glm(pull_asym_direction =="left_stronger"~ Leg_dominance, data = all_asym, family ="binomial")summary(pull_asym_model)
Call:
glm(formula = pull_asym_direction == "left_stronger" ~ Leg_dominance,
family = "binomial", data = all_asym)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.517e-15 8.165e-01 0.000 1.000
Leg_dominanceright -8.004e-02 8.642e-01 -0.093 0.926
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 77.561 on 55 degrees of freedom
Residual deviance: 77.552 on 54 degrees of freedom
AIC: 81.552
Number of Fisher Scoring iterations: 3
# Logistic regression for squeeze asymmetrysqueeze_asym_model <-glm(squeeze_asym_direction =="left_stronger"~ Leg_dominance, data = all_asym, family ="binomial")summary(squeeze_asym_model)
Call:
glm(formula = squeeze_asym_direction == "left_stronger" ~ Leg_dominance,
family = "binomial", data = all_asym)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.609 1.095 1.469 0.142
Leg_dominanceright -1.851 1.132 -1.635 0.102
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 77.561 on 55 degrees of freedom
Residual deviance: 74.000 on 54 degrees of freedom
AIC: 78
Number of Fisher Scoring iterations: 3
# Not used in study#Graph showing FPPA and Pull Asymmetry for Right Legggplot(all_asym, aes(x =right, y = pull_asym)) +geom_point(size =3) +# Scatter plot pointsgeom_smooth(method ="lm", se =TRUE, color ="black") +# Add a smooth linelabs(title ="Scatter Plot of Right vs. Pull Assymetry",x ="Right",y ="Pull Asym" ) +theme_minimal()
`geom_smooth()` using formula = 'y ~ x'
# Not used in study#Graph showing FPPA and Pull Asymmetry for Left Legggplot(all_asym, aes(x =left, y = pull_asym)) +geom_point(size =3) +# Scatter plot pointsgeom_smooth(method ="lm", se =TRUE, color ="black") +# Add a smooth linelabs(title ="Scatter Plot of Left vs. Pull Assymetry",x ="Left",y ="Pull Asym" ) +theme_minimal()
`geom_smooth()` using formula = 'y ~ x'
# Not used in study#Graph showing FPPA and Squeeze Asymmetry for Left Legggplot(all_asym, aes(x =left, y = squeeze_asym)) +geom_point(size =3) +# Scatter plot pointsgeom_smooth(method ="lm", se =TRUE, color ="black") +# Add a smooth linelabs(title ="Scatter Plot of Left vs. Squeeze Assymetry",x ="Left",y ="Squeeze Asym" ) +theme_minimal()
`geom_smooth()` using formula = 'y ~ x'
# Not used in study#Graph showing FPPA and Squeeze Asymmetry for Right Legggplot(all_asym, aes(x =right, y = squeeze_asym)) +geom_point(size =3) +# Scatter plot pointsgeom_smooth(method ="lm", se =TRUE, color ="black") +# Add a smooth linelabs(title ="Scatter Plot of Right vs. Squeeze Assymetry",x ="Right",y ="Squeeze Asym" ) +theme_minimal()
# A tibble: 6 × 15
id group height mass maturity_offset dob right left Leg_dominance
<chr> <chr> <dbl> <dbl> <dbl> <chr> <dbl> <dbl> <chr>
1 ETC02 u12s 148 37.6 -0.370 03/05/2012 12.2 4.59 right
2 ETC03 u12s 142 32.4 -0.686 04/08/2012 8.33 12.7 left
3 ETC05 u12s 151 45.5 -0.559 25/04/2013 7.81 8.21 right
4 ETC06 u12s 154 38.6 -0.0285 19/03/2012 12.4 12.0 right
5 ETC07 u12s 160 41.5 0.764 01/11/2011 9.94 8.41 right
6 ETC08 u12s 157 44.6 0.641 16/09/2011 13.2 9.81 right
# ℹ 6 more variables: date_utc <chr>, l_Pull <dbl>, l_Squeeze <dbl>,
# r_Pull <dbl>, r_Squeeze <dbl>, pull_asym <dbl>
# Not used in study# Pearson correlation for pull asymmetry and FPPAcor_pull_fppa <-cor(all_asym$pull_asym, all_asym$right, method ="pearson")print(cor_pull_fppa)
[1] 0.1256906
# Pearson correlation for squeeze asymmetry and FPPAcor_squeeze_fppa <-cor(all_asym$squeeze_asym, all_asym$right, method ="pearson")print(cor_squeeze_fppa)
[1] -0.01831602
# Not used in study# Shapiro-Wilk test for pull asymmetry directionshapiro_test_left <-shapiro.test(all_asym$right[all_asym$pull_asym_direction =="left_stronger"])shapiro_test_right <-shapiro.test(all_asym$right[all_asym$pull_asym_direction =="right_stronger"])# Print resultsprint(shapiro_test_left)
Shapiro-Wilk normality test
data: all_asym$right[all_asym$pull_asym_direction == "left_stronger"]
W = 0.97088, p-value = 0.6253
print(shapiro_test_right)
Shapiro-Wilk normality test
data: all_asym$right[all_asym$pull_asym_direction == "right_stronger"]
W = 0.96006, p-value = 0.3499
# Shapiro-Wilk test for squeeze asymmetry directionshapiro_test_squeeze_left <-shapiro.test(all_asym$right[all_asym$squeeze_asym_direction =="left_stronger"])shapiro_test_squeeze_right <-shapiro.test(all_asym$right[all_asym$squeeze_asym_direction =="right_stronger"])# Print resultsprint(shapiro_test_squeeze_left)
Shapiro-Wilk normality test
data: all_asym$right[all_asym$squeeze_asym_direction == "left_stronger"]
W = 0.94454, p-value = 0.1576
print(shapiro_test_squeeze_right)
Shapiro-Wilk normality test
data: all_asym$right[all_asym$squeeze_asym_direction == "right_stronger"]
W = 0.98698, p-value = 0.9694
# Shapiro-Wilk test for pull asymmetry directionshapiro_test_left <-shapiro.test(all_asym$left[all_asym$pull_asym_direction =="left_stronger"])shapiro_test_right <-shapiro.test(all_asym$left[all_asym$pull_asym_direction =="right_stronger"])# Print resultsprint(shapiro_test_left)
Shapiro-Wilk normality test
data: all_asym$left[all_asym$pull_asym_direction == "left_stronger"]
W = 0.98253, p-value = 0.9144
print(shapiro_test_right)
Shapiro-Wilk normality test
data: all_asym$left[all_asym$pull_asym_direction == "right_stronger"]
W = 0.92684, p-value = 0.05135
# Shapiro-Wilk test for squeeze asymmetry directionshapiro_test_squeeze_left <-shapiro.test(all_asym$left[all_asym$squeeze_asym_direction =="left_stronger"])shapiro_test_squeeze_right <-shapiro.test(all_asym$left[all_asym$squeeze_asym_direction =="right_stronger"])# Print resultsprint(shapiro_test_squeeze_left)
Shapiro-Wilk normality test
data: all_asym$left[all_asym$squeeze_asym_direction == "left_stronger"]
W = 0.95606, p-value = 0.2995
print(shapiro_test_squeeze_right)
Shapiro-Wilk normality test
data: all_asym$left[all_asym$squeeze_asym_direction == "right_stronger"]
W = 0.97141, p-value = 0.5984
# Not used in study# Checking relationship between asymmetry and FPPA# ANOVA for pull asymmetry direction and FPPAanova_pull <-aov(right ~ pull_asym_direction, data = all_asym)summary(anova_pull)
Df Sum Sq Mean Sq F value Pr(>F)
pull_asym_direction 2 50.2 25.09 1.422 0.25
Residuals 53 935.1 17.64
# ANOVA for squeeze asymmetry direction and FPPAanova_squeeze <-aov(right ~ squeeze_asym_direction, data = all_asym)summary(anova_squeeze)
Df Sum Sq Mean Sq F value Pr(>F)
squeeze_asym_direction 1 0.1 0.055 0.003 0.956
Residuals 54 985.2 18.244
# ANOVA for pull asymmetry direction and FPPAanova_pull <-aov(left ~ pull_asym_direction, data = all_asym)summary(anova_pull)
Df Sum Sq Mean Sq F value Pr(>F)
pull_asym_direction 2 52.0 26.02 1.889 0.161
Residuals 53 729.9 13.77
# ANOVA for squeeze asymmetry direction and FPPAanova_squeeze <-aov(left ~ squeeze_asym_direction, data = all_asym)summary(anova_squeeze)
Df Sum Sq Mean Sq F value Pr(>F)
squeeze_asym_direction 1 11.6 11.60 0.813 0.371
Residuals 54 770.3 14.27
#Not used in study#Graph showing FPPA and Squeeze Asymmetry for Right Leg grouped by Leg Dominancesmooth_r_Squeezedom <- all_asym %>% dplyr::group_by(Leg_dominance) %>% dplyr::summarize(FPPA_mid =mean(right, na.rm =TRUE),Squeeze_mid =mean(squeeze_asym, na.rm =TRUE),label =case_when(first(Leg_dominance) =="right"~"right",first(Leg_dominance) =="left"~"left" ) )# Define distinct colors for groupsleg_colors <-c("right"="#4c72b0", "left"="#e08214")# Generate a larger color palette for IDsid_colors <- viridis::viridis(n =length(unique(all_asym$id)), option ="magma")# Combine group and id colors (ensure you have enough colors)color_map <-setNames(c(id_colors, leg_colors), c(unique(all_asym$id), unique(all_asym$Leg_dominance)))# Create the plotggplot(all_asym, aes(squeeze_asym, right, group = Leg_dominance)) +geom_point(aes(color = id, shape = Leg_dominance), show.legend =TRUE) +# Ensure shape legend is showngeom_smooth(aes(color = Leg_dominance), method ="lm", formula = y ~ x, show.legend =FALSE) +# Hide legend for smoothed linesgeom_label_repel(data = smooth_r_Squeezedom,aes(label = label, x = Squeeze_mid, y = FPPA_mid, color = Leg_dominance),size =3,segment.color ="transparent",direction ="both",box.padding =-0.5, # Adjusted for better readabilitypoint.padding =0.5,min.segment.length =0.5,nudge_x =0,nudge_y =0,show.legend =FALSE# Hide legend for labels ) +labs(x ="Groin Squeeze Strength Asymmetry",y ="Frontal Plane Projection Angle", ) +scale_color_manual(values = color_map, guide ="none") +# Apply distinct colors and hide color legendscale_shape_manual(values =c("right"=19, "left"=17)) +theme_minimal() +theme(text =element_text(size =14),axis.text.x =element_text(angle =0, hjust =1),legend.position ="right"# Adjust position of the legend ) +labs(shape ="Leg Dominance") # Add label for the shape legend
#Not used in study# Count the number of "right" and "left" in Leg_dominanceleg_dominance_counts <- all_norm %>% dplyr::group_by(Leg_dominance) %>% dplyr::summarize(count =n()) %>% dplyr::filter(Leg_dominance %in%c("right", "left")) %>% tidyr::pivot_wider(names_from = Leg_dominance, values_from = count)# View the resultsprint(leg_dominance_counts)
# A tibble: 1 × 2
left right
<int> <int>
1 6 50
library(Hmisc)
Attaching package: 'Hmisc'
The following objects are masked from 'package:dplyr':
src, summarize
The following objects are masked from 'package:base':
format.pval, units
# Subset the data where group is u12 (L)subset_data <- all_norm[all_norm$group =="U12s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Squeeze
t = -2.0647, df = 18, p-value = 0.05367
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.737329639 0.006119774
sample estimates:
cor
-0.437586
cor.test(subset_data$FPPA_l, subset_data$l_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Pull
t = -0.68953, df = 18, p-value = 0.4993
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5629748 0.3036582
sample estimates:
cor
-0.1604188
# Subset the data where group is u14s (L)subset_data <- all_norm[all_norm$group =="U14s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Squeeze
t = -1.4947, df = 21, p-value = 0.1499
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.6404349 0.1170725
sample estimates:
cor
-0.310094
cor.test(subset_data$FPPA_l, subset_data$l_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Pull
t = -0.76005, df = 21, p-value = 0.4557
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5394409 0.2665589
sample estimates:
cor
-0.1636214
# Subset the data where group is u16s (L)subset_data <- all_norm[all_norm$group =="U16s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Squeeze
t = -0.56629, df = 11, p-value = 0.5826
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.6582495 0.4217935
sample estimates:
cor
-0.1683066
cor.test(subset_data$FPPA_l, subset_data$l_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_l and subset_data$l_Pull
t = 0.56586, df = 11, p-value = 0.5829
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.4218991 0.6581767
sample estimates:
cor
0.1681817
# Subset the data where group is u12 (R)subset_data <- all_norm[all_norm$group =="U12s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Squeeze
t = 1.0701, df = 18, p-value = 0.2987
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.2219852 0.6199839
sample estimates:
cor
0.2445594
cor.test(subset_data$FPPA_r, subset_data$r_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Pull
t = 0.87508, df = 18, p-value = 0.3931
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.2641259 0.5916387
sample estimates:
cor
0.2020055
# Subset the data where group is u14 (R)subset_data <- all_norm[all_norm$group =="U14s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Squeeze
t = -1.8609, df = 21, p-value = 0.07681
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.68258816 0.04255266
sample estimates:
cor
-0.376249
cor.test(subset_data$FPPA_r, subset_data$r_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Pull
t = -0.6625, df = 21, p-value = 0.5149
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5243585 0.2859870
sample estimates:
cor
-0.1430824
# Subset the data where group is u16 (R)subset_data <- all_norm[all_norm$group =="U16s", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Squeeze
t = 0.91264, df = 11, p-value = 0.381
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.3345861 0.7121863
sample estimates:
cor
0.2653095
cor.test(subset_data$FPPA_r, subset_data$r_Pull)
Pearson's product-moment correlation
data: subset_data$FPPA_r and subset_data$r_Pull
t = -0.44468, df = 11, p-value = 0.6652
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.6372154 0.4511305
sample estimates:
cor
-0.1328858
#not used in studyresult_asym <-rcorr(as.matrix(all_asym[, c("right","left", "pull_asym", "squeeze_asym")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result_asym$r# Extract the p-value matrixp_value_matrix <- result_asym$P# Print the correlation and p-value matricesprint(correlation_matrix)
right left pull_asym squeeze_asym
right 1.00000000 0.47672487 0.1256906 -0.01831602
left 0.47672487 1.00000000 0.2101742 0.06027983
pull_asym 0.12569063 0.21017416 1.0000000 -0.11988398
squeeze_asym -0.01831602 0.06027983 -0.1198840 1.00000000
print(p_value_matrix)
right left pull_asym squeeze_asym
right NA 0.0002036826 0.3559885 0.8934150
left 0.0002036826 NA 0.1200061 0.6589810
pull_asym 0.3559884693 0.1200060612 NA 0.3788185
squeeze_asym 0.8934149522 0.6589809603 0.3788185 NA
#not used in studycor(averages[, c("FPPA_r", "r_Pull", "r_Squeeze")], method ="pearson")
result_normr <-rcorr(as.matrix(all_norm[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result_normr$r# Extract the p-value matrixp_value_matrix <- result_normr$P# Print the correlation and p-value matricesprint(correlation_matrix)
FPPA_r r_Pull r_Squeeze
FPPA_r NA 8.143049e-01 6.198082e-01
r_Pull 0.8143049 NA 4.430596e-05
r_Squeeze 0.6198082 4.430596e-05 NA
result_norml <-rcorr(as.matrix(all_norm[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result_norml$r# Extract the p-value matrixp_value_matrix <- result_norml$P# Print the correlation and p-value matricesprint(correlation_matrix)
FPPA_l l_Pull l_Squeeze
FPPA_l NA 0.533973801 0.031339221
l_Pull 0.53397380 NA 0.003228937
l_Squeeze 0.03133922 0.003228937 NA
#Not used in study# Subset the data where leg dominance is right (R)subset_data <- all_norm[all_norm$Leg_dominance =="right", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
FPPA_r r_Pull r_Squeeze
FPPA_r NA 0.739265654 0.704372269
r_Pull 0.7392657 NA 0.000154851
r_Squeeze 0.7043723 0.000154851 NA
# Not used in study# Subset the data where leg dominance is right (L)subset_data <- all_norm[all_norm$Leg_dominance =="right", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
FPPA_l l_Pull l_Squeeze
FPPA_l NA 0.3423488 0.0455115
l_Pull 0.3423488 NA 0.0105854
l_Squeeze 0.0455115 0.0105854 NA
# Not used in study# Subset the data where leg dominance is left (R)subset_data <- all_norm[all_norm$Leg_dominance =="left", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_r", "r_Pull", "r_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
FPPA_r r_Pull r_Squeeze
FPPA_r NA 0.3468777 0.9311722
r_Pull 0.3468777 NA 0.2086760
r_Squeeze 0.9311722 0.2086760 NA
# Not used in study# Subset the data where leg dominance is left (L)subset_data <- all_norm[all_norm$Leg_dominance =="left", ]# Calculate the correlation matrix and p-valuesresult <-rcorr(as.matrix(subset_data[, c("FPPA_l", "l_Pull", "l_Squeeze")]), type ="pearson")# Extract the correlation matrixcorrelation_matrix <- result$r# Extract the p-value matrixp_value_matrix <- result$P# Print the correlation and p-value matricesprint(correlation_matrix)
# Perform normality tests on 'Original' and 'Remeasure'shapiro.test(reliability$Original)
Shapiro-Wilk normality test
data: reliability$Original
W = 0.9589, p-value = 0.2903
shapiro.test(reliability$Remeasure)
Shapiro-Wilk normality test
data: reliability$Remeasure
W = 0.95704, p-value = 0.2598
# Calculate Pearson correlation between the two measures as a preliminary checkcor.test(reliability$Original, reliability$Remeasure, method ="pearson")
Pearson's product-moment correlation
data: reliability$Original and reliability$Remeasure
t = 31.034, df = 28, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.9699889 0.9932837
sample estimates:
cor
0.9857728
# Calculate ICC using the psych packageicc_result <-ICC(reliability)# Print all ICC results (this will give various ICC values, including ICC(3,1))print(icc_result)
Call: ICC(x = reliability)
Intraclass correlation coefficients
type ICC F df1 df2 p lower bound upper bound
Single_raters_absolute ICC1 0.99 133 29 30 1.1e-24 0.97 0.99
Single_random_raters ICC2 0.99 138 29 29 3.2e-24 0.97 0.99
Single_fixed_raters ICC3 0.99 138 29 29 3.2e-24 0.97 0.99
Average_raters_absolute ICC1k 0.99 133 29 30 1.1e-24 0.98 1.00
Average_random_raters ICC2k 0.99 138 29 29 3.2e-24 0.98 1.00
Average_fixed_raters ICC3k 0.99 138 29 29 3.2e-24 0.98 1.00
Number of subjects = 30 Number of Judges = 2
See the help file for a discussion of the other 4 McGraw and Wong estimates,
# Extract the ICC value for ICC(3,1) - single measures, absolute agreement# In the psych package's ICC function, ICC(3,1) is typically the 3rd rowicc_value <- icc_result$results[3, "ICC"]print(paste("ICC(3,1):", icc_value))
[1] "ICC(3,1): 0.985575138145207"
# Number of subjects (or pairs)n <-nrow(reliability)# Calculate Standard Error (SE) for ICC(3,1)SE_ICC <-sqrt((1- icc_value)^2/ (n -1))# Print the Standard Errorprint(paste("Standard Error (SE) of ICC(3,1):", SE_ICC))
[1] "Standard Error (SE) of ICC(3,1): 0.00267862960028312"