Welcome to the data analysis code of the corresponding article.

This Document

This is an R Markdown document combining R analysis code with comments.

To execute this file, save it as a text file with the extension “.Rmd” and open the file in R Studio https://www.rstudio.com/.

Before executing the code, install the necessary packages and place the file hbmass_development_data.xlsx in the same directory as this file.

Now press Run All or Cmd/Ctrl + Alt + R. You can also knit this document to an HTML report.

Loading Packages

knitr::opts_chunk$set(message = FALSE, warning = FALSE)
library(tidyverse) # to use modern R code, see www.tidyverse.org
library(readxl) # to read Excel data file
library(lme4) # perform linear mixed modeling
library(modelr) # working with model objects

Loading Data

data <- read_excel("hbmass_development_data.xlsx", range = "A1:BP155", 
                   col_names = TRUE) %>% 
  mutate(ID = factor(ID), 
         A_K = factor(A_K), 
         age_16 = age_y - 16, # so modelled intercepts = values at age 16
         VO2_per_Hb = VO2max_abs / HbM_g, 
         VO2_per_BV = VO2max_abs / BV, 
         VO2_per_PV = VO2max_abs / PV)

Adjust Ploting Style

theme_custom <- function (base_size = 8, base_family = "") {
  theme_grey(base_size = base_size, base_family = base_family) %+replace% 
    theme(
      axis.ticks.length = unit(-0.1, "cm"),
      axis.ticks = element_line(colour = "black", size = 0.5),
      axis.text.x = element_text(margin = unit(c(0.2, 0.2, 0.0, 0.0), "cm"), 
                                 colour = "black"),
      axis.text.y = element_text(margin = unit(c(0.2, 0.2, 0.0, 0.0), "cm"), 
                                 colour = "black"),
      
      panel.background = element_rect(fill = "white", colour = NA), 
      panel.border = element_blank(),
      axis.line = element_line(colour = "black", size = 0.5),
      
      panel.grid.major.y = element_line(linetype = "dotted", size = 0.5, 
                                        colour = "darkgrey"),
      panel.grid.major.x = element_blank(),
      panel.grid.minor = element_blank(),
      
      strip.background = element_rect(fill = "white", colour = "black"), 
      
      legend.key = element_rect(fill = "white", colour = NA),
      legend.margin = margin(c(0, 0, 0.1, 0), unit = "cm"),
      legend.box.spacing = unit(0.0, "cm"),
      legend.position = "top",
      complete = TRUE)
}

Defining Functions

Next we define important functions for later use. E.g. to quickly plot the individual development of a variable or to sequentially fit a mixed model for a variable.

# function to plot the individual development of a variable colored by group
plot_develop_indiv <- function(var){
  ggplot(data) +
    aes_string(x = "age_y", y = var, color = "A_K", group = "ID") +
    geom_line(alpha = 0.5) +
    theme_custom()
}

# function to find the right linear mixed model for a variable
get_lmer <- function(variable){
  
  # build all models (from baseline to full model)
  # all models use the same random effects: (age_16|ID)
  baseline <- lmer(as.formula(paste(variable, "~ 1 + (age_16|ID)")), data = data)
  lmem_age <- lmer(as.formula(paste(variable, "~ age_16 + (age_16|ID)")), 
                   data = data)
  lmem_tr <- lmer(as.formula(paste(variable, "~ A_K + (age_16|ID)")), 
                  data = data)
  lmem_age_tr <- lmer(as.formula(paste(variable, "~ age_16 + A_K + (age_16|ID)")), 
                      data = data)
  lmem_age_tr_i <- lmer(as.formula(paste(variable, "~ age_16 * A_K + (age_16|ID)")),
                        data = data)
  
  # choose the right model with likelihood ratio tests (proceed if p < 0.05)
  print(paste("baseline to lmem_age:", 
              anova(baseline, lmem_age)$`Pr(>Chisq)`[2]))
  print(paste("baseline to lmem_tr:", 
              anova(baseline, lmem_tr)$`Pr(>Chisq)`[2]))
  print(paste("baseline to lmem_age_tr_i:", 
              anova(baseline, lmem_age_tr_i)$`Pr(>Chisq)`[2]))
  if(anova(baseline, lmem_age)$`Pr(>Chisq)`[2] < 0.05) {
    model <- lmem_age
    print(paste("lmem_age to lmem_age_tr:", 
                anova(lmem_age, lmem_age_tr)$`Pr(>Chisq)`[2]))
    if(anova(lmem_age, lmem_age_tr)$`Pr(>Chisq)`[2] < 0.05) {
      model <- lmem_age_tr
      print(paste("lmem_age_tr to lmem_age_tr_i:", 
                  anova(lmem_age_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2]))
      if(anova(lmem_age_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2] < 0.05) {
        model <- lmem_age_tr_i
      }
    } else {
      print(paste("lmem_age to lmem_age_tr_i:", 
                  anova(lmem_age, lmem_age_tr_i)$`Pr(>Chisq)`[2]))
      if(anova(lmem_age, lmem_age_tr_i)$`Pr(>Chisq)`[2] < 0.05) {
        model <- lmem_age_tr_i
      }
    }
  } else if(anova(baseline, lmem_tr)$`Pr(>Chisq)`[2] < 0.05) {
    model <- lmem_tr
    print(paste("lmem_tr to lmem_age_tr:", 
                anova(lmem_tr, lmem_age_tr)$`Pr(>Chisq)`[2]))
    if(anova(lmem_tr, lmem_age_tr)$`Pr(>Chisq)`[2] < 0.05) {
      model <- lmem_age_tr
      print(paste("lmem_age_tr to lmem_age_tr_i:", 
                  anova(lmem_age_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2]))
      if(anova(lmem_age_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2] < 0.05) {
        model <- lmem_age_tr_i
      }
    } else {
      print(paste("lmem_tr to lmem_age_tr_i:", 
                  anova(lmem_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2]))
      if(anova(lmem_tr, lmem_age_tr_i)$`Pr(>Chisq)`[2] < 0.05) {
        model <- lmem_age_tr_i
      }
    }
  } else {
    model <- baseline
    if(anova(baseline, lmem_age_tr_i)$`Pr(>Chisq)`[2] < 0.05){
      model <- lmem_age_tr_i
    }
  }
  # at the end, return the right model
  return(model)
}

