Altitude Script

Load packages

library(tidyverse)
library(ggpubr)
library(readxl)
library(lme4)
library(performance)
library(haven)
library(robustlmm) 
library(emmeans)
library(extrafont)
#font_import()
#loadfonts(device = "all")

Data

data<- data %>%
  mutate(RPEdif = (RPELeg - RPEBreathe)) 

data2 =  data %>%
  mutate(Altitude_code = recode(Altitude_code, "1" = "Sea", "2" = "Altitude", "3" = "Altitude")) %>%
  mutate(Altitude_code = factor(Altitude_code, levels = c("Sea", "Altitude")) %>%
           fct_explicit_na())
head(data)
# A tibble: 6 × 14
  ID    Replication GD    TimeinEnvironment Altitude Altitude_code Duration
  <fct> <fct>       <fct>             <dbl>    <dbl> <fct>            <dbl>
1 8     1           0                   168     11.9 1                   98
2 8     2           0                   168     11.9 1                   98
3 10    1           0                   168     11.9 1                   95
4 10    2           0                   168     11.9 1                   98
5 10    3           0                   168     11.9 1                   98
6 27    1           0                   168     11.9 1                   95
# ℹ 7 more variables: Distance <dbl>, Distancemin <dbl>,
#   HighSpeedRunning <dbl>, HSRmin <dbl>, RPELeg <dbl>, RPEBreathe <dbl>,
#   RPEdif <dbl>

Filter data into match and training

Game2<-subset(data2 ,GD ==  "0" )
Game2<-data.frame(Game2)

Train<-subset(data2 ,GD ==  c("1","2" ))

Example code for match data

Visualization of Match data: RPE

b <- ggplot(Game2) +
  aes(x = Altitude_code, y = RPEBreathe, fill = Altitude_code) +
  geom_boxplot() +
  scale_fill_manual(values = c(Sea = "#cbd6e4", Altitude = "#b04238")) +
  geom_jitter(aes(fill = Altitude_code), color = "grey2", alpha = 0.5, size = 2, shape = 21) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.text.y = element_text(size = 12, family = 'Arial', color = 'black'),
        axis.text.x = element_text(size = 12, family = 'Arial', color = 'black'),
        plot.subtitle = element_text(face = "bold.italic", size = 14, family = "Arial"),
        axis.title.y = element_text(size = 14, family = 'Arial',face = "bold")) +
  scale_y_continuous(
    limits = c(0, 120),
    breaks = c(2, 5, 13, 25, 35, 50, 70, 90, 100, 120),
    labels = c("Minimal", "Very Easy", "Easy", "Moderate", "Somewhat hard", "Hard", "Very hard", "Extremely hard", "Almost Maximal", "Absolute Max")
  ) +
  labs(y = "RPE: CR-100 scale (AU)", x = "", subtitle = "Breathlessness exertion")

l <- ggplot(Game2) +
  aes(x = Altitude_code, y = RPELeg, fill = Altitude_code) +
  geom_boxplot() +
  scale_fill_manual(values = c(Sea = "#cbd6e4", Altitude = "#b04238")) +
   geom_jitter(color = "grey2", alpha = 0.8, size = 1.5) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.text.y = element_text(size = 12, family = 'Arial', color = 'black'),
        axis.text.x = element_text(size = 12, family = 'Arial', color = 'black')) +
    theme(plot.subtitle = element_text(
  face = "bold.italic",
  size = 14,
  family = "Arial"
))+
  scale_y_continuous(
    limits = c(0, 120),
    breaks = c(2, 5, 13, 25, 35, 50, 70, 90, 100, 120),
    labels = c("Minimal", "Very Easy", "Easy", "Moderate", "Somewhat hard", "Hard", "Very hard", "Extremely hard", "Almost Maximal", "Absolute Max")
  ) +
  labs(y = "", x = "", subtitle = "Leg exertion")

