dissertation analysis

Test-Retest Reliability of Strength Testing on Youth Female Soccer Players Data Analysis Script

Matthew McCarthy (A0023711)

Loading Packages

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.4
✔ forcats   1.0.0     ✔ stringr   1.5.0
✔ ggplot2   3.4.4     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.0
✔ purrr     1.0.2     
── 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(readxl)
library(ggplot2)
library(dplyr)
library(gridExtra)

Attaching package: 'gridExtra'

The following object is masked from 'package:dplyr':

    combine
library(knitr)
library(rsconnect)
library(psych)
Warning: package 'psych' was built under R version 4.3.3

Attaching package: 'psych'

The following objects are masked from 'package:ggplot2':

    %+%, alpha
library(irr)
Loading required package: lpSolve

Reading In Data and Cleaning Names

setwd("~/Library/CloudStorage/OneDrive-TeessideUniversity/MSc strength and condtioning /dissertation /dissertation data")

IMTP <- read_excel("Dissertation data 2.xlsx", sheet = "IMTP")
HIP_ADD_ABD <- read_excel("Dissertation data 2.xlsx", sheet = "Hip-ADD-ABD")
CMJ <- read_excel("Dissertation data 2.xlsx", sheet = "CMJ")
New names:
• `` -> `...4`
ISO_30 <- read_excel("Dissertation data 2.xlsx", sheet = "ISO_30")

names<-names(IMTP%>%clean_names)
colnames(IMTP) <- names
head(IMTP)
# A tibble: 6 × 5
  name   t1_peak_vertical_force_…¹ t1_peak_vertical_for…² t2_peak_vertical_for…³
  <chr>                      <dbl>                  <dbl>                  <dbl>
1 ETC 01                      30.1                   1127                   26.0
2 ETC 05                      22.4                   1120                   19.6
3 ETC 14                      21.3                    827                   23.3
4 ETC 18                      31.9                   1682                   29.2
5 ETC 25                      26.8                    814                   26.5
6 ETC 26                      23.5                    966                   21.6
# ℹ abbreviated names: ¹​t1_peak_vertical_force_bm_n_kg,
#   ²​t1_peak_vertical_force_n, ³​t2_peak_vertical_force_bm_n_kg
# ℹ 1 more variable: t2_peak_vertical_force_n <dbl>
names<-names(HIP_ADD_ABD%>%clean_names)
colnames(HIP_ADD_ABD) <- names
head(HIP_ADD_ABD)
# A tibble: 6 × 20
  name   date_utc            test      position       t1_abd_l_max_force_n
  <chr>  <dttm>              <chr>     <chr>                         <dbl>
1 ETC 01 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 202.
2 ETC 05 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 218.
3 ETC 11 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 193.
4 ETC 14 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 154.
5 ETC 18 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 207.
6 ETC 25 2024-07-22 00:00:00 Hip AD/AB Hip AD/AB - 60                 153.
# ℹ 15 more variables: t1_abd_r_max_force_n <dbl>, t1_abd_l_avg_force_n <dbl>,
#   t1_abd_r_avg_force_n <dbl>, t1_add_l_max_force_n <dbl>,
#   t1_add_r_max_force_n <dbl>, t1_add_l_avg_force_n <dbl>,
#   t1_add_r_avg_force_n <dbl>, t2_abd_l_max_force_n <dbl>,
#   t2_abd_r_max_force_n <dbl>, t2_abd_l_avg_force_n <dbl>,
#   t2_abd_r_avg_force_n <dbl>, t2_add_l_max_force_n <dbl>,
#   t2_add_r_max_force_n <dbl>, t2_add_l_avg_force_n <dbl>, …
names<-names(CMJ%>%clean_names)
colnames(CMJ) <- names
head(CMJ)
# A tibble: 6 × 4
  name   t1_jump_height_cm t2_jump_height_cm    x4
  <chr>              <dbl>             <dbl> <dbl>
1 RTC 50              28                29.4  NA  
2 RTC 94              24.6              24    NA  
3 RTC 76              20.3              22.3  NA  
4 RTC 85              22.4              23    NA  
5 ETC 30              17.7              14.7  18.7
6 RTC 69              17                18.9  NA  
names<-names(ISO_30%>%clean_names)
colnames(ISO_30) <- names
head(ISO_30)
# A tibble: 6 × 9
  name   t1_l_max_force_n t1_r_max_force_n t1_l_avg_force_n t1_r_avg_force_n
  <chr>             <dbl>            <dbl>            <dbl>            <dbl>
1 ETC 01             217.             211              198.             199.
2 ETC 05             228.             236.             210.             223.
3 ETC 14             156.             193.             145.             170.
4 ETC 18             263              321              241.             290.
5 ETC 25             159              175.             151.             149.
6 ETC 26             123              114.             116.             104.
# ℹ 4 more variables: t2_l_max_force_n <dbl>, t2_r_max_force_n <dbl>,
#   t2_l_avg_force_n <dbl>, t2r_avg_force_n <dbl>

Shapiro Wilk Normality Test

IMTP Shapiro Wilk