# function to get confidence limits for the fixed effects with bootstraping
get_boot_cls <- function(model, variable, n = 1000){

  b <- bootMer(model, nsim = n, FUN = function(x) predict(x, re.form = NA))
  cls <- apply(b$t, 2, function(x) quantile(x, probs = c(0.05, 0.95)))
  cls_data <- tibble(low = cls[1,], high = cls[2,], 
                     age_16 = data$age_16, A_K = data$A_K) %>% 
    gather(key = "cl", value = "Var", low, high)
  names(cls_data)[names(cls_data) == "Var"] <- variable
  
  return(cls_data)
}

# function to plot the fixed effects of the mixed model with CLs and data
plot_lmer <- function(model, variable, cls_data, no_AK = FALSE){
  
  p <- ggplot(data) +
    aes_string(x = "age_16+16", y = variable, color = "A_K") +
    
    # raw data points with connecting lines
    geom_line(aes(group = ID), size = 0.3) + 
    geom_point(size = 1) +

    scale_color_discrete(labels = c("Athletes", "Controls"), name = "Group") +
    labs(x = "Age (y)") +
    theme_custom()
  
  # and add confidence limits (overall, or separate for athletes and controls)
  if(no_AK == FALSE){
    p +
      geom_line(aes(y = predict(model, re.form=NA), group = ID), 
                size = 0.75, color = "black") + 
      geom_line(data = cls_data, aes(group = interaction(cl, A_K)), 
                size = 0.5, linetype = "dashed", color = "black")
  } else {
    p +
      geom_line(aes(y = predict(model, re.form=NA)), 
                size = 0.75, color = "black") + 
      geom_line(data = cls_data %>% filter(A_K == "A"), 
                aes(group = interaction(cl)), 
                size = 0.5, linetype = "dashed", color = "black")
  }
}

Data preparation

When checking the raw data, some outliers were detected for sTfR and EPO. They were adjusted as follows:

sTfR

Delete values with a distance > 3 sd from the mean

cutoff <- data$sTfR %>% mean() + 3 * data$sTfR %>% sd()
data$sTfR[data$sTfR > cutoff] <- NA

EPO

Delete values > 20

data$epo[data$epo > 20] <- NA

Main Plots

We use the previously defined functions to find the right model, calculate confidence limits for the fixed effects and plot the model together with the raw data.

VO2max

model <- get_lmer("VO2max_LBM")
## [1] "baseline to lmem_age: 3.95690095457991e-05"
## [1] "baseline to lmem_tr: 5.90362390665932e-07"
## [1] "baseline to lmem_age_tr_i: 3.13790752784746e-09"
## [1] "lmem_age to lmem_age_tr: 4.18237467831728e-07"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.958873195031813"
cls_data <- get_boot_cls(model, "VO2max_LBM")
p <- plot_lmer(model, "VO2max_LBM", cls_data)

# To finish we adjust some labels and scales and save the plot
p + 
  labs(y = expression(paste(dot(italic(V)),O[2],"max (",mL%.%kg^-1," LBM)"))) +
  scale_y_continuous(breaks = seq(55, 85, 5)) +
  coord_cartesian(ylim = c(50,85), xlim = c(14.3,20), expand = FALSE)

ggsave(filename = "plots/plot_vo2max.svg", width = 8, height = 8, units = "cm")

HbMass

model <- get_lmer("HbM_LBM")
## [1] "baseline to lmem_age: 4.40893341816593e-05"
## [1] "baseline to lmem_tr: 0.796690717779254"
## [1] "baseline to lmem_age_tr_i: 0.000792829111660387"
## [1] "lmem_age to lmem_age_tr: 0.803351532692963"
## [1] "lmem_age to lmem_age_tr_i: 0.965361650660179"
cls_data <- get_boot_cls(model, "HbM_LBM")
p <- plot_lmer(model, "HbM_LBM", cls_data, no_AK = TRUE)

# To finish we adjust some labels and scales and save the plot
p + 
  labs(y = expression(paste("Hbmass (",g%.%kg^-1," LBM)"))) +
  scale_y_continuous(breaks = seq(11, 17, 1)) +
  coord_cartesian(ylim = c(10,17), xlim = c(14.3,20), expand = FALSE)