d <- ggplot(Game2) +
  aes(x = Altitude_code, y = RPEdif, fill = Altitude_code) +
  geom_boxplot() +
  scale_fill_manual(values = c(Sea = "#cbd6e4", Altitude = "#b04238")) +
  geom_jitter(aes(fill = Altitude_code), color = "grey2", alpha = 0.5, size = 1.5, shape = 21) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.text.y = element_text(size = 12, family = 'Arial', color = 'black'),
        axis.text.x = element_text(size = 12, family = 'Arial', color = 'black'),
        plot.subtitle = element_text(face = "bold.italic", size = 14, family = "Arial"),
        axis.title.y = element_text(size = 14, family = 'Arial',face = "bold")) +
  labs(y = "RPE difference (AU)", x = "", subtitle = "Leg - Breathlessness exertion")

fig <- ggarrange(b, l, d, nrow = 1)

fig

Visualization of match data: Running data

td <- ggplot(Game2) +
  aes(x = Altitude_code, y = Distancemin , fill = Altitude_code) +
  geom_boxplot() +
  scale_fill_manual(values = c(Sea = "#cbd6e4", Altitude = "#b04238")) +
  geom_jitter(aes(fill = Altitude_code), color = "grey2", alpha = 0.5, size = 2, shape = 21) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.text.y = element_text(size = 12, family = 'Arial', color = 'black'),
        axis.text.x = element_text(size = 12, family = 'Arial', color = 'black'),
        plot.subtitle = element_text(face = "bold.italic", size = 14, family = "Arial"),
        axis.title.y = element_text(size = 14, family = 'Arial',face = "bold")) +
  labs(
   y = "Distance (m·min)",
    x = "", title = "",
    subtitle = "Total distance (m·min)"
  )


hsr <-ggplot(Game2) +
  aes(x = Altitude_code, y = HSRmin , fill = Altitude_code) +
   geom_boxplot() +
  scale_fill_manual(values = c(Sea = "#cbd6e4", Altitude = "#b04238")) +
  geom_jitter(aes(fill = Altitude_code), color = "grey2", alpha = 0.5, size = 2, shape = 21) +
  theme_minimal() +
  theme(legend.position = "none",
        axis.text.y = element_text(size = 12, family = 'Arial', color = 'black'),
        axis.text.x = element_text(size = 12, family = 'Arial', color = 'black'),
        plot.subtitle = element_text(face = "bold.italic", size = 14, family = "Arial"),
        axis.title.y = element_text(size = 14, family = 'Arial',face = "bold")) +
  labs(
   y = "",
    x = "", title = "",
    subtitle = "High-speed running distance (m·min)"
  )


fig2<-ggarrange(td, hsr, nrow = 1)
fig2

Analysis of match data

Model development (example for RPE Legs)

null<- lmer(RPELeg ~ 1  + (1| ID), Game2)
mod1<- lmer(RPELeg ~ 1 + Altitude_code + (1| ID), Game2)
mod2<- lmer(RPELeg ~ 1 + Altitude_code + Replication + (1| ID), Game2)
mod3<- lmer(RPELeg ~ 1 + Altitude_code + Replication + Duration + (1| ID), Game2)
mod4<- lmer(RPELeg~ 1 + Altitude_code  + Duration + (1| ID), Game2)

compare_performance(null, mod1,mod2,mod3,mod4)
# Comparison of Model Performance Indices

Name |   Model | AIC (weights) | AICc (weights) | BIC (weights) | R2 (cond.)
----------------------------------------------------------------------------
null | lmerMod | 289.7 (0.023) |  290.5 (0.047) | 294.5 (0.117) |      0.426
mod1 | lmerMod | 290.4 (0.017) |  291.7 (0.026) | 296.7 (0.038) |      0.442
mod2 | lmerMod | 293.2 (0.004) |  296.1 (0.003) | 302.7 (0.002) |      0.427
mod3 | lmerMod | 285.6 (0.180) |  289.6 (0.072) | 296.7 (0.038) |      0.679
mod4 | lmerMod | 282.7 (0.777) |  284.7 (0.851) | 290.6 (0.805) |      0.686

