#|output: false
library(dplyr)
library(ggplot2)
library(stringr)
library(lme4)
library(ggeffects)
data("sports_features_missing", package = "sportsfeatures")
df_sports <- sports_features_missing %>%
type.convert(as.is = TRUE)2026-11-30
R0 established the conceptual foundations of the sportsfeatures framework, introducing its simulation architecture, variance structure, missing-data mechanisms, and derived-variable ecosystem. The purpose of R1 is to explore whether these derived physiological variables can be used to predict aerobic demand and athlete rested-status within a multilevel sports performance environment.
Prediction forms the first stage of the analytical pathway and provides useful and interpretable signals once athlete-level variability and exercise modality are considered. R1 introduces a progression of predictive modelling approaches. The vignette begins with fixed-effects regression models that quantify physiological relationships, progresses to mixed-effects logistic regression that incorporates athlete-level heterogeneity, and concludes with decomposed multiple regression models that serve as interpretable benchmarks.
Modern sports data contain multiple interacting influences, including exercise modality, physiological status, accumulated workload, and athlete-specific baseline characteristics. Predictive models provide a mechanism for quantifying these relationships and evaluating how individual features contribute to observed performance outcomes. Within the sportsfeatures framework, prediction serves two purposes. First, it identifies variables that carry meaningful physiological information. Second, it establishes baselines against which more advanced explanatory, exploratory, and dimensional-reduction techniques can later be evaluated.
A single statistical model cannot fully capture the multiple dimensions of sports performance data. As stated above, physiological responses are influenced by various contributors and thus different modelling approaches are required to examine different components of the prediction problem. The models presented in R1 address distinct analytical questions while building upon insights obtained from the previous stage.
The Two-Slope Linear Model establishes whether aerobic demand changes systematically with pace, exercise modality, and rested status. This provides an interpretable fixed-effects framework for understanding the primary drivers of cardiorespiratory strain. The Mixed-Effects Logistic Regression Model extends the analysis by predicting athlete rested-status while accounting for subject-specific baseline differences. It separates population-level effects from individual athlete variability by incorporating random intercepts. The Decomposed Multiple Linear Regression Model evaluates whether the relationships identified in previous models remain consistent when physiological demand is represented through a fixed-effects regression framework and serves as an interpretable benchmark.
This model assesses the extent to which aerobic demand varies systematically with movement pace, rested status, exercise modality, session distance, fatigue, and athlete-specific baseline differences. The Two-Slope Linear Model provides an interpretable fixed-effects foundation for examining these relationships before the introduction of athlete-level random effects in Model 02. The model represents vo2_utilisation as a function of pace_min_km, rested status, exercise modality, centred session distance, fatigue per kilometre, and athlete-specific fixed effects. A pace-by-rested interaction is included to examine whether the association between pace and aerobic demand differs according to rested status.
vo2_utilisation (fraction of VO₂ max)pace_min_km, rested, activity_group, distance_centered, fatigue_per_km, and as.factor(athlete_id)pace_min_km × restedathlete_id included as a categorical fixed effectHypothesis: Aerobic demand (VO2 utilisation) is associated with movement pace, while rested status may influence either the baseline level of aerobic demand or the relationship between pace and aerobic demand.
Intent: The model evaluates how the association between movement pace and VO2 utilisation differs according to rested status while controlling for exercise modality, centred session distance, fatigue per kilometre, and athlete-specific baseline differences. The pace-by-rested interaction provides the formal test of whether the fitted pace gradient varies between rested-status groups.
For observation j from athlete i, aerobic demand can be represented as
Yij = β0 + β1Paceij + β2restedij + β3(Paceij × restedij) + β4TActivityij + β5Distanceij + β6Fatigueij + γTAthletei + εij,
where
εij ∼ N(0, σ2).
Here, β0 represents the reference-group intercept; β1 represents the pace association for the reference rested-status group; β2 represents the rested-group contrast at the reference value of pace; and β3 represents the pace-by-rested interaction. The remaining terms account for activity group, centred session distance, fatigue per kilometre, and athlete-specific fixed-effect contrasts. The residual term εij represents variation in aerobic demand not explained by the included predictors.
#|output: false
library(dplyr)
library(ggplot2)
library(stringr)
library(lme4)
library(ggeffects)
data("sports_features_missing", package = "sportsfeatures")
df_sports <- sports_features_missing %>%
type.convert(as.is = TRUE)df_sports2 <- df_sports %>%
mutate(
rested = case_when(
str_to_lower(str_trim(personal_status)) %in%
c("normal", "optimal") ~ 1L,
str_to_lower(str_trim(personal_status)) %in%
c("tired", "poor_sleep") ~ 0L,
TRUE ~ NA_integer_
),
activity_group = case_when(
str_detect(activity_type, regex("cycle|bike", ignore_case = TRUE)) ~ "Cycling",
str_detect(activity_type, regex("walk", ignore_case = TRUE)) ~ "Walking",
str_detect(activity_type, regex("hiking", ignore_case = TRUE)) ~ "Hiking",
str_detect(activity_type, regex("run|jog", ignore_case = TRUE)) ~ "Running",
TRUE ~ "Other"
),
weather_group = case_when(
str_detect(weather_type, regex("cloud", ignore_case = TRUE)) ~ "Cloudy",
str_detect(weather_type, regex("overcast", ignore_case = TRUE)) ~ "Overcast",
str_detect(weather_type, regex("rain|shower", ignore_case = TRUE)) ~ "Rain",
str_detect(weather_type, regex("sun|clear", ignore_case = TRUE)) ~ "Sunny",
TRUE ~ "Other"
),
personal_status = str_replace_all(
str_to_title(personal_status),
"_",
" "
),
rested_label = ifelse(
rested == 1,
"Rested",
"Not Rested"
),
activity_group = as.factor(activity_group)
)two_slope_lm <- glm(vo2_utilisation ~ pace_min_km * rested + activity_group + distance_centered,
data = df_sports2,
na.action = na.omit)two_slope_lm <- glm(
vo2_utilisation ~ pace_min_km * rested + activity_group + distance_centered + fatigue_per_km + as.factor(athlete_id),data = df_sports2,na.action = na.omit)
summary(two_slope_lm)| Parameter | Estimate (β) | Std. Error | t-value | p-value | Significance |
|---|---|---|---|---|---|
| (Intercept) | +0.7424 | 0.0447 | +16.624 | < 2 × 10−16 | *** |
| pace_min_km | −0.0270 | 0.0076 | −3.578 | 0.000390 | *** |
| rested | +0.0140 | 0.0314 | +0.445 | 0.656233 | NS |
| activity_groupHiking | −0.0018 | 0.0062 | −0.291 | 0.771543 | NS |
| activity_groupRunning | +0.0677 | 0.0050 | +13.426 | < 2 × 10−16 | *** |
| activity_groupWalking | −0.0262 | 0.0055 | −4.774 | 2.56 × 10−6 | *** |
| distance_centered | +0.0029 | 0.0008 | +3.431 | 0.000667 | *** |
| fatigue_per_km | +0.0016 | 0.0010 | +1.534 | 0.125953 | NS |
| pace_min_km : rested | −0.0025 | 0.0060 | −0.416 | 0.677975 | NS |
Note
Individual fixed effects for
athlete_idaccount for between-athlete differences in fitted baseline VO2 utilisation. For example, Athlete 1006 has β = +0.0520 (p < 0.001), while Athlete 1008 has β = +0.1582 (p < 0.001).
| Statistic | Value | Interpretation |
|---|---|---|
| Intercept (β0) | 0.7424 (p < 0.001) | Expected VO2 utilisation for the reference categories when the continuous predictors are at their zero/reference values. The intercept is a model reference value rather than a physiologically realistic zero-pace condition. |
| Pace slope (βpace) | −0.0270 (p < 0.001) | Within the reference rested-status group, a 1 min/km increase in pace_min_km is associated with a 0.0270 decrease in VO2 utilisation, holding the remaining model terms constant. |
| Rested status (βrested) | +0.0140 (p = 0.656) | Estimated contrast between rested and not-rested observations when pace_min_km = 0; this coefficient is not statistically significant. |
| Pace × rested interaction (βpace : rested) | −0.0025 (p = 0.678) | Estimates the difference in the pace gradient between rested and not-rested observations. There is little evidence of a difference in the pace slope within this specification. |
| Centred distance (βdistance) | +0.0029 (p < 0.001) | A 1-unit increase in distance_centered is associated with a 0.0029 increase in VO2 utilisation, holding the remaining model terms constant. |
| Deviance explained | 76.7% | The reduction from null deviance (2.2977) to residual deviance (0.5357) corresponds to approximately 76.7% deviance explained by the fitted model. |
p_two_slope <- ggplot(
df_sports2,
aes(
x = pace_min_km,
y = vo2_utilisation,
color = rested_label
)
) +
geom_point(alpha = 0.4, size = 1.8) +
geom_smooth(method = "lm", se = TRUE) +
facet_wrap(~ activity_group, scales = "free_x") +
scale_color_manual(
values = c(
"Not Rested" = "#d95f02",
"Rested" = "#1b9e77"
)
) +
theme_minimal() +
labs(
title = "Two-Slope Linear Model: VO2 Utilisation vs Pace by Rested Status and Activity",
x = "Pace (min/km)",
y = "VO2 Utilisation (Fraction)",
color = "Rested Status"
)
print(p_two_slope)Pace and aerobic demand: pace_min_km is negatively associated with VO₂ utilisation (β = −0.0270, p < 0.001). For the reference rested-status group, a 1 min/km increase in pace (i.e., slower movement) is associated with a 0.0270 decrease in fitted VO₂ utilisation, holding the remaining model terms constant.
Rested status and the pace gradient: The main contrast for rested is small and not statistically significant (β = +0.0140, p = 0.656). The interaction between pace_min_km and rested is also small and non-significant (β = −0.0025, p = 0.678), providing little evidence that the association between pace and VO₂ utilisation differs between rested and not-rested observations in this model.
Exercise modality: Relative to the reference activity group, Running is associated with higher fitted VO₂ utilisation (β = +0.0677, p < 0.001), whereas Walking is associated with lower fitted VO₂ utilisation (β = −0.0262, p < 0.001). The Hiking contrast is small and not statistically significant (β = −0.0018, p = 0.772).
Centred session distance: distance_centered is positively associated with VO₂ utilisation (β = +0.0029, p < 0.001). A one-unit increase in centred distance is associated with a 0.0029 increase in fitted VO₂ utilisation, conditional on the remaining model terms.
Fatigue per kilometre: fatigue_per_km has a small positive coefficient (β = +0.0016), but the association is not statistically significant (p = 0.126) after accounting for pace, rested status, activity group, centred distance, and athlete fixed effects.
Athlete-specific differences: The athlete fixed effects capture between-athlete differences in fitted baseline VO₂ utilisation relative to the reference athlete. Several athlete coefficients differ appreciably from the reference, supporting the inclusion of athlete-specific controls when modelling pooled physiological observations.
Overall interpretation: Model 01 provides evidence that pace, exercise modality, centred distance, and athlete-specific baseline differences are associated with VO₂ utilisation. In contrast, this specification provides little evidence for either an independent rested-status effect or a modification of the pace–VO₂ relationship by rested status.
The following visual summary brings together the principal numerical results from Model 01, including the pace association, selected activity and distance contrasts, overall model fit, and the pace-by-rested-status interaction. It provides a concise reference to the estimates given above in Tables 1.1 and 1.2.
Figure 1.2. Key parameter estimates and model-fit statistics from the Two-Slope Linear Model.
Model 01 established an interpretable fixed-effects framework for examining variation in aerobic demand while accounting for pace, rested status, exercise modality, session characteristics, and athlete-specific differences. The athlete fixed effects capture systematic differences in fitted baseline VO₂ utilisation between individual athletes relative to the reference athlete. Model 02 tests the probability of being in the rested state. Since repeated observations are nested within athletes, the model introduces an athlete-specific random intercept, allowing baseline log-odds of rested status to vary between individuals. The transition from Model 01 to Model 02 represents a change in how athlete-level differences are modelled: Model 01 represents athletes through categorical fixed effects, whereas Model 02 treats between-athlete baseline variation through a random-intercept structure.
Model 02 focuses on the probability of an athlete being classified as rested. Since repeated observations are nested within athletes, a standard logistic regression may not adequately represent athlete-level differences in baseline status. The Mixed-Effects Logistic Regression Model addresses this hierarchical structure by combining population-level fixed effects with an athlete-specific random intercept. The model estimates the probability of rested = 1 as a function of aerobic demand, pace, fatigue, and exercise modality, while allowing baseline log-odds of being rested to vary across athletes. Model 02 represents between-athlete baseline variation through a random-intercept structure.
rested (1 = Rested; 0 = Not Rested)vo2_utilisation, pace_min_km, fatigue_per_km, and activity_group(1 | athlete_id) (athlete-specific random intercept)maxfun = 2e5)Hypothesis: The probability that an observation is classified as rested, P(restedij = 1), is associated with physiological and activity-related characteristics, while baseline resting status may also vary between athletes.
Intent: The model evaluates whether vo2_utilisation, pace_min_km, fatigue_per_km, and activity_group are associated with the log-odds of being rested while accounting for repeated observations within individual athletes. Population-level associations are represented through fixed effects, while an athlete-specific random intercept allows baseline log-odds of being rested to vary between athletes.
This set-up separates the estimated population-level associations of the session-level predictors from between-athlete heterogeneity in baseline rested status.
For observation j from athlete i, define
$$ Y_{ij} = \begin{cases} 1, & \text{if the observation is classified as rested},\\ 0, & \text{if the observation is classified as not rested}. \end{cases} $$
Let
πij = P(Yij = 1).
The mixed-effects logistic regression model is then
$$ \operatorname{logit}(\pi_{ij}) = \log\left(\frac{\pi_{ij}}{1-\pi_{ij}}\right) = \beta_0 + \beta_1 \text{VO2}_{ij} + \beta_2 \text{Pace}_{ij} + \beta_3 \text{Fatigue}_{ij} + \boldsymbol{\beta}_4^{\mathsf T} \text{Activity}_{ij} + u_{0i}, $$
where
u0i ∼ 𝒩(0, σu2).
Here, β0 represents the population-level intercept; β1, β2, and β3 represent the fixed effects associated with VO₂ utilisation, pace, and fatigue per kilometre; β4 represents the activity-group contrasts; and u0i represents the athlete-specific random intercept.
The random intercept allows the baseline log-odds of being rested to vary across athletes while the fixed-effect slopes are shared across athletes.
model_mixed_logit <- glmer(
rested ~ vo2_utilisation + pace_min_km + fatigue_per_km + activity_group + (1 | athlete_id),
data = df_sports2,
family = binomial(link = "logit"),
control = glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 2e5))
)
# Model Summary Output
summary(model_mixed_logit)cat("\n--- Stable Odds Ratios (Exponentiated Fixed Effects) ---\n")
se <- sqrt(diag(vcov(model_mixed_logit)))
tab <- cbind(
OR = exp(fixef(model_mixed_logit)),
LL = exp(fixef(model_mixed_logit) - 1.96 * se),
UL = exp(fixef(model_mixed_logit) + 1.96 * se)
)
print(round(tab, 4))df_diag <- df_sports2 %>%
mutate(
vo2_c = vo2_utilisation - mean(vo2_utilisation, na.rm = TRUE),
pace_c = pace_min_km - mean(pace_min_km, na.rm = TRUE),
fatigue_c = fatigue_per_km - mean(fatigue_per_km, na.rm = TRUE)
)model_mixed_logit_c <- glmer(
rested ~ vo2_c +
pace_c +
fatigue_c +
activity_group +
(1 | athlete_id),
data = df_diag,
family = binomial(link = "logit"),
control = glmerControl(
optimizer = "bobyqa",
optCtrl = list(maxfun = 2e5)
)
)
summary(model_mixed_logit_c)cat("\n--- Stable Odds Ratios (Exponentiated Fixed Effects For Centred Model) ---\n")
se <- sqrt(diag(vcov(model_mixed_logit_c)))
tab_c <- cbind(
OR = exp(fixef(model_mixed_logit_c)),
LL = exp(fixef(model_mixed_logit_c) - 1.96 * se),
UL = exp(fixef(model_mixed_logit_c) + 1.96 * se)
)
# print(round(tab_c, 4))fixef(model_mixed_logit)
fixef(model_mixed_logit_c)
AIC(model_mixed_logit, model_mixed_logit_c)
logLik(model_mixed_logit)
logLik(model_mixed_logit_c)
VarCorr(model_mixed_logit)
VarCorr(model_mixed_logit_c)Explanation
A series of diagnostic checks was conducted to investigate the large intercept, the extreme odds ratio associated with
pace_min_km, and the athlete-level random-intercept variance.First, every athlete contributed both rested and not-rested observations. No athlete exhibited complete outcome separation, and no single athlete appeared to determine the overall distribution of rested status.
Second, the pace distributions for rested and not-rested observations showed substantial overlap. Although not-rested observations tended to have somewhat higher
pace_min_kmvalues, no univariate pace threshold cleanly separated the two outcome groups.Third, correlations among
vo2_utilisation,pace_min_km, andfatigue_per_kmwere modest, providing little evidence that strong collinearity among the continuous predictors explains the coefficient magnitudes. Group-activity status was also similarly distributed across the outcome classes: 68.2% of non-group observations and 69.1% of group observations were classified as rested.Mean-centring the continuous predictors reduced the intercept from approximately 44.08 to 0.46 while leaving the predictor slopes, activity-group coefficients, AIC, log-likelihood, and athlete random-intercept variance essentially unchanged. The extreme uncentred intercept primarily reflects an extrapolated reference condition in which continuous predictors are evaluated at zero values outside or far from their observed ranges. It does not, by itself, indicate model failure.
The pace coefficient required separate consideration. Its estimated value was approximately −0.96 in a pace-only logistic model, −1.22 after adjustment for VO₂ utilisation and fatigue, and −1.21 after additional adjustment for activity group. The coefficient increased substantially in magnitude to approximately −7.82 only after the athlete random intercept was introduced.
Taken together, the diagnostics provide little evidence of simple complete separation by athlete, pace, or group-activity status. They indicate instead that the large conditional pace coefficient is closely associated with the athlete-level random-intercept structure. The coefficient is interpreted cautiously as an athlete-conditioned association within this GLMM, rather than as a general marginal effect of pace across the pooled sample.
| Parameter | Odds Ratio (OR) | 2.5% Lower CI | 97.5% Upper CI | Interpretation |
|---|---|---|---|---|
| (Intercept) | 1.5826 | 0.0547 | 45.7784 | Reference odds of being rested for the reference activity group when the centred continuous predictors are at their mean values and the athlete random effect is zero. |
| vo2_c | 0.0300 | < 0.0001 | 189.7927 | The estimated association is highly uncertain and not statistically significant after adjustment for the remaining fixed effects and athlete-level random intercept. |
| pace_c | 0.0004 | 0.0001 | 0.0021 | Within the athlete-conditioned GLMM, higher centred pace (greater min/km) is associated with substantially lower conditional odds of being rested. The magnitude of this estimate depends strongly on the athlete random-intercept structure and should not be interpreted as a pooled marginal pace effect. |
| fatigue_c | 0.9723 | 0.8731 | 1.0826 | The estimated fatigue association is small and its confidence interval includes 1, providing little evidence of an independent association with rested status in this specification. |
| activity_groupHiking | 1.3175 | 0.4119 | 4.2141 | Estimated contrast between Hiking and the reference activity group; the confidence interval includes 1. |
| activity_groupRunning | 0.7408 | 0.2519 | 2.1792 | Estimated contrast between Running and the reference activity group; the confidence interval includes 1. |
| activity_groupWalking | 0.6291 | 0.2238 | 1.7689 | Estimated contrast between Walking and the reference activity group; the confidence interval includes 1. |
Note
The continuous predictors were mean-centred before fitting the reporting model. Centring changes the reference point of the intercept but leaves the substantive predictor slopes, activity-group contrasts, model fit, and athlete random-effect variance essentially unchanged. The lower confidence limit for
vo2_cis reported as< 0.0001rather than0.0000, because the latter results from numerical rounding rather than a true zero estimate.
| Statistic | Value | Interpretation |
|---|---|---|
| Centred intercept (β0) | 0.4591 (p = 0.789) | Population-level reference log-odds of being rested for the reference activity group when the centred continuous predictors are at their observed means and the athlete random effect is zero. The intercept is not statistically significant. |
| Pace coefficient (βpace) | −7.8165 (p < 0.001) | Strong negative conditional association between centred pace_min_km and the log-odds of being rested. Diagnostic comparisons showed that the coefficient becomes substantially larger after introducing the athlete random intercept, so its magnitude should be interpreted as athlete-conditioned rather than as a pooled marginal pace effect. |
| Pace odds ratio (ORpace) | 0.0004 (95% CI: 0.0001–0.0021) | Conditional odds ratio associated with a 1 min/km increase in centred pace within the fitted GLMM. The very small OR reflects the large conditional pace coefficient and should be interpreted together with the athlete-level model structure. |
| Aerobic-demand coefficient (βVO2) | −3.5076 (p = 0.432) | The VO₂-utilisation association is not statistically significant after adjustment for pace, fatigue, activity group, and athlete-level random effects. |
| Aerobic-demand odds ratio (ORVO2) | 0.0300 (95% CI: <0.0001–189.7927) | The extremely wide confidence interval indicates substantial uncertainty in the estimated VO₂ association. |
| Fatigue odds ratio (ORfatigue) | 0.9723 (95% CI: 0.8731–1.0826) | The estimated association between fatigue per kilometre and rested status is small, with the confidence interval spanning 1. |
| Athlete random-intercept variance (σu2) | 25.22 | Indicates substantial between-athlete variation in baseline log-odds of being rested after accounting for the fixed effects. |
| Athlete random-intercept SD (σu) | 5.022 | Corresponding standard deviation of the athlete-specific random intercepts. |
| Observations / athletes | 403 / 9 | Model fitted to 403 observations nested within 9 athletes. |
| AIC | 292.4 | Information criterion for the fitted centred GLMM; centring leaves model fit unchanged relative to the equivalent uncentred parameterisation. |
| log-likelihood | −138.2 | Maximised log-likelihood of the fitted model; unchanged by mean-centring of the continuous predictors. |
The centred specification is used for interpretation because it provides a meaningful reference condition for the model intercept without changing the fitted relationships. Diagnostic checks found no evidence of simple complete outcome separation by athlete, pace, or group-activity status, and correlations among the continuous predictors were modest. Mean-centring reduced the intercept from approximately 44.08 to 0.46 while leaving the slopes, model fit, and athlete random-effect variance essentially unchanged.
The large negative pace coefficient remained after centring. Progressive logistic-model comparisons showed that its magnitude increased sharply only after the athlete random intercept was introduced. The pace estimate is interpreted as a conditional, athlete-adjusted association within this GLMM rather than as a general pooled effect of pace.
# Mean VO2 utilisation used to centre the reporting model
mean_vo2 <- mean(df_sports2$vo2_utilisation, na.rm = TRUE)
# Generate predictions from the centred GLMM
pred_spaghetti <- ggpredict(
model_mixed_logit_c,
terms = c("vo2_c [all]", "activity_group", "athlete_id"),
type = "random"
)
# Convert centred VO2 values back to the original VO2-utilisation scale
pred_spaghetti$vo2_original <- pred_spaghetti$x + mean_vo2
p_spaghetti <- ggplot(
pred_spaghetti,
aes(
x = vo2_original,
y = predicted,
colour = group
)
) +
geom_line(
aes(group = interaction(group, facet)),
alpha = 0.25,
linewidth = 0.6
) +
stat_summary(
fun = mean,
geom = "line",
aes(group = group),
linewidth = 1.4
) +
scale_color_brewer(palette = "Set1") +
theme_minimal() +
labs(
title = "GLMM: Athlete-Specific Rested-Status Probability Curves",
subtitle = "Thin lines = athlete-specific random-intercept curves | Thick lines = average fitted pattern",
x = "VO2 Utilisation (Fraction)",
y = "Model-based P(rested = 1)",
colour = "Activity Group"
)
print(p_spaghetti)Figure 2.1 illustrates two components of the centred mixed-effects logistic regression model: the fitted population-level pattern associated with the fixed effects and athlete-specific shifts associated with the random intercept.
Population-level pattern: The thicker activity-group curves summarise the average fitted probability pattern across athletes over the displayed range of VO₂ utilisation. A modest negative visual gradient is apparent, but the corresponding fixed effect for centred VO₂ utilisation is not statistically significant (β = −3.5076, p = 0.432). Its odds ratio is 0.0300, with a very wide 95% confidence interval ( < 0.0001 to 189.7927). The visual gradient should not be interpreted as strong evidence of an independent association between VO₂ utilisation and rested status.
Athlete-specific variation: The thinner curves show how the fitted probabilities shift when athlete-specific random intercepts are included. Their vertical separation reflects between-athlete heterogeneity in the baseline log-odds of being rested after accounting for the fixed effects.
The estimated athlete random-intercept variance is σu2 = 25.22 (SD = 5.022), indicating substantial between-athlete variation in the fitted baseline log-odds of rested status. The GLMM captures this heterogeneity statistically but does not identify its underlying physiological or behavioural causes. These differences should not be attributed specifically to fitness, recovery capacity, training history, or other unmeasured athlete characteristics.
Pace and rested status: Centred pace_min_km shows a strong negative conditional association with the log-odds of being rested (β = −7.8165, p < 0.001; OR = 0.0004, 95% CI: 0.0001–0.0021). Because larger values of pace_min_km represent slower movement, a 1 min/km increase is associated with lower conditional odds of being rested within the fitted athlete random-intercept GLMM. Diagnostic comparisons showed that the magnitude of this coefficient increased substantially when the athlete random intercept was introduced. The coefficient is thus interpreted as an athlete-conditioned association rather than as a pooled marginal effect of pace.
Aerobic demand: Centred VO₂ utilisation has a negative point estimate (β = −3.5076; OR = 0.0300), but the association is not statistically significant (p = 0.432) and its confidence interval is extremely wide ( < 0.0001–189.7927). The estimate is highly uncertain and must be interpreted with caution rather than as evidence of an independent VO₂ effect on rested status.
Fatigue per kilometre: Centred fatigue_per_km has an odds ratio of 0.9723 (95% CI: 0.8731–1.0826). The estimate is small and its confidence interval includes 1, providing little evidence of an independent association with rested status in this specification.
Exercise modality: The Hiking (OR = 1.3175), Running (OR = 0.7408), and Walking (OR = 0.6291) contrasts all have confidence intervals that include 1. The activity-group estimates do not provide clear evidence of independent modality differences in the conditional odds of being rested.
Athlete-level heterogeneity: The athlete random-intercept variance is 25.22 (SD = 5.022), indicating substantial between-athlete variation in fitted baseline log-odds of rested status after adjustment for the fixed effects.
Model interpretation: Model 02 separates fixed-effect associations from athlete-level variation in baseline rested status. The centred specification provides a more meaningful intercept while leaving the model slopes, fit statistics, and random-effect variance essentially unchanged. Pace provides the strongest fixed-effect signal in the fitted GLMM, but its magnitude is closely associated with the athlete-level random-intercept structure and should be interpreted with caution.
The following visual summary brings together the principal results from the centred mixed-effects logistic regression, including the conditional pace association, selected odds ratios, athlete-level random-intercept variation, and overall model specification. The visual card provides a concise reference to the fitted GLMM, as given in Tables 2.1 and 2.2.
Figure 2.2. Key fixed-effect and athlete-level variance statistics from the centred mixed-effects logistic regression model.
Model 02 examined rested status as a binary outcome while allowing baseline log-odds to vary between athletes through an athlete-specific random intercept. The centred GLMM separated population-level fixed-effect associations from substantial between-athlete variation in baseline rested status. Within this specification, centred pace provided the clearest fixed-effect signal. Diagnostic analysis showed, however, that the magnitude of the conditional pace coefficient increased substantially after the athlete random intercept was introduced. The pace estimate is interpreted as an athlete-conditioned association rather than as a general pooled effect. The remaining fixed-effect estimates, including VO₂ utilisation, fatigue per kilometre, and activity-group contrasts, showed considerably greater uncertainty. Model 03 uses continuous VO₂ utilisation as the outcome. It includes athlete identity through categorical fixed effects within an ordinary least-squares regression. Model 03 serves as a transparent additive benchmark for assessing aerobic demand.
Model 03 provides an interpretable additive fixed-effects benchmark using vo2_utilisation as an outcome through ordinary least-squares regression. The model represents aerobic demand as a function of pace, rested status, centred session distance, exercise modality, and athlete-specific fixed effects. It includes athlete_id as a categorical predictor to represent systematic baseline differences between athletes within a multiple-regression framework. The focus here is on assessing whether aerobic-demand associations identified earlier remain evident after adjusting for exercise modality and athlete-specific baseline differences.
stats::lm)vo2_utilisation (fraction of VO₂ max)pace_min_km, rested, distance_centered, activity_group, and athlete_idathlete_id represented as a categorical fixed effectHypothesis: Aerobic demand (VO2 utilisation) is associated with movement pace, rested status, centred session distance, exercise modality, and athlete-specific baseline differences. Intent: Model 03 provides an interpretable additive fixed-effects benchmark for quantifying associations between these predictors and aerobic demand. Athlete identity is represented through categorical fixed effects, allowing systematic between-athlete baseline differences to be controlled while estimating the associations of pace, rested status, centred distance, and exercise modality with VO₂ utilisation.
For observation j from athlete i, let
Yij = VO2 utilisationij.
The additive fixed-effects model is
$$ Y_{ij} = \beta_0 +\beta_1\text{Pace}_{ij} +\beta_2\text{Rested}_{ij} +\beta_3\overline{\text{Distance}}_{ij} +\boldsymbol{\beta}_4^{\mathsf T}\text{Activity}_{ij} +\boldsymbol{\gamma}^{\mathsf T}\text{Athlete}_{i} +\varepsilon_{ij}, $$
where
εij ∼ 𝒩(0, σ2).
Here, β0 represents the intercept for the reference activity group and reference athlete when the continuous predictors equal zero; β1 represents the conditional association between movement pace and VO₂ utilisation; β2 represents the adjusted contrast between rested and not-rested observations; and β3 represents the association between centred session distance and VO₂ utilisation.
The vector β4 represents activity-group contrasts relative to the reference activity category, while γ represents athlete-specific fixed-effect contrasts relative to the reference athlete. The residual term εij represents variation in VO₂ utilisation not explained by the included predictors.
df_sports3 <- df_sports2 %>%
mutate(
# Set Cycling as the reference activity category
activity_group = factor(
activity_group,
levels = c(
"Cycling",
"Hiking",
"Running",
"Walking",
"Other"
)
),
# Athlete-specific categorical fixed effects
athlete_id = as.factor(athlete_id),
# Binary rested-status fixed effect
rested = as.factor(rested)
)
# Complete-case dataset for Model 03
df_model <- df_sports3 %>%
filter(
!is.na(vo2_utilisation),
!is.na(pace_min_km),
!is.na(rested),
!is.na(distance_centered),
!is.na(activity_group),
!is.na(athlete_id)
)mlr_model_r <- lm(
vo2_utilisation ~
pace_min_km +
rested +
distance_centered +
activity_group +
athlete_id,
data = df_model
)
summary(mlr_model_r)| Parameter / Predictor | Estimate (β) | Std. Error | t-value | p-value | Significance | Interpretation |
|---|---|---|---|---|---|---|
| (Intercept) | +0.7505 | 0.0432 | +17.366 | < 2 × 10−16 | *** | Model reference value for Cycling, the reference athlete, not-rested status, and zero values of the continuous predictors. |
| pace_min_km | −0.0266 | 0.0072 | −3.691 | 0.000255 | *** | A 1 min/km increase in pace is associated with a 0.0266 decrease in fitted VO₂ utilisation, holding the remaining model terms constant. |
| rested1 | −0.0003 | 0.0058 | −0.044 | 0.965229 | NS | The adjusted contrast between rested and not-rested observations is close to zero and not statistically significant. |
| distance_centered | +0.0019 | 0.0005 | +3.654 | 0.000294 | *** | A one-unit increase in centred distance is associated with a 0.0019 increase in fitted VO₂ utilisation, holding the remaining model terms constant. |
| activity_groupHiking | −0.0023 | 0.0062 | −0.370 | 0.711624 | NS | Estimated Hiking contrast relative to Cycling is small and not statistically significant. |
| activity_groupRunning | +0.0673 | 0.0050 | +13.352 | < 2 × 10−16 | *** | Running is associated with 0.0673 higher fitted VO₂ utilisation than Cycling, holding the remaining model terms constant. |
| activity_groupWalking | −0.0264 | 0.0055 | −4.818 | 2.08 × 10−6 | *** | Walking is associated with 0.0264 lower fitted VO₂ utilisation than Cycling, holding the remaining model terms constant. |
| athlete_id1002 | −0.0064 | 0.0102 | −0.630 | 0.528893 | NS | Estimated athlete-specific contrast relative to the reference athlete; not statistically significant. |
| athlete_id1003 | +0.0068 | 0.0079 | +0.862 | 0.388995 | NS | Estimated athlete-specific contrast relative to the reference athlete; not statistically significant. |
| athlete_id1005 | −0.0229 | 0.0088 | −2.614 | 0.009305 | ** | Fitted VO₂ utilisation is 0.0229 lower than for the reference athlete, conditional on the remaining model terms. |
| athlete_id1006 | +0.0508 | 0.0088 | +5.752 | 1.79 × 10−8 | *** | Fitted VO₂ utilisation is 0.0508 higher than for the reference athlete, conditional on the remaining model terms. |
| athlete_id1007 | +0.0261 | 0.0127 | +2.064 | 0.039718 | * | Fitted VO₂ utilisation is 0.0261 higher than for the reference athlete, conditional on the remaining model terms. |
| athlete_id1008 | +0.1572 | 0.0075 | +20.842 | < 2 × 10−16 | *** | Fitted VO₂ utilisation is 0.1572 higher than for the reference athlete, conditional on the remaining model terms. |
| athlete_id1009 | +0.0019 | 0.0101 | +0.190 | 0.849428 | NS | Estimated athlete-specific contrast relative to the reference athlete; not statistically significant. |
| athlete_id1010 | +0.0056 | 0.0083 | +0.674 | 0.500595 | NS | Estimated athlete-specific contrast relative to the reference athlete; not statistically significant. |
Note
rested1represents the adjusted contrast for rested observations relative to the not-rested reference category. Athlete coefficients represent categorical fixed-effect contrasts relative to the reference athlete.
| Statistic | Value | Interpretation |
|---|---|---|
| Pace slope (βpace) | −0.0266 (p < 0.001) | Conditional on the remaining model terms, a 1 min/km increase in pace_min_km is associated with a 0.0266 decrease in fitted VO₂ utilisation. |
| Rested-status contrast (βrested) | −0.0003 (p = 0.965) | The adjusted difference in fitted VO₂ utilisation between rested and not-rested observations is effectively zero in this additive specification. |
| Centred distance (βdistance) | +0.0019 (p < 0.001) | A one-unit increase in distance_centered is associated with a 0.0019 increase in fitted VO₂ utilisation, holding the remaining predictors constant. |
| Activity: Running (βRunning) | +0.0673 (p < 0.001) | Running is associated with 0.0673 higher fitted VO₂ utilisation than Cycling, the reference activity group, conditional on the remaining model terms. |
| Activity: Walking (βWalking) | −0.0264 (p < 0.001) | Walking is associated with 0.0264 lower fitted VO₂ utilisation than Cycling, conditional on the remaining model terms. |
| Activity: Hiking (βHiking) | −0.0023 (p = 0.712) | The Hiking contrast relative to Cycling is small and not statistically significant. |
| Athlete 1008 fixed-effect contrast | +0.1572 (p < 0.001) | Athlete 1008 has 0.1572 higher fitted VO₂ utilisation than the reference athlete after adjustment for the remaining model terms. |
| Residual standard error | 0.03728 | Residual variation around the fitted regression is characterised by a standard error of approximately 0.0373 VO₂-utilisation units. |
| Multiple R2 | 0.7653 | The fitted additive Model 03 accounts for approximately 76.5% of the observed variation in VO₂ utilisation in the analysis sample. |
| Adjusted R2 | 0.7568 | After adjustment for model complexity, approximately 75.7% of the observed variation in VO₂ utilisation is accounted for by the fitted specification. |
| Overall model test | F(14, 388) = 90.38, p < 2.2 × 10−16 | The fitted regression model is statistically significant when compared with an intercept-only specification. |
| Analysis sample | N = 403 | The fitted Model 03 uses 403 complete observations. |
p_mlr <- ggplot(
df_model,
aes(
x = pace_min_km,
y = vo2_utilisation,
color = activity_group,
shape = rested
)
) +
geom_point(
alpha = 0.7,
size = 2.5
) +
geom_smooth(
method = "lm",
formula = y ~ x,
se = TRUE,
color = "#333333",
linetype = "dashed",
linewidth = 0.8
) +
scale_color_brewer(
palette = "Set1"
) +
scale_shape_manual(
values = c(
"0" = 16,
"1" = 17
),
labels = c(
"0" = "Not Rested",
"1" = "Rested"
)
) +
theme_minimal() +
labs(
title = "Decomposed MLR: VO2 Utilisation vs Pace",
subtitle = "Additive fixed-effects benchmark",
x = "Pace (min/km)",
y = "VO2 Utilisation (Fraction)",
color = "Activity Group",
shape = "Rested Status"
)
print(p_mlr)Overall model fit: The additive multiple-regression benchmark accounts for approximately 76.5% of the observed variation in VO₂ utilisation (R2 = 0.7653; adjusted R2 = 0.7568). The overall regression is statistically significant, F(14, 388) = 90.38, p < 0.001.
Pace and aerobic demand: pace_min_km is negatively associated with VO₂ utilisation (β = −0.0266, p < 0.001). Holding the remaining model terms constant, a 1 min/km increase in pace, corresponding to slower movement, is associated with a 0.0266 decrease in fitted VO₂ utilisation.
Centred session distance: distance_centered is positively associated with VO₂ utilisation (β = +0.0019, p < 0.001). A one-unit increase in centred session distance is associated with a 0.0019 increase in fitted VO₂ utilisation, conditional on the remaining model terms.
Exercise modality: Relative to Cycling, Running is associated with higher fitted VO₂ utilisation (β = +0.0673, p < 0.001), whereas Walking is associated with lower fitted VO₂ utilisation (β = −0.0264, p < 0.001). The Hiking contrast is small and not statistically significant (β = −0.0023, p = 0.712).
Rested status: The adjusted contrast between rested and not-rested observations is effectively zero (β = −0.0003, p = 0.965). Model 03 provides little evidence of an independent additive association between rested status and VO₂ utilisation after accounting for pace, centred distance, exercise modality, and athlete fixed effects.
Athlete-specific differences: Several athlete fixed-effect contrasts differ from the reference athlete. Athlete 1008 has the largest positive contrast reported in Table 3.1 (β = +0.1572, p < 0.001), illustrating substantial between-athlete differences in fitted VO₂ utilisation after adjustment for the remaining model terms.
Benchmark interpretation: The simpler additive specification preserves the principal aerobic-demand associations identified earlier: pace, centred distance, exercise modality, and athlete-specific baseline differences remain informative, whereas rested status contributes little independent additive signal.
The following visual summary brings together the principal results from the Model 03 additive fixed-effects benchmark, including overall model fit, the associations of pace and centred session distance with VO₂ utilisation, selected activity-group contrasts, rested status, and athlete-specific fixed effects. The visual card provides a concise summary of the fitted regression, as given in Tables 3.1 and 3.2.
Figure 3.2. Key model-fit statistics and selected fixed-effect estimates from the Model 03 additive multiple linear regression benchmark.
R1 Part 1 examined aerobic demand and rested status through three complementary statistical models, progressing from a fixed-effects model of aerobic demand to a mixed-effects binary-outcome model of rested status, and finally to aerobic demand through a simpler additive multiple-regression benchmark.
Model 01 showed that pace, exercise modality, centred session distance, and athlete-specific baseline differences were associated with fitted VO₂ utilisation. The pace-by-rested-status interaction was not statistically significant, providing little evidence that the pace–VO₂ relationship differed between rested and not-rested observations within that specification. Model 02, meanwhile, demonstrated that mean-centring the continuous predictors provided a more meaningful intercept without materially changing the fitted slopes, model fit, or random-effect variance. Within the centred GLMM, pace provided the clearest fixed-effect signal, while substantial variation remained in baseline log-odds of being rested across athletes.
Diagnostic comparisons further indicated that the large conditional pace coefficient was closely associated with the athlete random-intercept structure and is interpreted as an athlete-conditioned association rather than as a pooled marginal effect.
Model 03, in turn, accounted for approximately 76.5% of the observed variation in VO₂ utilisation ($R^2=0.7653; adjusted $R^2=0.7568). Pace, centred session distance, exercise modality, and selected athlete-specific contrasts remained associated with fitted aerobic demand, whereas the adjusted rested-status contrast was effectively zero.
Taken together, the three models illustrate how different statistical models address different questions within the same simulated sports-performance environment. Model 01 evaluates aerobic-demand relationships and a possible pace-by-rested-status interaction; Model 02 tests rested status while allowing baseline log-odds to vary between athletes; and Model 03 examines whether aerobic-demand associations remain evident within a simpler additive fixed-effects benchmark.
R1 Part 2 examines machine-learning-oriented approaches, such as LASSO, Elastic Net, train-test validation, and Random Forest modelling. These methods advance the R1 analytical pathway for evaluating predictive performance relative to the interpretable statistical benchmarks established in R1 Part 1. They also examine whether greater model complexity produces measurable out-of-sample gains.