ggsave(filename = "plots/plot_hbm.svg", width = 8, height = 8, units = "cm")

BV

model <- get_lmer("BV_LBM")
## [1] "baseline to lmem_age: 8.21284254715656e-06"
## [1] "baseline to lmem_tr: 0.0255462801053532"
## [1] "baseline to lmem_age_tr_i: 3.84612230795517e-06"
## [1] "lmem_age to lmem_age_tr: 0.0239636299700087"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.0887688223002285"
cls_data <- get_boot_cls(model, "BV_LBM")
p <- plot_lmer(model, "BV_LBM", cls_data)

# To finish we adjust some labels and scales and save the plot
p + 
  labs(y = expression(paste("BV (",mL%.%kg^-1," LBM)"))) +
  scale_y_continuous(breaks = seq(85, 125, 5)) +
  coord_cartesian(ylim = c(80,125), xlim = c(14.3,20), expand = FALSE)

ggsave(filename = "plots/plot_bv.svg", width = 8, height = 8, units = "cm")

PV

model <- get_lmer("PV_LBM")
## [1] "baseline to lmem_age: 0.851395615526362"
## [1] "baseline to lmem_tr: 0.00826051719414878"
## [1] "baseline to lmem_age_tr_i: 0.0122235746075533"
## [1] "lmem_tr to lmem_age_tr: 0.777149918852902"
## [1] "lmem_tr to lmem_age_tr_i: 0.139894989312945"
cls_data <- get_boot_cls(model, "PV_LBM")
p <- plot_lmer(model, "PV_LBM", cls_data)

# To finish we adjust some labels and scales and save the plot
p + 
  labs(y = expression(paste("PV (",mL%.%kg^-1," LBM)"))) +
  scale_y_continuous(breaks = seq(50, 75, 5)) +
  coord_cartesian(ylim = c(45,75), xlim = c(14.3,20), expand = FALSE)

ggsave(filename = "plots/plot_pv.svg", width = 8, height = 8, units = "cm")

Numeric Summaries

Main Tables

Now we calculate the tables summarising the raw data by group and testnumber and export a CSV.

important_vars <- c("LBM_kg", "fat_kg", "fat_perc", 
                    "weight_kg", "height_cm", "biolage_y","vmax_kmh",
                    "PV_LBM", "BV_LBM","EV_LBM",
                    "HbM_LBM", "HbM_g", "HbM_gkg",
                    "VO2max_LBM", "VO2max_abs", "VO2max_rel",
                    "VO2_per_BV", "VO2_per_Hb", "VO2_per_PV",
                    "hb", "hkt", "reti_proz", "epo", "sTfR", "ferritin")

# function to return a nicely formatted mean ± SD summary
mean_sd <- function(x){
  if (mean(x, na.rm = TRUE) < 120) 
    sprintf("%.1f ± %.1f", mean(x, na.rm = TRUE), sd(x, na.rm = TRUE))
  else 
    sprintf("%.0f ± %.0f", mean(x, na.rm = TRUE), sd(x, na.rm = TRUE))
}

# take data, select variables, group by A/C and testnumber and calculate summary
overview_table <- data %>% 
  select(A_K, testnumber, age_y, important_vars, train_h_ausd) %>% 
  group_by(A_K, testnumber) %>% 
  summarise_all(mean_sd) %>% 
  arrange(A_K, testnumber)

write_csv(overview_table, "overview_table.csv")

Values by group

Summaries of variables by group.

data %>% group_by(A_K) %>% summarise_at(
  vars(VO2_per_Hb, vmax_kmh, hb, reti_proz, epo, sTfR, ferritin), mean_sd)
## # A tibble: 2 x 8
##   A_K   VO2_per_Hb vmax_kmh   hb         reti_proz epo     sTfR   ferritin
##   <fct> <chr>      <chr>      <chr>      <chr>     <chr>   <chr>  <chr>   
## 1 A     5.4 ± 0.4  15.6 ± 0.5 14.4 ± 1.1 0.8 ± 0.3 10.9 ±~ 7.6 ±~ 60.0 ± ~
## 2 K     4.9 ± 0.4  13.0 ± 0.8 15.1 ± 0.7 0.8 ± 0.3 10.6 ±~ 7.4 ±~ 47.1 ± ~

Mixed Models

Data Preparation

Log-transformation for fat, percent fat and ferritin.

data$fat_kg <- log(data$fat_kg)
data$fat_perc <- log(data$fat_perc)
data$ferritin  <- log(data$ferritin)

Detailed Model Outputs

The following loop will for each variable: Plot the individual lines, fit the appropriate mixed model, print the model summary and the residual plot.

# change the order of factor levels (intercept = controls)
data$A_K <- data$A_K %>% fct_relevel("K", "A")

# define function
print_lmer <- function(variable){
  print("--------------------------------------------------------------")
  print(variable)
  print("--------------------------------------------------------------")
  
  plot_develop_indiv(variable) %>% print()
  model <- get_lmer(variable)
  model %>% summary() %>% print()
  model %>% plot() %>% print()
}