Name | R2 (marg.) |   ICC |  RMSE |  Sigma
------------------------------------------
null |      0.000 | 0.426 | 8.631 | 10.215
mod1 |      0.025 | 0.428 | 8.428 | 10.160
mod2 |      0.047 | 0.399 | 8.424 | 10.463
mod3 |      0.232 | 0.582 | 6.169 |  8.320
mod4 |      0.223 | 0.596 | 6.266 |  8.104
 anova(null, mod1,mod2,mod3,mod4)
refitting model(s) with ML (instead of REML)
Data: Game2
Models:
null: RPELeg ~ 1 + (1 | ID)
mod1: RPELeg ~ 1 + Altitude_code + (1 | ID)
mod4: RPELeg ~ 1 + Altitude_code + Duration + (1 | ID)
mod2: RPELeg ~ 1 + Altitude_code + Replication + (1 | ID)
mod3: RPELeg ~ 1 + Altitude_code + Replication + Duration + (1 | ID)
     npar    AIC    BIC  logLik deviance  Chisq Df Pr(>Chisq)   
null    3 289.71 294.46 -141.86   283.71                        
mod1    4 290.39 296.73 -141.19   282.39 1.3209  1   0.250433   
mod4    5 282.70 290.62 -136.35   272.70 9.6881  1   0.001855 **
mod2    6 293.15 302.65 -140.58   281.15 0.0000  1   1.000000   
mod3    7 285.56 296.65 -135.78   271.56 9.5920  1   0.001954 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
compare_performance(null, mod1,mod2,mod3,mod4, rank = TRUE)
# Comparison of Model Performance Indices

Name |   Model | R2 (cond.) | R2 (marg.) |   ICC |  RMSE |  Sigma | AIC weights
-------------------------------------------------------------------------------
mod4 | lmerMod |      0.686 |      0.223 | 0.596 | 6.266 |  8.104 |       0.777
mod3 | lmerMod |      0.679 |      0.232 | 0.582 | 6.169 |  8.320 |       0.180
mod1 | lmerMod |      0.442 |      0.025 | 0.428 | 8.428 | 10.160 |       0.017
null | lmerMod |      0.426 |      0.000 | 0.426 | 8.631 | 10.215 |       0.023
mod2 | lmerMod |      0.427 |      0.047 | 0.399 | 8.424 | 10.463 |       0.004

Name | AICc weights | BIC weights | Performance-Score
-----------------------------------------------------
mod4 |        0.851 |       0.805 |            99.02%
mod3 |        0.072 |       0.038 |            64.57%
mod1 |        0.026 |       0.038 |             7.71%
null |        0.047 |       0.117 |             5.74%
mod2 |        0.003 |       0.002 |             3.66%
check_heteroscedasticity(mod4)
Warning: Heteroscedasticity (non-constant error variance) detected (p < .001).
check_normality(mod4)
OK: residuals appear as normally distributed (p = 0.078).
check_collinearity(mod4)
# Check for Multicollinearity
Warning: Argument `pattern` is deprecated. Please use `select` instead.

Low Correlation

          Term  VIF       VIF 95% CI Increased SE Tolerance Tolerance 95% CI
 Altitude_code 1.02 [1.00, 4.50e+05]         1.01      0.98     [0.00, 1.00]
      Duration 1.02 [1.00, 4.50e+05]         1.01      0.98     [0.00, 1.00]

Moving to a robust model

Total Distance

rlm_GD_TD <- rlmer(Distance ~ 1 + Duration + Altitude_code + (1| ID), Game2)

residuals <- residuals(rlm_GD_TD )

# Perform normality tests (e.g., Shapiro-Wilk test)
shapiro.test(residuals )

    Shapiro-Wilk normality test

data:  residuals
W = 0.95827, p-value = 0.128
# Alternatively, you can create a QQ plot
qqnorm(residuals  )
qqline(residuals )

summary(rlm_GD_TD )
Robust linear mixed model fit by DAStau 
Formula: Distance ~ 1 + Duration + Altitude_code + (1 | ID) 
   Data: Game2 

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.75977 -0.63898  0.01019  0.58416  1.38970 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept) 150834   388.4   
 Residual             433951   658.7   
Number of obs: 42, groups: ID, 20

Fixed effects:
                      Estimate Std. Error t value