IMTP_t1_shapiro_test_result <- shapiro.test(IMTP$t1_peak_vertical_force_bm_n_kg)
print(IMTP_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  IMTP$t1_peak_vertical_force_bm_n_kg
W = 0.9592, p-value = 0.3336
IMTP_t2_shapiro_test_result <- shapiro.test(IMTP$t2_peak_vertical_force_bm_n_kg)
print(IMTP_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  IMTP$t2_peak_vertical_force_bm_n_kg
W = 0.97651, p-value = 0.7601

CMJ Shapiro Wilk

CMJ_t1_shapiro_test_result <- shapiro.test(CMJ$t1_jump_height_cm)
print(CMJ_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  CMJ$t1_jump_height_cm
W = 0.98447, p-value = 0.9343
CMJ_t2_shapiro_test_result <- shapiro.test(CMJ$t2_jump_height_cm)
print(CMJ_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  CMJ$t2_jump_height_cm
W = 0.9789, p-value = 0.8095

Left Hip Abductor Shapiro Wilk

Hip_l_abd_t1_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t1_abd_l_max_force_n)
print(Hip_l_abd_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t1_abd_l_max_force_n
W = 0.96903, p-value = 0.5336
Hip_l_abd_t2_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t2_abd_l_max_force_n)
print(Hip_l_abd_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t2_abd_l_max_force_n
W = 0.95503, p-value = 0.2466

Right Hip Abductor Shapiro Wilk

Hip_r_abd_t1_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t1_abd_r_max_force_n)
print(Hip_r_abd_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t1_abd_r_max_force_n
W = 0.9578, p-value = 0.2898
Hip_r_abd_t2_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t2_abd_r_max_force_n)
print(Hip_r_abd_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t2_abd_r_max_force_n
W = 0.94027, p-value = 0.1019

Left Hip Adductor Shapiro Wilk

Hip_l_add_t1_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t1_add_l_max_force_n)
print(Hip_l_add_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t1_add_l_max_force_n
W = 0.98903, p-value = 0.987
Hip_l_add_t2_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t2_add_l_max_force_n)
print(Hip_l_add_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t2_add_l_max_force_n
W = 0.95683, p-value = 0.274

Right Hip Adductor Shapiro Wilk

Hip_r_add_t1_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t1_add_r_max_force_n)
print(Hip_r_add_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t1_add_r_max_force_n
W = 0.97399, p-value = 0.6717
Hip_r_add_t2_shapiro_test_result <- shapiro.test(HIP_ADD_ABD$t2_add_r_max_force_n)
print(Hip_r_add_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  HIP_ADD_ABD$t2_add_r_max_force_n
W = 0.94355, p-value = 0.1242

Left ISO 30

ISO_30_l_t1_shapiro_test_result <- shapiro.test(ISO_30$t1_l_max_force_n)
print(ISO_30_l_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  ISO_30$t1_l_max_force_n
W = 0.95461, p-value = 0.2767
ISO_30_l_t2_shapiro_test_result <- shapiro.test(ISO_30$t2_l_max_force_n)
print(ISO_30_l_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  ISO_30$t2_l_max_force_n
W = 0.95428, p-value = 0.2717

Right ISO 30

ISO_30_r_t1_shapiro_test_result <- shapiro.test(ISO_30$t1_r_max_force_n)
print(ISO_30_r_t1_shapiro_test_result)

    Shapiro-Wilk normality test

data:  ISO_30$t1_r_max_force_n
W = 0.97129, p-value = 0.6362
ISO_30_r_t2_shapiro_test_result <- shapiro.test(ISO_30$t2_r_max_force_n)
print(ISO_30_r_t2_shapiro_test_result)

    Shapiro-Wilk normality test

data:  ISO_30$t2_r_max_force_n
W = 0.91837, p-value = 0.03606

Bar Charts of Tests

ggplot(IMTP, aes(x = IMTP$name, y = IMTP$t1_peak_vertical_force_n)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Peak Vertical Force",
       x = "Name",
       y = "Peak Vertical Force (N)") +
  theme_classic()
Warning: Use of `IMTP$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `IMTP$t1_peak_vertical_force_n` is discouraged.
ℹ Use `t1_peak_vertical_force_n` instead.

ggplot(CMJ, aes(x = CMJ$name, y = CMJ$t1_jump_height_cm)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Jump Height",
       x = "Name",
       y = "Jump height (cm)") +
  theme_classic()
Warning: Use of `CMJ$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `CMJ$t1_jump_height_cm` is discouraged.
ℹ Use `t1_jump_height_cm` instead.

ggplot(HIP_ADD_ABD, aes(x = HIP_ADD_ABD$name, y = HIP_ADD_ABD$t1_abd_l_max_force_n)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Left Leg Max Force",
       x = "Name",
       y = "Max force(N)") +
  theme_classic()
Warning: Use of `HIP_ADD_ABD$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `HIP_ADD_ABD$t1_abd_l_max_force_n` is discouraged.
ℹ Use `t1_abd_l_max_force_n` instead.

ggplot(HIP_ADD_ABD, aes(x = HIP_ADD_ABD$name, y = HIP_ADD_ABD$t1_abd_r_max_force_n)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Right Leg Max Force",
       x = "Name",
       y = "Max force(N)") +
  theme_classic()
Warning: Use of `HIP_ADD_ABD$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `HIP_ADD_ABD$t1_abd_r_max_force_n` is discouraged.
ℹ Use `t1_abd_r_max_force_n` instead.

ggplot(ISO_30, aes(x = ISO_30$name, y = ISO_30$t1_l_max_force_n)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Left Leg Max Force",
       x = "Name",
       y = "Max force(N)") +
  theme_classic()
Warning: Use of `ISO_30$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `ISO_30$t1_l_max_force_n` is discouraged.
ℹ Use `t1_l_max_force_n` instead.

ggplot(ISO_30, aes(x = ISO_30$name, y = ISO_30$t1_r_max_force_n)) +
  geom_bar(stat = "identity") +
  theme_minimal() +
  labs(title = "Bar Chart of Right Leg Max Force",
       x = "Name",
       y = "Max force(N)") +
  theme_classic()
Warning: Use of `ISO_30$name` is discouraged.
ℹ Use `name` instead.
Warning: Use of `ISO_30$t1_r_max_force_n` is discouraged.
ℹ Use `t1_r_max_force_n` instead.

Pearson Correlation Coefficient

pearson_corr_IMTP <- cor(IMTP$t1_peak_vertical_force_bm_n_kg, IMTP$t2_peak_vertical_force_bm_n_kg, method = "pearson")
print(pearson_corr_IMTP)
[1] 0.706035
pearson_corr_CMJ <- cor(CMJ$t1_jump_height_cm, CMJ$t2_jump_height_cm, method = "pearson")
print(pearson_corr_CMJ)
[1] 0.7714102
pearson_corr_Hip_Abd_l <- cor(HIP_ADD_ABD$t1_abd_l_max_force_n, HIP_ADD_ABD$t2_abd_l_max_force_n, method = "pearson")
print(pearson_corr_Hip_Abd_l)
[1] 0.9085257
pearson_corr_Hip_Abd_r <- cor(HIP_ADD_ABD$t1_abd_r_max_force_n, HIP_ADD_ABD$t2_abd_r_max_force_n, method = "pearson")
print(pearson_corr_Hip_Abd_r)
[1] 0.9206193
pearson_corr_Hip_Add_l <- cor(HIP_ADD_ABD$t1_add_l_max_force_n, HIP_ADD_ABD$t2_add_l_max_force_n, method = "pearson")
print(pearson_corr_Hip_Add_l)
[1] 0.868996
pearson_corr_Hip_Add_r <- cor(HIP_ADD_ABD$t1_add_r_max_force_n, HIP_ADD_ABD$t2_add_r_max_force_n, method = "pearson")
print(pearson_corr_Hip_Add_r)
[1] 0.8596194
pearson_corr_ISO_30_l <- cor(ISO_30$t1_l_max_force_n, ISO_30$t2_l_max_force_n, method = "pearson")
print(pearson_corr_ISO_30_l)
[1] 0.8926829
pearson_corr_ISO_30_r <- cor(ISO_30$t1_r_max_force_n, ISO_30$t2_r_max_force_n, method = "pearson")
print(pearson_corr_ISO_30_r)
[1] 0.896301

Calculating ICC Values

df_IMTP <- data.frame(t1 = IMTP$t1_peak_vertical_force_bm_n_kg, 
                      t2 = IMTP$t2_peak_vertical_force_bm_n_kg)

# Calculate ICC(2,1)
icc_IMTP <- icc(df_IMTP, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_IMTP)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 28 
     Raters = 2 
   ICC(C,1) = 0.706

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(27,27) = 5.8 , p = 9.42e-06 

 95%-Confidence Interval for ICC Population Values:
  0.457 < ICC < 0.852
df_CMJ <- data.frame(t1 = CMJ$t1_jump_height_cm, 
                      t2 = CMJ$t2_jump_height_cm)

# Calculate ICC(2,1)
icc_CMJ <- icc(df_CMJ, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_CMJ)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 29 
     Raters = 2 
   ICC(C,1) = 0.77

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(28,28) = 7.71 , p = 3.18e-07 

 95%-Confidence Interval for ICC Population Values:
  0.567 < ICC < 0.885
df_Hip_abd_l <- data.frame(t1 = HIP_ADD_ABD$t1_abd_l_max_force_n, 
                      t2 = HIP_ADD_ABD$t2_abd_l_max_force_n)

# Calculate ICC(2,1)
icc_Hip_abd_l <- icc(df_Hip_abd_l, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_Hip_abd_l)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 29 
     Raters = 2 
   ICC(C,1) = 0.909

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(28,28) = 20.9 , p = 2e-12 

 95%-Confidence Interval for ICC Population Values:
  0.815 < ICC < 0.956
df_Hip_abd_r <- data.frame(t1 = HIP_ADD_ABD$t1_abd_r_max_force_n, 
                      t2 = HIP_ADD_ABD$t2_abd_r_max_force_n)

# Calculate ICC(2,1)
icc_Hip_abd_r <- icc(df_Hip_abd_r, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_Hip_abd_r)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 29 
     Raters = 2 
   ICC(C,1) = 0.918

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(28,28) = 23.3 , p = 4.74e-13 

 95%-Confidence Interval for ICC Population Values:
  0.833 < ICC < 0.961
df_Hip_add_l <- data.frame(t1 = HIP_ADD_ABD$t1_add_l_max_force_n, 
                      t2 = HIP_ADD_ABD$t2_add_l_max_force_n)

# Calculate ICC(2,1)
icc_Hip_add_l <- icc(df_Hip_add_l, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_Hip_add_l)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 29 
     Raters = 2 
   ICC(C,1) = 0.868

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(28,28) = 14.2 , p = 2.57e-10 

 95%-Confidence Interval for ICC Population Values:
  0.739 < ICC < 0.936
df_Hip_add_r <- data.frame(t1 = HIP_ADD_ABD$t1_add_r_max_force_n, 
                      t2 = HIP_ADD_ABD$t2_add_r_max_force_n)

# Calculate ICC(2,1)
icc_Hip_add_r <- icc(df_Hip_add_r, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_Hip_add_r)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 29 
     Raters = 2 
   ICC(C,1) = 0.86

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(28,28) = 13.2 , p = 5.92e-10 

 95%-Confidence Interval for ICC Population Values:
  0.723 < ICC < 0.931
df_ISO_30_l <- data.frame(t1 = ISO_30$t1_l_max_force_n, 
                      t2 = ISO_30$t2_l_max_force_n)


# Calculate ICC(2,1)
icc_ISO_30_l <- icc(df_ISO_30_l, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_ISO_30_l)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 27 
     Raters = 2 
   ICC(C,1) = 0.892

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(26,26) = 17.5 , p = 9.4e-11 

 95%-Confidence Interval for ICC Population Values:
  0.777 < ICC < 0.949
df_ISO_30_r <- data.frame(t1 = ISO_30$t1_r_max_force_n, 
                      t2 = ISO_30$t2_r_max_force_n)

# Calculate ICC(2,1)
icc_ISO_30_r <- icc(df_ISO_30_r, model = "twoway", type = "consistency", unit = "single")

# Print the ICC result
print(icc_ISO_30_r)
 Single Score Intraclass Correlation

   Model: twoway 
   Type : consistency 

   Subjects = 27 
     Raters = 2 
   ICC(C,1) = 0.896

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
   F(26,26) = 18.3 , p = 5.64e-11 

 95%-Confidence Interval for ICC Population Values:
  0.786 < ICC < 0.951

Calculate SEM and TE (with 95% CI)

# Calculate the standard deviation of the test scores
sd_test_IMTP <- sd(c(df_IMTP$t1, df_IMTP$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_IMTP <- icc_IMTP$value  # Extract the ICC value directly

# Calculate SEM
SEM_IMPT <- sd_test_IMTP * sqrt(1 - icc_value_IMTP)

# Print the SEM
print(SEM_IMPT)
[1] 1.893216
IMTP_TE <- sd_test_IMTP / sqrt(2)

print(IMTP_TE)
[1] 2.46861
# Calculate the Standard Error of TE
IMTP_SE_TE <- IMTP_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
IMTP_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
IMTP_CI_lower <- IMTP_TE - (IMTP_t_critical * IMTP_SE_TE)
IMTP_CI_upper <- IMTP_TE + (IMTP_t_critical * IMTP_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", IMTP_TE, "\n")
Typical Error (TE): 2.46861 
cat("95% Confidence Interval for TE: [", IMTP_CI_lower, ",", IMTP_CI_upper, "]\n")
95% Confidence Interval for TE: [ -19.71097 , 24.64819 ]
# Calculate the standard deviation of the test scores
sd_test_CMJ <- sd(c(df_CMJ$t1, df_CMJ$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_CMJ <- icc_CMJ$value  # Extract the ICC value directly

# Calculate SEM
SEM_CMJ <- sd_test_CMJ * sqrt(1 - icc_value_CMJ)

# Print the SEM
print(SEM_CMJ)
[1] 1.557489
CMJ_TE <- sd_test_CMJ / sqrt(2)

print(CMJ_TE)
[1] 2.298729
# Calculate the Standard Error of TE
CMJ_SE_TE <- CMJ_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
CMJ_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
CMJ_CI_lower <- CMJ_TE - (CMJ_t_critical * CMJ_SE_TE)
CMJ_CI_upper <- CMJ_TE + (CMJ_t_critical * CMJ_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", CMJ_TE, "\n")
Typical Error (TE): 2.298729 
cat("95% Confidence Interval for TE: [", CMJ_CI_lower, ",", CMJ_CI_upper, "]\n")
95% Confidence Interval for TE: [ -18.35453 , 22.95199 ]
# Calculate the standard deviation of the test scores
sd_test_Hip_Abd_l <- sd(c(df_Hip_abd_l$t1, df_Hip_abd_l$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_Hip_Abd_l <- icc_Hip_abd_l$value  # Extract the ICC value directly

# Calculate SEM
SEM_Hip_Abd_l <- sd_test_Hip_Abd_l * sqrt(1 - icc_value_Hip_Abd_l)

# Print the SEM
print(SEM_Hip_Abd_l)
[1] 15.47046
Hip_Abd_l_TE <- sd_test_Hip_Abd_l / sqrt(2)

print(Hip_Abd_l_TE)
[1] 36.1649
# Calculate the Standard Error of TE
Hip_Abd_l_SE_TE <- Hip_Abd_l_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
Hip_Abd_l_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
Hip_Abd_l_CI_lower <- Hip_Abd_l_TE - (Hip_Abd_l_t_critical * Hip_Abd_l_SE_TE)
Hip_Abd_l_CI_upper <- Hip_Abd_l_TE + (Hip_Abd_l_t_critical * Hip_Abd_l_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", Hip_Abd_l_TE, "\n")
Typical Error (TE): 36.1649 
cat("95% Confidence Interval for TE: [", Hip_Abd_l_CI_lower, ",", Hip_Abd_l_CI_upper, "]\n")
95% Confidence Interval for TE: [ -288.7639 , 361.0937 ]
# Calculate the standard deviation of the test scores
sd_test_Hip_Abd_r <- sd(c(df_Hip_abd_r$t1, df_Hip_abd_r$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_Hip_Abd_r <- icc_Hip_abd_r$value  # Extract the ICC value directly

# Calculate SEM
SEM_Hip_Abd_r <- sd_test_Hip_Abd_r * sqrt(1 - icc_value_Hip_Abd_r)

# Print the SEM
print(SEM_Hip_Abd_r)
[1] 15.98328
Hip_Abd_r_TE <- sd_test_Hip_Abd_r / sqrt(2)

print(Hip_Abd_r_TE)
[1] 39.41799
# Calculate the Standard Error of TE
Hip_Abd_r_SE_TE <- Hip_Abd_r_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
Hip_Abd_r_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
Hip_Abd_r_CI_lower <- Hip_Abd_r_TE - (Hip_Abd_r_t_critical * Hip_Abd_r_SE_TE)
Hip_Abd_r_CI_upper <- Hip_Abd_r_TE + (Hip_Abd_r_t_critical * Hip_Abd_r_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", Hip_Abd_r_TE, "\n")
Typical Error (TE): 39.41799 
cat("95% Confidence Interval for TE: [", Hip_Abd_r_CI_lower, ",", Hip_Abd_r_CI_upper, "]\n")
95% Confidence Interval for TE: [ -314.7386 , 393.5745 ]
# Calculate the standard deviation of the test scores
sd_test_Hip_Add_l <- sd(c(df_Hip_add_l$t1, df_Hip_add_l$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_Hip_Add_l <- icc_Hip_add_l$value  # Extract the ICC value directly

# Calculate SEM
SEM_Hip_Add_l <- sd_test_Hip_Add_l * sqrt(1 - icc_value_Hip_Add_l)

# Print the SEM
print(SEM_Hip_Add_l)
[1] 22.09023
Hip_Add_l_TE <- sd_test_Hip_Add_l / sqrt(2)

print(Hip_Add_l_TE)
[1] 43.02328
# Calculate the Standard Error of TE
Hip_Add_l_SE_TE <- Hip_Add_l_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
Hip_Add_l_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
Hip_Add_l_CI_lower <- Hip_Add_l_TE - (Hip_Add_l_t_critical * Hip_Add_l_SE_TE)
Hip_Add_l_CI_upper <- Hip_Add_l_TE + (Hip_Add_l_t_critical * Hip_Add_l_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", Hip_Add_l_TE, "\n")
Typical Error (TE): 43.02328 
cat("95% Confidence Interval for TE: [", Hip_Add_l_CI_lower, ",", Hip_Add_l_CI_upper, "]\n")
95% Confidence Interval for TE: [ -343.5255 , 429.5721 ]
# Calculate the standard deviation of the test scores
sd_test_Hip_Add_r <- sd(c(df_Hip_add_r$t1, df_Hip_add_r$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_Hip_Add_r <- icc_Hip_add_r$value  # Extract the ICC value directly

# Calculate SEM
SEM_Hip_Add_r <- sd_test_Hip_Add_r * sqrt(1 - icc_value_Hip_Add_r)

# Print the SEM
print(SEM_Hip_Add_r)
[1] 23.78432
Hip_Add_r_TE <- sd_test_Hip_Add_r / sqrt(2)

print(Hip_Add_r_TE)
[1] 44.87071
# Calculate the Standard Error of TE
Hip_Add_r_SE_TE <- Hip_Add_r_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
Hip_Add_r_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
Hip_Add_r_CI_lower <- Hip_Add_r_TE - (Hip_Add_r_t_critical * Hip_Add_r_SE_TE)
Hip_Add_r_CI_upper <- Hip_Add_r_TE + (Hip_Add_r_t_critical * Hip_Add_r_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", Hip_Add_r_TE, "\n")
Typical Error (TE): 44.87071 
cat("95% Confidence Interval for TE: [", Hip_Add_r_CI_lower, ",", Hip_Add_r_CI_upper, "]\n")
95% Confidence Interval for TE: [ -358.2767 , 448.0181 ]
# Calculate the standard deviation of the test scores
sd_test_ISO_30_l <- sd(c(df_ISO_30_l$t1, df_ISO_30_l$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_ISO_30_l <- icc_ISO_30_l$value  # Extract the ICC value directly

# Calculate SEM
SEM_ISO_30_l <- sd_test_ISO_30_l * sqrt(1 - icc_value_ISO_30_l)

# Print the SEM
print(SEM_ISO_30_l)
[1] 20.87541
ISO_30_l_TE <- sd_test_ISO_30_l / sqrt(2)

print(ISO_30_l_TE)
[1] 44.90122
# Calculate the Standard Error of TE
ISO_30_l_SE_TE <- ISO_30_l_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
ISO_30_l_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
ISO_30_l_CI_lower <- ISO_30_l_TE - (ISO_30_l_t_critical * ISO_30_l_SE_TE)
ISO_30_l_CI_upper <- ISO_30_l_TE + (ISO_30_l_t_critical * ISO_30_l_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", ISO_30_l_TE, "\n")
Typical Error (TE): 44.90122 
cat("95% Confidence Interval for TE: [", ISO_30_l_CI_lower, ",", ISO_30_l_CI_upper, "]\n")
95% Confidence Interval for TE: [ -358.5202 , 448.3227 ]
# Calculate the standard deviation of the test scores
sd_test_ISO_30_r <- sd(c(df_ISO_30_r$t1, df_ISO_30_r$t2))

# Extract the ICC value from the icc_IMTP object
icc_value_ISO_30_r <- icc_ISO_30_r$value  # Extract the ICC value directly

# Calculate SEM
SEM_ISO_30_r <- sd_test_ISO_30_r * sqrt(1 - icc_value_ISO_30_r)

# Print the SEM
print(SEM_ISO_30_r)
[1] 21.55332
ISO_30_r_TE <- sd_test_ISO_30_r / sqrt(2)

print(ISO_30_r_TE)
[1] 47.32731
# Calculate the Standard Error of TE
ISO_30_r_SE_TE <- ISO_30_r_TE / sqrt(2)

# Set the confidence level (e.g., 95% confidence level)
confidence_level <- 0.95  # Ensure this is a numeric value

# Calculate alpha (1 - confidence level)
alpha <- 1 - confidence_level

# Calculate the t-critical value (alpha/2 for two-tailed test, df = n - 1)
ISO_30_r_t_critical <- qt(p = 1 - (alpha / 2), df = 2 - 1)

# Calculate the confidence interval (lower and upper bounds)
ISO_30_r_CI_lower <- ISO_30_r_TE - (ISO_30_r_t_critical * ISO_30_r_SE_TE)
ISO_30_r_CI_upper <- ISO_30_r_TE + (ISO_30_r_t_critical * ISO_30_r_SE_TE)

# Print the confidence interval
cat("Typical Error (TE):", ISO_30_r_TE, "\n")
Typical Error (TE): 47.32731 
cat("95% Confidence Interval for TE: [", ISO_30_r_CI_lower, ",", ISO_30_r_CI_upper, "]\n")
95% Confidence Interval for TE: [ -377.8917 , 472.5463 ]

Calculating CV of Test Scores

# Calculate the mean of the test scores
mean_test_IMTP <- mean(c(df_IMTP$t1, df_IMTP$t2))
CV_IMTP <- (sd_test_IMTP / mean_test_IMTP) * 100
print(CV_IMTP)
[1] 13.08498
mean_test_CMJ <- mean(c(df_CMJ$t1, df_CMJ$t2))
CV_CMJ <- (sd_test_CMJ / mean_test_CMJ) * 100
print(CV_CMJ)
[1] 15.69696
mean_test_Hip_Abd_l <- mean(c(df_Hip_abd_l$t1, df_Hip_abd_l$t2))
CV_Hip_Abd_l <- (sd_test_Hip_Abd_l / mean_test_Hip_Abd_l) * 100
print(CV_Hip_Abd_l)
[1] 25.79706
mean_test_Hip_Abd_r <- mean(c(df_Hip_abd_r$t1, df_Hip_abd_r$t2))
CV_Hip_Abd_r <- (sd_test_Hip_Abd_r / mean_test_Hip_Abd_r) * 100
print(CV_Hip_Abd_r)
[1] 26.65597
mean_test_Hip_Add_l <- mean(c(df_Hip_add_l$t1, df_Hip_add_l$t2))
CV_Hip_Add_l <- (sd_test_Hip_Add_l / mean_test_Hip_Add_l) * 100
print(CV_Hip_Add_l)
[1] 25.66048
mean_test_Hip_Add_r <- mean(c(df_Hip_add_r$t1, df_Hip_add_r$t2))
CV_Hip_Add_r <- (sd_test_Hip_Add_r / mean_test_Hip_Add_r) * 100
print(CV_Hip_Add_r)
[1] 26.74145
mean_test_ISO_30_l <- mean(c(df_ISO_30_l$t1, df_ISO_30_l$t2))
CV_ISO_30_l <- (sd_test_ISO_30_l / mean_test_ISO_30_l) * 100
print(CV_ISO_30_l)
[1] 31.37305
mean_test_ISO_30_r <- mean(c(df_ISO_30_r$t1, df_ISO_30_r$t2))
CV_ISO_30_r <- (sd_test_ISO_30_r / mean_test_ISO_30_r) * 100
print(CV_ISO_30_r)
[1] 32.0976

T-Tests and Density plots

t.test(ISO_30$t1_l_max_force_n, ISO_30$t2_l_max_force_n)

    Welch Two Sample t-test

data:  ISO_30$t1_l_max_force_n and ISO_30$t2_l_max_force_n
t = 0.14491, df = 51.912, p-value = 0.8853
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -32.47829  37.53385
sample estimates:
mean of x mean of y 
 203.6667  201.1389 
ggplot(ISO_30, aes( x = t1_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(ISO_30, aes( x = t2_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(ISO_30$t1_r_max_force_n, ISO_30$t2_r_max_force_n)

    Welch Two Sample t-test

data:  ISO_30$t1_r_max_force_n and ISO_30$t2_r_max_force_n
t = 0.14352, df = 52, p-value = 0.8864
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -34.25727  39.53505
sample estimates:
mean of x mean of y 
 209.8426  207.2037 
ggplot(ISO_30, aes( x = t1_r_max_force_n)) +
  geom_density(adjust = 1L)+
  theme_classic()

ggplot(ISO_30, aes( x = t2_r_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(HIP_ADD_ABD$t1_add_r_max_force_n, HIP_ADD_ABD$t2_add_r_max_force_n)

    Welch Two Sample t-test

data:  HIP_ADD_ABD$t1_add_r_max_force_n and HIP_ADD_ABD$t2_add_r_max_force_n
t = 0.5341, df = 55.987, p-value = 0.5954
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -24.6377  42.5515
sample estimates:
mean of x mean of y 
 241.7759  232.8190 
ggplot(HIP_ADD_ABD, aes( x = t1_add_r_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(HIP_ADD_ABD, aes( x = t2_add_r_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(HIP_ADD_ABD$t1_add_l_max_force_n, HIP_ADD_ABD$t2_add_l_max_force_n)

    Welch Two Sample t-test

data:  HIP_ADD_ABD$t1_add_l_max_force_n and HIP_ADD_ABD$t2_add_l_max_force_n
t = -0.082359, df = 55.896, p-value = 0.9347
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -33.62016  30.96498
sample estimates:
mean of x mean of y 
 236.4483  237.7759 
ggplot(HIP_ADD_ABD, aes( x = t1_add_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(HIP_ADD_ABD, aes( x = t2_add_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(HIP_ADD_ABD$t1_abd_r_max_force_n, HIP_ADD_ABD$t2_abd_r_max_force_n)

    Welch Two Sample t-test

data:  HIP_ADD_ABD$t1_abd_r_max_force_n and HIP_ADD_ABD$t2_abd_r_max_force_n
t = 0.2067, df = 55.659, p-value = 0.837
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -26.52807  32.63152
sample estimates:
mean of x mean of y 
 210.6552  207.6034 
ggplot(HIP_ADD_ABD, aes( x = t1_abd_r_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(HIP_ADD_ABD, aes( x = t2_abd_r_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(HIP_ADD_ABD$t1_abd_l_max_force_n, HIP_ADD_ABD$t2_abd_l_max_force_n)

    Welch Two Sample t-test

data:  HIP_ADD_ABD$t1_abd_l_max_force_n and HIP_ADD_ABD$t2_abd_l_max_force_n
t = 0.19983, df = 55.997, p-value = 0.8423
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -24.42877  29.84256
sample estimates:
mean of x mean of y 
 199.6121  196.9052 
ggplot(HIP_ADD_ABD, aes( x = t1_abd_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(HIP_ADD_ABD, aes( x = t2_abd_l_max_force_n)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(IMTP$t1_peak_vertical_force_bm_n_kg, IMTP$t2_peak_vertical_force_bm_n_kg)

    Welch Two Sample t-test

data:  IMTP$t1_peak_vertical_force_bm_n_kg and IMTP$t2_peak_vertical_force_bm_n_kg
t = -0.30406, df = 53.982, p-value = 0.7623
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -2.172359  1.600217
sample estimates:
mean of x mean of y 
 26.53750  26.82357 
ggplot(IMTP, aes( x = t1_peak_vertical_force_bm_n_kg)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(IMTP, aes( x = t2_peak_vertical_force_bm_n_kg)) +
  geom_density(adjust = 1L) +
  theme_classic()

t.test(CMJ$t1_jump_height_cm, CMJ$t2_jump_height_cm)

    Welch Two Sample t-test

data:  CMJ$t1_jump_height_cm and CMJ$t2_jump_height_cm
t = 0.024021, df = 55.864, p-value = 0.9809
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -1.704817  1.746196
sample estimates:
mean of x mean of y 
 20.72069  20.70000 
ggplot(CMJ, aes( x = t1_jump_height_cm)) +
  geom_density(adjust = 1L) +
  theme_classic()

ggplot(CMJ, aes( x = t2_jump_height_cm)) +
  geom_density(adjust = 1L) +
  theme_classic()

Mean of Tests

mean(CMJ$t1_jump_height_cm)
[1] 20.72069
mean(CMJ$t2_jump_height_cm)
[1] 20.7
mean(IMTP$t1_peak_vertical_force_bm_n_kg)
[1] 26.5375
mean(IMTP$t2_peak_vertical_force_bm_n_kg)
[1] 26.82357
mean(HIP_ADD_ABD$t1_abd_l_max_force_n)
[1] 199.6121
mean(HIP_ADD_ABD$t2_abd_l_max_force_n)
[1] 196.9052
mean(HIP_ADD_ABD$t1_abd_r_max_force_n)
[1] 210.6552
mean(HIP_ADD_ABD$t2_abd_r_max_force_n)
[1] 207.6034
mean(HIP_ADD_ABD$t1_add_l_max_force_n)
[1] 236.4483
mean(HIP_ADD_ABD$t2_add_l_max_force_n)
[1] 237.7759
mean(HIP_ADD_ABD$t1_add_r_max_force_n)
[1] 241.7759
mean(HIP_ADD_ABD$t2_add_r_max_force_n)
[1] 232.819
mean(ISO_30$t1_l_max_force_n)
[1] 203.6667
mean(ISO_30$t2_l_max_force_n)
[1] 201.1389
mean(ISO_30$t1_r_max_force_n)
[1] 209.8426
mean(ISO_30$t2_r_max_force_n)
[1] 207.2037
CV_Results <- data_frame(CV_CMJ, CV_IMTP, CV_Hip_Abd_l, CV_Hip_Abd_r, CV_Hip_Add_l, CV_Hip_Add_r, CV_ISO_30_l, CV_ISO_30_r)
Warning: `data_frame()` was deprecated in tibble 1.1.0.
ℹ Please use `tibble()` instead.
CV_Results_long <- CV_Results %>%
  pivot_longer(cols = everything(),    # Transform all columns
               names_to = "Test",      # Name of the new column that will hold the test names
               values_to = "CV_Score") # Name of the new column that will hold the scores
# View the transformed data frame
print(CV_Results_long)
# A tibble: 8 × 2
  Test         CV_Score
  <chr>           <dbl>
1 CV_CMJ           15.7
2 CV_IMTP          13.1
3 CV_Hip_Abd_l     25.8
4 CV_Hip_Abd_r     26.7
5 CV_Hip_Add_l     25.7
6 CV_Hip_Add_r     26.7
7 CV_ISO_30_l      31.4
8 CV_ISO_30_r      32.1

Bar Chart of CV Scores

CV_values <- c(CV_IMTP, CV_CMJ, CV_Hip_Abd_l, CV_Hip_Abd_r, CV_Hip_Add_l, CV_Hip_Add_r, CV_ISO_30_l, CV_ISO_30_r)

# Create a vector of corresponding test names
test_names <- c("IMTP", "CMJ", "Hip_Abd_l", "Hip_Abd_r", "Hip_Add_l", "Hip_Add_r", "ISO_30_l", "ISO_30_r")

# Combine into a dataframe for easier plotting
cv_data <- data.frame(Test = test_names, CV = CV_values)

ggplot(cv_data, aes(x = Test, y = CV, fill = Test)) +
  geom_bar(stat = "identity", color = "black") +
  labs(title = "Bar Plot of Coefficient of Variation (CV)",
       x = "Test",
       y = "Coefficient of Variation (%)") +
  theme_classic() +
  theme(legend.position = "none")

Bland-Altman Plots

CMJ_t1 <- CMJ$t1_jump_height_cm
CMJ_t2 <- CMJ$t2_jump_height_cm

# Calculate means and differences
CMJ_mean_values <- (CMJ_t1 + CMJ_t2) / 2
CMJ_diff_values <- CMJ_t1 - CMJ_t2

# Calculate mean difference and limits of agreement
CMJ_mean_diff <- mean(CMJ_diff_values)
CMJ_sd_diff <- sd(CMJ_diff_values)
CMJ_upper_limit <- CMJ_mean_diff + 1.96 * CMJ_sd_diff
CMJ_lower_limit <- CMJ_mean_diff - 1.96 * CMJ_sd_diff

# Create Bland-Altman plot
ggplot(data = NULL, aes(x = CMJ_mean_values, y = CMJ_diff_values)) +
  geom_point() +
  geom_hline(yintercept = CMJ_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = CMJ_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = CMJ_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for Jump Height",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

IMTP_t1 <- IMTP$t1_peak_vertical_force_bm_n_kg
IMTP_t2 <- IMTP$t2_peak_vertical_force_bm_n_kg

IMTP_mean_values <- (IMTP_t1 + IMTP_t2) / 2
IMTP_diff_values <- IMTP_t1 - IMTP_t2

IMTP_mean_diff <- mean(IMTP_diff_values)
IMTP_sd_diff <- sd(IMTP_diff_values)
IMTP_upper_limit <- IMTP_mean_diff + 1.96 * IMTP_sd_diff
IMTP_lower_limit <- IMTP_mean_diff - 1.96 * IMTP_sd_diff

ggplot(data = NULL, aes(x = IMTP_mean_values, y = IMTP_diff_values)) +
  geom_point() +
  geom_hline(yintercept = IMTP_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = IMTP_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = IMTP_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for IMTP Peak Vertical Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

l_abd_t1 <- HIP_ADD_ABD$t1_abd_l_max_force_n
l_abd_t2 <- HIP_ADD_ABD$t2_abd_l_max_force_n

l_abd_mean_values <- (l_abd_t1 + l_abd_t2) / 2
l_abd_diff_values <- l_abd_t1 - l_abd_t2

l_abd_mean_diff <- mean(l_abd_diff_values)
l_abd_sd_diff <- sd(l_abd_diff_values)
l_abd_upper_limit <- l_abd_mean_diff + 1.96 * l_abd_sd_diff
l_abd_lower_limit <- l_abd_mean_diff - 1.96 * l_abd_sd_diff

ggplot(data = NULL, aes(x = l_abd_mean_values, y = l_abd_diff_values)) +
  geom_point() +
  geom_hline(yintercept = l_abd_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = l_abd_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = l_abd_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for Hip Abd L Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

r_abd_t1 <- HIP_ADD_ABD$t1_abd_r_max_force_n
r_abd_t2 <- HIP_ADD_ABD$t2_abd_r_max_force_n

r_abd_mean_values <- (r_abd_t1 + r_abd_t2) / 2
r_abd_diff_values <- r_abd_t1 - r_abd_t2

r_abd_mean_diff <- mean(r_abd_diff_values)
r_abd_sd_diff <- sd(r_abd_diff_values)
r_abd_upper_limit <- r_abd_mean_diff + 1.96 * r_abd_sd_diff
r_abd_lower_limit <- r_abd_mean_diff - 1.96 * r_abd_sd_diff

ggplot(data = NULL, aes(x = r_abd_mean_values, y = r_abd_diff_values)) +
  geom_point() +
  geom_hline(yintercept = r_abd_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = r_abd_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = r_abd_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for Hip Abd R Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

l_add_t1 <- HIP_ADD_ABD$t1_add_l_max_force_n
l_add_t2 <- HIP_ADD_ABD$t2_add_l_max_force_n

l_add_mean_values <- (l_add_t1 + l_add_t2) / 2
l_add_diff_values <- l_add_t1 - l_add_t2

l_add_mean_diff <- mean(l_add_diff_values)
l_add_sd_diff <- sd(l_add_diff_values)
l_add_upper_limit <- l_add_mean_diff + 1.96 * l_add_sd_diff
l_add_lower_limit <- l_add_mean_diff - 1.96 * l_add_sd_diff

ggplot(data = NULL, aes(x = l_add_mean_values, y = l_add_diff_values)) +
  geom_point() +
  geom_hline(yintercept = l_add_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = l_add_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = l_add_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for Hip Add L Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal()  +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

r_add_t1 <- HIP_ADD_ABD$t1_add_r_max_force_n
r_add_t2 <- HIP_ADD_ABD$t2_add_r_max_force_n

r_add_mean_values <- (r_add_t1 + r_add_t2) / 2
r_add_diff_values <- r_add_t1 - r_add_t2

r_add_mean_diff <- mean(r_add_diff_values)
r_add_sd_diff <- sd(r_add_diff_values)
r_add_upper_limit <- r_add_mean_diff + 1.96 * r_add_sd_diff
r_add_lower_limit <- r_add_mean_diff - 1.96 * r_add_sd_diff

ggplot(data = NULL, aes(x = r_add_mean_values, y = r_add_diff_values)) +
  geom_point() +
  geom_hline(yintercept = r_add_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = r_add_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = r_add_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for Hip Add R Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

l_iso_30_t1 <- ISO_30$t1_l_max_force_n
l_iso_30_t2 <- ISO_30$t2_l_max_force_n

l_iso_30_mean_values <- (l_iso_30_t1 + l_iso_30_t2) / 2
l_iso_30_diff_values <- l_iso_30_t1 - l_iso_30_t2

l_iso_30_mean_diff <- mean(l_iso_30_diff_values)
l_iso_30_sd_diff <- sd(l_iso_30_diff_values)
l_iso_30_upper_limit <- l_iso_30_mean_diff + 1.96 * l_iso_30_sd_diff
l_iso_30_lower_limit <- l_iso_30_mean_diff - 1.96 * l_iso_30_sd_diff

ggplot(data = NULL, aes(x = l_iso_30_mean_values, y = l_iso_30_diff_values)) +
  geom_point() +
  geom_hline(yintercept = l_iso_30_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = l_iso_30_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = l_iso_30_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for ISO 30 L Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )

r_iso_30_t1 <- ISO_30$t1_r_max_force_n
r_iso_30_t2 <- ISO_30$t2_r_max_force_n

r_iso_mean_values <- (r_iso_30_t1 + r_iso_30_t2) / 2
r_iso_diff_values <- r_iso_30_t1 - r_iso_30_t2

r_iso_mean_diff <- mean(r_iso_diff_values)
r_iso_sd_diff <- sd(r_iso_diff_values)
r_iso_upper_limit <- r_iso_mean_diff + 1.96 * r_iso_sd_diff
r_iso_lower_limit <- r_iso_mean_diff - 1.96 * r_iso_sd_diff

ggplot(data = NULL, aes(x = r_iso_mean_values, y = r_iso_diff_values)) +
  geom_point() +
  geom_hline(yintercept = r_iso_mean_diff, color = "blue", linetype = "dashed") +
  geom_hline(yintercept = r_iso_upper_limit, color = "red", linetype = "dashed") +
  geom_hline(yintercept = r_iso_lower_limit, color = "red", linetype = "dashed") +
  labs(title = "Bland-Altman Plot for ISO 30 R Max Force",
       x = "Average of t1 and t2",
       y = "Difference (t1 - t2)") +
  theme_minimal() +
  theme(
    axis.title = element_text(size = 14),  # Increase axis labels font size
    axis.text = element_text(size = 12)    # Increase tick marks font size
  )