# applies function to every important variable
walk(important_vars, print_lmer)
## [1] "--------------------------------------------------------------"
## [1] "LBM_kg"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 2.34944726424691e-09"
## [1] "baseline to lmem_tr: 0.877808818743114"
## [1] "baseline to lmem_age_tr_i: 3.41186287966931e-08"
## [1] "lmem_age to lmem_age_tr: 0.88556380362213"
## [1] "lmem_age to lmem_age_tr_i: 0.37646121700274"
## Linear mixed model fit by REML ['lmerMod']
## Formula: LBM_kg ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 576.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.00078 -0.64913 -0.05592  0.65768  1.97456 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 30.0138  5.4785        
##           age_16       0.8638  0.9294   -0.12
##  Residual              0.8498  0.9218        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  58.5152     1.1758  49.767
## age_16        1.9522     0.2117   9.222
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.140

## [1] "--------------------------------------------------------------"
## [1] "fat_kg"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 1.93048282469141e-05"
## [1] "baseline to lmem_tr: 0.0196999078663384"
## [1] "baseline to lmem_age_tr_i: 2.22526351168085e-05"
## [1] "lmem_age to lmem_age_tr: 0.0193847702018757"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.471988563139435"
## Linear mixed model fit by REML ['lmerMod']
## Formula: fat_kg ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: -57
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2660 -0.5881 -0.0789  0.6027  2.4161 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.203018 0.45058       
##           age_16      0.006596 0.08121  -0.57
##  Residual             0.018019 0.13424       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  1.46024    0.12283  11.889
## age_16       0.10664    0.02042   5.223
## A_KA        -0.39157    0.16301  -2.402
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.448       
## A_KA   -0.602  0.000

## [1] "--------------------------------------------------------------"
## [1] "fat_perc"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.000436534762697919"
## [1] "baseline to lmem_tr: 0.00400583770097151"
## [1] "baseline to lmem_age_tr_i: 0.000101167777608284"
## [1] "lmem_age to lmem_age_tr: 0.00389217919377166"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.537147822051965"
## Linear mixed model fit by REML ['lmerMod']
## Formula: fat_perc ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: -102.4
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.20113 -0.54550 -0.08097  0.61028  2.37438 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.124754 0.35321       
##           age_16      0.004797 0.06926  -0.62
##  Residual             0.013951 0.11811       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  1.92870    0.09553  20.189
## age_16       0.07019    0.01757   3.995
## A_KA        -0.37912    0.12389  -3.060
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.487       
## A_KA   -0.588  0.000

## [1] "--------------------------------------------------------------"
## [1] "weight_kg"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 1.81518186660196e-08"
## [1] "baseline to lmem_tr: 0.570706662747848"
## [1] "baseline to lmem_age_tr_i: 3.68525120101223e-07"
## [1] "lmem_age to lmem_age_tr: 0.565034634210204"
## [1] "lmem_age to lmem_age_tr_i: 0.594614819368363"
## Linear mixed model fit by REML ['lmerMod']
## Formula: weight_kg ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 695.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0507 -0.5863 -0.0621  0.5325  2.8154 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 56.790   7.536         
##           age_16       1.585   1.259    -0.20
##  Residual              1.982   1.408         
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  62.6177     1.6198  38.658
## age_16        2.3971     0.2915   8.224
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.219

## [1] "--------------------------------------------------------------"
## [1] "height_cm"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 1.38894428913354e-08"
## [1] "baseline to lmem_tr: 0.94280698828231"
## [1] "baseline to lmem_age_tr_i: 4.73140135469937e-07"
## [1] "lmem_age to lmem_age_tr: 0.946649973985829"
## [1] "lmem_age to lmem_age_tr_i: 0.997471404694807"
## Linear mixed model fit by REML ['lmerMod']
## Formula: height_cm ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 490.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.89615 -0.45978 -0.00515  0.51653  2.29413 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 45.0247  6.7100       
##           age_16       0.4015  0.6336   0.18
##  Residual              0.4183  0.6468       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 176.6888     1.4337 123.239
## age_16        1.2099     0.1448   8.353
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 0.144

## [1] "--------------------------------------------------------------"
## [1] "biolage_y"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 3.97065180591532e-21"
## [1] "baseline to lmem_tr: 0.625869499041139"
## [1] "baseline to lmem_age_tr_i: 2.29743140671939e-19"
## [1] "lmem_age to lmem_age_tr: 0.656249912278727"
## [1] "lmem_age to lmem_age_tr_i: 0.632880389143895"
## Linear mixed model fit by REML ['lmerMod']
## Formula: biolage_y ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: -118
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.6564 -0.4343  0.0273  0.5093  3.9639 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.152608 0.39065       
##           age_16      0.002802 0.05293  -0.50
##  Residual             0.012186 0.11039       
## Number of obs: 153, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 16.35416    0.08482  192.81
## age_16       0.49601    0.01442   34.39
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.480