(Intercept)           2072.337    896.292   2.312
Duration                80.273      9.736   8.245
Altitude_codeAltitude -387.588    219.536  -1.765

Correlation of Fixed Effects:
            (Intr) Duratn
Duration    -0.979       
Alttd_cdAlt -0.235  0.113

Robustness weights for the residuals: 
 37 weights are ~= 1. The remaining 5 ones are
   11    22    23    27    32 
0.997 0.487 0.922 0.997 0.943 

Robustness weights for the random effects: 
 All 20 weights are ~= 1.

Rho functions used for fitting:
  Residuals:
    eff: smoothed Huber (k = 1.345, s = 10) 
    sig: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
  Random Effects, variance component 1 (ID):
    eff: smoothed Huber (k = 1.345, s = 10) 
    vcp: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
emm_rlm_GD_TD  <- emmeans(rlm_GD_TD, pairwise ~ Altitude_code)
emm_rlm_GD_TD 
$emmeans
 Altitude_code emmean  SE  df asymp.LCL asymp.UCL
 Sea             9326 182 Inf      8969      9682
 Altitude        8938 181 Inf      8584      9292

Confidence level used: 0.95 

$contrasts
 contrast       estimate  SE  df z.ratio p.value
 Sea - Altitude      388 220 Inf   1.765  0.0775
confint(emm_rlm_GD_TD , level = 0.95)
$emmeans
 Altitude_code emmean  SE  df asymp.LCL asymp.UCL
 Sea             9326 182 Inf      8969      9682
 Altitude        8938 181 Inf      8584      9292

Confidence level used: 0.95 

$contrasts
 contrast       estimate  SE  df asymp.LCL asymp.UCL
 Sea - Altitude      388 220 Inf     -42.7       818

Confidence level used: 0.95 

HSR

rlm_GD_HSR <- rlmer(HighSpeedRunning ~ 1 + Duration + Altitude_code + (1| ID), Game2)

residuals <- residuals(rlm_GD_HSR )

# Perform normality tests (e.g., Shapiro-Wilk test)
shapiro.test(residuals )

    Shapiro-Wilk normality test

data:  residuals
W = 0.96125, p-value = 0.1637
# Alternatively, you can create a QQ plot
qqnorm(residuals  )
qqline(residuals )

summary(rlm_GD_HSR )
Robust linear mixed model fit by DAStau 
Formula: HighSpeedRunning ~ 1 + Duration + Altitude_code + (1 | ID) 
   Data: Game2 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.2151 -0.4828 -0.1034  0.4249  2.1681 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept) 27224    165.0   
 Residual             16657    129.1   
Number of obs: 42, groups: ID, 20

Fixed effects:
                      Estimate Std. Error t value
(Intercept)            137.662    211.821   0.650
Duration                 4.486      2.332   1.923
Altitude_codeAltitude  -56.699     45.379  -1.249

Correlation of Fixed Effects:
            (Intr) Duratn
Duration    -0.971       
Alttd_cdAlt -0.164  0.054

Robustness weights for the residuals: 
 40 weights are ~= 1. The remaining 2 ones are
    2    35 
0.620 0.792 

Robustness weights for the random effects: 
 17 weights are ~= 1. The remaining 3 ones are
   11    12    19 
0.580 0.971 0.945 

Rho functions used for fitting:
  Residuals:
    eff: smoothed Huber (k = 1.345, s = 10) 
    sig: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
  Random Effects, variance component 1 (ID):
    eff: smoothed Huber (k = 1.345, s = 10) 
    vcp: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
emm_rlm_GD_HSR  <- emmeans(rlm_GD_HSR, pairwise ~ Altitude_code)
emm_rlm_GD_HSR
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea              543 50.6 Inf       444       642
 Altitude         486 50.0 Inf       388       584

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df z.ratio p.value
 Sea - Altitude     56.7 45.4 Inf   1.249  0.2115
confint(emm_rlm_GD_HSR , level = 0.95)
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea              543 50.6 Inf       444       642
 Altitude         486 50.0 Inf       388       584

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df asymp.LCL asymp.UCL
 Sea - Altitude     56.7 45.4 Inf     -32.2       146

