Are assumptions met?
cor.test
function
Pearson's product-moment correlation
data: hypertrophy$VL_T1 and hypertrophy$SQUAT_VOLUME
t = 3.335, df = 27, p-value = 0.00249
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.2164913 0.7568216
sample estimates:
cor
0.5401395
lm
(\(\sqrt{R^2}\)) as the estimate from cor.test
R from lm
0.5401395
Correlation estimate from cor.test
0.5401395
When assumptions about normally distributed variables and outliers are questioned we may use a rank-based correlation.
Spearman’s or Kendall’s correlation coefficient are both alternatives to the Pearson correlation coefficient
Spearman’s \(\rho\) is simply the correlation coefficient calculated from ranked values
## Ranking is sensitive to missing values
dat <- hypertrophy %>%
select(VL_T1, SQUAT_VOLUME) %>%
filter(!is.na(VL_T1),
!is.na(SQUAT_VOLUME))
# The spearman method
with(dat,
cor.test(VL_T1,
SQUAT_VOLUME,
method = "spearman"))
# Pearson method on ranked data
with(dat,
cor.test(rank(VL_T1),
rank(SQUAT_VOLUME),
method = "pearson"))
Spearman's rank correlation rho
data: VL_T1 and SQUAT_VOLUME
S = 1609.8, p-value = 0.0005285
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.6035045
Pearson's product-moment correlation
data: rank(VL_T1) and rank(SQUAT_VOLUME)
t = 3.9329, df = 27, p-value = 0.0005285
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.3043080 0.7943169
sample estimates:
cor
0.6035045