## [1] "--------------------------------------------------------------"
## [1] "vmax_kmh"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.682562268243043"
## [1] "baseline to lmem_tr: 2.81556367613805e-11"
## [1] "baseline to lmem_age_tr_i: 1.18478030487875e-09"
## [1] "lmem_tr to lmem_age_tr: 0.669179910229647"
## [1] "lmem_tr to lmem_age_tr_i: 0.907729720545447"
## Linear mixed model fit by REML ['lmerMod']
## Formula: vmax_kmh ~ A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 195.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.82273 -0.57320  0.09308  0.58563  2.56108 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.39777  0.6307        
##           age_16      0.06697  0.2588   -0.56
##  Residual             0.10612  0.3258        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  13.0068     0.1550   83.94
## A_KA          2.6245     0.2305   11.39
## 
## Correlation of Fixed Effects:
##      (Intr)
## A_KA -0.672

## [1] "--------------------------------------------------------------"
## [1] "PV_LBM"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.851395615526362"
## [1] "baseline to lmem_tr: 0.00826051719414931"
## [1] "baseline to lmem_age_tr_i: 0.0122235746075533"
## [1] "lmem_tr to lmem_age_tr: 0.777149918852594"
## [1] "lmem_tr to lmem_age_tr_i: 0.139894989312937"
## Linear mixed model fit by REML ['lmerMod']
## Formula: PV_LBM ~ A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 828.4
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.68121 -0.72851  0.01516  0.65179  2.15842 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 9.8806   3.1433        
##           age_16      0.1431   0.3782   -0.16
##  Residual             9.6513   3.1067        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  57.6255     0.9582  60.142
## A_KA          4.3290     1.4223   3.044
## 
## Correlation of Fixed Effects:
##      (Intr)
## A_KA -0.674

## [1] "--------------------------------------------------------------"
## [1] "BV_LBM"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 8.21284254715656e-06"
## [1] "baseline to lmem_tr: 0.0255462801053515"
## [1] "baseline to lmem_age_tr_i: 3.84612230795517e-06"
## [1] "lmem_age to lmem_age_tr: 0.0239636299700118"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.0887688223002162"
## Linear mixed model fit by REML ['lmerMod']
## Formula: BV_LBM ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 863.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.6601 -0.7416 -0.1305  0.7467  2.1637 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 16.0640  4.0080       
##           age_16       0.9421  0.9706   0.13
##  Residual             10.8707  3.2971       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  96.5276     1.3027  74.097
## age_16        1.8681     0.3358   5.564
## A_KA          4.6247     1.9042   2.429
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.180       
## A_KA   -0.662  0.000

## [1] "--------------------------------------------------------------"
## [1] "EV_LBM"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 3.54742183717463e-09"
## [1] "baseline to lmem_tr: 0.457466908407772"
## [1] "baseline to lmem_age_tr_i: 8.31398894420757e-08"
## [1] "lmem_age to lmem_age_tr: 0.475902031632312"
## [1] "lmem_age to lmem_age_tr_i: 0.628871260584055"
## Linear mixed model fit by REML ['lmerMod']
## Formula: EV_LBM ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 675.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7949 -0.6328 -0.1044  0.5826  2.5630 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 7.9135   2.8131       
##           age_16      0.5658   0.7522   0.30
##  Residual             2.6547   1.6293       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  39.1197     0.6441  60.738
## age_16        1.8662     0.2072   9.008
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 0.028

## [1] "--------------------------------------------------------------"
## [1] "HbM_LBM"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 4.40893341816593e-05"
## [1] "baseline to lmem_tr: 0.796690717779169"
## [1] "baseline to lmem_age_tr_i: 0.000792829111660354"
## [1] "lmem_age to lmem_age_tr: 0.803351532693272"
## [1] "lmem_age to lmem_age_tr_i: 0.965361650660138"
## Linear mixed model fit by REML ['lmerMod']
## Formula: HbM_LBM ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 241
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.11311 -0.57254  0.00248  0.54531  3.02417 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 0.78795  0.8877       
##           age_16      0.03756  0.1938   0.11
##  Residual             0.13712  0.3703       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 13.24398    0.19672  67.324
## age_16       0.24820    0.05097   4.869
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.041

## [1] "--------------------------------------------------------------"
## [1] "HbM_g"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 6.50293558122721e-08"
## [1] "baseline to lmem_tr: 0.958155735043722"
## [1] "baseline to lmem_age_tr_i: 1.55150475223909e-06"
## [1] "lmem_age to lmem_age_tr: 0.967104144547207"
## [1] "lmem_age to lmem_age_tr_i: 0.759279628379613"
## Linear mixed model fit by REML ['lmerMod']
## Formula: HbM_g ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 1548
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.1029 -0.6230 -0.0170  0.5861  4.0476 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 8738.3   93.48        
##           age_16       587.7   24.24    0.14
##  Residual              565.9   23.79        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  775.396     20.230  38.328
## age_16        42.041      5.514   7.624
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 0.083

## [1] "--------------------------------------------------------------"
## [1] "HbM_gkg"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.00146278409049112"
## [1] "baseline to lmem_tr: 0.205418296998794"
## [1] "baseline to lmem_age_tr_i: 0.0084677643210548"
## [1] "lmem_age to lmem_age_tr: 0.210228376837079"
## [1] "lmem_age to lmem_age_tr_i: 0.453976685115016"
## Linear mixed model fit by REML ['lmerMod']
## Formula: HbM_gkg ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 258.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.18833 -0.61944  0.02217  0.59601  2.02979 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 0.85014  0.9220       
##           age_16      0.02941  0.1715   0.01
##  Residual             0.16117  0.4015       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 12.40620    0.20499  60.521
## age_16       0.17014    0.04882   3.485
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.143