Confidence level used: 0.95 

sRPE Legs

rlm_GD_Leg <- rlmer(RPELeg ~ 1 + Duration + Altitude_code + (1| ID), Game2)

residuals <- residuals(rlm_GD_Leg )

# Perform normality tests (e.g., Shapiro-Wilk test)
shapiro.test(residuals )

    Shapiro-Wilk normality test

data:  residuals
W = 0.94101, p-value = 0.05462
# Alternatively, you can create a QQ plot
qqnorm(residuals  )
qqline(residuals )

summary(rlm_GD_Leg  )
Robust linear mixed model fit by DAStau 
Formula: RPELeg ~ 1 + Duration + Altitude_code + (1 | ID) 
   Data: Game2 

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.56274 -0.27252  0.09252  0.47114  1.48035 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept) 92.45    9.615   
 Residual             56.53    7.519   
Number of obs: 36, groups: ID, 18

Fixed effects:
                      Estimate Std. Error t value
(Intercept)            34.8051    14.1179   2.465
Duration                0.5339     0.1518   3.517
Altitude_codeAltitude  -4.0301     2.9823  -1.351

Correlation of Fixed Effects:
            (Intr) Duratn
Duration    -0.974       
Alttd_cdAlt -0.239  0.127

Robustness weights for the residuals: 
 32 weights are ~= 1. The remaining 4 ones are
    6     7    19    33 
0.525 0.896 0.997 0.987 

Robustness weights for the random effects: 
 17 weights are ~= 1. The remaining one are
   16 
0.475 

Rho functions used for fitting:
  Residuals:
    eff: smoothed Huber (k = 1.345, s = 10) 
    sig: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
  Random Effects, variance component 1 (ID):
    eff: smoothed Huber (k = 1.345, s = 10) 
    vcp: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
emm_rlm_GD_Leg  <- emmeans(rlm_GD_Leg, pairwise ~ Altitude_code)
emm_rlm_GD_Leg 
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea             83.5 3.20 Inf      77.3      89.8
 Altitude        79.5 3.08 Inf      73.5      85.5

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df z.ratio p.value
 Sea - Altitude     4.03 2.98 Inf   1.351  0.1766
confint(emm_rlm_GD_Leg  , level = 0.95)
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea             83.5 3.20 Inf      77.3      89.8
 Altitude        79.5 3.08 Inf      73.5      85.5

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df asymp.LCL asymp.UCL
 Sea - Altitude     4.03 2.98 Inf     -1.82      9.88

Confidence level used: 0.95 

sRPE BReath

rlm_GD_Breath <- rlmer(RPEBreathe ~ 1 + Duration + Altitude_code + (1| ID), Game2)

residuals <- residuals(rlm_GD_Breath  )

# Perform normality tests (e.g., Shapiro-Wilk test)
shapiro.test(residuals )

    Shapiro-Wilk normality test

data:  residuals
W = 0.75789, p-value = 2.629e-06
# Alternatively, you can create a QQ plot
qqnorm(residuals  )
qqline(residuals )

summary(rlm_GD_Breath  )
Robust linear mixed model fit by DAStau 
Formula: RPEBreathe ~ 1 + Duration + Altitude_code + (1 | ID) 
   Data: Game2 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-4.6792 -0.4374  0.1299  0.5179  1.1947 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept) 53.37    7.305   
 Residual             55.83    7.472   
Number of obs: 36, groups: ID, 18

Fixed effects:
                      Estimate Std. Error t value
(Intercept)            48.5922    13.0475   3.724
Duration                0.3695     0.1401   2.637
Altitude_codeAltitude   5.0635     2.8869   1.754

Correlation of Fixed Effects:
            (Intr) Duratn
Duration    -0.977       
Alttd_cdAlt -0.253  0.137

Robustness weights for the residuals: 
 33 weights are ~= 1. The remaining 3 ones are
    6    11    17 
0.287 0.409 0.410 

Robustness weights for the random effects: 
 17 weights are ~= 1. The remaining one are
   16 