## [1] "--------------------------------------------------------------"
## [1] "VO2max_LBM"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 3.95690095457991e-05"
## [1] "baseline to lmem_tr: 5.90362390665445e-07"
## [1] "baseline to lmem_age_tr_i: 3.13790752784746e-09"
## [1] "lmem_age to lmem_age_tr: 4.18237467831802e-07"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.958873195029178"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2max_LBM ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 767.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.37877 -0.42027 -0.03865  0.52653  2.50250 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 7.2417   2.6910        
##           age_16      0.6519   0.8074   -0.51
##  Residual             6.1507   2.4801        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  63.9088     0.8310  76.908
## age_16        1.3250     0.2622   5.053
## A_KA          7.0930     1.0747   6.600
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.495       
## A_KA   -0.582 -0.003

## [1] "--------------------------------------------------------------"
## [1] "VO2max_abs"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 1.82067644253205e-08"
## [1] "baseline to lmem_tr: 0.00659471027681868"
## [1] "baseline to lmem_age_tr_i: 9.39548202782665e-09"
## [1] "lmem_age to lmem_age_tr: 0.00651551672281263"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.277586775151503"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2max_abs ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 2068
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.01996 -0.58979  0.02481  0.46945  2.44125 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 121603   348.7         
##           age_16       11915   109.2    -0.10
##  Residual              23796   154.3         
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  3724.62     104.13  35.767
## age_16        216.88      26.39   8.220
## A_KA          445.14     153.12   2.907
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.142       
## A_KA   -0.666 -0.001

## [1] "--------------------------------------------------------------"
## [1] "VO2max_rel"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.00190749371299934"
## [1] "baseline to lmem_tr: 3.28242766635589e-07"
## [1] "baseline to lmem_age_tr_i: 7.57121461487558e-08"
## [1] "lmem_age to lmem_age_tr: 2.89758843980826e-07"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.876574181383188"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2max_rel ~ age_16 + A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 771.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.39881 -0.49169  0.01296  0.45157  2.43083 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 10.8752  3.2977        
##           age_16       0.7189  0.8479   -0.52
##  Residual              5.9590  2.4411        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  59.0571     0.9772  60.438
## age_16        0.9137     0.2662   3.432
## A_KA          8.6963     1.2845   6.770
## 
## Correlation of Fixed Effects:
##        (Intr) age_16
## age_16 -0.468       
## A_KA   -0.593 -0.002

## [1] "--------------------------------------------------------------"
## [1] "VO2_per_BV"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.830525931271103"
## [1] "baseline to lmem_tr: 0.069144475761104"
## [1] "baseline to lmem_age_tr_i: 0.179430662559077"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2_per_BV ~ 1 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: -559.9
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.35907 -0.57903  0.04661  0.66833  1.98519 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr 
##  ID       (Intercept) 0.0020410 0.04518       
##           age_16      0.0001129 0.01063  -0.65
##  Residual             0.0009720 0.03118       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept) 0.683370   0.008065   84.73

## [1] "--------------------------------------------------------------"
## [1] "VO2_per_Hb"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.678122318821988"
## [1] "baseline to lmem_tr: 0.00183102418265141"
## [1] "baseline to lmem_age_tr_i: 0.0188635860043452"
## [1] "lmem_tr to lmem_age_tr: 0.614793764811338"
## [1] "lmem_tr to lmem_age_tr_i: 0.880901625284346"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2_per_Hb ~ A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 45.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6010 -0.5138 -0.1029  0.6358  2.4302 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.127367 0.35689       
##           age_16      0.001084 0.03292  -0.23
##  Residual             0.049797 0.22315       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   4.8697     0.1036  47.002
## A_KA          0.5131     0.1537   3.337
## 
## Correlation of Fixed Effects:
##      (Intr)
## A_KA -0.674

## [1] "--------------------------------------------------------------"
## [1] "VO2_per_PV"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.00468287008461115"
## [1] "baseline to lmem_tr: 0.273903455047344"
## [1] "baseline to lmem_age_tr_i: 0.00975486650505664"
## [1] "lmem_age to lmem_age_tr: 0.271441897599715"
## [1] "lmem_age to lmem_age_tr_i: 0.182633767496736"
## Linear mixed model fit by REML ['lmerMod']
## Formula: VO2_per_PV ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: -299.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.29782 -0.67068  0.01658  0.72803  1.83007 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. Corr 
##  ID       (Intercept) 0.0063081 0.07942       
##           age_16      0.0003672 0.01916  -0.37
##  Residual             0.0054236 0.07364       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  1.13255    0.01996  56.739
## age_16       0.02180    0.00716   3.045
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.536

## [1] "--------------------------------------------------------------"
## [1] "hb"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.927399218206841"
## [1] "baseline to lmem_tr: 0.0204580244537933"
## [1] "baseline to lmem_age_tr_i: 0.0568271784500187"
## [1] "lmem_tr to lmem_age_tr: 0.997133211908229"
## [1] "lmem_tr to lmem_age_tr_i: 0.340231875805212"
## Linear mixed model fit by REML ['lmerMod']
## Formula: hb ~ A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 303.9
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.76366 -0.59333  0.07593  0.54393  3.06648 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.68308  0.8265        
##           age_16      0.01604  0.1267   -0.56
##  Residual             0.27357  0.5230        
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  15.1266     0.2164  69.887
## A_KA         -0.8140     0.3213  -2.534
## 
## Correlation of Fixed Effects:
##      (Intr)
## A_KA -0.674

## [1] "--------------------------------------------------------------"
## [1] "hkt"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 3.20532403570735e-07"
## [1] "baseline to lmem_tr: 0.331476259693046"
## [1] "baseline to lmem_age_tr_i: 4.78738440486987e-06"
## [1] "lmem_age to lmem_age_tr: 0.345779491666498"
## [1] "lmem_age to lmem_age_tr_i: 0.520360557012096"
## Linear mixed model fit by REML ['lmerMod']
## Formula: hkt ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 696.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2819 -0.6716 -0.1114  0.7167  2.1271 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 5.6252   2.3718       
##           age_16      0.1457   0.3817   0.07
##  Residual             3.6359   1.9068       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  43.5830     0.5745  75.859
## age_16        1.2049     0.1732   6.958
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.313

## [1] "--------------------------------------------------------------"
## [1] "reti_proz"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.00161412234817861"
## [1] "baseline to lmem_tr: 0.953891304115965"
## [1] "baseline to lmem_age_tr_i: 0.0188104315879513"
## [1] "lmem_age to lmem_age_tr: 0.975605908506663"
## [1] "lmem_age to lmem_age_tr_i: 0.98615915445703"
## Linear mixed model fit by REML ['lmerMod']
## Formula: reti_proz ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 6.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0953 -0.6857 -0.0596  0.4550  3.1965 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 0.014292 0.1195       
##           age_16      0.001246 0.0353   1.00
##  Residual             0.044794 0.2116       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  0.91505    0.03906  23.429
## age_16      -0.06126    0.01839  -3.332
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.297

## [1] "--------------------------------------------------------------"
## [1] "epo"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.000703111177174793"
## [1] "baseline to lmem_tr: 0.587766639093916"
## [1] "baseline to lmem_age_tr_i: 0.00630581478778203"
## [1] "lmem_age to lmem_age_tr: 0.705516579066661"
## [1] "lmem_age to lmem_age_tr_i: 0.650954579900834"
## Linear mixed model fit by REML ['lmerMod']
## Formula: epo ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 700.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -1.77286 -0.66087 -0.08092  0.69931  2.56440 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 2.4515   1.5657       
##           age_16      0.1955   0.4422   1.00
##  Residual             5.3154   2.3055       
## Number of obs: 146, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   9.7665     0.4664  20.942
## age_16        0.7769     0.2121   3.664
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.175

## [1] "--------------------------------------------------------------"
## [1] "sTfR"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.00100403314739059"
## [1] "baseline to lmem_tr: 0.272303144006043"
## [1] "baseline to lmem_age_tr_i: 0.00580841414528383"
## [1] "lmem_age to lmem_age_tr: 0.268406458384257"
## [1] "lmem_age to lmem_age_tr_i: 0.42822823182741"
## Linear mixed model fit by REML ['lmerMod']
## Formula: sTfR ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 458.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.87754 -0.52489  0.02802  0.59450  2.24882 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 1.3818   1.1755        
##           age_16      0.1652   0.4064   -0.81
##  Residual             0.8092   0.8995        
## Number of obs: 152, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   8.0609     0.2850  28.281
## age_16       -0.4212     0.1135  -3.709
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.798

## [1] "--------------------------------------------------------------"
## [1] "ferritin"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 4.78822316526038e-08"
## [1] "baseline to lmem_tr: 0.248620775037785"
## [1] "baseline to lmem_age_tr_i: 2.76496573271033e-07"
## [1] "lmem_age to lmem_age_tr: 0.173139360613315"
## [1] "lmem_age to lmem_age_tr_i: 0.17261492638739"
## Linear mixed model fit by REML ['lmerMod']
## Formula: ferritin ~ age_16 + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 174.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5116 -0.5632 -0.0024  0.5015  3.4369 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr 
##  ID       (Intercept) 0.180082 0.42436       
##           age_16      0.006716 0.08195  -1.00
##  Residual             0.134725 0.36705       
## Number of obs: 154, groups:  ID, 22
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)  3.46445    0.10477  33.068
## age_16       0.25124    0.03389   7.413
## 
## Correlation of Fixed Effects:
##        (Intr)
## age_16 -0.802

data$A_K <- data$A_K %>% fct_relevel("A", "K")

Table with fitted values at age 16

We can use the mixed models to predict individual values at age 16.

data_at16 <- data %>% 
  select(ID, A_K, testnumber) %>% 
  filter(testnumber == 1) %>% 
  mutate(age_16 = 0)

# define function that fits model, predicts values at 16 and returns mean ± sd
return_meansd_16_df <- function(variable){
  
  model <- get_lmer(variable)

  data_at16 %>% 
    add_predictions(model) %>% 
    group_by(A_K) %>% 
    summarise(mean = mean(pred) %>% round(4), 
              sd = sd(pred) %>% round(4)) %>% 
    unite(mean, sd, col = "mean_sd", sep=" ± ") %>% 
    spread(A_K, mean_sd) %>% 
    mutate(model = variable)
}