0.934 

Rho functions used for fitting:
  Residuals:
    eff: smoothed Huber (k = 1.345, s = 10) 
    sig: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
  Random Effects, variance component 1 (ID):
    eff: smoothed Huber (k = 1.345, s = 10) 
    vcp: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
emm_rlm_GD_Breath  <- emmeans(rlm_GD_Breath , pairwise ~ Altitude_code)
emm_rlm_GD_Breath 
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea             82.3 2.76 Inf      76.9      87.7
 Altitude        87.4 2.64 Inf      82.2      92.6

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df z.ratio p.value
 Sea - Altitude    -5.06 2.89 Inf  -1.754  0.0794
confint(emm_rlm_GD_Breath  , level = 0.95)
$emmeans
 Altitude_code emmean   SE  df asymp.LCL asymp.UCL
 Sea             82.3 2.76 Inf      76.9      87.7
 Altitude        87.4 2.64 Inf      82.2      92.6

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df asymp.LCL asymp.UCL
 Sea - Altitude    -5.06 2.89 Inf     -10.7     0.595

Confidence level used: 0.95 

sRPE dif

rlm_GD_dif <- rlmer(RPEdif ~ 1 + Duration + Altitude_code + (1| ID), Game2)
boundary (singular) fit: see help('isSingular')
residuals <- residuals(rlm_GD_dif)

# Perform normality tests (e.g., Shapiro-Wilk test)
shapiro.test(residuals )

    Shapiro-Wilk normality test

data:  residuals
W = 0.88833, p-value = 0.001662
# Alternatively, you can create a QQ plot
qqnorm(residuals  )
qqline(residuals )

summary(rlm_GD_dif )
Robust linear mixed model fit by DAStau 
Formula: RPEdif ~ 1 + Duration + Altitude_code + (1 | ID) 
   Data: Game2 

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-3.0934 -0.5319 -0.1768  0.4018  3.9028 

Random effects:
 Groups   Name        Variance Std.Dev.
 ID       (Intercept)  0.00    0.000   
 Residual             20.49    4.527   
Number of obs: 36, groups: ID, 18

Fixed effects:
                       Estimate Std. Error t value
(Intercept)            -7.06232    6.24827  -1.130
Duration                0.09890    0.06572   1.505
Altitude_codeAltitude -10.26481    1.57766  -6.506

Correlation of Fixed Effects:
            (Intr) Duratn
Duration    -0.985       
Alttd_cdAlt -0.313  0.194

Robustness weights for the residuals: 
 27 weights are ~= 1. The remaining 9 ones are
    6    11    18    24    26    29    30    32    36 
0.481 0.345 0.822 0.911 0.435 0.722 0.408 0.802 0.815 

Robustness weights for the random effects: 
 All 18 weights are ~= 1.

Rho functions used for fitting:
  Residuals:
    eff: smoothed Huber (k = 1.345, s = 10) 
    sig: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
  Random Effects, variance component 1 (ID):
    eff: smoothed Huber (k = 1.345, s = 10) 
    vcp: smoothed Huber, Proposal 2 (k = 1.345, s = 10) 
emm_rlm_GD_dif  <- emmeans(rlm_GD_dif, pairwise ~ Altitude_code)
emm_rlm_GD_dif
$emmeans
 Altitude_code emmean  SE  df asymp.LCL asymp.UCL
 Sea             1.97 1.1 Inf      -0.2      4.13
 Altitude       -8.30 1.1 Inf     -10.5     -6.13

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df z.ratio p.value
 Sea - Altitude     10.3 1.58 Inf   6.506  <.0001
confint(emm_rlm_GD_dif  , level = 0.95)
$emmeans
 Altitude_code emmean  SE  df asymp.LCL asymp.UCL
 Sea             1.97 1.1 Inf      -0.2      4.13
 Altitude       -8.30 1.1 Inf     -10.5     -6.13

Confidence level used: 0.95 

$contrasts
 contrast       estimate   SE  df asymp.LCL asymp.UCL
 Sea - Altitude     10.3 1.58 Inf      7.17      13.4

Confidence level used: 0.95