# apply function to all variables
meansd_16 <- map_df(important_vars, return_meansd_16_df)
meansd_16 %>% print(n = 100)
## # A tibble: 25 x 3
##    A                    K                    model     
##    <chr>                <chr>                <chr>     
##  1 58.5017 ± 5.064      58.5264 ± 5.9682     LBM_kg    
##  2 1.033 ± 0.3078       1.49 ± 0.5304        fat_kg    
##  3 1.524 ± 0.2291       1.95 ± 0.4198        fat_perc  
##  4 61.4123 ± 5.8373     63.6221 ± 8.7475     weight_kg 
##  5 176.7958 ± 4.997     176.5996 ± 8.0726    height_cm 
##  6 16.3482 ± 0.3654     16.3591 ± 0.4171     biolage_y 
##  7 15.5944 ± 0.4066     12.9844 ± 0.7264     vmax_kmh  
##  8 61.8791 ± 3.0698     57.6724 ± 2.7445     PV_LBM    
##  9 101.2739 ± 2.6105    96.4262 ± 4.4031     BV_LBM    
## 10 39.6297 ± 3.2449     38.6947 ± 2.1647     EV_LBM    
## 11 13.2905 ± 1.0737     13.2052 ± 0.6865     HbM_LBM   
## 12 778.33 ± 102.7272    772.9518 ± 87.0965   HbM_g     
## 13 12.6569 ± 1.0438     12.1973 ± 0.7294     HbM_gkg   
## 14 71.011 ± 2.0188      63.9011 ± 2.6306     VO2max_LBM
## 15 4162.4943 ± 364.1558 3730.6793 ± 310.3456 VO2max_abs
## 16 67.7116 ± 2.0273     59.092 ± 3.6617      VO2max_rel
## 17 0.7023 ± 0.025       0.6659 ± 0.0471      VO2_per_BV
## 18 5.3798 ± 0.3738      4.8666 ± 0.3177      VO2_per_Hb
## 19 1.1541 ± 0.0672      1.1146 ± 0.072       VO2_per_PV
## 20 14.3931 ± 1.0579     15.0567 ± 0.4556     hb        
## 21 43.1064 ± 3.1034     43.9801 ± 1.0948     hkt       
## 22 0.9139 ± 0.1111      0.916 ± 0.1113       reti_proz 
## 23 9.789 ± 1.0978       9.7477 ± 1.7238      epo       
## 24 8.1341 ± 0.9639      7.9998 ± 1.1483      sTfR      
## 25 3.6211 ± 0.3014      3.3339 ± 0.4139      ferritin

Mixed model for training time

For this variable, we exclude the first values, because they were reported from memory before training was actually tracked in a training log.

data <- data %>% filter(testnumber != 1)

data$A_K <- data$A_K %>% fct_relevel("K", "A")
print_lmer("train_h_ausd")
## [1] "--------------------------------------------------------------"
## [1] "train_h_ausd"
## [1] "--------------------------------------------------------------"

## [1] "baseline to lmem_age: 0.0705273294570296"
## [1] "baseline to lmem_tr: 6.55713431212708e-14"
## [1] "baseline to lmem_age_tr_i: 1.52537911633164e-14"
## [1] "lmem_tr to lmem_age_tr: 0.0247951906081345"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.0129100498801037"
## Linear mixed model fit by REML ['lmerMod']
## Formula: train_h_ausd ~ age_16 * A_K + (age_16 | ID)
##    Data: data
## 
## REML criterion at convergence: 480.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -3.04263 -0.14470 -0.02919  0.18315  2.73260 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev. Corr
##  ID       (Intercept) 0.39583  0.6291       
##           age_16      0.01066  0.1032   1.00
##  Residual             1.84261  1.3574       
## Number of obs: 132, groups:  ID, 22
## 
## Fixed effects:
##              Estimate Std. Error t value
## (Intercept)  0.202901   0.398212   0.510
## age_16      -0.009516   0.187173  -0.051
## A_KA         6.651585   0.576570  11.536
## age_16:A_KA  0.674714   0.268996   2.508
## 
## Correlation of Fixed Effects:
##             (Intr) age_16 A_KA  
## age_16      -0.711              
## A_KA        -0.691  0.491       
## age_16:A_KA  0.495 -0.696 -0.695

This is obviously a bad model fit, but the differences are clear.

return_meansd_16_df("train_h_ausd")
## [1] "baseline to lmem_age: 0.0705273294570296"
## [1] "baseline to lmem_tr: 6.55713431212708e-14"
## [1] "baseline to lmem_age_tr_i: 1.52537911633164e-14"
## [1] "lmem_tr to lmem_age_tr: 0.0247951906081345"
## [1] "lmem_age_tr to lmem_age_tr_i: 0.0129100498801037"
## # A tibble: 1 x 3
##   A               K               model       
##   <chr>           <chr>           <chr>       
## 1 6.8545 ± 0.7647 0.2029 ± 0.0888 train_h_ausd