Group CoM Analysis 2

library(tidyverse)
library(tidyr)
library(dplyr)
library(readr)
library(purrr)
library(ggplot2)
library(e1071)
library(emmeans)
library(lme4)
library(lmerTest)
library(patchwork)
library(brms)
library(bayesplot)
library(car)
library(effects)

# Disable emmeans computation limits for large models
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

The used data here is mixed: the training blocks are cleaned of all trials that had a accuracy <0.8 and also the trials with xsens errors are deleted. The Test-Blocks (4 & 5) involve all trials except the ones with xsens errors.

#Root mean square
#Root mean square (RMS) of acceleration is an often-used value in gait analysis research to quantify the magnitude of body segment accelerations(Menz et al., 2003; Mizuike et al., 2009; Sekine et al., 2013; Senden et al., 2012). RMS can be easily computed with the raw accelerometer data and is seen as an uncomplicated approach to analyse the magnitude of accelerations in each axis(Mizuike et al., 2009; Sekine et al., 2013)). Although this study does not directly analyses gait performance, the movements performed in the ds-dsp task resemble walking movements and therefore it is seen as a suitable approach for the following analysis. In the present study, RMS of the center of mass acceleration is used to evaluate the movement characteristics across task phases and sequence lengths, providing insights into movement control and paired with its standard deviation movement variability.
# -------- Step-Level Step Counts --------
step_counts <- tibble(
  Block = c(1, 2, 3, 4, 5),
  Steps = c(6, 12, 18, 18, 18)
)

# -------- Assign Steps Helper Function --------
assign_steps_by_block <- function(df, steps_df = step_counts) {
  df %>%
    inner_join(steps_df, by = "Block") %>%
    group_by(subject, Block, trial) %>%
    mutate(Step = cut_number(row_number(), n = unique(Steps), labels = FALSE)) %>%
    ungroup()
}

# -------- Tag Trial Phases Function (26 or 25 as end marker) --------
tag_trial_phases <- function(df) {
  df %>%
    group_by(subject, Block, trial) %>%
    mutate(
      start_ms = ms[which(Marker.Text == 27)[1]],
      end_ms = {
        end_candidates <- which(Marker.Text %in% c(26, 25))
        if (length(end_candidates) > 0) ms[end_candidates[1]] else NA_real_
      },
      phase = case_when(
        !is.na(start_ms) & !is.na(end_ms) & ms >= start_ms & ms <= end_ms ~ "Execution",
        !is.na(start_ms) & ms >= (start_ms - 1500) & ms < start_ms ~ "Preparation",
        TRUE ~ NA_character_
      )
    ) %>%
    ungroup() %>%
    filter(!is.na(phase))
}
# Load Data
mixed_files <- list.files("/Users/can/Documents/Uni/Thesis/Data/Xsens/cleaned_csv/merged/Cleaned", pattern = "_mixed\\.csv$", full.names = TRUE)
all_data_mixed <- map_dfr(mixed_files, read_csv)

# Tag trial phases once
tagged_data <- tag_trial_phases(all_data_mixed) %>% mutate(DataType = "Mixed")
# Compute RMS Function
compute_rms <- function(df) {
  df %>%
    group_by(subject, Block, trial, phase) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    group_by(subject, Block, phase) %>%
    arrange(trial) %>%
    mutate(TrialInBlock = row_number()) %>%
    ungroup()
}
# Compute RMS per trial and phase (used throughout)
rms_data <- compute_rms(tagged_data) %>%
  mutate(DataType = "Mixed")


group_rms_summary <- rms_data %>%
  group_by(Block, TrialInBlock, phase) %>%
  summarise(
    mean_rms_x = mean(rms_x, na.rm = TRUE),
    se_rms_x = sd(rms_x, na.rm = TRUE) / sqrt(n()),
    mean_rms_y = mean(rms_y, na.rm = TRUE),
    se_rms_y = sd(rms_y, na.rm = TRUE) / sqrt(n()),
    mean_rms_z = mean(rms_z, na.rm = TRUE),
    se_rms_z = sd(rms_z, na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  )
# ---- Plot Mean RMS per Axis ----

plot_rms_axis <- function(data, axis, y_label, title_prefix) {
  axis_mean <- paste0("mean_rms_", axis)
  axis_se <- paste0("se_rms_", axis)

  ggplot(data, aes(x = TrialInBlock, y = .data[[axis_mean]], color = factor(Block))) +
    geom_line(size = 1) +
    geom_ribbon(aes(
      ymin = .data[[axis_mean]] - .data[[axis_se]],
      ymax = .data[[axis_mean]] + .data[[axis_se]],
      fill = factor(Block)
    ), alpha = 0.2, color = NA) +
    facet_wrap(~ phase, nrow = 1) +
    ylim(0, 2) +
    labs(
      title = paste(title_prefix, "-", toupper(axis), "Axis"),
      x = "Trial Number",
      y = y_label,
      color = "Block",
      fill = "Block"
    ) +
    theme_minimal() +
    theme(text = element_text(size = 12))
}

# ---- Plot for Mixed Dataset Only ----
plot_rms_axis(group_rms_summary, "x", "RMS Acceleration", "Mean RMS of CoM Acceleration")

plot_rms_axis(group_rms_summary, "y", "RMS Acceleration", "Mean RMS of CoM Acceleration")

plot_rms_axis(group_rms_summary, "z", "RMS Acceleration", "Mean RMS of CoM Acceleration")

# -------- Acceleration Trends over Trials (Execution & Preparation) --------

plot_acc_trends <- function(df, phase_filter, y_limit, title_text) {
  colors <- c("blue", "green", "red", "purple", "orange")
  plot_list <- list()

  for (block in 1:5) {
    block_data <- df %>% filter(phase == phase_filter, Block == block)
    if (nrow(block_data) > 0) {
      block_long <- block_data %>%
        pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
        mutate(Axis = sub("rms_", "", Axis))

      p <- ggplot(block_long, aes(x = trial, y = RMS)) +
        geom_point(alpha = 0.6) +
        geom_smooth(method = "lm", se = TRUE, color = colors[block]) +
        facet_wrap(~ Axis, nrow = 1) +
        ylim(0, y_limit) +
        labs(
          title = paste("Block", block),
          x = "Trial",
          y = "RMS Acceleration (m/s²)"
        ) +
        theme_minimal()

      plot_list[[paste0("Block", block)]] <- p
    }
  }

  if (length(plot_list) > 0) {
    wrap_plots(plot_list, nrow = 1) +
      plot_annotation(
        title = title_text,
        theme = theme(plot.title = element_text(hjust = 0.5, size = 16))
      )
  } else {
    message("No plots to display. Check that data exists for the requested phase and blocks.")
  }
}

# ---- Generate Plots for Execution and Preparation ----
print(plot_acc_trends(rms_data, "Execution", 2.5, "CoM RMS Acceleration Trends Across Trials - Execution Phase"))
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 65 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 65 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 56 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 56 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 17 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 17 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 39 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 39 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 17 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 17 rows containing missing values or values outside the scale range
(`geom_point()`).

print(plot_acc_trends(rms_data, "Preparation", 1.0, "CoM RMS Acceleration Trends Across Trials - Preparation Phase"))
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 45 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 45 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 69 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 69 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 61 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 61 rows containing missing values or values outside the scale range
(`geom_point()`).
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 44 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 44 rows containing missing values or values outside the scale range
(`geom_point()`).

1 Acceleration in Blocks and phases

#1.1.1 RMS Acceleration Box Plots - Execution

# ----- Execution Phase RMS Boxplots -----
exec_data <- rms_data %>% filter(phase == "Execution")

for (axis in c("x", "y", "z")) {
  axis_col <- paste0("rms_", axis)
  gg <- ggplot(exec_data, aes(x = factor(Block), y = .data[[axis_col]], fill = phase)) +
    geom_boxplot(alpha = 0.7, outlier.shape = NA) +
    geom_jitter(width = 0.2, alpha = 0.4, size = 0.6) +
    geom_vline(xintercept = 3.5, linetype = "dashed", color = "black") +
    ylim(0, 2.5) +
    labs(
      title = paste("Execution Phase: CoM Acceleration RMS -", toupper(axis), "Axis"),
      x = "Block",
      y = "RMS Acceleration"
    ) +
    theme_minimal() +
    theme(text = element_text(size = 12), legend.position = "none")
  print(gg)
}
Warning: Removed 3 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 3 rows containing missing values or values outside the scale range
(`geom_point()`).

Warning: Removed 16 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 16 rows containing missing values or values outside the scale range
(`geom_point()`).

Warning: Removed 175 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 175 rows containing missing values or values outside the scale range
(`geom_point()`).

#1.1.2 RMS Acceleration Box Plots - Preparation

# ----- Preparation Phase RMS Boxplots -----

# Extract 1500ms Preparation Window
prep_window_ms <- 1500

extract_preparation_phase <- function(df) {
  df %>%
    group_split(subject, Block, trial) %>%
    map_dfr(function(trial_df) {
      exec_start_row <- which(trial_df$Marker.Text == 27)[1]
      if (!is.na(exec_start_row) && exec_start_row > 1) {
        exec_start_ms <- trial_df$ms[exec_start_row]
        trial_df %>%
          filter(ms >= (exec_start_ms - prep_window_ms) & ms < exec_start_ms) %>%
          mutate(phase = "Preparation")
      } else {
        NULL
      }
    })
}

prep_data <- extract_preparation_phase(tagged_data)

# Compute preparation phase RMS
prep_rms <- prep_data %>%
  group_by(subject, Block, trial, phase) %>%
  summarise(
    rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
    rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
    rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
    .groups = "drop"
  )

# Plot preparation boxplots
for (axis in c("x", "y", "z")) {
  axis_col <- paste0("rms_", axis)
  fill_color <- switch(axis,
                       "x" = "skyblue",
                       "y" = "salmon",
                       "z" = "seagreen")
  
  gg <- ggplot(prep_rms, aes(x = factor(Block), y = .data[[axis_col]])) +
    geom_boxplot(fill = fill_color, alpha = 0.7, outlier.shape = NA) +
    geom_jitter(width = 0.2, alpha = 0.4, size = 0.6) +
    geom_vline(xintercept = 3.5, linetype = "dashed", color = "black") +
    ylim(0, 0.5) +
    labs(
      title = paste("Preparation Phase: CoM RMS -", toupper(axis), "Axis"),
      x = "Block",
      y = "RMS Acceleration"
    ) +
    theme_minimal()
  print(gg)
}
Warning: Removed 159 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 159 rows containing missing values or values outside the scale range
(`geom_point()`).

Warning: Removed 159 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Removed 159 rows containing missing values or values outside the scale range
(`geom_point()`).

Warning: Removed 217 rows containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 217 rows containing missing values or values outside the scale range
(`geom_point()`).

#1.2.1 LMM to assess whether block and phase significantly influence rms (per axis)

# --- Function: Run Random Intercept LMMs and Extract ANOVA P-Values ---
extract_rms_interceptonly_pvalues <- function(data, label) {
  # Assume data is already tagged
  rms_data <- compute_rms(data) %>%
    mutate(Block = factor(Block), subject = factor(subject))

  axes <- c("x", "y", "z")

  results <- map_dfr(axes, function(axis) {
    formula <- as.formula(paste0("rms_", axis, " ~ Block * phase + (1 | subject) + (1 | TrialInBlock)"))
    model <- lmer(formula, data = rms_data, REML = FALSE)
    anova_tbl <- anova(model)

    tibble(
      Dataset = label,
      Axis = toupper(axis),
      `Block p-value` = anova_tbl["Block", "Pr(>F)"],
      `Phase p-value` = anova_tbl["phase", "Pr(>F)"],
      `Interaction p-value` = anova_tbl["Block:phase", "Pr(>F)"]
    )
  })

  return(results)
}

# --- Run Model on Mixed Data (Tagged Once) ---
interceptonly_pvals <- extract_rms_interceptonly_pvalues(tagged_data, "Mixed")
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
# --- Display Results ---
print(interceptonly_pvals)
# A tibble: 3 × 5
  Dataset Axis  `Block p-value` `Phase p-value` `Interaction p-value`
  <chr>   <chr>           <dbl>           <dbl>                 <dbl>
1 Mixed   X            2.09e-33               0              8.06e-76
2 Mixed   Y            5.37e-32               0              6.63e-61
3 Mixed   Z            2.30e-25               0              1.28e-43
#results:
#block p-value <0.05 :This suggests learning or adaptation effects across blocks
#phase p-value 0 because it is either execution or preparation 
#interaction <0.05 :this suggest the effect of block is different depending on phase

#clean vs unclean dataset: unclean p-values< clean p-values: probably because of more variability
# --- Extended Function: Run Random Intercept LMMs and Extract All Outputs ---
extract_rms_intercept_model_diagnostics <- function(data, label) {
  rms_data <- compute_rms(data) %>%
    mutate(Block = factor(Block), subject = factor(subject))

  axes <- c("x", "y", "z")

  results <- list()

  for (axis in axes) {
    formula <- as.formula(paste0("rms_", axis, " ~ Block * phase + (1 | subject) + (1 | TrialInBlock)"))
    model <- lmer(formula, data = rms_data, REML = FALSE)

    # Store everything
    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      anova = anova(model),
      emmeans = emmeans(model, ~ Block * phase),
      fixed_effects = fixef(model),
      random_effects = ranef(model),
      scaled_residuals = resid(model, scaled = TRUE),
      model = model  # include model object in case you want to inspect further
    )
  }

  return(results)
}

# --- Run and Store Full Diagnostics ---
intercept_diagnostics <- extract_rms_intercept_model_diagnostics(tagged_data, "Mixed")
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
cat("\n=== Axis X ===\n")

=== Axis X ===
print(intercept_diagnostics$Mixed_X$anova)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF  DenDF  F value    Pr(>F)    
Block        10.49    2.62     4 6521.7   40.303 < 2.2e-16 ***
phase       573.66  573.66     1 6521.0 8815.596 < 2.2e-16 ***
Block:phase  23.82    5.95     4 6521.0   91.511 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(intercept_diagnostics$Mixed_X$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.8548 0.0338 22.8  0.78477    0.925
 2     Execution   0.7951 0.0341 23.4  0.72470    0.866
 3     Execution   0.6665 0.0345 24.7  0.59539    0.738
 4     Execution   0.7384 0.0335 21.9  0.66885    0.808
 5     Execution   0.5848 0.0335 21.9  0.51530    0.654
 1     Preparation 0.0653 0.0338 22.6 -0.00462    0.135
 2     Preparation 0.1178 0.0340 23.4  0.04746    0.188
 3     Preparation 0.1670 0.0345 24.6  0.09596    0.238
 4     Preparation 0.1246 0.0335 21.9  0.05505    0.194
 5     Preparation 0.1266 0.0335 21.8  0.05716    0.196

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(intercept_diagnostics$Mixed_X$fixed_effects)
            (Intercept)                  Block2                  Block3 
             0.85480165             -0.05969952             -0.18831819 
                 Block4                  Block5        phasePreparation 
            -0.11640071             -0.26998999             -0.78950868 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.11223106              0.29001003              0.17566536 
Block5:phasePreparation 
             0.33133074 
print(intercept_diagnostics$Mixed_X$random_effects)
$TrialInBlock
   (Intercept)
1            0
2            0
3            0
4            0
5            0
6            0
7            0
8            0
9            0
10           0
11           0
12           0
13           0
14           0
15           0
16           0
17           0
18           0
19           0
20           0
21           0
22           0
23           0
24           0
25           0
26           0
27           0
28           0
29           0
30           0
31           0
32           0
33           0
34           0
35           0
36           0
37           0
38           0
39           0
40           0
41           0
42           0
43           0
44           0
45           0
46           0
47           0

$subject
    (Intercept)
2   0.084959638
3   0.009364058
4  -0.080528746
5  -0.168694714
7  -0.048952044
8   0.054209259
10  0.363123135
11  0.234222092
13 -0.064380022
14  0.068621634
15 -0.055710537
16 -0.013565294
17 -0.107231929
18 -0.022325251
19 -0.152035277
20 -0.114690560
22 -0.094722921
23  0.108337479

with conditional variances for "TrialInBlock" "subject" 
print(head(intercept_diagnostics$Mixed_X$scaled_residuals))
         1          2          3          4          5          6 
-0.6855627 -0.7206152  0.9381860 -0.8704046 -0.4171842 -0.7726668 
cat("\n=== Axis Y ===\n")

=== Axis Y ===
print(intercept_diagnostics$Mixed_Y$anova)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF  DenDF  F value    Pr(>F)    
Block        14.13    3.53     4 6521.7   38.620 < 2.2e-16 ***
phase       640.85  640.85     1 6521.0 7007.730 < 2.2e-16 ***
Block:phase  26.84    6.71     4 6521.0   73.362 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(intercept_diagnostics$Mixed_Y$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution    0.902 0.0385 23.1   0.8225    0.982
 2     Execution    0.844 0.0388 23.9   0.7636    0.924
 3     Execution    0.696 0.0393 25.3   0.6154    0.777
 4     Execution    0.769 0.0381 22.2   0.6902    0.848
 5     Execution    0.608 0.0381 22.1   0.5293    0.687
 1     Preparation  0.064 0.0384 22.9  -0.0155    0.144
 2     Preparation  0.129 0.0388 23.8   0.0493    0.209
 3     Preparation  0.173 0.0393 25.1   0.0924    0.254
 4     Preparation  0.121 0.0381 22.1   0.0422    0.200
 5     Preparation  0.121 0.0381 22.1   0.0417    0.200

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(intercept_diagnostics$Mixed_Y$fixed_effects)
            (Intercept)                  Block2                  Block3 
             0.90214276             -0.05842377             -0.20575453 
                 Block4                  Block5        phasePreparation 
            -0.13285794             -0.29386277             -0.83811781 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.12373927              0.31502104              0.19003310 
Block5:phasePreparation 
             0.35047549 
print(intercept_diagnostics$Mixed_Y$random_effects)
$TrialInBlock
   (Intercept)
1            0
2            0
3            0
4            0
5            0
6            0
7            0
8            0
9            0
10           0
11           0
12           0
13           0
14           0
15           0
16           0
17           0
18           0
19           0
20           0
21           0
22           0
23           0
24           0
25           0
26           0
27           0
28           0
29           0
30           0
31           0
32           0
33           0
34           0
35           0
36           0
37           0
38           0
39           0
40           0
41           0
42           0
43           0
44           0
45           0
46           0
47           0

$subject
   (Intercept)
2   0.07607719
3   0.06014675
4  -0.12497919
5  -0.19130128
7  -0.05470047
8   0.12826081
10  0.38400762
11  0.24920485
13 -0.04855387
14  0.03922394
15 -0.07320697
16 -0.01721857
17 -0.09868179
18 -0.03594357
19 -0.18125383
20 -0.13068631
22 -0.13748388
23  0.15708857

with conditional variances for "TrialInBlock" "subject" 
print(head(intercept_diagnostics$Mixed_Y$scaled_residuals))
         1          2          3          4          5          6 
-0.5318674 -0.5359392  0.3359262 -0.3116383 -0.4810701 -0.5891674 
cat("\n=== Axis Z ===\n")

=== Axis Z ===
print(intercept_diagnostics$Mixed_Z$anova)
Type III Analysis of Variance Table with Satterthwaite's method
             Sum Sq Mean Sq NumDF  DenDF  F value    Pr(>F)    
Block         29.25    7.31     4 6521.7   30.709 < 2.2e-16 ***
phase       1874.32 1874.32     1 6521.0 7871.441 < 2.2e-16 ***
Block:phase   50.03   12.51     4 6521.0   52.528 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(intercept_diagnostics$Mixed_Z$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   1.4005 0.0637 22.9   1.2686    1.532
 2     Execution   1.3897 0.0642 23.6   1.2572    1.522
 3     Execution   1.1908 0.0650 24.9   1.0569    1.325
 4     Execution   1.2873 0.0631 22.0   1.1564    1.418
 5     Execution   1.0224 0.0631 22.0   0.8916    1.153
 1     Preparation 0.0654 0.0636 22.7  -0.0662    0.197
 2     Preparation 0.1707 0.0641 23.5   0.0382    0.303
 3     Preparation 0.2442 0.0649 24.8   0.1104    0.378
 4     Preparation 0.1603 0.0631 21.9   0.0295    0.291
 5     Preparation 0.1581 0.0630 21.9   0.0274    0.289

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(intercept_diagnostics$Mixed_Z$fixed_effects)
            (Intercept)                  Block2                  Block3 
             1.40045721             -0.01071856             -0.20969227 
                 Block4                  Block5        phasePreparation 
            -0.11316313             -0.37806730             -1.33509017 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.11606228              0.38849177              0.20809330 
Block5:phasePreparation 
             0.47083282 
print(intercept_diagnostics$Mixed_Z$random_effects)
$TrialInBlock
     (Intercept)
1  -4.672739e-18
2  -3.785541e-18
3  -2.639675e-18
4  -3.196648e-18
5  -2.018497e-18
6  -1.254622e-18
7  -1.531263e-18
8  -1.534912e-18
9  -9.670340e-19
10 -8.655370e-19
11 -1.800131e-18
12 -1.742469e-18
13 -1.414453e-18
14  7.297968e-19
15 -1.288192e-18
16  1.223828e-19
17 -8.045113e-20
18  1.364653e-18
19  8.512410e-19
20  7.695664e-19
21  7.388552e-19
22  6.277646e-19
23  2.888206e-18
24  1.126255e-18
25  8.512645e-19
26  1.405709e-18
27  4.969577e-19
28  4.371513e-19
29  1.793159e-18
30  7.012849e-19
31  2.616306e-18
32  1.360328e-18
33  5.462224e-19
34  2.275377e-18
35  1.018464e-18
36 -3.964937e-19
37  6.194290e-19
38  1.006329e-19
39  3.669487e-19
40 -1.097710e-18
41  2.495015e-19
42  7.556181e-19
43  4.742588e-20
44  1.341924e-18
45  1.992059e-18
46  2.020313e-18
47  7.156944e-20

$subject
   (Intercept)
2  -0.06278903
3   0.11146166
4  -0.16036249
5  -0.33042021
7   0.03383043
8   0.25270668
10  0.57795953
11  0.40688787
13 -0.01408191
14 -0.01304987
15 -0.09268749
16  0.10293051
17 -0.25400560
18  0.05092086
19 -0.30976159
20 -0.22418418
22 -0.32333051
23  0.24797532

with conditional variances for "TrialInBlock" "subject" 
print(head(intercept_diagnostics$Mixed_Z$scaled_residuals))
           1            2            3            4            5            6 
-0.009895962 -0.166656384  0.182396834 -0.682980337 -0.517337694 -0.905689179 

#1.2.2 Random slope model to assess whether block and phase significantly influence rms (per axis)

# --- Function to Run Random Slope LMMs and Extract ANOVA P-Values ---
extract_rms_randomslope_pvalues <- function(tagged_df, label) {
  # Compute RMS and prepare data
  rms_data <- compute_rms(tagged_df) %>%
    mutate(Block = factor(Block), subject = factor(subject))

  # Axes to iterate over
  axes <- c("x", "y", "z")

  # Fit models and extract p-values in loop
  map_dfr(axes, function(axis) {
    formula <- as.formula(paste0("rms_", axis, " ~ Block * phase + (1 + Block | subject) + (1 | TrialInBlock)"))
    model <- lmer(formula, data = rms_data, REML = FALSE)
    aov_tbl <- anova(model)

    tibble(
      Dataset = label,
      Axis = toupper(axis),
      `Block p-value` = aov_tbl["Block", "Pr(>F)"],
      `Phase p-value` = aov_tbl["phase", "Pr(>F)"],
      `Interaction p-value` = aov_tbl["Block:phase", "Pr(>F)"]
    )
  })
}


# Run Random Slope LMMs for tagged and cleaned "Mixed" dataset
randomslope_pvals_mixed <- extract_rms_randomslope_pvalues(tagged_data, "Mixed")
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
# View results
print(randomslope_pvals_mixed)
# A tibble: 3 × 5
  Dataset Axis  `Block p-value` `Phase p-value` `Interaction p-value`
  <chr>   <chr>           <dbl>           <dbl>                 <dbl>
1 Mixed   X              0.0291               0              1.72e-81
2 Mixed   Y              0.0497               0              1.54e-66
3 Mixed   Z              0.0799               0              5.21e-47
#compared to the first model this also includes a random slope for Block within subjects

#results:
#block p-value        >0.05 (z - axis)   :This suggests no learning or adaptation effects across blocks after accounting for between subject
#block p-value        <0.05 (x & y axis) :This suggests learning or adaptation effects across blocks after accounting for between subject variation
#phase p-value            0                     :because it is either execution or preparation 
#interaction          <0.05                     :this suggest the effect of block is different depending on phase

#clean vs unclean dataset: unclean p-values< clean p-values: probably because of more variability
# --- Extended: Run Random Slope LMMs + Extract Diagnostics per Axis ---
extract_rms_randomslope_model_diagnostics <- function(tagged_df, label) {
  # Compute RMS and prepare data
  rms_data <- compute_rms(tagged_df) %>%
    mutate(Block = factor(Block), subject = factor(subject))

  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    formula <- as.formula(paste0("rms_", axis, " ~ Block * phase + (1 + Block | subject) + (1 | TrialInBlock)"))
    model <- lmer(formula, data = rms_data, REML = FALSE)

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      anova = anova(model),
      emmeans = emmeans(model, ~ Block * phase),
      fixed_effects = fixef(model),
      random_effects = ranef(model),
      scaled_residuals = resid(model, scaled = TRUE),
      model = model
    )
  }

  return(results)
}

# --- Run Full Diagnostic Extraction ---
randomslope_diagnostics <- extract_rms_randomslope_model_diagnostics(tagged_data, "Mixed")
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
Warning: Model failed to converge with 1 negative eigenvalue: -2.8e+02
boundary (singular) fit: see help('isSingular')
boundary (singular) fit: see help('isSingular')
# --- Example: Output for Axis X ---
cat("\n=== RANDOM SLOPE MODEL: Axis X ===\n")

=== RANDOM SLOPE MODEL: Axis X ===
print(randomslope_diagnostics$Mixed_X$anova)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF  DenDF   F value Pr(>F)    
Block         0.84    0.21     4   18.2    3.4446 0.0291 *  
phase       573.74  573.74     1 6449.7 9439.2430 <2e-16 ***
Block:phase  23.95    5.99     4 6449.6   98.4879 <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(randomslope_diagnostics$Mixed_X$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.8581 0.0462 20.1   0.7617    0.954
 2     Execution   0.7961 0.0458 20.2   0.7006    0.892
 3     Execution   0.6647 0.0337 21.7   0.5948    0.735
 4     Execution   0.7388 0.0372 20.3   0.6612    0.816
 5     Execution   0.5846 0.0233 22.2   0.5363    0.633
 1     Preparation 0.0679 0.0462 20.0  -0.0284    0.164
 2     Preparation 0.1189 0.0458 20.2   0.0235    0.214
 3     Preparation 0.1654 0.0336 21.6   0.0956    0.235
 4     Preparation 0.1246 0.0372 20.2   0.0471    0.202
 5     Preparation 0.1268 0.0233 22.1   0.0785    0.175

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(randomslope_diagnostics$Mixed_X$fixed_effects)
            (Intercept)                  Block2                  Block3 
             0.85807572             -0.06199209             -0.19338294 
                 Block4                  Block5        phasePreparation 
            -0.11932482             -0.27343346             -0.79017599 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.11300841              0.29089739              0.17599842 
Block5:phasePreparation 
             0.33233393 
print(randomslope_diagnostics$Mixed_X$random_effects)
$TrialInBlock
   (Intercept)
1            0
2            0
3            0
4            0
5            0
6            0
7            0
8            0
9            0
10           0
11           0
12           0
13           0
14           0
15           0
16           0
17           0
18           0
19           0
20           0
21           0
22           0
23           0
24           0
25           0
26           0
27           0
28           0
29           0
30           0
31           0
32           0
33           0
34           0
35           0
36           0
37           0
38           0
39           0
40           0
41           0
42           0
43           0
44           0
45           0
46           0
47           0

$subject
    (Intercept)      Block2       Block3      Block4       Block5
2  -0.002130586  0.14017493  0.148701112  0.08993780  0.060847144
3   0.210340137 -0.19493023 -0.262292535 -0.27672991 -0.248451306
4  -0.085446616 -0.05020446 -0.016821648 -0.01101010  0.060940174
5  -0.114092690 -0.06979523 -0.052808530 -0.09701340 -0.035909232
7  -0.082545142  0.03209474  0.069011823  0.06584268  0.008289092
8   0.024054267  0.03420203  0.004816552  0.05241983  0.044426694
10  0.320462541  0.17465061  0.053780616  0.09681161 -0.085178938
11  0.419658078 -0.04906292 -0.228674348 -0.17200762 -0.340715848
13 -0.104908274 -0.01293570  0.032276596  0.08150349  0.073389640
14  0.121877414 -0.04187897 -0.085279110 -0.08689654 -0.062858733
15 -0.119542720  0.01146563  0.051490105  0.01877142  0.183808910
16 -0.102998188  0.06985160  0.128249919  0.16846852  0.071799365
17 -0.191048839  0.04562005  0.120572790  0.08978650  0.150921427
18 -0.098169526  0.06185725  0.127720268  0.13486697  0.066073017
19 -0.198929688  0.01751672  0.078972777  0.05765067  0.087451508
20 -0.125914157 -0.01192369  0.014789375 -0.02058285  0.060390331
22 -0.155593412  0.02648825  0.076921180  0.05137631  0.128263021
23  0.284927402 -0.18319063 -0.261426942 -0.24319536 -0.223486265

with conditional variances for "TrialInBlock" "subject" 
print(head(randomslope_diagnostics$Mixed_X$scaled_residuals))
         1          2          3          4          5          6 
-0.7209621 -0.6398466  0.1449765 -0.5947548 -0.1244542 -0.6062213 
cat("\n=== RANDOM SLOPE MODEL: Axis Y ===\n")

=== RANDOM SLOPE MODEL: Axis Y ===
print(randomslope_diagnostics$Mixed_Y$anova)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF  DenDF   F value  Pr(>F)    
Block         0.99    0.25     4   17.9    2.9365 0.04966 *  
phase       641.04  641.04     1 6451.0 7581.0440 < 2e-16 ***
Block:phase  27.13    6.78     4 6451.0   80.2193 < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(randomslope_diagnostics$Mixed_Y$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.9082 0.0583 19.9   0.7866    1.030
 2     Execution   0.8494 0.0544 20.2   0.7359    0.963
 3     Execution   0.6935 0.0349 22.0   0.6211    0.766
 4     Execution   0.7690 0.0421 20.2   0.6813    0.857
 5     Execution   0.6079 0.0242 23.3   0.5579    0.658
 1     Preparation 0.0681 0.0582 19.8  -0.0534    0.190
 2     Preparation 0.1356 0.0544 20.2   0.0221    0.249
 3     Preparation 0.1709 0.0349 21.8   0.0985    0.243
 4     Preparation 0.1209 0.0421 20.1   0.0332    0.209
 5     Preparation 0.1207 0.0242 23.1   0.0707    0.171

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(randomslope_diagnostics$Mixed_Y$fixed_effects)
            (Intercept)                  Block2                  Block3 
             0.90817438             -0.05879782             -0.21466453 
                 Block4                  Block5        phasePreparation 
            -0.13912680             -0.30022914             -0.84004818 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.12622211              0.31739871              0.19188449 
Block5:phasePreparation 
             0.35280793 
print(randomslope_diagnostics$Mixed_Y$random_effects)
$TrialInBlock
   (Intercept)
1            0
2            0
3            0
4            0
5            0
6            0
7            0
8            0
9            0
10           0
11           0
12           0
13           0
14           0
15           0
16           0
17           0
18           0
19           0
20           0
21           0
22           0
23           0
24           0
25           0
26           0
27           0
28           0
29           0
30           0
31           0
32           0
33           0
34           0
35           0
36           0
37           0
38           0
39           0
40           0
41           0
42           0
43           0
44           0
45           0
46           0
47           0

$subject
   (Intercept)       Block2      Block3      Block4      Block5
2  -0.08078052  0.181935400  0.21041561  0.18173095  0.17466746
3   0.04556358  0.030170428  0.03304694  0.02365688 -0.01363942
4  -0.18623694 -0.016290519  0.08655674  0.04621311  0.15558167
5  -0.22381098 -0.006486568  0.06116852  0.01923111  0.08840549
7  -0.10910846  0.025773837  0.06166384  0.03566723  0.11834885
8   0.14429595  0.083351323 -0.04796118  0.01425454 -0.09529695
10  0.44806386  0.019942566 -0.08193563 -0.01763671 -0.22373269
11  0.49539636  0.049356876 -0.36602737 -0.19090847 -0.52891486
13  0.08060563 -0.171227191 -0.19367681 -0.17094475 -0.11370305
14  0.13504171 -0.098395040 -0.14268455 -0.12321746 -0.13346534
15 -0.12719732 -0.045048083  0.07748791  0.03302485  0.16035012
16 -0.12430409  0.075884559  0.14903445  0.12545229  0.16456399
17 -0.24725183  0.127249131  0.20977745  0.16258130  0.22582123
18 -0.08917553  0.020109577  0.12522703  0.07813967  0.06961063
19 -0.21076853  0.022316268  0.04029086  0.01720718  0.06758009
20 -0.15632996  0.044182478  0.04304839  0.02083403  0.03819070
22 -0.20436428  0.004752615  0.08691285  0.04679237  0.15696899
23  0.41036134 -0.347577658 -0.35234508 -0.30207813 -0.31133692

with conditional variances for "TrialInBlock" "subject" 
print(head(randomslope_diagnostics$Mixed_Y$scaled_residuals))
         1          2          3          4          5          6 
-0.6375648 -0.6188274  0.3853927 -0.3544758 -0.5304047 -0.5144974 
cat("\n=== RANDOM SLOPE MODEL: Axis Z ===\n")

=== RANDOM SLOPE MODEL: Axis Z ===
print(randomslope_diagnostics$Mixed_Z$anova)
Type III Analysis of Variance Table with Satterthwaite's method
             Sum Sq Mean Sq NumDF  DenDF   F value  Pr(>F)    
Block          2.22    0.55     4   18.1    2.4874 0.07987 .  
phase       1874.02 1874.02     1 6450.9 8416.9276 < 2e-16 ***
Block:phase   50.41   12.60     4 6450.9   56.6080 < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(randomslope_diagnostics$Mixed_Z$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   1.4106 0.0868 20.0  1.22941    1.592
 2     Execution   1.3960 0.0880 20.2  1.21265    1.579
 3     Execution   1.1816 0.0663 21.6  1.04381    1.319
 4     Execution   1.2868 0.0665 20.4  1.14826    1.425
 5     Execution   1.0219 0.0506 21.4  0.91673    1.127
 1     Preparation 0.0737 0.0867 19.9 -0.10723    0.255
 2     Preparation 0.1777 0.0879 20.1 -0.00565    0.361
 3     Preparation 0.2358 0.0663 21.5  0.09815    0.373
 4     Preparation 0.1597 0.0665 20.4  0.02121    0.298
 5     Preparation 0.1582 0.0506 21.4  0.05313    0.263

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(randomslope_diagnostics$Mixed_Z$fixed_effects)
            (Intercept)                  Block2                  Block3 
             1.41055951             -0.01451272             -0.22900373 
                 Block4                  Block5        phasePreparation 
            -0.12374563             -0.38869059             -1.33681079 
Block2:phasePreparation Block3:phasePreparation Block4:phasePreparation 
             0.11844394              0.39103417              0.20968663 
Block5:phasePreparation 
             0.47312389 
print(randomslope_diagnostics$Mixed_Z$random_effects)
$TrialInBlock
   (Intercept)
1            0
2            0
3            0
4            0
5            0
6            0
7            0
8            0
9            0
10           0
11           0
12           0
13           0
14           0
15           0
16           0
17           0
18           0
19           0
20           0
21           0
22           0
23           0
24           0
25           0
26           0
27           0
28           0
29           0
30           0
31           0
32           0
33           0
34           0
35           0
36           0
37           0
38           0
39           0
40           0
41           0
42           0
43           0
44           0
45           0
46           0
47           0

$subject
    (Intercept)       Block2      Block3      Block4      Block5
2  -0.304860092  0.232026688  0.34789249  0.26744037  0.32438026
3   0.335394305 -0.215269615 -0.27735356 -0.26123632 -0.33676956
4  -0.163414581 -0.112151047 -0.04214627 -0.03622428  0.12262390
5  -0.318903056 -0.028105370  0.00237320 -0.01340532 -0.01312176
7  -0.008331758  0.024204490  0.10292948  0.09537122 -0.01174119
8   0.236457901  0.161103937 -0.03235719  0.04204253 -0.04791900
10  0.480200692  0.202724692  0.16116345  0.10935513  0.03266552
11  0.843843879  0.008190312 -0.60477913 -0.43901462 -0.82331915
13  0.116667046 -0.237355164 -0.27024477 -0.21975774  0.01838803
14 -0.027545810 -0.007698254  0.07932719  0.04880952 -0.03417139
15 -0.139398643 -0.100411511 -0.04265057 -0.05971883  0.31589393
16 -0.080901993  0.246104730  0.25249949  0.22399302  0.18511139
17 -0.445123398  0.102517498  0.29627519  0.23720892  0.30187712
18 -0.076939097  0.093506386  0.33161479  0.24947682  0.04223143
19 -0.310712178 -0.034224562 -0.01156170 -0.01691626  0.03859358
20 -0.253668742 -0.009628290  0.02563412  0.01478410  0.08087746
22 -0.391165577 -0.021001007  0.05325682  0.03750079  0.18759053
23  0.508401103 -0.304533911 -0.37187302 -0.27970905 -0.38319112

with conditional variances for "TrialInBlock" "subject" 
print(head(randomslope_diagnostics$Mixed_Z$scaled_residuals))
          1           2           3           4           5           6 
-0.06271144 -0.34689028 -0.30371480 -0.62623216 -0.45466235 -0.69638425 

#1.2.3 Model: CoM RMS Acceleration changes over time

# --- Optimized: Extract p-values from RMS learning LMMs (TrialInBlock * Block * Phase) ---
extract_learning_pvalues <- function(df, label) {
  rms_df <- compute_rms(df) %>%
    mutate(
      Block = factor(Block),
      subject = factor(subject),
      phase = factor(phase)
    )

  fit_model_and_anova <- function(axis) {
    model <- lmer(as.formula(paste0("rms_", axis, " ~ TrialInBlock * Block * phase + (1 + TrialInBlock | subject)")),
                  data = rms_df)
    anova(model)
  }

  an_x <- fit_model_and_anova("x")
  an_y <- fit_model_and_anova("y")
  an_z <- fit_model_and_anova("z")

  tibble(
    Dataset = label,
    Axis = c("X", "Y", "Z"),
    `TrialInBlock p-value` = c(an_x["TrialInBlock", "Pr(>F)"], an_y["TrialInBlock", "Pr(>F)"], an_z["TrialInBlock", "Pr(>F)"]),
    `Block p-value`         = c(an_x["Block", "Pr(>F)"], an_y["Block", "Pr(>F)"], an_z["Block", "Pr(>F)"]),
    `Phase p-value`         = c(an_x["phase", "Pr(>F)"], an_y["phase", "Pr(>F)"], an_z["phase", "Pr(>F)"]),
    `TrialInBlock:Block p`  = c(an_x["TrialInBlock:Block", "Pr(>F)"], an_y["TrialInBlock:Block", "Pr(>F)"], an_z["TrialInBlock:Block", "Pr(>F)"]),
    `TrialInBlock:Phase p`  = c(an_x["TrialInBlock:phase", "Pr(>F)"], an_y["TrialInBlock:phase", "Pr(>F)"], an_z["TrialInBlock:phase", "Pr(>F)"]),
    `Block:Phase p`         = c(an_x["Block:phase", "Pr(>F)"], an_y["Block:phase", "Pr(>F)"], an_z["Block:phase", "Pr(>F)"]),
    `3-way p-value`         = c(an_x["TrialInBlock:Block:phase", "Pr(>F)"],
                                an_y["TrialInBlock:Block:phase", "Pr(>F)"],
                                an_z["TrialInBlock:Block:phase", "Pr(>F)"])
  )
}


# Use pre-tagged data (tagged_data) instead of tagging again
learning_pvals_mixed <- extract_learning_pvalues(tagged_data, "Mixed")
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
Warning: Model failed to converge with 1 negative eigenvalue: -3.1e+00
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.886971 (tol = 0.002, component 1)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.345604 (tol = 0.002, component 1)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?
# Show result
print(learning_pvals_mixed)
# A tibble: 3 × 9
  Dataset Axis  `TrialInBlock p-value` `Block p-value` `Phase p-value`
  <chr>   <chr>                  <dbl>           <dbl>           <dbl>
1 Mixed   X                     0.537         2.48e-25               0
2 Mixed   Y                     0.504         2.30e-15               0
3 Mixed   Z                     0.0791        1.87e-14               0
# ℹ 4 more variables: `TrialInBlock:Block p` <dbl>,
#   `TrialInBlock:Phase p` <dbl>, `Block:Phase p` <dbl>, `3-way p-value` <dbl>
#results:
#trial in block p-value         >0.05   : Participants do not change rms within block
#block p-value                  <0.05   : RMS differs significantly between blocks
#phase p-value                          : 0 because it is either execution or preparation 
#Trial in block x Block         <0.05   : significant changes across blocks                    (except y )
#Trial in block x phase         <0.05   : as before different phases differ
#Block x phase                  <0.05   : changes in blocks differ across phases
#trial in block x block x phase <0.05   : trial in block changes across both blocks and phases

#clean vs unclean dataset: unclean p-values< clean p-values: probably because of more variability
# --- Global Options to Suppress Emmeans Warnings ---
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# --- Extended: Extract Full Diagnostics from Learning LMM (TrialInBlock * Block * Phase) ---
extract_learning_model_diagnostics <- function(df, label) {
  rms_df <- compute_rms(df) %>%
    mutate(
      Block = factor(Block),
      subject = factor(subject),
      phase = factor(phase)
    )

  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    formula <- as.formula(paste0("rms_", axis, " ~ TrialInBlock * Block * phase + (1 + TrialInBlock | subject)"))
    model <- lmer(formula, data = rms_df)

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      anova = anova(model),
      emmeans = emmeans(model, ~ Block * phase),
      fixed_effects = fixef(model),
      random_effects = ranef(model),
      scaled_residuals = resid(model, scaled = TRUE),
      model = model
    )
  }

  return(results)
}

# --- Run Diagnostics on Mixed Data ---
learning_diagnostics <- extract_learning_model_diagnostics(tagged_data, "Mixed")
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
Warning: Model failed to converge with 1 negative eigenvalue: -3.1e+00
NOTE: Results may be misleading due to involvement in interactions
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.886971 (tol = 0.002, component 1)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?
NOTE: Results may be misleading due to involvement in interactions
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model failed to converge with max|grad| = 0.345604 (tol = 0.002, component 1)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
 - Rescale variables?
NOTE: Results may be misleading due to involvement in interactions
# --- Display Example for Axis X ---
cat("\n=== LEARNING MODEL: Axis X ===\n")

=== LEARNING MODEL: Axis X ===
print(learning_diagnostics$Mixed_X$anova)
Type III Analysis of Variance Table with Satterthwaite's method
                          Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               0.024   0.024     1   14.9    0.4001    0.5366    
Block                      7.478   1.869     4 6510.9   30.6708 < 2.2e-16 ***
phase                    247.417 247.417     1 6502.0 4059.3063 < 2.2e-16 ***
TrialInBlock:Block         1.579   0.395     4 6486.8    6.4766 3.379e-05 ***
TrialInBlock:phase        17.990  17.990     1 6502.5  295.1528 < 2.2e-16 ***
Block:phase                6.830   1.707     4 6502.1   28.0133 < 2.2e-16 ***
TrialInBlock:Block:phase   7.787   1.947     4 6503.0   31.9385 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(learning_diagnostics$Mixed_X$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.8534 0.0604 17.9   0.7264    0.980
 2     Execution   0.7689 0.0606 18.1   0.6416    0.896
 3     Execution   0.6016 0.0612 18.9   0.4734    0.730
 4     Execution   0.7505 0.0602 17.7   0.6238    0.877
 5     Execution   0.5829 0.0602 17.7   0.4562    0.710
 1     Preparation 0.0652 0.0603 17.8  -0.0616    0.192
 2     Preparation 0.1409 0.0606 18.1   0.0137    0.268
 3     Preparation 0.2242 0.0611 18.8   0.0962    0.352
 4     Preparation 0.1080 0.0602 17.7  -0.0187    0.235
 5     Preparation 0.1090 0.0602 17.7  -0.0177    0.236

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(learning_diagnostics$Mixed_X$fixed_effects)
                         (Intercept)                         TrialInBlock 
                         0.869554190                         -0.000815170 
                              Block2                               Block3 
                         0.056231080                         -0.046320814 
                              Block4                               Block5 
                        -0.030141574                         -0.298745743 
                    phasePreparation                  TrialInBlock:Block2 
                        -0.802993291                         -0.007086100 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                        -0.010345664                         -0.003661642 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                         0.001422747                          0.000747590 
             Block2:phasePreparation              Block3:phasePreparation 
                        -0.131199560                         -0.005336387 
             Block4:phasePreparation              Block5:phasePreparation 
                        -0.033760839                          0.241061209 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                         0.014672477                          0.020955325 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                         0.009034563                          0.003688619 
print(learning_diagnostics$Mixed_X$random_effects)
$subject
   (Intercept)  TrialInBlock
2   0.07302469  5.308416e-04
3   0.01624823 -3.243428e-04
4  -0.08363521  1.630923e-04
5  -0.18109175  6.672144e-04
7  -0.04714231 -9.913308e-05
8   0.03653227  8.672690e-04
10  0.47350198 -5.353684e-03
11  0.24204458 -4.588085e-04
13 -0.06004387 -1.949274e-04
14  0.10671382 -1.819133e-03
15 -0.08623060  1.476287e-03
16 -0.02883266  7.445906e-04
17 -0.11511557  4.420390e-04
18 -0.03941152  8.196021e-04
19 -0.16774728  6.936795e-04
20 -0.13467107  9.835804e-04
22 -0.12154706  1.325688e-03
23  0.11740332 -4.638557e-04

with conditional variances for "subject" 
print(head(learning_diagnostics$Mixed_X$scaled_residuals))
          1           2           3           4           5           6 
-0.18990813 -0.24184350  0.93796009 -1.31694436  0.01463411 -0.77067947 
# --- Display Example for Axis Y ---
cat("\n=== LEARNING MODEL: Axis Y ===\n")

=== LEARNING MODEL: Axis Y ===
print(learning_diagnostics$Mixed_Y$anova)
Type III Analysis of Variance Table with Satterthwaite's method
                          Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               0.041   0.041     1   13.1    0.4724    0.5038    
Block                      6.540   1.635     4 6496.5   18.7812 2.300e-15 ***
phase                    277.980 277.980     1 6486.7 3193.3384 < 2.2e-16 ***
TrialInBlock:Block         0.674   0.168     4 6450.8    1.9345    0.1018    
TrialInBlock:phase        20.516  20.516     1 6487.4  235.6777 < 2.2e-16 ***
Block:phase                5.954   1.488     4 6486.9   17.0991 5.858e-14 ***
TrialInBlock:Block:phase   8.840   2.210     4 6488.0   25.3869 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(learning_diagnostics$Mixed_Y$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.9023 0.0466 19.2  0.80476    1.000
 2     Execution   0.8161 0.0470 19.8  0.71804    0.914
 3     Execution   0.6231 0.0482 21.9  0.52317    0.723
 4     Execution   0.7800 0.0463 18.7  0.68293    0.877
 5     Execution   0.6116 0.0463 18.7  0.51455    0.709
 1     Preparation 0.0639 0.0465 19.0 -0.03346    0.161
 2     Preparation 0.1544 0.0469 19.7  0.05643    0.252
 3     Preparation 0.2321 0.0480 21.5  0.13244    0.332
 4     Preparation 0.1034 0.0463 18.7  0.00637    0.200
 5     Preparation 0.1030 0.0463 18.7  0.00598    0.200

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(learning_diagnostics$Mixed_Y$fixed_effects)
                         (Intercept)                         TrialInBlock 
                        0.8965891748                         0.0002860064 
                              Block2                               Block3 
                        0.0834540742                        -0.0231160443 
                              Block4                               Block5 
                       -0.0366819627                        -0.2625843564 
                    phasePreparation                  TrialInBlock:Block2 
                       -0.8353361241                        -0.0085408622 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                       -0.0128963730                        -0.0043103349 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                       -0.0014139899                        -0.0001539001 
             Block2:phasePreparation              Block3:phasePreparation 
                       -0.1539901171                        -0.0211594939 
             Block4:phasePreparation              Block5:phasePreparation 
                       -0.0335017769                         0.2046221909 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                        0.0166549728                         0.0235975593 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                        0.0098371767                         0.0063052323 
print(learning_diagnostics$Mixed_Y$random_effects)
$subject
   (Intercept)  TrialInBlock
2   0.06495950  4.992502e-04
3   0.06287877 -1.311103e-04
4  -0.15039502  1.250827e-03
5  -0.21147593  1.057579e-03
7  -0.05367103 -3.655988e-05
8   0.12560239  1.045282e-04
10  0.48398030 -4.861964e-03
11  0.25602323 -4.358573e-04
13 -0.03175058 -7.612633e-04
14  0.05977602 -9.739708e-04
15 -0.09637827  1.127104e-03
16 -0.03957080  1.076302e-03
17 -0.11636312  8.997991e-04
18 -0.05116744  7.111814e-04
19 -0.19782374  7.779060e-04
20 -0.14111958  5.308198e-04
22 -0.16429801  1.335118e-03
23  0.20079332 -2.169688e-03

with conditional variances for "subject" 
print(head(learning_diagnostics$Mixed_Y$scaled_residuals))
          1           2           3           4           5           6 
-0.08727244 -0.13262099  0.34444084 -0.62174085 -0.08001239 -0.69605215 
# --- Display Example for Axis Z ---
cat("\n=== LEARNING MODEL: Axis Z ===\n")

=== LEARNING MODEL: Axis Z ===
print(learning_diagnostics$Mixed_Z$anova)
Type III Analysis of Variance Table with Satterthwaite's method
                         Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               0.77    0.77     1   21.2    3.4021   0.07910 .  
Block                     15.99    4.00     4 6494.4   17.6929 1.869e-14 ***
phase                    780.96  780.96     1 6485.6 3456.6273 < 2.2e-16 ***
TrialInBlock:Block         2.44    0.61     4 6473.9    2.7037   0.02881 *  
TrialInBlock:phase        50.18   50.18     1 6486.1  222.1007 < 2.2e-16 ***
Block:phase               16.82    4.21     4 6485.7   18.6161 3.162e-15 ***
TrialInBlock:Block:phase  25.85    6.46     4 6486.6   28.6040 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(learning_diagnostics$Mixed_Z$emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   1.4038 0.0644 20.1  1.26954    1.538
 2     Execution   1.3592 0.0651 21.0  1.22387    1.495
 3     Execution   1.0714 0.0673 23.9  0.93260    1.210
 4     Execution   1.3077 0.0638 19.4  1.17430    1.441
 5     Execution   1.0219 0.0638 19.4  0.88852    1.155
 1     Preparation 0.0652 0.0642 19.8 -0.06868    0.199
 2     Preparation 0.2134 0.0650 20.9  0.07819    0.349
 3     Preparation 0.3485 0.0669 23.5  0.21023    0.487
 4     Preparation 0.1298 0.0638 19.4 -0.00360    0.263
 5     Preparation 0.1270 0.0638 19.4 -0.00635    0.260

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(learning_diagnostics$Mixed_Z$fixed_effects)
                         (Intercept)                         TrialInBlock 
                         1.353577419                          0.002528096 
                              Block2                               Block3 
                         0.187019467                          0.126105269 
                              Block4                               Block5 
                         0.105883854                         -0.334139230 
                    phasePreparation                  TrialInBlock:Block2 
                        -1.299114412                         -0.011662011 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                        -0.023089554                         -0.010171168 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                        -0.002404067                         -0.001985429 
             Block2:phasePreparation              Block3:phasePreparation 
                        -0.305102557                         -0.213476645 
             Block4:phasePreparation              Block5:phasePreparation 
                        -0.223802256                          0.230539774 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                         0.025071416                          0.041757496 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                         0.019360686                          0.010732750 
print(learning_diagnostics$Mixed_Z$random_effects)
$subject
   (Intercept)  TrialInBlock
2  -0.12659865  0.0029943843
3   0.07188886  0.0019215453
4  -0.18003179  0.0010373833
5  -0.34805899  0.0010072593
7   0.05044426 -0.0008655676
8   0.24469200  0.0004400951
10  0.73778702 -0.0079000916
11  0.47466205 -0.0034692325
13  0.03063876 -0.0021687529
14  0.04276772 -0.0026600999
15 -0.12972566  0.0018099850
16  0.04714354  0.0025942608
17 -0.27112242  0.0008305766
18  0.04492925  0.0001822943
19 -0.33312577  0.0011472055
20 -0.25977048  0.0019207945
22 -0.37044512  0.0025131660
23  0.27392543 -0.0013352055

with conditional variances for "subject" 
print(head(learning_diagnostics$Mixed_Z$scaled_residuals))
          1           2           3           4           5           6 
 0.56805124  0.37425066  0.28826247 -0.96807903 -0.00162998 -0.84463387 

2 Movement Variability

#2.1 SD of RMS Plots

# -------- Standard Deviation Summary & Plot (Movement Variability) --------

# Convert to long format
rms_data_long <- rms_data %>%
  pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
  mutate(Axis = sub("rms_", "", Axis))

# Compute SD per trial per phase
rms_sd_summary <- rms_data_long %>%
  group_by(Block, phase, trial, Axis) %>%
  summarise(
    sd_RMS = sd(RMS, na.rm = TRUE),
    .groups = "drop"
  )

# Compute mean SD per block-phase-axis
mean_sd_per_block_phase <- rms_sd_summary %>%
  group_by(Block, phase, Axis) %>%
  summarise(mean_sd = mean(sd_RMS, na.rm = TRUE), .groups = "drop")

# ---- Plot Movement Variability (SD) ----
ggplot(mean_sd_per_block_phase, aes(x = factor(Block), y = mean_sd, fill = phase)) +
  geom_bar(stat = "identity", position = "dodge", width = 0.7) +
  geom_vline(xintercept = 3.5, linetype = "dashed", color = "black") +
  facet_wrap(~ Axis, nrow = 1) +
  ylim(0, 1) +
  labs(
    title = "Mean Standard Deviation of CoM RMS Acceleration",
    x = "Block",
    y = "Mean SD of RMS Acceleration (m/s²)",
    fill = "Phase"
  ) +
  theme_minimal() +
  theme(
    text = element_text(size = 14),
    strip.text = element_text(face = "bold"),
    legend.position = "top"
  )

#2.2 CV of RMS Plots

# -------- CV, Skewness, Kurtosis Summary (Long Format) --------
cv_long_summary <- rms_data %>%
  pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
  mutate(Axis = sub("rms_", "", Axis)) %>%
  group_by(subject, Block, phase, Axis) %>%
  summarise(
    mean_rms = mean(RMS, na.rm = TRUE),
    sd_rms = sd(RMS, na.rm = TRUE),
    cv = sd_rms / mean_rms,
    skew = skewness(RMS, na.rm = TRUE),
    kurt = kurtosis(RMS, na.rm = TRUE),
    .groups = "drop"
  )

# -------- CV Boxplot by Axis & Phase --------
ggplot(cv_long_summary, aes(x = factor(Block), y = cv, color = phase)) +
  geom_boxplot(outlier.shape = NA) +
  geom_jitter(width = 0.2, alpha = 0.4, size = 0.7) +
  facet_wrap(~ Axis, nrow = 1) +
  ylim(0, 3.5) +
  labs(
    title = "Coefficient of Variation (CV) of CoM RMS Acceleration",
    x = "Block",
    y = "CV",
    color = "Phase"
  ) +
  theme_minimal() +
  theme(text = element_text(size = 12))
Warning: Removed 1 row containing non-finite outside the scale range
(`stat_boxplot()`).
Warning: Removed 1 row containing missing values or values outside the scale range
(`geom_point()`).

3 Step-Analysis

#3.1 Plots for RMS ± SD: Separate Plot per Block

# -------- Step-Wise RMS ± SD: Separate Plot per Block --------
plot_stepwise_rms_by_block_split <- function(tagged_data) {
  step_markers <- c(14, 15, 16, 17)
  buffer <- 5

  # Assign step numbers and buffer rows
  step_data <- tagged_data %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()

  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)

  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)

    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })

  # Compute RMS
  step_summary <- window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = toupper(gsub("rms_", "", Axis)),
      Step = as.numeric(Step),
      Block = factor(Block)
    )

  # Summary for plotting
  plot_data <- step_summary %>%
    group_by(Block, Step, Axis) %>%
    summarise(
      mean_rms = mean(RMS, na.rm = TRUE),
      sd_rms = sd(RMS, na.rm = TRUE),
      .groups = "drop"
    )

  # Generate separate plots per block
  blocks <- unique(plot_data$Block)
  plots <- map(blocks, function(b) {
    block_data <- filter(plot_data, Block == b)

    ggplot(block_data, aes(x = Step, y = mean_rms)) +
      geom_point(color = "steelblue", size = 2) +
      geom_errorbar(aes(ymin = mean_rms - sd_rms, ymax = mean_rms + sd_rms), width = 0.3) +
      facet_wrap(~ Axis, scales = "free_y") +
      ylim(0, 3.25) +
      labs(
        title = paste("Block", b, "- Step-Wise CoM RMS Acceleration ± SD"),
        x = "Step Number",
        y = "RMS Acceleration (m/s²)"
      ) +
      theme_minimal() +
      theme(
        text = element_text(size = 12),
        strip.text = element_text(face = "bold")
      )
  })

  names(plots) <- paste0("Block_", blocks)
  return(plots)
}

# ---- Generate and Print Separate Plots per Block ----
stepwise_block_plots <- plot_stepwise_rms_by_block_split(tagged_data)

# Display them one by one
for (plot_name in names(stepwise_block_plots)) {
  cat("\n\n=====", plot_name, "=====\n\n")
  print(stepwise_block_plots[[plot_name]])
}


===== Block_1 =====



===== Block_2 =====



===== Block_3 =====



===== Block_4 =====



===== Block_5 =====

#3.2 Step Pairwise Model RMS

# -------- Global Settings to Suppress Emmeans Warnings --------
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# -------- Step-Wise LMM + Full Diagnostics --------
run_stepwise_lmm_full_diagnostics <- function(tagged_data, dataset_name = "Mixed") {
  step_markers <- c(14, 15, 16, 17)
  buffer <- 5

  step_data <- tagged_data %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()

  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)

  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)

    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })

  step_summary <- window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = toupper(gsub("rms_", "", Axis)),
      Step = factor(Step),
      Block = factor(Block),
      subject = factor(subject)
    )

  axis_labels <- c("X", "Y", "Z")
  blocks <- unique(step_summary$Block)
  results <- list()

  for (blk in blocks) {
    for (axis in axis_labels) {
      data_sub <- step_summary %>%
        filter(Block == blk, Axis == axis)

      model <- lmer(RMS ~ Step + (1 | subject), data = data_sub)
      aov_tbl <- anova(model)
      emmeans_out <- emmeans(model, pairwise ~ Step)

      key <- glue::glue("{dataset_name} - Block {blk} - Axis {axis}")

      results[[key]] <- list(
        ANOVA = aov_tbl,
        Pairwise = summary(emmeans_out$contrasts),
        Emmeans = summary(emmeans_out$emmeans),
        FixedEffects = fixef(model),
        RandomEffects = ranef(model),
        ScaledResiduals = resid(model, scaled = TRUE),
        Model = model
      )
    }
  }

  return(results)
}

# -------- Run Full Diagnostic LMMs --------
stepwise_lmm_diag_results <- run_stepwise_lmm_full_diagnostics(tagged_data)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
unable to evaluate scaled gradient
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge: degenerate Hessian with 1 negative eigenvalues
# -------- Print Function --------
print_stepwise_lmm_diagnostics <- function(results_list, dataset_name = "Mixed") {
  cat(glue::glue("\n=========== STEPWISE LMM DIAGNOSTICS: {dataset_name} ===========\n"))
  for (key in names(results_list)) {
    cat("\n---", key, "---\n")
    cat("ANOVA:\n")
    print(results_list[[key]]$ANOVA)

    cat("\nPairwise Comparisons:\n")
    print(results_list[[key]]$Pairwise)

    cat("\nFixed Effects:\n")
    print(results_list[[key]]$FixedEffects)

    cat("\nRandom Effects:\n")
    print(results_list[[key]]$RandomEffects)

    cat("\nSample Scaled Residuals:\n")
    print(head(results_list[[key]]$ScaledResiduals))

    cat("\n=============================================================\n")
  }
}

# -------- Output Diagnostics --------
print_stepwise_lmm_diagnostics(stepwise_lmm_diag_results)
=========== STEPWISE LMM DIAGNOSTICS: Mixed ===========
--- Mixed - Block 1 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
         Sum Sq    Mean Sq NumDF DenDF F value Pr(>F)
Step 3.6349e-05 7.2698e-06     5    85  0.5483 0.7392

Pairwise Comparisons:
 contrast       estimate      SE df t.ratio p.value
 Step1 - Step2  0.000000 0.00121 85   0.000  1.0000
 Step1 - Step3 -0.000237 0.00121 85  -0.195  1.0000
 Step1 - Step4  0.001436 0.00121 85   1.183  0.8438
 Step1 - Step5 -0.000237 0.00121 85  -0.195  1.0000
 Step1 - Step6  0.000000 0.00121 85   0.000  1.0000
 Step2 - Step3 -0.000237 0.00121 85  -0.195  1.0000
 Step2 - Step4  0.001436 0.00121 85   1.183  0.8438
 Step2 - Step5 -0.000237 0.00121 85  -0.195  1.0000
 Step2 - Step6  0.000000 0.00121 85   0.000  1.0000
 Step3 - Step4  0.001673 0.00121 85   1.378  0.7399
 Step3 - Step5  0.000000 0.00121 85   0.000  1.0000
 Step3 - Step6  0.000237 0.00121 85   0.195  1.0000
 Step4 - Step5 -0.001673 0.00121 85  -1.378  0.7399
 Step4 - Step6 -0.001436 0.00121 85  -1.183  0.8438
 Step5 - Step6  0.000237 0.00121 85   0.195  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 9.033510e-01 -1.343375e-15  2.369465e-04 -1.435722e-03  2.369465e-04 
        Step6 
-1.343278e-15 

Random Effects:
$subject
   (Intercept)
2  -0.31304681
3   0.46726960
4  -0.35153031
5  -0.35685471
7  -0.25416428
8   0.43417162
10  0.79640301
11  1.18636141
13 -0.27453277
14  0.27470644
15 -0.03594521
16 -0.29490285
17 -0.53490624
18 -0.36116900
19 -0.59237201
20 -0.35929688
22 -0.36247753
23  0.93228652

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.04467009 -0.04467009 -0.10974188  0.34961708 -0.10974188 -0.04467009 

=============================================================

--- Mixed - Block 1 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
         Sum Sq    Mean Sq NumDF DenDF F value Pr(>F)
Step 6.5888e-05 1.3178e-05     5    85  1.0991  0.367

Pairwise Comparisons:
 contrast       estimate      SE df t.ratio p.value
 Step1 - Step2  0.000000 0.00115 85   0.000  1.0000
 Step1 - Step3 -0.000478 0.00115 85  -0.414  0.9984
 Step1 - Step4 -0.002207 0.00115 85  -1.912  0.4020
 Step1 - Step5 -0.000478 0.00115 85  -0.414  0.9984
 Step1 - Step6  0.000000 0.00115 85   0.000  1.0000
 Step2 - Step3 -0.000478 0.00115 85  -0.414  0.9984
 Step2 - Step4 -0.002207 0.00115 85  -1.912  0.4020
 Step2 - Step5 -0.000478 0.00115 85  -0.414  0.9984
 Step2 - Step6  0.000000 0.00115 85   0.000  1.0000
 Step3 - Step4 -0.001729 0.00115 85  -1.498  0.6665
 Step3 - Step5  0.000000 0.00115 85   0.000  1.0000
 Step3 - Step6  0.000478 0.00115 85   0.414  0.9984
 Step4 - Step5  0.001729 0.00115 85   1.498  0.6665
 Step4 - Step6  0.002207 0.00115 85   1.912  0.4020
 Step5 - Step6  0.000478 0.00115 85   0.414  0.9984

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
9.193385e-01 3.718384e-15 4.780119e-04 2.207022e-03 4.780119e-04 3.718139e-15 

Random Effects:
$subject
   (Intercept)
2  -0.34149126
3  -0.01557639
4  -0.51582035
5  -0.46789552
7  -0.35147498
8   0.51884042
10  1.46390217
11  1.54996497
13 -0.02793612
14  0.33124128
15 -0.37957661
16 -0.42647561
17 -0.52143573
18 -0.32044305
19 -0.50343505
20 -0.34561824
22 -0.53641670
23  0.88964677

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.15181965  0.15181965  0.01376883 -0.48557269  0.01376883  0.15181965 

=============================================================

--- Mixed - Block 1 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
        Sum Sq    Mean Sq NumDF DenDF F value Pr(>F)
Step 0.0001275 2.5499e-05     5    85  1.4231 0.2242

Pairwise Comparisons:
 contrast      estimate      SE df t.ratio p.value
 Step1 - Step2  0.00000 0.00141 85   0.000  1.0000
 Step1 - Step3  0.00030 0.00141 85   0.213  0.9999
 Step1 - Step4 -0.00277 0.00141 85  -1.965  0.3708
 Step1 - Step5  0.00030 0.00141 85   0.213  0.9999
 Step1 - Step6  0.00000 0.00141 85   0.000  1.0000
 Step2 - Step3  0.00030 0.00141 85   0.213  0.9999
 Step2 - Step4 -0.00277 0.00141 85  -1.965  0.3708
 Step2 - Step5  0.00030 0.00141 85   0.213  0.9999
 Step2 - Step6  0.00000 0.00141 85   0.000  1.0000
 Step3 - Step4 -0.00307 0.00141 85  -2.178  0.2588
 Step3 - Step5  0.00000 0.00141 85   0.000  1.0000
 Step3 - Step6 -0.00030 0.00141 85  -0.213  0.9999
 Step4 - Step5  0.00307 0.00141 85   2.178  0.2588
 Step4 - Step6  0.00277 0.00141 85   1.965  0.3708
 Step5 - Step6 -0.00030 0.00141 85  -0.213  0.9999

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 1.911159e+00  9.972743e-15 -3.002440e-04  2.772995e-03 -3.002440e-04 
        Step6 
 9.972708e-15 

Random Effects:
$subject
   (Intercept)
2  -0.89159251
3   0.99106197
4  -0.73766169
5  -1.02403754
7   0.13388536
8   0.94843933
10  1.28591024
11  2.54731932
13  0.37298319
14 -0.92657390
15 -0.00723227
16 -0.55180433
17 -1.37027671
18  0.13952567
19 -0.98476620
20 -0.93961104
22 -0.83624691
23  1.85067803

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
 0.0850446  0.0850446  0.1559748 -0.5700529  0.1559748  0.0850446 

=============================================================

--- Mixed - Block 2 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.34496 0.03136    11   187  6.5814 3.014e-09 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast        estimate    SE  df t.ratio p.value
 Step1 - Step2    0.01821 0.023 187   0.791  0.9997
 Step1 - Step3    0.03153 0.023 187   1.370  0.9677
 Step1 - Step4    0.03715 0.023 187   1.614  0.9018
 Step1 - Step5    0.04117 0.023 187   1.789  0.8218
 Step1 - Step6    0.04689 0.023 187   2.038  0.6669
 Step1 - Step7    0.04862 0.023 187   2.113  0.6143
 Step1 - Step8    0.06690 0.023 187   2.907  0.1469
 Step1 - Step9    0.09947 0.023 187   4.323  0.0015
 Step1 - Step10   0.10902 0.023 187   4.738  0.0003
 Step1 - Step11   0.11852 0.023 187   5.151  <.0001
 Step1 - Step12   0.12667 0.023 187   5.505  <.0001
 Step2 - Step3    0.01332 0.023 187   0.579  1.0000
 Step2 - Step4    0.01893 0.023 187   0.823  0.9996
 Step2 - Step5    0.02296 0.023 187   0.998  0.9976
 Step2 - Step6    0.02868 0.023 187   1.247  0.9843
 Step2 - Step7    0.03041 0.023 187   1.321  0.9754
 Step2 - Step8    0.04869 0.023 187   2.116  0.6121
 Step2 - Step9    0.08126 0.023 187   3.531  0.0254
 Step2 - Step10   0.09081 0.023 187   3.947  0.0061
 Step2 - Step11   0.10031 0.023 187   4.360  0.0013
 Step2 - Step12   0.10846 0.023 187   4.714  0.0003
 Step3 - Step4    0.00561 0.023 187   0.244  1.0000
 Step3 - Step5    0.00964 0.023 187   0.419  1.0000
 Step3 - Step6    0.01536 0.023 187   0.668  0.9999
 Step3 - Step7    0.01708 0.023 187   0.742  0.9999
 Step3 - Step8    0.03536 0.023 187   1.537  0.9283
 Step3 - Step9    0.06793 0.023 187   2.952  0.1316
 Step3 - Step10   0.07749 0.023 187   3.368  0.0421
 Step3 - Step11   0.08699 0.023 187   3.780  0.0111
 Step3 - Step12   0.09514 0.023 187   4.135  0.0031
 Step4 - Step5    0.00403 0.023 187   0.175  1.0000
 Step4 - Step6    0.00975 0.023 187   0.424  1.0000
 Step4 - Step7    0.01147 0.023 187   0.499  1.0000
 Step4 - Step8    0.02975 0.023 187   1.293  0.9791
 Step4 - Step9    0.06232 0.023 187   2.709  0.2304
 Step4 - Step10   0.07188 0.023 187   3.124  0.0845
 Step4 - Step11   0.08138 0.023 187   3.537  0.0249
 Step4 - Step12   0.08953 0.023 187   3.891  0.0075
 Step5 - Step6    0.00572 0.023 187   0.249  1.0000
 Step5 - Step7    0.00744 0.023 187   0.323  1.0000
 Step5 - Step8    0.02572 0.023 187   1.118  0.9936
 Step5 - Step9    0.05829 0.023 187   2.533  0.3261
 Step5 - Step10   0.06785 0.023 187   2.949  0.1329
 Step5 - Step11   0.07735 0.023 187   3.362  0.0429
 Step5 - Step12   0.08550 0.023 187   3.716  0.0138
 Step6 - Step7    0.00172 0.023 187   0.075  1.0000
 Step6 - Step8    0.02000 0.023 187   0.869  0.9993
 Step6 - Step9    0.05257 0.023 187   2.285  0.4911
 Step6 - Step10   0.06213 0.023 187   2.700  0.2346
 Step6 - Step11   0.07163 0.023 187   3.113  0.0870
 Step6 - Step12   0.07978 0.023 187   3.467  0.0311
 Step7 - Step8    0.01828 0.023 187   0.794  0.9997
 Step7 - Step9    0.05085 0.023 187   2.210  0.5446
 Step7 - Step10   0.06040 0.023 187   2.625  0.2735
 Step7 - Step11   0.06990 0.023 187   3.038  0.1060
 Step7 - Step12   0.07806 0.023 187   3.392  0.0391
 Step8 - Step9    0.03257 0.023 187   1.416  0.9592
 Step8 - Step10   0.04213 0.023 187   1.831  0.7990
 Step8 - Step11   0.05163 0.023 187   2.244  0.5204
 Step8 - Step12   0.05978 0.023 187   2.598  0.2886
 Step9 - Step10   0.00955 0.023 187   0.415  1.0000
 Step9 - Step11   0.01905 0.023 187   0.828  0.9996
 Step9 - Step12   0.02720 0.023 187   1.182  0.9897
 Step10 - Step11  0.00950 0.023 187   0.413  1.0000
 Step10 - Step12  0.01765 0.023 187   0.767  0.9998
 Step11 - Step12  0.00815 0.023 187   0.354  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 0.87088941 -0.01821043 -0.03153397 -0.03714541 -0.04117452 -0.04689354 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.04861641 -0.06689580 -0.09946748 -0.10902120 -0.11852127 -0.12667167 

Random Effects:
$subject
   (Intercept)
2   0.28233873
3   0.18937486
4  -0.34329097
5  -0.29571225
7  -0.18208210
8   0.17263703
10  0.84812261
11  0.98627106
13 -0.28153644
14  0.20444475
15 -0.16575175
16 -0.17554454
17 -0.31096263
18 -0.15518140
19 -0.34536283
20 -0.29928598
22 -0.15447203
23  0.02599387

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-0.5230097 -0.9884890 -1.4028116 -0.5991659 -0.3681573  0.3975858 

=============================================================

--- Mixed - Block 2 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value  Pr(>F)  
Step 0.15911 0.014465    11   187  2.1374 0.01966 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast        estimate     SE  df t.ratio p.value
 Step1 - Step2    0.00221 0.0274 187   0.080  1.0000
 Step1 - Step3    0.01473 0.0274 187   0.537  1.0000
 Step1 - Step4    0.01980 0.0274 187   0.722  0.9999
 Step1 - Step5    0.02304 0.0274 187   0.840  0.9995
 Step1 - Step6    0.02620 0.0274 187   0.956  0.9984
 Step1 - Step7    0.04122 0.0274 187   1.503  0.9381
 Step1 - Step8    0.05133 0.0274 187   1.872  0.7749
 Step1 - Step9    0.05716 0.0274 187   2.084  0.6344
 Step1 - Step10   0.06187 0.0274 187   2.256  0.5115
 Step1 - Step11   0.07664 0.0274 187   2.795  0.1909
 Step1 - Step12   0.08556 0.0274 187   3.120  0.0854
 Step2 - Step3    0.01252 0.0274 187   0.457  1.0000
 Step2 - Step4    0.01759 0.0274 187   0.641  1.0000
 Step2 - Step5    0.02083 0.0274 187   0.760  0.9998
 Step2 - Step6    0.02400 0.0274 187   0.875  0.9993
 Step2 - Step7    0.03902 0.0274 187   1.423  0.9576
 Step2 - Step8    0.04913 0.0274 187   1.792  0.8207
 Step2 - Step9    0.05495 0.0274 187   2.004  0.6902
 Step2 - Step10   0.05966 0.0274 187   2.176  0.5693
 Step2 - Step11   0.07443 0.0274 187   2.714  0.2276
 Step2 - Step12   0.08335 0.0274 187   3.040  0.1056
 Step3 - Step4    0.00507 0.0274 187   0.185  1.0000
 Step3 - Step5    0.00831 0.0274 187   0.303  1.0000
 Step3 - Step6    0.01148 0.0274 187   0.419  1.0000
 Step3 - Step7    0.02650 0.0274 187   0.966  0.9982
 Step3 - Step8    0.03661 0.0274 187   1.335  0.9734
 Step3 - Step9    0.04243 0.0274 187   1.547  0.9250
 Step3 - Step10   0.04714 0.0274 187   1.719  0.8573
 Step3 - Step11   0.06191 0.0274 187   2.258  0.5103
 Step3 - Step12   0.07083 0.0274 187   2.583  0.2970
 Step4 - Step5    0.00324 0.0274 187   0.118  1.0000
 Step4 - Step6    0.00641 0.0274 187   0.234  1.0000
 Step4 - Step7    0.02143 0.0274 187   0.781  0.9998
 Step4 - Step8    0.03154 0.0274 187   1.150  0.9918
 Step4 - Step9    0.03736 0.0274 187   1.362  0.9691
 Step4 - Step10   0.04207 0.0274 187   1.534  0.9291
 Step4 - Step11   0.05684 0.0274 187   2.073  0.6426
 Step4 - Step12   0.06576 0.0274 187   2.398  0.4126
 Step5 - Step6    0.00317 0.0274 187   0.116  1.0000
 Step5 - Step7    0.01819 0.0274 187   0.663  1.0000
 Step5 - Step8    0.02830 0.0274 187   1.032  0.9968
 Step5 - Step9    0.03412 0.0274 187   1.244  0.9845
 Step5 - Step10   0.03883 0.0274 187   1.416  0.9591
 Step5 - Step11   0.05360 0.0274 187   1.955  0.7229
 Step5 - Step12   0.06252 0.0274 187   2.280  0.4945
 Step6 - Step7    0.01502 0.0274 187   0.548  1.0000
 Step6 - Step8    0.02513 0.0274 187   0.916  0.9989
 Step6 - Step9    0.03096 0.0274 187   1.129  0.9930
 Step6 - Step10   0.03566 0.0274 187   1.301  0.9782
 Step6 - Step11   0.05044 0.0274 187   1.839  0.7941
 Step6 - Step12   0.05935 0.0274 187   2.164  0.5773
 Step7 - Step8    0.01011 0.0274 187   0.369  1.0000
 Step7 - Step9    0.01593 0.0274 187   0.581  1.0000
 Step7 - Step10   0.02064 0.0274 187   0.753  0.9998
 Step7 - Step11   0.03541 0.0274 187   1.291  0.9793
 Step7 - Step12   0.04433 0.0274 187   1.617  0.9010
 Step8 - Step9    0.00583 0.0274 187   0.212  1.0000
 Step8 - Step10   0.01053 0.0274 187   0.384  1.0000
 Step8 - Step11   0.02531 0.0274 187   0.923  0.9988
 Step8 - Step12   0.03422 0.0274 187   1.248  0.9842
 Step9 - Step10   0.00471 0.0274 187   0.172  1.0000
 Step9 - Step11   0.01948 0.0274 187   0.710  0.9999
 Step9 - Step12   0.02840 0.0274 187   1.036  0.9967
 Step10 - Step11  0.01477 0.0274 187   0.539  1.0000
 Step10 - Step12  0.02369 0.0274 187   0.864  0.9994
 Step11 - Step12  0.00892 0.0274 187   0.325  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.915640591 -0.002206877 -0.014727037 -0.019797229 -0.023035267 -0.026203243 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.041224960 -0.051333071 -0.057158852 -0.061867452 -0.076638672 -0.085556183 

Random Effects:
$subject
   (Intercept)
2   0.18471939
3   0.37503726
4  -0.46215459
5  -0.43759428
7  -0.18823031
8   0.68909557
10  0.82952104
11  1.09340874
13 -0.25532207
14  0.09366402
15 -0.28172676
16 -0.11407996
17 -0.29039133
18 -0.20610963
19 -0.34856010
20 -0.25190308
22 -0.49217550
23  0.06280158

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-0.8862877 -0.8257382 -0.3788806 -0.5657424  0.1050657 -0.1231394 

=============================================================

--- Mixed - Block 2 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value Pr(>F)
Step 0.31403 0.028548    11   187  1.0622 0.3942

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.010127 0.0546 187   0.185  1.0000
 Step1 - Step3    0.017660 0.0546 187   0.323  1.0000
 Step1 - Step4    0.017799 0.0546 187   0.326  1.0000
 Step1 - Step5    0.021011 0.0546 187   0.384  1.0000
 Step1 - Step6    0.019690 0.0546 187   0.360  1.0000
 Step1 - Step7    0.040106 0.0546 187   0.734  0.9999
 Step1 - Step8    0.058965 0.0546 187   1.079  0.9952
 Step1 - Step9    0.079766 0.0546 187   1.460  0.9494
 Step1 - Step10   0.087186 0.0546 187   1.595  0.9088
 Step1 - Step11   0.117830 0.0546 187   2.156  0.5833
 Step1 - Step12   0.100389 0.0546 187   1.837  0.7954
 Step2 - Step3    0.007533 0.0546 187   0.138  1.0000
 Step2 - Step4    0.007672 0.0546 187   0.140  1.0000
 Step2 - Step5    0.010884 0.0546 187   0.199  1.0000
 Step2 - Step6    0.009563 0.0546 187   0.175  1.0000
 Step2 - Step7    0.029979 0.0546 187   0.549  1.0000
 Step2 - Step8    0.048838 0.0546 187   0.894  0.9991
 Step2 - Step9    0.069639 0.0546 187   1.274  0.9814
 Step2 - Step10   0.077059 0.0546 187   1.410  0.9603
 Step2 - Step11   0.107703 0.0546 187   1.971  0.7124
 Step2 - Step12   0.090262 0.0546 187   1.652  0.8871
 Step3 - Step4    0.000138 0.0546 187   0.003  1.0000
 Step3 - Step5    0.003351 0.0546 187   0.061  1.0000
 Step3 - Step6    0.002030 0.0546 187   0.037  1.0000
 Step3 - Step7    0.022445 0.0546 187   0.411  1.0000
 Step3 - Step8    0.041305 0.0546 187   0.756  0.9998
 Step3 - Step9    0.062106 0.0546 187   1.136  0.9926
 Step3 - Step10   0.069526 0.0546 187   1.272  0.9816
 Step3 - Step11   0.100169 0.0546 187   1.833  0.7977
 Step3 - Step12   0.082729 0.0546 187   1.514  0.9351
 Step4 - Step5    0.003212 0.0546 187   0.059  1.0000
 Step4 - Step6    0.001892 0.0546 187   0.035  1.0000
 Step4 - Step7    0.022307 0.0546 187   0.408  1.0000
 Step4 - Step8    0.041166 0.0546 187   0.753  0.9998
 Step4 - Step9    0.061967 0.0546 187   1.134  0.9927
 Step4 - Step10   0.069387 0.0546 187   1.270  0.9819
 Step4 - Step11   0.100031 0.0546 187   1.830  0.7991
 Step4 - Step12   0.082590 0.0546 187   1.511  0.9358
 Step5 - Step6   -0.001321 0.0546 187  -0.024  1.0000
 Step5 - Step7    0.019095 0.0546 187   0.349  1.0000
 Step5 - Step8    0.037954 0.0546 187   0.695  0.9999
 Step5 - Step9    0.058755 0.0546 187   1.075  0.9954
 Step5 - Step10   0.066175 0.0546 187   1.211  0.9875
 Step5 - Step11   0.096819 0.0546 187   1.772  0.8311
 Step5 - Step12   0.079378 0.0546 187   1.453  0.9510
 Step6 - Step7    0.020415 0.0546 187   0.374  1.0000
 Step6 - Step8    0.039274 0.0546 187   0.719  0.9999
 Step6 - Step9    0.060075 0.0546 187   1.099  0.9944
 Step6 - Step10   0.067496 0.0546 187   1.235  0.9854
 Step6 - Step11   0.098139 0.0546 187   1.796  0.8183
 Step6 - Step12   0.080698 0.0546 187   1.477  0.9451
 Step7 - Step8    0.018859 0.0546 187   0.345  1.0000
 Step7 - Step9    0.039660 0.0546 187   0.726  0.9999
 Step7 - Step10   0.047080 0.0546 187   0.862  0.9994
 Step7 - Step11   0.077724 0.0546 187   1.422  0.9578
 Step7 - Step12   0.060283 0.0546 187   1.103  0.9942
 Step8 - Step9    0.020801 0.0546 187   0.381  1.0000
 Step8 - Step10   0.028221 0.0546 187   0.516  1.0000
 Step8 - Step11   0.058865 0.0546 187   1.077  0.9953
 Step8 - Step12   0.041424 0.0546 187   0.758  0.9998
 Step9 - Step10   0.007420 0.0546 187   0.136  1.0000
 Step9 - Step11   0.038064 0.0546 187   0.697  0.9999
 Step9 - Step12   0.020623 0.0546 187   0.377  1.0000
 Step10 - Step11  0.030644 0.0546 187   0.561  1.0000
 Step10 - Step12  0.013203 0.0546 187   0.242  1.0000
 Step11 - Step12 -0.017441 0.0546 187  -0.319  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 1.79057546 -0.01012696 -0.01766023 -0.01779866 -0.02101094 -0.01969042 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.04010554 -0.05896485 -0.07976575 -0.08718597 -0.11782967 -0.10038882 

Random Effects:
$subject
   (Intercept)
2   -0.1474609
3    0.5520054
4   -0.8154371
5   -0.8007244
7    0.0919751
8    0.8892435
10   1.6019275
11   2.1068230
13  -0.4724234
14  -0.5384222
15  -0.3232169
16   0.4164849
17  -0.8794031
18   0.3431330
19  -0.7447090
20  -0.7086679
22  -0.6732561
23   0.1021287

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
0.31105538 0.17581098 0.19034833 0.21761241 0.12793070 0.01944703 

=============================================================

--- Mixed - Block 3 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step  0.233 0.013706    17   289  3.9247 5.812e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    3.31e-03 0.0197 289   0.168  1.0000
 Step1 - Step3    1.18e-02 0.0197 289   0.600  1.0000
 Step1 - Step4    1.38e-02 0.0197 289   0.700  1.0000
 Step1 - Step5    1.06e-02 0.0197 289   0.538  1.0000
 Step1 - Step6    1.10e-02 0.0197 289   0.557  1.0000
 Step1 - Step7    1.55e-02 0.0197 289   0.789  1.0000
 Step1 - Step8    3.04e-02 0.0197 289   1.541  0.9868
 Step1 - Step9    3.31e-02 0.0197 289   1.681  0.9689
 Step1 - Step10   5.11e-02 0.0197 289   2.596  0.4600
 Step1 - Step11   5.15e-02 0.0197 289   2.617  0.4447
 Step1 - Step12   6.10e-02 0.0197 289   3.096  0.1645
 Step1 - Step13   6.02e-02 0.0197 289   3.058  0.1807
 Step1 - Step14   5.76e-02 0.0197 289   2.926  0.2452
 Step1 - Step15   6.02e-02 0.0197 289   3.056  0.1814
 Step1 - Step16   7.09e-02 0.0197 289   3.598  0.0392
 Step1 - Step17   8.00e-02 0.0197 289   4.062  0.0077
 Step1 - Step18   8.13e-02 0.0197 289   4.126  0.0060
 Step2 - Step3    8.50e-03 0.0197 289   0.432  1.0000
 Step2 - Step4    1.05e-02 0.0197 289   0.532  1.0000
 Step2 - Step5    7.30e-03 0.0197 289   0.371  1.0000
 Step2 - Step6    7.66e-03 0.0197 289   0.389  1.0000
 Step2 - Step7    1.22e-02 0.0197 289   0.621  1.0000
 Step2 - Step8    2.70e-02 0.0197 289   1.373  0.9963
 Step2 - Step9    2.98e-02 0.0197 289   1.513  0.9892
 Step2 - Step10   4.78e-02 0.0197 289   2.428  0.5870
 Step2 - Step11   4.82e-02 0.0197 289   2.449  0.5712
 Step2 - Step12   5.77e-02 0.0197 289   2.928  0.2437
 Step2 - Step13   5.69e-02 0.0197 289   2.890  0.2650
 Step2 - Step14   5.43e-02 0.0197 289   2.758  0.3461
 Step2 - Step15   5.69e-02 0.0197 289   2.888  0.2659
 Step2 - Step16   6.76e-02 0.0197 289   3.430  0.0659
 Step2 - Step17   7.67e-02 0.0197 289   3.894  0.0143
 Step2 - Step18   7.80e-02 0.0197 289   3.958  0.0113
 Step3 - Step4    1.98e-03 0.0197 289   0.100  1.0000
 Step3 - Step5   -1.20e-03 0.0197 289  -0.061  1.0000
 Step3 - Step6   -8.46e-04 0.0197 289  -0.043  1.0000
 Step3 - Step7    3.73e-03 0.0197 289   0.189  1.0000
 Step3 - Step8    1.85e-02 0.0197 289   0.941  1.0000
 Step3 - Step9    2.13e-02 0.0197 289   1.081  0.9998
 Step3 - Step10   3.93e-02 0.0197 289   1.997  0.8686
 Step3 - Step11   3.97e-02 0.0197 289   2.017  0.8586
 Step3 - Step12   4.92e-02 0.0197 289   2.497  0.5348
 Step3 - Step13   4.84e-02 0.0197 289   2.458  0.5641
 Step3 - Step14   4.58e-02 0.0197 289   2.326  0.6636
 Step3 - Step15   4.84e-02 0.0197 289   2.457  0.5653
 Step3 - Step16   5.91e-02 0.0197 289   2.999  0.2080
 Step3 - Step17   6.82e-02 0.0197 289   3.463  0.0598
 Step3 - Step18   6.95e-02 0.0197 289   3.527  0.0491
 Step4 - Step5   -3.18e-03 0.0197 289  -0.161  1.0000
 Step4 - Step6   -2.82e-03 0.0197 289  -0.143  1.0000
 Step4 - Step7    1.75e-03 0.0197 289   0.089  1.0000
 Step4 - Step8    1.66e-02 0.0197 289   0.841  1.0000
 Step4 - Step9    1.93e-02 0.0197 289   0.981  1.0000
 Step4 - Step10   3.74e-02 0.0197 289   1.896  0.9111
 Step4 - Step11   3.78e-02 0.0197 289   1.917  0.9032
 Step4 - Step12   4.72e-02 0.0197 289   2.396  0.6112
 Step4 - Step13   4.64e-02 0.0197 289   2.358  0.6401
 Step4 - Step14   4.38e-02 0.0197 289   2.226  0.7348
 Step4 - Step15   4.64e-02 0.0197 289   2.356  0.6413
 Step4 - Step16   5.71e-02 0.0197 289   2.898  0.2604
 Step4 - Step17   6.62e-02 0.0197 289   3.362  0.0804
 Step4 - Step18   6.75e-02 0.0197 289   3.426  0.0667
 Step5 - Step6    3.58e-04 0.0197 289   0.018  1.0000
 Step5 - Step7    4.93e-03 0.0197 289   0.250  1.0000
 Step5 - Step8    1.97e-02 0.0197 289   1.003  0.9999
 Step5 - Step9    2.25e-02 0.0197 289   1.142  0.9996
 Step5 - Step10   4.05e-02 0.0197 289   2.058  0.8377
 Step5 - Step11   4.09e-02 0.0197 289   2.078  0.8264
 Step5 - Step12   5.04e-02 0.0197 289   2.558  0.4885
 Step5 - Step13   4.96e-02 0.0197 289   2.519  0.5176
 Step5 - Step14   4.70e-02 0.0197 289   2.387  0.6181
 Step5 - Step15   4.96e-02 0.0197 289   2.518  0.5188
 Step5 - Step16   6.03e-02 0.0197 289   3.060  0.1799
 Step5 - Step17   6.94e-02 0.0197 289   3.524  0.0495
 Step5 - Step18   7.07e-02 0.0197 289   3.588  0.0405
 Step6 - Step7    4.57e-03 0.0197 289   0.232  1.0000
 Step6 - Step8    1.94e-02 0.0197 289   0.984  0.9999
 Step6 - Step9    2.21e-02 0.0197 289   1.124  0.9997
 Step6 - Step10   4.02e-02 0.0197 289   2.040  0.8473
 Step6 - Step11   4.06e-02 0.0197 289   2.060  0.8363
 Step6 - Step12   5.00e-02 0.0197 289   2.540  0.5022
 Step6 - Step13   4.93e-02 0.0197 289   2.501  0.5314
 Step6 - Step14   4.67e-02 0.0197 289   2.369  0.6317
 Step6 - Step15   4.92e-02 0.0197 289   2.500  0.5326
 Step6 - Step16   5.99e-02 0.0197 289   3.041  0.1880
 Step6 - Step17   6.91e-02 0.0197 289   3.506  0.0524
 Step6 - Step18   7.03e-02 0.0197 289   3.570  0.0429
 Step7 - Step8    1.48e-02 0.0197 289   0.752  1.0000
 Step7 - Step9    1.76e-02 0.0197 289   0.892  1.0000
 Step7 - Step10   3.56e-02 0.0197 289   1.807  0.9401
 Step7 - Step11   3.60e-02 0.0197 289   1.828  0.9340
 Step7 - Step12   4.55e-02 0.0197 289   2.307  0.6773
 Step7 - Step13   4.47e-02 0.0197 289   2.269  0.7048
 Step7 - Step14   4.21e-02 0.0197 289   2.137  0.7923
 Step7 - Step15   4.47e-02 0.0197 289   2.267  0.7059
 Step7 - Step16   5.53e-02 0.0197 289   2.809  0.3131
 Step7 - Step17   6.45e-02 0.0197 289   3.273  0.1034
 Step7 - Step18   6.57e-02 0.0197 289   3.337  0.0864
 Step8 - Step9    2.75e-03 0.0197 289   0.140  1.0000
 Step8 - Step10   2.08e-02 0.0197 289   1.055  0.9999
 Step8 - Step11   2.12e-02 0.0197 289   1.076  0.9998
 Step8 - Step12   3.06e-02 0.0197 289   1.555  0.9855
 Step8 - Step13   2.99e-02 0.0197 289   1.517  0.9888
 Step8 - Step14   2.73e-02 0.0197 289   1.385  0.9959
 Step8 - Step15   2.98e-02 0.0197 289   1.515  0.9890
 Step8 - Step16   4.05e-02 0.0197 289   2.057  0.8381
 Step8 - Step17   4.97e-02 0.0197 289   2.521  0.5161
 Step8 - Step18   5.09e-02 0.0197 289   2.585  0.4680
 Step9 - Step10   1.80e-02 0.0197 289   0.916  1.0000
 Step9 - Step11   1.84e-02 0.0197 289   0.936  1.0000
 Step9 - Step12   2.79e-02 0.0197 289   1.416  0.9948
 Step9 - Step13   2.71e-02 0.0197 289   1.377  0.9962
 Step9 - Step14   2.45e-02 0.0197 289   1.245  0.9989
 Step9 - Step15   2.71e-02 0.0197 289   1.376  0.9962
 Step9 - Step16   3.78e-02 0.0197 289   1.917  0.9030
 Step9 - Step17   4.69e-02 0.0197 289   2.382  0.6223
 Step9 - Step18   4.82e-02 0.0197 289   2.446  0.5738
 Step10 - Step11  4.09e-04 0.0197 289   0.021  1.0000
 Step10 - Step12  9.85e-03 0.0197 289   0.500  1.0000
 Step10 - Step13  9.09e-03 0.0197 289   0.462  1.0000
 Step10 - Step14  6.49e-03 0.0197 289   0.330  1.0000
 Step10 - Step15  9.06e-03 0.0197 289   0.460  1.0000
 Step10 - Step16  1.97e-02 0.0197 289   1.002  0.9999
 Step10 - Step17  2.89e-02 0.0197 289   1.466  0.9923
 Step10 - Step18  3.01e-02 0.0197 289   1.530  0.9878
 Step11 - Step12  9.44e-03 0.0197 289   0.479  1.0000
 Step11 - Step13  8.69e-03 0.0197 289   0.441  1.0000
 Step11 - Step14  6.08e-03 0.0197 289   0.309  1.0000
 Step11 - Step15  8.65e-03 0.0197 289   0.439  1.0000
 Step11 - Step16  1.93e-02 0.0197 289   0.981  1.0000
 Step11 - Step17  2.85e-02 0.0197 289   1.445  0.9934
 Step11 - Step18  2.97e-02 0.0197 289   1.509  0.9894
 Step12 - Step13 -7.57e-04 0.0197 289  -0.038  1.0000
 Step12 - Step14 -3.36e-03 0.0197 289  -0.171  1.0000
 Step12 - Step15 -7.88e-04 0.0197 289  -0.040  1.0000
 Step12 - Step16  9.88e-03 0.0197 289   0.502  1.0000
 Step12 - Step17  1.90e-02 0.0197 289   0.966  1.0000
 Step12 - Step18  2.03e-02 0.0197 289   1.030  0.9999
 Step13 - Step14 -2.60e-03 0.0197 289  -0.132  1.0000
 Step13 - Step15 -3.12e-05 0.0197 289  -0.002  1.0000
 Step13 - Step16  1.06e-02 0.0197 289   0.540  1.0000
 Step13 - Step17  1.98e-02 0.0197 289   1.004  0.9999
 Step13 - Step18  2.10e-02 0.0197 289   1.068  0.9998
 Step14 - Step15  2.57e-03 0.0197 289   0.131  1.0000
 Step14 - Step16  1.32e-02 0.0197 289   0.672  1.0000
 Step14 - Step17  2.24e-02 0.0197 289   1.137  0.9996
 Step14 - Step18  2.36e-02 0.0197 289   1.201  0.9993
 Step15 - Step16  1.07e-02 0.0197 289   0.542  1.0000
 Step15 - Step17  1.98e-02 0.0197 289   1.006  0.9999
 Step15 - Step18  2.11e-02 0.0197 289   1.070  0.9998
 Step16 - Step17  9.15e-03 0.0197 289   0.464  1.0000
 Step16 - Step18  1.04e-02 0.0197 289   0.528  1.0000
 Step17 - Step18  1.26e-03 0.0197 289   0.064  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.689309168 -0.003305951 -0.011809312 -0.013786735 -0.010605600 -0.010963456 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.015537692 -0.030353983 -0.033104519 -0.051139534 -0.051548403 -0.060991308 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.060234324 -0.057630813 -0.060203113 -0.070874770 -0.080019924 -0.081279532 

Random Effects:
$subject
    (Intercept)
2   0.217037342
3   0.033555084
4  -0.234093010
5  -0.316646415
7  -0.069082186
8   0.087326188
10  0.652465179
11  0.490556976
13 -0.195562843
14 -0.045275608
15 -0.125049094
16 -0.047142158
17 -0.060202858
18  0.153796820
19 -0.212052954
20 -0.233419425
22 -0.103076962
23  0.006865923

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-0.9965127 -0.1189668 -0.4756679 -0.3119872 -0.5505712 -0.2530975 

=============================================================

--- Mixed - Block 3 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq Mean Sq NumDF DenDF F value   Pr(>F)   
Step 0.17203 0.01012    17   289  2.4861 0.001117 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.002131 0.0213 289   0.100  1.0000
 Step1 - Step3    0.005563 0.0213 289   0.262  1.0000
 Step1 - Step4    0.008644 0.0213 289   0.406  1.0000
 Step1 - Step5    0.002865 0.0213 289   0.135  1.0000
 Step1 - Step6   -0.001075 0.0213 289  -0.051  1.0000
 Step1 - Step7   -0.006767 0.0213 289  -0.318  1.0000
 Step1 - Step8    0.006123 0.0213 289   0.288  1.0000
 Step1 - Step9    0.010348 0.0213 289   0.487  1.0000
 Step1 - Step10   0.022694 0.0213 289   1.067  0.9998
 Step1 - Step11   0.031230 0.0213 289   1.469  0.9921
 Step1 - Step12   0.034406 0.0213 289   1.618  0.9784
 Step1 - Step13   0.036427 0.0213 289   1.713  0.9628
 Step1 - Step14   0.036046 0.0213 289   1.695  0.9663
 Step1 - Step15   0.037173 0.0213 289   1.748  0.9553
 Step1 - Step16   0.048228 0.0213 289   2.268  0.7057
 Step1 - Step17   0.062916 0.0213 289   2.958  0.2280
 Step1 - Step18   0.075799 0.0213 289   3.564  0.0436
 Step2 - Step3    0.003432 0.0213 289   0.161  1.0000
 Step2 - Step4    0.006513 0.0213 289   0.306  1.0000
 Step2 - Step5    0.000734 0.0213 289   0.034  1.0000
 Step2 - Step6   -0.003206 0.0213 289  -0.151  1.0000
 Step2 - Step7   -0.008898 0.0213 289  -0.418  1.0000
 Step2 - Step8    0.003992 0.0213 289   0.188  1.0000
 Step2 - Step9    0.008217 0.0213 289   0.386  1.0000
 Step2 - Step10   0.020563 0.0213 289   0.967  1.0000
 Step2 - Step11   0.029099 0.0213 289   1.368  0.9964
 Step2 - Step12   0.032275 0.0213 289   1.518  0.9888
 Step2 - Step13   0.034295 0.0213 289   1.613  0.9791
 Step2 - Step14   0.033915 0.0213 289   1.595  0.9813
 Step2 - Step15   0.035042 0.0213 289   1.648  0.9742
 Step2 - Step16   0.046096 0.0213 289   2.168  0.7731
 Step2 - Step17   0.060784 0.0213 289   2.858  0.2833
 Step2 - Step18   0.073668 0.0213 289   3.464  0.0595
 Step3 - Step4    0.003081 0.0213 289   0.145  1.0000
 Step3 - Step5   -0.002698 0.0213 289  -0.127  1.0000
 Step3 - Step6   -0.006638 0.0213 289  -0.312  1.0000
 Step3 - Step7   -0.012330 0.0213 289  -0.580  1.0000
 Step3 - Step8    0.000560 0.0213 289   0.026  1.0000
 Step3 - Step9    0.004785 0.0213 289   0.225  1.0000
 Step3 - Step10   0.017131 0.0213 289   0.806  1.0000
 Step3 - Step11   0.025667 0.0213 289   1.207  0.9992
 Step3 - Step12   0.028843 0.0213 289   1.356  0.9968
 Step3 - Step13   0.030864 0.0213 289   1.451  0.9931
 Step3 - Step14   0.030483 0.0213 289   1.433  0.9940
 Step3 - Step15   0.031610 0.0213 289   1.486  0.9910
 Step3 - Step16   0.042665 0.0213 289   2.006  0.8641
 Step3 - Step17   0.057353 0.0213 289   2.697  0.3875
 Step3 - Step18   0.070236 0.0213 289   3.303  0.0953
 Step4 - Step5   -0.005779 0.0213 289  -0.272  1.0000
 Step4 - Step6   -0.009719 0.0213 289  -0.457  1.0000
 Step4 - Step7   -0.015411 0.0213 289  -0.725  1.0000
 Step4 - Step8   -0.002521 0.0213 289  -0.119  1.0000
 Step4 - Step9    0.001704 0.0213 289   0.080  1.0000
 Step4 - Step10   0.014050 0.0213 289   0.661  1.0000
 Step4 - Step11   0.022586 0.0213 289   1.062  0.9999
 Step4 - Step12   0.025762 0.0213 289   1.211  0.9992
 Step4 - Step13   0.027783 0.0213 289   1.306  0.9979
 Step4 - Step14   0.027402 0.0213 289   1.289  0.9983
 Step4 - Step15   0.028529 0.0213 289   1.342  0.9972
 Step4 - Step16   0.039584 0.0213 289   1.861  0.9234
 Step4 - Step17   0.054272 0.0213 289   2.552  0.4930
 Step4 - Step18   0.067155 0.0213 289   3.158  0.1407
 Step5 - Step6   -0.003939 0.0213 289  -0.185  1.0000
 Step5 - Step7   -0.009632 0.0213 289  -0.453  1.0000
 Step5 - Step8    0.003258 0.0213 289   0.153  1.0000
 Step5 - Step9    0.007484 0.0213 289   0.352  1.0000
 Step5 - Step10   0.019830 0.0213 289   0.932  1.0000
 Step5 - Step11   0.028365 0.0213 289   1.334  0.9974
 Step5 - Step12   0.031542 0.0213 289   1.483  0.9912
 Step5 - Step13   0.033562 0.0213 289   1.578  0.9832
 Step5 - Step14   0.033181 0.0213 289   1.560  0.9850
 Step5 - Step15   0.034309 0.0213 289   1.613  0.9790
 Step5 - Step16   0.045363 0.0213 289   2.133  0.7946
 Step5 - Step17   0.060051 0.0213 289   2.824  0.3041
 Step5 - Step18   0.072935 0.0213 289   3.430  0.0660
 Step6 - Step7   -0.005692 0.0213 289  -0.268  1.0000
 Step6 - Step8    0.007198 0.0213 289   0.338  1.0000
 Step6 - Step9    0.011423 0.0213 289   0.537  1.0000
 Step6 - Step10   0.023769 0.0213 289   1.118  0.9997
 Step6 - Step11   0.032305 0.0213 289   1.519  0.9887
 Step6 - Step12   0.035481 0.0213 289   1.668  0.9709
 Step6 - Step13   0.037501 0.0213 289   1.763  0.9517
 Step6 - Step14   0.037121 0.0213 289   1.745  0.9559
 Step6 - Step15   0.038248 0.0213 289   1.799  0.9426
 Step6 - Step16   0.049302 0.0213 289   2.318  0.6694
 Step6 - Step17   0.063990 0.0213 289   3.009  0.2030
 Step6 - Step18   0.076874 0.0213 289   3.615  0.0371
 Step7 - Step8    0.012890 0.0213 289   0.606  1.0000
 Step7 - Step9    0.017115 0.0213 289   0.805  1.0000
 Step7 - Step10   0.029461 0.0213 289   1.385  0.9959
 Step7 - Step11   0.037997 0.0213 289   1.787  0.9458
 Step7 - Step12   0.041173 0.0213 289   1.936  0.8955
 Step7 - Step13   0.043193 0.0213 289   2.031  0.8517
 Step7 - Step14   0.042813 0.0213 289   2.013  0.8606
 Step7 - Step15   0.043940 0.0213 289   2.066  0.8332
 Step7 - Step16   0.054994 0.0213 289   2.586  0.4675
 Step7 - Step17   0.069683 0.0213 289   3.277  0.1025
 Step7 - Step18   0.082566 0.0213 289   3.882  0.0149
 Step8 - Step9    0.004225 0.0213 289   0.199  1.0000
 Step8 - Step10   0.016571 0.0213 289   0.779  1.0000
 Step8 - Step11   0.025107 0.0213 289   1.181  0.9994
 Step8 - Step12   0.028283 0.0213 289   1.330  0.9975
 Step8 - Step13   0.030304 0.0213 289   1.425  0.9944
 Step8 - Step14   0.029923 0.0213 289   1.407  0.9951
 Step8 - Step15   0.031051 0.0213 289   1.460  0.9926
 Step8 - Step16   0.042105 0.0213 289   1.980  0.8765
 Step8 - Step17   0.056793 0.0213 289   2.671  0.4060
 Step8 - Step18   0.069676 0.0213 289   3.276  0.1025
 Step9 - Step10   0.012346 0.0213 289   0.581  1.0000
 Step9 - Step11   0.020882 0.0213 289   0.982  1.0000
 Step9 - Step12   0.024058 0.0213 289   1.131  0.9997
 Step9 - Step13   0.026078 0.0213 289   1.226  0.9991
 Step9 - Step14   0.025698 0.0213 289   1.208  0.9992
 Step9 - Step15   0.026825 0.0213 289   1.261  0.9987
 Step9 - Step16   0.037879 0.0213 289   1.781  0.9472
 Step9 - Step17   0.052567 0.0213 289   2.472  0.5538
 Step9 - Step18   0.065451 0.0213 289   3.078  0.1722
 Step10 - Step11  0.008536 0.0213 289   0.401  1.0000
 Step10 - Step12  0.011712 0.0213 289   0.551  1.0000
 Step10 - Step13  0.013732 0.0213 289   0.646  1.0000
 Step10 - Step14  0.013352 0.0213 289   0.628  1.0000
 Step10 - Step15  0.014479 0.0213 289   0.681  1.0000
 Step10 - Step16  0.025533 0.0213 289   1.201  0.9993
 Step10 - Step17  0.040221 0.0213 289   1.891  0.9129
 Step10 - Step18  0.053105 0.0213 289   2.497  0.5345
 Step11 - Step12  0.003176 0.0213 289   0.149  1.0000
 Step11 - Step13  0.005196 0.0213 289   0.244  1.0000
 Step11 - Step14  0.004816 0.0213 289   0.226  1.0000
 Step11 - Step15  0.005943 0.0213 289   0.279  1.0000
 Step11 - Step16  0.016997 0.0213 289   0.799  1.0000
 Step11 - Step17  0.031686 0.0213 289   1.490  0.9908
 Step11 - Step18  0.044569 0.0213 289   2.096  0.8166
 Step12 - Step13  0.002020 0.0213 289   0.095  1.0000
 Step12 - Step14  0.001640 0.0213 289   0.077  1.0000
 Step12 - Step15  0.002767 0.0213 289   0.130  1.0000
 Step12 - Step16  0.013821 0.0213 289   0.650  1.0000
 Step12 - Step17  0.028509 0.0213 289   1.341  0.9972
 Step12 - Step18  0.041393 0.0213 289   1.946  0.8912
 Step13 - Step14 -0.000380 0.0213 289  -0.018  1.0000
 Step13 - Step15  0.000747 0.0213 289   0.035  1.0000
 Step13 - Step16  0.011801 0.0213 289   0.555  1.0000
 Step13 - Step17  0.026489 0.0213 289   1.246  0.9989
 Step13 - Step18  0.039373 0.0213 289   1.851  0.9267
 Step14 - Step15  0.001127 0.0213 289   0.053  1.0000
 Step14 - Step16  0.012181 0.0213 289   0.573  1.0000
 Step14 - Step17  0.026870 0.0213 289   1.263  0.9986
 Step14 - Step18  0.039753 0.0213 289   1.869  0.9207
 Step15 - Step16  0.011054 0.0213 289   0.520  1.0000
 Step15 - Step17  0.025742 0.0213 289   1.210  0.9992
 Step15 - Step18  0.038626 0.0213 289   1.816  0.9376
 Step16 - Step17  0.014688 0.0213 289   0.691  1.0000
 Step16 - Step18  0.027572 0.0213 289   1.296  0.9981
 Step17 - Step18  0.012884 0.0213 289   0.606  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.696902361 -0.002131264 -0.005563023 -0.008643998 -0.002864774  0.001074614 
       Step7        Step8        Step9       Step10       Step11       Step12 
 0.006766807 -0.006122937 -0.010348414 -0.022694347 -0.031230184 -0.034406319 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.036426630 -0.036046142 -0.037173483 -0.048227557 -0.062915706 -0.075799312 

Random Effects:
$subject
   (Intercept)
2   0.11067362
3   0.24126818
4  -0.19756778
5  -0.21922887
7  -0.10876780
8   0.26530435
10  0.65696392
11  0.19910429
13 -0.18156031
14  0.02331389
15  0.01310774
16 -0.11719019
17 -0.02139368
18 -0.06177287
19 -0.23766503
20 -0.18475356
22 -0.27069470
23  0.09085881

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-0.8618287 -0.5153149 -0.8523797 -0.2206190  0.7062235  0.4722699 

=============================================================

--- Mixed - Block 3 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
Step 0.15751 0.0092653    17   289   0.832 0.6555

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.007128 0.0352 289   0.203  1.0000
 Step1 - Step3    0.006744 0.0352 289   0.192  1.0000
 Step1 - Step4    0.012191 0.0352 289   0.347  1.0000
 Step1 - Step5    0.007362 0.0352 289   0.209  1.0000
 Step1 - Step6    0.015308 0.0352 289   0.435  1.0000
 Step1 - Step7    0.009666 0.0352 289   0.275  1.0000
 Step1 - Step8    0.027661 0.0352 289   0.786  1.0000
 Step1 - Step9    0.036206 0.0352 289   1.029  0.9999
 Step1 - Step10   0.039308 0.0352 289   1.117  0.9997
 Step1 - Step11   0.045058 0.0352 289   1.281  0.9984
 Step1 - Step12   0.043526 0.0352 289   1.237  0.9989
 Step1 - Step13   0.049684 0.0352 289   1.412  0.9949
 Step1 - Step14   0.056215 0.0352 289   1.598  0.9809
 Step1 - Step15   0.054530 0.0352 289   1.550  0.9860
 Step1 - Step16   0.065661 0.0352 289   1.867  0.9217
 Step1 - Step17   0.062591 0.0352 289   1.779  0.9477
 Step1 - Step18   0.061268 0.0352 289   1.742  0.9567
 Step2 - Step3   -0.000384 0.0352 289  -0.011  1.0000
 Step2 - Step4    0.005063 0.0352 289   0.144  1.0000
 Step2 - Step5    0.000234 0.0352 289   0.007  1.0000
 Step2 - Step6    0.008180 0.0352 289   0.233  1.0000
 Step2 - Step7    0.002538 0.0352 289   0.072  1.0000
 Step2 - Step8    0.020533 0.0352 289   0.584  1.0000
 Step2 - Step9    0.029078 0.0352 289   0.827  1.0000
 Step2 - Step10   0.032180 0.0352 289   0.915  1.0000
 Step2 - Step11   0.037930 0.0352 289   1.078  0.9998
 Step2 - Step12   0.036398 0.0352 289   1.035  0.9999
 Step2 - Step13   0.042556 0.0352 289   1.210  0.9992
 Step2 - Step14   0.049087 0.0352 289   1.395  0.9955
 Step2 - Step15   0.047402 0.0352 289   1.348  0.9970
 Step2 - Step16   0.058533 0.0352 289   1.664  0.9717
 Step2 - Step17   0.055463 0.0352 289   1.577  0.9833
 Step2 - Step18   0.054140 0.0352 289   1.539  0.9870
 Step3 - Step4    0.005447 0.0352 289   0.155  1.0000
 Step3 - Step5    0.000618 0.0352 289   0.018  1.0000
 Step3 - Step6    0.008564 0.0352 289   0.243  1.0000
 Step3 - Step7    0.002922 0.0352 289   0.083  1.0000
 Step3 - Step8    0.020917 0.0352 289   0.595  1.0000
 Step3 - Step9    0.029462 0.0352 289   0.838  1.0000
 Step3 - Step10   0.032564 0.0352 289   0.926  1.0000
 Step3 - Step11   0.038314 0.0352 289   1.089  0.9998
 Step3 - Step12   0.036782 0.0352 289   1.046  0.9999
 Step3 - Step13   0.042940 0.0352 289   1.221  0.9991
 Step3 - Step14   0.049471 0.0352 289   1.406  0.9951
 Step3 - Step15   0.047786 0.0352 289   1.358  0.9967
 Step3 - Step16   0.058917 0.0352 289   1.675  0.9698
 Step3 - Step17   0.055847 0.0352 289   1.588  0.9821
 Step3 - Step18   0.054524 0.0352 289   1.550  0.9860
 Step4 - Step5   -0.004830 0.0352 289  -0.137  1.0000
 Step4 - Step6    0.003117 0.0352 289   0.089  1.0000
 Step4 - Step7   -0.002525 0.0352 289  -0.072  1.0000
 Step4 - Step8    0.015470 0.0352 289   0.440  1.0000
 Step4 - Step9    0.024015 0.0352 289   0.683  1.0000
 Step4 - Step10   0.027117 0.0352 289   0.771  1.0000
 Step4 - Step11   0.032867 0.0352 289   0.934  1.0000
 Step4 - Step12   0.031335 0.0352 289   0.891  1.0000
 Step4 - Step13   0.037493 0.0352 289   1.066  0.9998
 Step4 - Step14   0.044024 0.0352 289   1.252  0.9988
 Step4 - Step15   0.042339 0.0352 289   1.204  0.9993
 Step4 - Step16   0.053470 0.0352 289   1.520  0.9886
 Step4 - Step17   0.050400 0.0352 289   1.433  0.9940
 Step4 - Step18   0.049077 0.0352 289   1.395  0.9956
 Step5 - Step6    0.007946 0.0352 289   0.226  1.0000
 Step5 - Step7    0.002305 0.0352 289   0.066  1.0000
 Step5 - Step8    0.020299 0.0352 289   0.577  1.0000
 Step5 - Step9    0.028844 0.0352 289   0.820  1.0000
 Step5 - Step10   0.031947 0.0352 289   0.908  1.0000
 Step5 - Step11   0.037697 0.0352 289   1.072  0.9998
 Step5 - Step12   0.036164 0.0352 289   1.028  0.9999
 Step5 - Step13   0.042322 0.0352 289   1.203  0.9993
 Step5 - Step14   0.048854 0.0352 289   1.389  0.9958
 Step5 - Step15   0.047169 0.0352 289   1.341  0.9972
 Step5 - Step16   0.058300 0.0352 289   1.657  0.9727
 Step5 - Step17   0.055230 0.0352 289   1.570  0.9840
 Step5 - Step18   0.053906 0.0352 289   1.532  0.9876
 Step6 - Step7   -0.005642 0.0352 289  -0.160  1.0000
 Step6 - Step8    0.012353 0.0352 289   0.351  1.0000
 Step6 - Step9    0.020898 0.0352 289   0.594  1.0000
 Step6 - Step10   0.024000 0.0352 289   0.682  1.0000
 Step6 - Step11   0.029751 0.0352 289   0.846  1.0000
 Step6 - Step12   0.028218 0.0352 289   0.802  1.0000
 Step6 - Step13   0.034376 0.0352 289   0.977  1.0000
 Step6 - Step14   0.040908 0.0352 289   1.163  0.9995
 Step6 - Step15   0.039222 0.0352 289   1.115  0.9997
 Step6 - Step16   0.050353 0.0352 289   1.431  0.9941
 Step6 - Step17   0.047283 0.0352 289   1.344  0.9971
 Step6 - Step18   0.045960 0.0352 289   1.307  0.9979
 Step7 - Step8    0.017995 0.0352 289   0.512  1.0000
 Step7 - Step9    0.026540 0.0352 289   0.754  1.0000
 Step7 - Step10   0.029642 0.0352 289   0.843  1.0000
 Step7 - Step11   0.035392 0.0352 289   1.006  0.9999
 Step7 - Step12   0.033860 0.0352 289   0.963  1.0000
 Step7 - Step13   0.040018 0.0352 289   1.138  0.9996
 Step7 - Step14   0.046549 0.0352 289   1.323  0.9976
 Step7 - Step15   0.044864 0.0352 289   1.275  0.9985
 Step7 - Step16   0.055995 0.0352 289   1.592  0.9817
 Step7 - Step17   0.052925 0.0352 289   1.505  0.9898
 Step7 - Step18   0.051602 0.0352 289   1.467  0.9922
 Step8 - Step9    0.008545 0.0352 289   0.243  1.0000
 Step8 - Step10   0.011647 0.0352 289   0.331  1.0000
 Step8 - Step11   0.017398 0.0352 289   0.495  1.0000
 Step8 - Step12   0.015865 0.0352 289   0.451  1.0000
 Step8 - Step13   0.022023 0.0352 289   0.626  1.0000
 Step8 - Step14   0.028555 0.0352 289   0.812  1.0000
 Step8 - Step15   0.026869 0.0352 289   0.764  1.0000
 Step8 - Step16   0.038000 0.0352 289   1.080  0.9998
 Step8 - Step17   0.034930 0.0352 289   0.993  0.9999
 Step8 - Step18   0.033607 0.0352 289   0.955  1.0000
 Step9 - Step10   0.003102 0.0352 289   0.088  1.0000
 Step9 - Step11   0.008852 0.0352 289   0.252  1.0000
 Step9 - Step12   0.007320 0.0352 289   0.208  1.0000
 Step9 - Step13   0.013478 0.0352 289   0.383  1.0000
 Step9 - Step14   0.020009 0.0352 289   0.569  1.0000
 Step9 - Step15   0.018324 0.0352 289   0.521  1.0000
 Step9 - Step16   0.029455 0.0352 289   0.837  1.0000
 Step9 - Step17   0.026385 0.0352 289   0.750  1.0000
 Step9 - Step18   0.025062 0.0352 289   0.712  1.0000
 Step10 - Step11  0.005750 0.0352 289   0.163  1.0000
 Step10 - Step12  0.004218 0.0352 289   0.120  1.0000
 Step10 - Step13  0.010376 0.0352 289   0.295  1.0000
 Step10 - Step14  0.016907 0.0352 289   0.481  1.0000
 Step10 - Step15  0.015222 0.0352 289   0.433  1.0000
 Step10 - Step16  0.026353 0.0352 289   0.749  1.0000
 Step10 - Step17  0.023283 0.0352 289   0.662  1.0000
 Step10 - Step18  0.021960 0.0352 289   0.624  1.0000
 Step11 - Step12 -0.001532 0.0352 289  -0.044  1.0000
 Step11 - Step13  0.004626 0.0352 289   0.131  1.0000
 Step11 - Step14  0.011157 0.0352 289   0.317  1.0000
 Step11 - Step15  0.009472 0.0352 289   0.269  1.0000
 Step11 - Step16  0.020603 0.0352 289   0.586  1.0000
 Step11 - Step17  0.017533 0.0352 289   0.498  1.0000
 Step11 - Step18  0.016209 0.0352 289   0.461  1.0000
 Step12 - Step13  0.006158 0.0352 289   0.175  1.0000
 Step12 - Step14  0.012689 0.0352 289   0.361  1.0000
 Step12 - Step15  0.011004 0.0352 289   0.313  1.0000
 Step12 - Step16  0.022135 0.0352 289   0.629  1.0000
 Step12 - Step17  0.019065 0.0352 289   0.542  1.0000
 Step12 - Step18  0.017742 0.0352 289   0.504  1.0000
 Step13 - Step14  0.006531 0.0352 289   0.186  1.0000
 Step13 - Step15  0.004846 0.0352 289   0.138  1.0000
 Step13 - Step16  0.015977 0.0352 289   0.454  1.0000
 Step13 - Step17  0.012907 0.0352 289   0.367  1.0000
 Step13 - Step18  0.011584 0.0352 289   0.329  1.0000
 Step14 - Step15 -0.001685 0.0352 289  -0.048  1.0000
 Step14 - Step16  0.009446 0.0352 289   0.269  1.0000
 Step14 - Step17  0.006376 0.0352 289   0.181  1.0000
 Step14 - Step18  0.005052 0.0352 289   0.144  1.0000
 Step15 - Step16  0.011131 0.0352 289   0.316  1.0000
 Step15 - Step17  0.008061 0.0352 289   0.229  1.0000
 Step15 - Step18  0.006738 0.0352 289   0.192  1.0000
 Step16 - Step17 -0.003070 0.0352 289  -0.087  1.0000
 Step16 - Step18 -0.004393 0.0352 289  -0.125  1.0000
 Step17 - Step18 -0.001324 0.0352 289  -0.038  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 1.468854734 -0.007128076 -0.006744010 -0.012191149 -0.007361597 -0.015307936 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.009666256 -0.027660958 -0.036206015 -0.039308206 -0.045058466 -0.043526034 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.049684043 -0.056215458 -0.054530288 -0.065661112 -0.062591406 -0.061267824 

Random Effects:
$subject
   (Intercept)
2   0.11364790
3   0.48351802
4  -0.66326977
5  -0.73420340
7   0.27589996
8   0.13705590
10  2.04364135
11  0.39240357
13 -0.37328200
14  0.10553543
15 -0.24318679
16  0.17402938
17 -0.39162124
18  0.44451774
19 -0.60821764
20 -0.57887660
22 -0.52256179
23 -0.05503001

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.29851085  0.85188820  0.41045393  0.27290405 -0.08093394 -0.58195098 

=============================================================

--- Mixed - Block 4 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.25215 0.014832    17   289  2.8141 0.0002125 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    1.72e-03 0.0242 289   0.071  1.0000
 Step1 - Step3   -8.16e-03 0.0242 289  -0.337  1.0000
 Step1 - Step4   -3.25e-03 0.0242 289  -0.134  1.0000
 Step1 - Step5    1.55e-03 0.0242 289   0.064  1.0000
 Step1 - Step6   -2.40e-03 0.0242 289  -0.099  1.0000
 Step1 - Step7   -2.40e-03 0.0242 289  -0.099  1.0000
 Step1 - Step8    4.05e-03 0.0242 289   0.168  1.0000
 Step1 - Step9    1.61e-02 0.0242 289   0.665  1.0000
 Step1 - Step10   2.05e-02 0.0242 289   0.847  1.0000
 Step1 - Step11   1.95e-02 0.0242 289   0.804  1.0000
 Step1 - Step12   4.37e-02 0.0242 289   1.806  0.9404
 Step1 - Step13   6.25e-02 0.0242 289   2.582  0.4707
 Step1 - Step14   5.02e-02 0.0242 289   2.075  0.8281
 Step1 - Step15   4.52e-02 0.0242 289   1.866  0.9218
 Step1 - Step16   7.47e-02 0.0242 289   3.086  0.1688
 Step1 - Step17   7.03e-02 0.0242 289   2.905  0.2568
 Step1 - Step18   5.67e-02 0.0242 289   2.344  0.6502
 Step2 - Step3   -9.88e-03 0.0242 289  -0.408  1.0000
 Step2 - Step4   -4.98e-03 0.0242 289  -0.206  1.0000
 Step2 - Step5   -1.68e-04 0.0242 289  -0.007  1.0000
 Step2 - Step6   -4.12e-03 0.0242 289  -0.170  1.0000
 Step2 - Step7   -4.12e-03 0.0242 289  -0.170  1.0000
 Step2 - Step8    2.33e-03 0.0242 289   0.096  1.0000
 Step2 - Step9    1.44e-02 0.0242 289   0.594  1.0000
 Step2 - Step10   1.88e-02 0.0242 289   0.776  1.0000
 Step2 - Step11   1.77e-02 0.0242 289   0.733  1.0000
 Step2 - Step12   4.20e-02 0.0242 289   1.735  0.9581
 Step2 - Step13   6.08e-02 0.0242 289   2.511  0.5243
 Step2 - Step14   4.85e-02 0.0242 289   2.004  0.8650
 Step2 - Step15   4.34e-02 0.0242 289   1.795  0.9435
 Step2 - Step16   7.30e-02 0.0242 289   3.015  0.2003
 Step2 - Step17   6.86e-02 0.0242 289   2.833  0.2982
 Step2 - Step18   5.50e-02 0.0242 289   2.273  0.7019
 Step3 - Step4    4.90e-03 0.0242 289   0.203  1.0000
 Step3 - Step5    9.71e-03 0.0242 289   0.401  1.0000
 Step3 - Step6    5.75e-03 0.0242 289   0.238  1.0000
 Step3 - Step7    5.75e-03 0.0242 289   0.238  1.0000
 Step3 - Step8    1.22e-02 0.0242 289   0.505  1.0000
 Step3 - Step9    2.42e-02 0.0242 289   1.002  0.9999
 Step3 - Step10   2.87e-02 0.0242 289   1.184  0.9994
 Step3 - Step11   2.76e-02 0.0242 289   1.141  0.9996
 Step3 - Step12   5.19e-02 0.0242 289   2.143  0.7883
 Step3 - Step13   7.06e-02 0.0242 289   2.919  0.2490
 Step3 - Step14   5.84e-02 0.0242 289   2.412  0.5992
 Step3 - Step15   5.33e-02 0.0242 289   2.203  0.7500
 Step3 - Step16   8.28e-02 0.0242 289   3.423  0.0674
 Step3 - Step17   7.84e-02 0.0242 289   3.242  0.1128
 Step3 - Step18   6.49e-02 0.0242 289   2.681  0.3984
 Step4 - Step5    4.81e-03 0.0242 289   0.199  1.0000
 Step4 - Step6    8.51e-04 0.0242 289   0.035  1.0000
 Step4 - Step7    8.52e-04 0.0242 289   0.035  1.0000
 Step4 - Step8    7.31e-03 0.0242 289   0.302  1.0000
 Step4 - Step9    1.93e-02 0.0242 289   0.799  1.0000
 Step4 - Step10   2.38e-02 0.0242 289   0.981  1.0000
 Step4 - Step11   2.27e-02 0.0242 289   0.938  1.0000
 Step4 - Step12   4.70e-02 0.0242 289   1.941  0.8935
 Step4 - Step13   6.57e-02 0.0242 289   2.716  0.3742
 Step4 - Step14   5.35e-02 0.0242 289   2.210  0.7456
 Step4 - Step15   4.84e-02 0.0242 289   2.001  0.8668
 Step4 - Step16   7.79e-02 0.0242 289   3.220  0.1194
 Step4 - Step17   7.35e-02 0.0242 289   3.039  0.1891
 Step4 - Step18   6.00e-02 0.0242 289   2.479  0.5485
 Step5 - Step6   -3.96e-03 0.0242 289  -0.163  1.0000
 Step5 - Step7   -3.95e-03 0.0242 289  -0.163  1.0000
 Step5 - Step8    2.50e-03 0.0242 289   0.103  1.0000
 Step5 - Step9    1.45e-02 0.0242 289   0.601  1.0000
 Step5 - Step10   1.89e-02 0.0242 289   0.783  1.0000
 Step5 - Step11   1.79e-02 0.0242 289   0.740  1.0000
 Step5 - Step12   4.22e-02 0.0242 289   1.742  0.9566
 Step5 - Step13   6.09e-02 0.0242 289   2.518  0.5190
 Step5 - Step14   4.87e-02 0.0242 289   2.011  0.8617
 Step5 - Step15   4.36e-02 0.0242 289   1.802  0.9416
 Step5 - Step16   7.31e-02 0.0242 289   3.022  0.1971
 Step5 - Step17   6.87e-02 0.0242 289   2.840  0.2940
 Step5 - Step18   5.52e-02 0.0242 289   2.280  0.6970
 Step6 - Step7    1.01e-06 0.0242 289   0.000  1.0000
 Step6 - Step8    6.46e-03 0.0242 289   0.267  1.0000
 Step6 - Step9    1.85e-02 0.0242 289   0.764  1.0000
 Step6 - Step10   2.29e-02 0.0242 289   0.946  1.0000
 Step6 - Step11   2.19e-02 0.0242 289   0.903  1.0000
 Step6 - Step12   4.61e-02 0.0242 289   1.906  0.9076
 Step6 - Step13   6.49e-02 0.0242 289   2.681  0.3986
 Step6 - Step14   5.26e-02 0.0242 289   2.175  0.7687
 Step6 - Step15   4.76e-02 0.0242 289   1.965  0.8830
 Step6 - Step16   7.71e-02 0.0242 289   3.185  0.1311
 Step6 - Step17   7.27e-02 0.0242 289   3.004  0.2054
 Step6 - Step18   5.91e-02 0.0242 289   2.444  0.5754
 Step7 - Step8    6.46e-03 0.0242 289   0.267  1.0000
 Step7 - Step9    1.85e-02 0.0242 289   0.764  1.0000
 Step7 - Step10   2.29e-02 0.0242 289   0.946  1.0000
 Step7 - Step11   2.19e-02 0.0242 289   0.903  1.0000
 Step7 - Step12   4.61e-02 0.0242 289   1.906  0.9076
 Step7 - Step13   6.49e-02 0.0242 289   2.681  0.3986
 Step7 - Step14   5.26e-02 0.0242 289   2.175  0.7687
 Step7 - Step15   4.76e-02 0.0242 289   1.965  0.8830
 Step7 - Step16   7.71e-02 0.0242 289   3.185  0.1311
 Step7 - Step17   7.27e-02 0.0242 289   3.004  0.2054
 Step7 - Step18   5.91e-02 0.0242 289   2.444  0.5754
 Step8 - Step9    1.20e-02 0.0242 289   0.497  1.0000
 Step8 - Step10   1.64e-02 0.0242 289   0.680  1.0000
 Step8 - Step11   1.54e-02 0.0242 289   0.636  1.0000
 Step8 - Step12   3.97e-02 0.0242 289   1.639  0.9755
 Step8 - Step13   5.84e-02 0.0242 289   2.414  0.5977
 Step8 - Step14   4.62e-02 0.0242 289   1.908  0.9068
 Step8 - Step15   4.11e-02 0.0242 289   1.699  0.9656
 Step8 - Step16   7.06e-02 0.0242 289   2.918  0.2493
 Step8 - Step17   6.62e-02 0.0242 289   2.737  0.3600
 Step8 - Step18   5.27e-02 0.0242 289   2.177  0.7672
 Step9 - Step10   4.41e-03 0.0242 289   0.182  1.0000
 Step9 - Step11   3.36e-03 0.0242 289   0.139  1.0000
 Step9 - Step12   2.76e-02 0.0242 289   1.142  0.9996
 Step9 - Step13   4.64e-02 0.0242 289   1.917  0.9032
 Step9 - Step14   3.41e-02 0.0242 289   1.410  0.9950
 Step9 - Step15   2.91e-02 0.0242 289   1.201  0.9993
 Step9 - Step16   5.86e-02 0.0242 289   2.421  0.5926
 Step9 - Step17   5.42e-02 0.0242 289   2.240  0.7253
 Step9 - Step18   4.06e-02 0.0242 289   1.679  0.9691
 Step10 - Step11 -1.05e-03 0.0242 289  -0.043  1.0000
 Step10 - Step12  2.32e-02 0.0242 289   0.959  1.0000
 Step10 - Step13  4.20e-02 0.0242 289   1.735  0.9583
 Step10 - Step14  2.97e-02 0.0242 289   1.228  0.9990
 Step10 - Step15  2.47e-02 0.0242 289   1.019  0.9999
 Step10 - Step16  5.42e-02 0.0242 289   2.239  0.7259
 Step10 - Step17  4.98e-02 0.0242 289   2.058  0.8378
 Step10 - Step18  3.62e-02 0.0242 289   1.497  0.9903
 Step11 - Step12  2.43e-02 0.0242 289   1.003  0.9999
 Step11 - Step13  4.30e-02 0.0242 289   1.778  0.9480
 Step11 - Step14  3.08e-02 0.0242 289   1.272  0.9985
 Step11 - Step15  2.57e-02 0.0242 289   1.062  0.9999
 Step11 - Step16  5.52e-02 0.0242 289   2.282  0.6956
 Step11 - Step17  5.08e-02 0.0242 289   2.101  0.8137
 Step11 - Step18  3.73e-02 0.0242 289   1.541  0.9869
 Step12 - Step13  1.88e-02 0.0242 289   0.775  1.0000
 Step12 - Step14  6.51e-03 0.0242 289   0.269  1.0000
 Step12 - Step15  1.45e-03 0.0242 289   0.060  1.0000
 Step12 - Step16  3.10e-02 0.0242 289   1.279  0.9984
 Step12 - Step17  2.66e-02 0.0242 289   1.098  0.9998
 Step12 - Step18  1.30e-02 0.0242 289   0.538  1.0000
 Step13 - Step14 -1.23e-02 0.0242 289  -0.506  1.0000
 Step13 - Step15 -1.73e-02 0.0242 289  -0.716  1.0000
 Step13 - Step16  1.22e-02 0.0242 289   0.504  1.0000
 Step13 - Step17  7.81e-03 0.0242 289   0.323  1.0000
 Step13 - Step18 -5.75e-03 0.0242 289  -0.237  1.0000
 Step14 - Step15 -5.06e-03 0.0242 289  -0.209  1.0000
 Step14 - Step16  2.45e-02 0.0242 289   1.010  0.9999
 Step14 - Step17  2.01e-02 0.0242 289   0.829  1.0000
 Step14 - Step18  6.51e-03 0.0242 289   0.269  1.0000
 Step15 - Step16  2.95e-02 0.0242 289   1.220  0.9991
 Step15 - Step17  2.51e-02 0.0242 289   1.038  0.9999
 Step15 - Step18  1.16e-02 0.0242 289   0.478  1.0000
 Step16 - Step17 -4.38e-03 0.0242 289  -0.181  1.0000
 Step16 - Step18 -1.79e-02 0.0242 289  -0.741  1.0000
 Step17 - Step18 -1.36e-02 0.0242 289  -0.560  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.778454008 -0.001722254  0.008154995  0.003252814 -0.001554268  0.002401562 
       Step7        Step8        Step9       Step10       Step11       Step12 
 0.002400557 -0.004054728 -0.016090644 -0.020498675 -0.019450045 -0.043714835 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.062477643 -0.050222268 -0.045160930 -0.074675757 -0.070291020 -0.056732481 

Random Effects:
$subject
   (Intercept)
2   0.11709623
3  -0.10546447
4  -0.27101283
5  -0.42855871
7  -0.09708163
8   0.41056427
10  1.15545637
11  0.42071593
13 -0.21297071
14 -0.03185362
15 -0.21351277
16  0.13384627
17 -0.14468682
18 -0.01479793
19 -0.22654812
20 -0.25994927
22 -0.17740503
23 -0.05383716

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.08752551 -0.39168491  0.23427732 -0.23241553 -0.33719605 -0.06044152 

=============================================================

--- Mixed - Block 4 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 1.0102 0.059424    17   289  6.3067 1.415e-12 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -0.003459 0.0324 289  -0.107  1.0000
 Step1 - Step3    0.028378 0.0324 289   0.877  1.0000
 Step1 - Step4    0.024563 0.0324 289   0.759  1.0000
 Step1 - Step5    0.026464 0.0324 289   0.818  1.0000
 Step1 - Step6    0.053216 0.0324 289   1.645  0.9747
 Step1 - Step7    0.037728 0.0324 289   1.166  0.9995
 Step1 - Step8    0.072733 0.0324 289   2.248  0.7196
 Step1 - Step9    0.075260 0.0324 289   2.326  0.6637
 Step1 - Step10   0.088741 0.0324 289   2.743  0.3563
 Step1 - Step11   0.101042 0.0324 289   3.123  0.1539
 Step1 - Step12   0.123077 0.0324 289   3.804  0.0197
 Step1 - Step13   0.157385 0.0324 289   4.864  0.0003
 Step1 - Step14   0.135146 0.0324 289   4.177  0.0050
 Step1 - Step15   0.122813 0.0324 289   3.796  0.0202
 Step1 - Step16   0.169141 0.0324 289   5.227  <.0001
 Step1 - Step17   0.160686 0.0324 289   4.966  0.0002
 Step1 - Step18   0.144933 0.0324 289   4.479  0.0015
 Step2 - Step3    0.031836 0.0324 289   0.984  0.9999
 Step2 - Step4    0.028021 0.0324 289   0.866  1.0000
 Step2 - Step5    0.029923 0.0324 289   0.925  1.0000
 Step2 - Step6    0.056675 0.0324 289   1.752  0.9545
 Step2 - Step7    0.041187 0.0324 289   1.273  0.9985
 Step2 - Step8    0.076191 0.0324 289   2.355  0.6425
 Step2 - Step9    0.078719 0.0324 289   2.433  0.5835
 Step2 - Step10   0.092199 0.0324 289   2.850  0.2885
 Step2 - Step11   0.104501 0.0324 289   3.230  0.1164
 Step2 - Step12   0.126536 0.0324 289   3.911  0.0135
 Step2 - Step13   0.160843 0.0324 289   4.971  0.0002
 Step2 - Step14   0.138605 0.0324 289   4.284  0.0033
 Step2 - Step15   0.126272 0.0324 289   3.903  0.0139
 Step2 - Step16   0.172600 0.0324 289   5.334  <.0001
 Step2 - Step17   0.164144 0.0324 289   5.073  0.0001
 Step2 - Step18   0.148391 0.0324 289   4.586  0.0009
 Step3 - Step4   -0.003815 0.0324 289  -0.118  1.0000
 Step3 - Step5   -0.001914 0.0324 289  -0.059  1.0000
 Step3 - Step6    0.024838 0.0324 289   0.768  1.0000
 Step3 - Step7    0.009350 0.0324 289   0.289  1.0000
 Step3 - Step8    0.044355 0.0324 289   1.371  0.9964
 Step3 - Step9    0.046882 0.0324 289   1.449  0.9932
 Step3 - Step10   0.060363 0.0324 289   1.866  0.9220
 Step3 - Step11   0.072664 0.0324 289   2.246  0.7211
 Step3 - Step12   0.094699 0.0324 289   2.927  0.2446
 Step3 - Step13   0.129007 0.0324 289   3.987  0.0102
 Step3 - Step14   0.106768 0.0324 289   3.300  0.0961
 Step3 - Step15   0.094435 0.0324 289   2.919  0.2491
 Step3 - Step16   0.140763 0.0324 289   4.350  0.0025
 Step3 - Step17   0.132308 0.0324 289   4.089  0.0070
 Step3 - Step18   0.116555 0.0324 289   3.602  0.0386
 Step4 - Step5    0.001901 0.0324 289   0.059  1.0000
 Step4 - Step6    0.028653 0.0324 289   0.886  1.0000
 Step4 - Step7    0.013165 0.0324 289   0.407  1.0000
 Step4 - Step8    0.048170 0.0324 289   1.489  0.9909
 Step4 - Step9    0.050698 0.0324 289   1.567  0.9844
 Step4 - Step10   0.064178 0.0324 289   1.983  0.8748
 Step4 - Step11   0.076480 0.0324 289   2.364  0.6358
 Step4 - Step12   0.098514 0.0324 289   3.045  0.1865
 Step4 - Step13   0.132822 0.0324 289   4.105  0.0066
 Step4 - Step14   0.110584 0.0324 289   3.418  0.0684
 Step4 - Step15   0.098250 0.0324 289   3.037  0.1902
 Step4 - Step16   0.144579 0.0324 289   4.468  0.0015
 Step4 - Step17   0.136123 0.0324 289   4.207  0.0044
 Step4 - Step18   0.120370 0.0324 289   3.720  0.0262
 Step5 - Step6    0.026752 0.0324 289   0.827  1.0000
 Step5 - Step7    0.011264 0.0324 289   0.348  1.0000
 Step5 - Step8    0.046268 0.0324 289   1.430  0.9941
 Step5 - Step9    0.048796 0.0324 289   1.508  0.9895
 Step5 - Step10   0.062276 0.0324 289   1.925  0.9001
 Step5 - Step11   0.074578 0.0324 289   2.305  0.6791
 Step5 - Step12   0.096613 0.0324 289   2.986  0.2141
 Step5 - Step13   0.130921 0.0324 289   4.046  0.0082
 Step5 - Step14   0.108682 0.0324 289   3.359  0.0812
 Step5 - Step15   0.096349 0.0324 289   2.978  0.2182
 Step5 - Step16   0.142677 0.0324 289   4.410  0.0019
 Step5 - Step17   0.134222 0.0324 289   4.148  0.0055
 Step5 - Step18   0.118469 0.0324 289   3.661  0.0319
 Step6 - Step7   -0.015488 0.0324 289  -0.479  1.0000
 Step6 - Step8    0.019516 0.0324 289   0.603  1.0000
 Step6 - Step9    0.022044 0.0324 289   0.681  1.0000
 Step6 - Step10   0.035524 0.0324 289   1.098  0.9998
 Step6 - Step11   0.047826 0.0324 289   1.478  0.9915
 Step6 - Step12   0.069861 0.0324 289   2.159  0.7785
 Step6 - Step13   0.104169 0.0324 289   3.219  0.1197
 Step6 - Step14   0.081930 0.0324 289   2.532  0.5079
 Step6 - Step15   0.069597 0.0324 289   2.151  0.7836
 Step6 - Step16   0.115925 0.0324 289   3.583  0.0411
 Step6 - Step17   0.107470 0.0324 289   3.321  0.0904
 Step6 - Step18   0.091717 0.0324 289   2.835  0.2975
 Step7 - Step8    0.035005 0.0324 289   1.082  0.9998
 Step7 - Step9    0.037532 0.0324 289   1.160  0.9995
 Step7 - Step10   0.051013 0.0324 289   1.577  0.9833
 Step7 - Step11   0.063314 0.0324 289   1.957  0.8867
 Step7 - Step12   0.085349 0.0324 289   2.638  0.4294
 Step7 - Step13   0.119657 0.0324 289   3.698  0.0282
 Step7 - Step14   0.097418 0.0324 289   3.011  0.2021
 Step7 - Step15   0.085085 0.0324 289   2.630  0.4354
 Step7 - Step16   0.131413 0.0324 289   4.061  0.0077
 Step7 - Step17   0.122958 0.0324 289   3.800  0.0199
 Step7 - Step18   0.107205 0.0324 289   3.313  0.0925
 Step8 - Step9    0.002528 0.0324 289   0.078  1.0000
 Step8 - Step10   0.016008 0.0324 289   0.495  1.0000
 Step8 - Step11   0.028310 0.0324 289   0.875  1.0000
 Step8 - Step12   0.050344 0.0324 289   1.556  0.9855
 Step8 - Step13   0.084652 0.0324 289   2.616  0.4451
 Step8 - Step14   0.062414 0.0324 289   1.929  0.8984
 Step8 - Step15   0.050080 0.0324 289   1.548  0.9862
 Step8 - Step16   0.096409 0.0324 289   2.980  0.2173
 Step8 - Step17   0.087953 0.0324 289   2.718  0.3727
 Step8 - Step18   0.072200 0.0324 289   2.231  0.7310
 Step9 - Step10   0.013480 0.0324 289   0.417  1.0000
 Step9 - Step11   0.025782 0.0324 289   0.797  1.0000
 Step9 - Step12   0.047817 0.0324 289   1.478  0.9916
 Step9 - Step13   0.082124 0.0324 289   2.538  0.5034
 Step9 - Step14   0.059886 0.0324 289   1.851  0.9269
 Step9 - Step15   0.047553 0.0324 289   1.470  0.9921
 Step9 - Step16   0.093881 0.0324 289   2.901  0.2585
 Step9 - Step17   0.085425 0.0324 289   2.640  0.4277
 Step9 - Step18   0.069672 0.0324 289   2.153  0.7821
 Step10 - Step11  0.012302 0.0324 289   0.380  1.0000
 Step10 - Step12  0.034336 0.0324 289   1.061  0.9999
 Step10 - Step13  0.068644 0.0324 289   2.122  0.8015
 Step10 - Step14  0.046406 0.0324 289   1.434  0.9939
 Step10 - Step15  0.034072 0.0324 289   1.053  0.9999
 Step10 - Step16  0.080401 0.0324 289   2.485  0.5439
 Step10 - Step17  0.071945 0.0324 289   2.224  0.7363
 Step10 - Step18  0.056192 0.0324 289   1.737  0.9578
 Step11 - Step12  0.022035 0.0324 289   0.681  1.0000
 Step11 - Step13  0.056343 0.0324 289   1.741  0.9568
 Step11 - Step14  0.034104 0.0324 289   1.054  0.9999
 Step11 - Step15  0.021771 0.0324 289   0.673  1.0000
 Step11 - Step16  0.068099 0.0324 289   2.105  0.8115
 Step11 - Step17  0.059643 0.0324 289   1.843  0.9293
 Step11 - Step18  0.043890 0.0324 289   1.356  0.9968
 Step12 - Step13  0.034308 0.0324 289   1.060  0.9999
 Step12 - Step14  0.012069 0.0324 289   0.373  1.0000
 Step12 - Step15 -0.000264 0.0324 289  -0.008  1.0000
 Step12 - Step16  0.046064 0.0324 289   1.424  0.9944
 Step12 - Step17  0.037609 0.0324 289   1.162  0.9995
 Step12 - Step18  0.021856 0.0324 289   0.675  1.0000
 Step13 - Step14 -0.022239 0.0324 289  -0.687  1.0000
 Step13 - Step15 -0.034572 0.0324 289  -1.068  0.9998
 Step13 - Step16  0.011756 0.0324 289   0.363  1.0000
 Step13 - Step17  0.003301 0.0324 289   0.102  1.0000
 Step13 - Step18 -0.012452 0.0324 289  -0.385  1.0000
 Step14 - Step15 -0.012333 0.0324 289  -0.381  1.0000
 Step14 - Step16  0.033995 0.0324 289   1.051  0.9999
 Step14 - Step17  0.025540 0.0324 289   0.789  1.0000
 Step14 - Step18  0.009787 0.0324 289   0.302  1.0000
 Step15 - Step16  0.046328 0.0324 289   1.432  0.9940
 Step15 - Step17  0.037873 0.0324 289   1.170  0.9995
 Step15 - Step18  0.022120 0.0324 289   0.684  1.0000
 Step16 - Step17 -0.008456 0.0324 289  -0.261  1.0000
 Step16 - Step18 -0.024209 0.0324 289  -0.748  1.0000
 Step17 - Step18 -0.015753 0.0324 289  -0.487  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 0.88440842  0.00345862 -0.02837787 -0.02456268 -0.02646418 -0.05321614 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.03772800 -0.07273255 -0.07526032 -0.08874055 -0.10104228 -0.12307700 
     Step13      Step14      Step15      Step16      Step17      Step18 
-0.15738481 -0.13514620 -0.12281291 -0.16914123 -0.16068571 -0.14493272 

Random Effects:
$subject
   (Intercept)
2   0.36975526
3   0.14786499
4  -0.27686909
5  -0.36168291
7  -0.28216811
8   0.47134441
10  0.98329144
11  0.43057146
13 -0.27065304
14 -0.08534180
15 -0.21444622
16  0.02414633
17 -0.12734390
18  0.12308542
19 -0.38318217
20 -0.27250425
22 -0.34491318
23  0.06904535

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.82993157 -0.05439119 -0.11599365 -0.85471963 -0.01832145  0.22418505 

=============================================================

--- Mixed - Block 4 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step  2.681 0.15771    17   289  6.8711 6.998e-14 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.013435 0.0505 289   0.266  1.0000
 Step1 - Step3    0.038242 0.0505 289   0.757  1.0000
 Step1 - Step4    0.037796 0.0505 289   0.748  1.0000
 Step1 - Step5    0.052683 0.0505 289   1.043  0.9999
 Step1 - Step6    0.052975 0.0505 289   1.049  0.9999
 Step1 - Step7    0.059776 0.0505 289   1.184  0.9994
 Step1 - Step8    0.072437 0.0505 289   1.434  0.9939
 Step1 - Step9    0.092874 0.0505 289   1.839  0.9307
 Step1 - Step10   0.123616 0.0505 289   2.448  0.5721
 Step1 - Step11   0.118163 0.0505 289   2.340  0.6535
 Step1 - Step12   0.185349 0.0505 289   3.670  0.0309
 Step1 - Step13   0.246680 0.0505 289   4.885  0.0002
 Step1 - Step14   0.218323 0.0505 289   4.323  0.0028
 Step1 - Step15   0.180664 0.0505 289   3.578  0.0418
 Step1 - Step16   0.279145 0.0505 289   5.528  <.0001
 Step1 - Step17   0.283546 0.0505 289   5.615  <.0001
 Step1 - Step18   0.214983 0.0505 289   4.257  0.0036
 Step2 - Step3    0.024807 0.0505 289   0.491  1.0000
 Step2 - Step4    0.024361 0.0505 289   0.482  1.0000
 Step2 - Step5    0.039248 0.0505 289   0.777  1.0000
 Step2 - Step6    0.039540 0.0505 289   0.783  1.0000
 Step2 - Step7    0.046341 0.0505 289   0.918  1.0000
 Step2 - Step8    0.059002 0.0505 289   1.168  0.9995
 Step2 - Step9    0.079439 0.0505 289   1.573  0.9837
 Step2 - Step10   0.110180 0.0505 289   2.182  0.7640
 Step2 - Step11   0.104728 0.0505 289   2.074  0.8290
 Step2 - Step12   0.171913 0.0505 289   3.404  0.0712
 Step2 - Step13   0.233244 0.0505 289   4.619  0.0008
 Step2 - Step14   0.204888 0.0505 289   4.057  0.0079
 Step2 - Step15   0.167229 0.0505 289   3.311  0.0930
 Step2 - Step16   0.265710 0.0505 289   5.262  <.0001
 Step2 - Step17   0.270111 0.0505 289   5.349  <.0001
 Step2 - Step18   0.201548 0.0505 289   3.991  0.0101
 Step3 - Step4   -0.000446 0.0505 289  -0.009  1.0000
 Step3 - Step5    0.014441 0.0505 289   0.286  1.0000
 Step3 - Step6    0.014733 0.0505 289   0.292  1.0000
 Step3 - Step7    0.021534 0.0505 289   0.426  1.0000
 Step3 - Step8    0.034195 0.0505 289   0.677  1.0000
 Step3 - Step9    0.054632 0.0505 289   1.082  0.9998
 Step3 - Step10   0.085373 0.0505 289   1.691  0.9671
 Step3 - Step11   0.079921 0.0505 289   1.583  0.9827
 Step3 - Step12   0.147106 0.0505 289   2.913  0.2521
 Step3 - Step13   0.208437 0.0505 289   4.127  0.0060
 Step3 - Step14   0.180081 0.0505 289   3.566  0.0434
 Step3 - Step15   0.142422 0.0505 289   2.820  0.3063
 Step3 - Step16   0.240903 0.0505 289   4.770  0.0004
 Step3 - Step17   0.245304 0.0505 289   4.858  0.0003
 Step3 - Step18   0.176741 0.0505 289   3.500  0.0534
 Step4 - Step5    0.014887 0.0505 289   0.295  1.0000
 Step4 - Step6    0.015179 0.0505 289   0.301  1.0000
 Step4 - Step7    0.021980 0.0505 289   0.435  1.0000
 Step4 - Step8    0.034641 0.0505 289   0.686  1.0000
 Step4 - Step9    0.055079 0.0505 289   1.091  0.9998
 Step4 - Step10   0.085820 0.0505 289   1.699  0.9654
 Step4 - Step11   0.080367 0.0505 289   1.591  0.9817
 Step4 - Step12   0.147553 0.0505 289   2.922  0.2473
 Step4 - Step13   0.208884 0.0505 289   4.136  0.0058
 Step4 - Step14   0.180527 0.0505 289   3.575  0.0422
 Step4 - Step15   0.142868 0.0505 289   2.829  0.3008
 Step4 - Step16   0.241349 0.0505 289   4.779  0.0004
 Step4 - Step17   0.245750 0.0505 289   4.866  0.0003
 Step4 - Step18   0.177187 0.0505 289   3.509  0.0519
 Step5 - Step6    0.000292 0.0505 289   0.006  1.0000
 Step5 - Step7    0.007093 0.0505 289   0.140  1.0000
 Step5 - Step8    0.019754 0.0505 289   0.391  1.0000
 Step5 - Step9    0.040191 0.0505 289   0.796  1.0000
 Step5 - Step10   0.070933 0.0505 289   1.405  0.9952
 Step5 - Step11   0.065480 0.0505 289   1.297  0.9981
 Step5 - Step12   0.132666 0.0505 289   2.627  0.4373
 Step5 - Step13   0.193997 0.0505 289   3.842  0.0172
 Step5 - Step14   0.165640 0.0505 289   3.280  0.1015
 Step5 - Step15   0.127981 0.0505 289   2.534  0.5063
 Step5 - Step16   0.226462 0.0505 289   4.484  0.0014
 Step5 - Step17   0.230863 0.0505 289   4.572  0.0010
 Step5 - Step18   0.162300 0.0505 289   3.214  0.1215
 Step6 - Step7    0.006801 0.0505 289   0.135  1.0000
 Step6 - Step8    0.019462 0.0505 289   0.385  1.0000
 Step6 - Step9    0.039900 0.0505 289   0.790  1.0000
 Step6 - Step10   0.070641 0.0505 289   1.399  0.9954
 Step6 - Step11   0.065188 0.0505 289   1.291  0.9982
 Step6 - Step12   0.132374 0.0505 289   2.621  0.4415
 Step6 - Step13   0.193705 0.0505 289   3.836  0.0176
 Step6 - Step14   0.165348 0.0505 289   3.274  0.1031
 Step6 - Step15   0.127690 0.0505 289   2.529  0.5107
 Step6 - Step16   0.226170 0.0505 289   4.479  0.0015
 Step6 - Step17   0.230571 0.0505 289   4.566  0.0010
 Step6 - Step18   0.162008 0.0505 289   3.208  0.1234
 Step7 - Step8    0.012661 0.0505 289   0.251  1.0000
 Step7 - Step9    0.033099 0.0505 289   0.655  1.0000
 Step7 - Step10   0.063840 0.0505 289   1.264  0.9986
 Step7 - Step11   0.058387 0.0505 289   1.156  0.9996
 Step7 - Step12   0.125573 0.0505 289   2.487  0.5426
 Step7 - Step13   0.186904 0.0505 289   3.701  0.0279
 Step7 - Step14   0.158547 0.0505 289   3.140  0.1475
 Step7 - Step15   0.120889 0.0505 289   2.394  0.6131
 Step7 - Step16   0.219369 0.0505 289   4.344  0.0026
 Step7 - Step17   0.223770 0.0505 289   4.431  0.0018
 Step7 - Step18   0.155207 0.0505 289   3.073  0.1740
 Step8 - Step9    0.020437 0.0505 289   0.405  1.0000
 Step8 - Step10   0.051179 0.0505 289   1.013  0.9999
 Step8 - Step11   0.045726 0.0505 289   0.905  1.0000
 Step8 - Step12   0.112912 0.0505 289   2.236  0.7279
 Step8 - Step13   0.174243 0.0505 289   3.450  0.0620
 Step8 - Step14   0.145886 0.0505 289   2.889  0.2656
 Step8 - Step15   0.108227 0.0505 289   2.143  0.7884
 Step8 - Step16   0.206708 0.0505 289   4.093  0.0069
 Step8 - Step17   0.211109 0.0505 289   4.180  0.0049
 Step8 - Step18   0.142546 0.0505 289   2.823  0.3048
 Step9 - Step10   0.030741 0.0505 289   0.609  1.0000
 Step9 - Step11   0.025288 0.0505 289   0.501  1.0000
 Step9 - Step12   0.092474 0.0505 289   1.831  0.9331
 Step9 - Step13   0.153805 0.0505 289   3.046  0.1861
 Step9 - Step14   0.125448 0.0505 289   2.484  0.5444
 Step9 - Step15   0.087790 0.0505 289   1.738  0.9574
 Step9 - Step16   0.186271 0.0505 289   3.689  0.0291
 Step9 - Step17   0.190672 0.0505 289   3.776  0.0217
 Step9 - Step18   0.122108 0.0505 289   2.418  0.5948
 Step10 - Step11 -0.005453 0.0505 289  -0.108  1.0000
 Step10 - Step12  0.061733 0.0505 289   1.222  0.9991
 Step10 - Step13  0.123064 0.0505 289   2.437  0.5804
 Step10 - Step14  0.094707 0.0505 289   1.875  0.9186
 Step10 - Step15  0.057049 0.0505 289   1.130  0.9997
 Step10 - Step16  0.155530 0.0505 289   3.080  0.1713
 Step10 - Step17  0.159931 0.0505 289   3.167  0.1375
 Step10 - Step18  0.091367 0.0505 289   1.809  0.9396
 Step11 - Step12  0.067186 0.0505 289   1.330  0.9974
 Step11 - Step13  0.128517 0.0505 289   2.545  0.4983
 Step11 - Step14  0.100160 0.0505 289   1.983  0.8748
 Step11 - Step15  0.062502 0.0505 289   1.238  0.9989
 Step11 - Step16  0.160982 0.0505 289   3.188  0.1302
 Step11 - Step17  0.165383 0.0505 289   3.275  0.1029
 Step11 - Step18  0.096820 0.0505 289   1.917  0.9031
 Step12 - Step13  0.061331 0.0505 289   1.214  0.9992
 Step12 - Step14  0.032974 0.0505 289   0.653  1.0000
 Step12 - Step15 -0.004684 0.0505 289  -0.093  1.0000
 Step12 - Step16  0.093797 0.0505 289   1.857  0.9248
 Step12 - Step17  0.098197 0.0505 289   1.945  0.8920
 Step12 - Step18  0.029634 0.0505 289   0.587  1.0000
 Step13 - Step14 -0.028357 0.0505 289  -0.562  1.0000
 Step13 - Step15 -0.066015 0.0505 289  -1.307  0.9979
 Step13 - Step16  0.032466 0.0505 289   0.643  1.0000
 Step13 - Step17  0.036867 0.0505 289   0.730  1.0000
 Step13 - Step18 -0.031697 0.0505 289  -0.628  1.0000
 Step14 - Step15 -0.037658 0.0505 289  -0.746  1.0000
 Step14 - Step16  0.060822 0.0505 289   1.204  0.9992
 Step14 - Step17  0.065223 0.0505 289   1.292  0.9982
 Step14 - Step18 -0.003340 0.0505 289  -0.066  1.0000
 Step15 - Step16  0.098481 0.0505 289   1.950  0.8896
 Step15 - Step17  0.102882 0.0505 289   2.037  0.8485
 Step15 - Step18  0.034318 0.0505 289   0.680  1.0000
 Step16 - Step17  0.004401 0.0505 289   0.087  1.0000
 Step16 - Step18 -0.064162 0.0505 289  -1.271  0.9985
 Step17 - Step18 -0.068563 0.0505 289  -1.358  0.9968

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 1.75672442 -0.01343518 -0.03824215 -0.03779586 -0.05268298 -0.05297480 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.05977578 -0.07243701 -0.09287447 -0.12361557 -0.11816280 -0.18534861 
     Step13      Step14      Step15      Step16      Step17      Step18 
-0.24667958 -0.21832283 -0.18066434 -0.27914522 -0.28354608 -0.21498274 

Random Effects:
$subject
   (Intercept)
2  -0.13093283
3   0.08152113
4  -0.62660875
5  -0.84994062
7   0.24815050
8   0.78580340
10  2.08091719
11  0.72704043
13 -0.43079730
14 -0.04942483
15 -0.50578548
16  0.08669507
17 -0.45794858
18  0.69413455
19 -0.77126730
20 -0.48946414
22 -0.67588648
23  0.28379404

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
 0.4958609  1.1146709  0.5987113  0.3269831  0.8249149 -0.1443813 

=============================================================

--- Mixed - Block 5 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
       Sum Sq  Mean Sq NumDF DenDF F value  Pr(>F)  
Step 0.097393 0.005729    17   289  2.0206 0.01036 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -0.003791 0.0177 289  -0.214  1.0000
 Step1 - Step3   -0.012747 0.0177 289  -0.718  1.0000
 Step1 - Step4    0.005586 0.0177 289   0.315  1.0000
 Step1 - Step5    0.007840 0.0177 289   0.442  1.0000
 Step1 - Step6   -0.014272 0.0177 289  -0.804  1.0000
 Step1 - Step7    0.014057 0.0177 289   0.792  1.0000
 Step1 - Step8    0.019433 0.0177 289   1.095  0.9998
 Step1 - Step9    0.020009 0.0177 289   1.127  0.9997
 Step1 - Step10   0.018370 0.0177 289   1.035  0.9999
 Step1 - Step11   0.016539 0.0177 289   0.932  1.0000
 Step1 - Step12   0.029785 0.0177 289   1.678  0.9693
 Step1 - Step13   0.033647 0.0177 289   1.896  0.9113
 Step1 - Step14   0.032737 0.0177 289   1.844  0.9290
 Step1 - Step15   0.035594 0.0177 289   2.005  0.8645
 Step1 - Step16   0.038640 0.0177 289   2.177  0.7671
 Step1 - Step17   0.043180 0.0177 289   2.433  0.5836
 Step1 - Step18   0.037328 0.0177 289   2.103  0.8124
 Step2 - Step3   -0.008956 0.0177 289  -0.505  1.0000
 Step2 - Step4    0.009377 0.0177 289   0.528  1.0000
 Step2 - Step5    0.011631 0.0177 289   0.655  1.0000
 Step2 - Step6   -0.010481 0.0177 289  -0.591  1.0000
 Step2 - Step7    0.017848 0.0177 289   1.006  0.9999
 Step2 - Step8    0.023224 0.0177 289   1.308  0.9979
 Step2 - Step9    0.023800 0.0177 289   1.341  0.9972
 Step2 - Step10   0.022161 0.0177 289   1.249  0.9988
 Step2 - Step11   0.020330 0.0177 289   1.145  0.9996
 Step2 - Step12   0.033576 0.0177 289   1.892  0.9128
 Step2 - Step13   0.037438 0.0177 289   2.109  0.8088
 Step2 - Step14   0.036527 0.0177 289   2.058  0.8376
 Step2 - Step15   0.039384 0.0177 289   2.219  0.7394
 Step2 - Step16   0.042431 0.0177 289   2.391  0.6156
 Step2 - Step17   0.046971 0.0177 289   2.646  0.4232
 Step2 - Step18   0.041119 0.0177 289   2.317  0.6706
 Step3 - Step4    0.018333 0.0177 289   1.033  0.9999
 Step3 - Step5    0.020587 0.0177 289   1.160  0.9995
 Step3 - Step6   -0.001525 0.0177 289  -0.086  1.0000
 Step3 - Step7    0.026804 0.0177 289   1.510  0.9894
 Step3 - Step8    0.032180 0.0177 289   1.813  0.9385
 Step3 - Step9    0.032756 0.0177 289   1.845  0.9286
 Step3 - Step10   0.031117 0.0177 289   1.753  0.9541
 Step3 - Step11   0.029286 0.0177 289   1.650  0.9739
 Step3 - Step12   0.042532 0.0177 289   2.396  0.6113
 Step3 - Step13   0.046394 0.0177 289   2.614  0.4469
 Step3 - Step14   0.045484 0.0177 289   2.563  0.4850
 Step3 - Step15   0.048341 0.0177 289   2.724  0.3691
 Step3 - Step16   0.051387 0.0177 289   2.895  0.2620
 Step3 - Step17   0.055927 0.0177 289   3.151  0.1432
 Step3 - Step18   0.050075 0.0177 289   2.821  0.3057
 Step4 - Step5    0.002254 0.0177 289   0.127  1.0000
 Step4 - Step6   -0.019858 0.0177 289  -1.119  0.9997
 Step4 - Step7    0.008471 0.0177 289   0.477  1.0000
 Step4 - Step8    0.013847 0.0177 289   0.780  1.0000
 Step4 - Step9    0.014423 0.0177 289   0.813  1.0000
 Step4 - Step10   0.012784 0.0177 289   0.720  1.0000
 Step4 - Step11   0.010954 0.0177 289   0.617  1.0000
 Step4 - Step12   0.024199 0.0177 289   1.363  0.9966
 Step4 - Step13   0.028061 0.0177 289   1.581  0.9829
 Step4 - Step14   0.027151 0.0177 289   1.530  0.9878
 Step4 - Step15   0.030008 0.0177 289   1.691  0.9671
 Step4 - Step16   0.033054 0.0177 289   1.862  0.9231
 Step4 - Step17   0.037594 0.0177 289   2.118  0.8036
 Step4 - Step18   0.031742 0.0177 289   1.788  0.9453
 Step5 - Step6   -0.022112 0.0177 289  -1.246  0.9988
 Step5 - Step7    0.006216 0.0177 289   0.350  1.0000
 Step5 - Step8    0.011593 0.0177 289   0.653  1.0000
 Step5 - Step9    0.012169 0.0177 289   0.686  1.0000
 Step5 - Step10   0.010530 0.0177 289   0.593  1.0000
 Step5 - Step11   0.008699 0.0177 289   0.490  1.0000
 Step5 - Step12   0.021945 0.0177 289   1.236  0.9990
 Step5 - Step13   0.025806 0.0177 289   1.454  0.9929
 Step5 - Step14   0.024896 0.0177 289   1.403  0.9953
 Step5 - Step15   0.027753 0.0177 289   1.564  0.9847
 Step5 - Step16   0.030800 0.0177 289   1.735  0.9581
 Step5 - Step17   0.035340 0.0177 289   1.991  0.8713
 Step5 - Step18   0.029487 0.0177 289   1.661  0.9721
 Step6 - Step7    0.028329 0.0177 289   1.596  0.9812
 Step6 - Step8    0.033705 0.0177 289   1.899  0.9101
 Step6 - Step9    0.034281 0.0177 289   1.931  0.8974
 Step6 - Step10   0.032642 0.0177 289   1.839  0.9307
 Step6 - Step11   0.030811 0.0177 289   1.736  0.9580
 Step6 - Step12   0.044057 0.0177 289   2.482  0.5459
 Step6 - Step13   0.047919 0.0177 289   2.700  0.3855
 Step6 - Step14   0.047008 0.0177 289   2.648  0.4217
 Step6 - Step15   0.049865 0.0177 289   2.809  0.3130
 Step6 - Step16   0.052912 0.0177 289   2.981  0.2165
 Step6 - Step17   0.057452 0.0177 289   3.237  0.1142
 Step6 - Step18   0.051600 0.0177 289   2.907  0.2554
 Step7 - Step8    0.005376 0.0177 289   0.303  1.0000
 Step7 - Step9    0.005952 0.0177 289   0.335  1.0000
 Step7 - Step10   0.004313 0.0177 289   0.243  1.0000
 Step7 - Step11   0.002483 0.0177 289   0.140  1.0000
 Step7 - Step12   0.015728 0.0177 289   0.886  1.0000
 Step7 - Step13   0.019590 0.0177 289   1.104  0.9998
 Step7 - Step14   0.018680 0.0177 289   1.052  0.9999
 Step7 - Step15   0.021537 0.0177 289   1.213  0.9992
 Step7 - Step16   0.024583 0.0177 289   1.385  0.9959
 Step7 - Step17   0.029124 0.0177 289   1.641  0.9752
 Step7 - Step18   0.023271 0.0177 289   1.311  0.9979
 Step8 - Step9    0.000576 0.0177 289   0.032  1.0000
 Step8 - Step10  -0.001063 0.0177 289  -0.060  1.0000
 Step8 - Step11  -0.002894 0.0177 289  -0.163  1.0000
 Step8 - Step12   0.010352 0.0177 289   0.583  1.0000
 Step8 - Step13   0.014214 0.0177 289   0.801  1.0000
 Step8 - Step14   0.013303 0.0177 289   0.750  1.0000
 Step8 - Step15   0.016160 0.0177 289   0.910  1.0000
 Step8 - Step16   0.019207 0.0177 289   1.082  0.9998
 Step8 - Step17   0.023747 0.0177 289   1.338  0.9973
 Step8 - Step18   0.017895 0.0177 289   1.008  0.9999
 Step9 - Step10  -0.001639 0.0177 289  -0.092  1.0000
 Step9 - Step11  -0.003470 0.0177 289  -0.195  1.0000
 Step9 - Step12   0.009776 0.0177 289   0.551  1.0000
 Step9 - Step13   0.013638 0.0177 289   0.768  1.0000
 Step9 - Step14   0.012728 0.0177 289   0.717  1.0000
 Step9 - Step15   0.015585 0.0177 289   0.878  1.0000
 Step9 - Step16   0.018631 0.0177 289   1.050  0.9999
 Step9 - Step17   0.023171 0.0177 289   1.305  0.9980
 Step9 - Step18   0.017319 0.0177 289   0.976  1.0000
 Step10 - Step11 -0.001831 0.0177 289  -0.103  1.0000
 Step10 - Step12  0.011415 0.0177 289   0.643  1.0000
 Step10 - Step13  0.015277 0.0177 289   0.861  1.0000
 Step10 - Step14  0.014366 0.0177 289   0.809  1.0000
 Step10 - Step15  0.017223 0.0177 289   0.970  1.0000
 Step10 - Step16  0.020270 0.0177 289   1.142  0.9996
 Step10 - Step17  0.024810 0.0177 289   1.398  0.9955
 Step10 - Step18  0.018957 0.0177 289   1.068  0.9998
 Step11 - Step12  0.013246 0.0177 289   0.746  1.0000
 Step11 - Step13  0.017107 0.0177 289   0.964  1.0000
 Step11 - Step14  0.016197 0.0177 289   0.913  1.0000
 Step11 - Step15  0.019054 0.0177 289   1.074  0.9998
 Step11 - Step16  0.022101 0.0177 289   1.245  0.9989
 Step11 - Step17  0.026641 0.0177 289   1.501  0.9900
 Step11 - Step18  0.020788 0.0177 289   1.171  0.9995
 Step12 - Step13  0.003862 0.0177 289   0.218  1.0000
 Step12 - Step14  0.002952 0.0177 289   0.166  1.0000
 Step12 - Step15  0.005808 0.0177 289   0.327  1.0000
 Step12 - Step16  0.008855 0.0177 289   0.499  1.0000
 Step12 - Step17  0.013395 0.0177 289   0.755  1.0000
 Step12 - Step18  0.007543 0.0177 289   0.425  1.0000
 Step13 - Step14 -0.000910 0.0177 289  -0.051  1.0000
 Step13 - Step15  0.001947 0.0177 289   0.110  1.0000
 Step13 - Step16  0.004993 0.0177 289   0.281  1.0000
 Step13 - Step17  0.009534 0.0177 289   0.537  1.0000
 Step13 - Step18  0.003681 0.0177 289   0.207  1.0000
 Step14 - Step15  0.002857 0.0177 289   0.161  1.0000
 Step14 - Step16  0.005904 0.0177 289   0.333  1.0000
 Step14 - Step17  0.010444 0.0177 289   0.588  1.0000
 Step14 - Step18  0.004591 0.0177 289   0.259  1.0000
 Step15 - Step16  0.003047 0.0177 289   0.172  1.0000
 Step15 - Step17  0.007587 0.0177 289   0.427  1.0000
 Step15 - Step18  0.001734 0.0177 289   0.098  1.0000
 Step16 - Step17  0.004540 0.0177 289   0.256  1.0000
 Step16 - Step18 -0.001313 0.0177 289  -0.074  1.0000
 Step17 - Step18 -0.005853 0.0177 289  -0.330  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.668041723  0.003790932  0.012746978 -0.005585973 -0.007840425  0.014271877 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.014056901 -0.019433124 -0.020009011 -0.018370347 -0.016539502 -0.029785060 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.033646887 -0.032736557 -0.035593548 -0.038640227 -0.043180462 -0.037327651 

Random Effects:
$subject
     (Intercept)
2   0.0271046434
3  -0.0525603679
4  -0.1363756416
5  -0.3210430066
7  -0.2690103005
8   0.4867411220
10  0.6352690182
11  0.0648859518
13 -0.0598412680
14 -0.0005446846
15  0.1932573874
16 -0.1145501218
17 -0.1277414736
18 -0.0490605740
19 -0.2559087842
20 -0.1675573393
22 -0.0672064567
23  0.2141418959

with conditional variances for "subject" 

Sample Scaled Residuals:
        1         2         3         4         5         6 
1.2126186 2.0728146 1.3868142 1.3727675 1.4555417 0.2742303 

=============================================================

--- Mixed - Block 5 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value  Pr(>F)  
Step 0.85141 0.050083    17   289  1.5759 0.06956 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.000754 0.0594 289   0.013  1.0000
 Step1 - Step3   -0.058706 0.0594 289  -0.988  0.9999
 Step1 - Step4   -0.020994 0.0594 289  -0.353  1.0000
 Step1 - Step5   -0.022466 0.0594 289  -0.378  1.0000
 Step1 - Step6   -0.095249 0.0594 289  -1.603  0.9803
 Step1 - Step7   -0.028306 0.0594 289  -0.476  1.0000
 Step1 - Step8   -0.024976 0.0594 289  -0.420  1.0000
 Step1 - Step9    0.012246 0.0594 289   0.206  1.0000
 Step1 - Step10   0.019084 0.0594 289   0.321  1.0000
 Step1 - Step11  -0.009623 0.0594 289  -0.162  1.0000
 Step1 - Step12   0.026015 0.0594 289   0.438  1.0000
 Step1 - Step13  -0.017257 0.0594 289  -0.290  1.0000
 Step1 - Step14   0.040221 0.0594 289   0.677  1.0000
 Step1 - Step15   0.066884 0.0594 289   1.126  0.9997
 Step1 - Step16   0.039247 0.0594 289   0.660  1.0000
 Step1 - Step17   0.121730 0.0594 289   2.049  0.8426
 Step1 - Step18   0.097830 0.0594 289   1.646  0.9744
 Step2 - Step3   -0.059460 0.0594 289  -1.001  0.9999
 Step2 - Step4   -0.021749 0.0594 289  -0.366  1.0000
 Step2 - Step5   -0.023221 0.0594 289  -0.391  1.0000
 Step2 - Step6   -0.096003 0.0594 289  -1.616  0.9787
 Step2 - Step7   -0.029060 0.0594 289  -0.489  1.0000
 Step2 - Step8   -0.025731 0.0594 289  -0.433  1.0000
 Step2 - Step9    0.011492 0.0594 289   0.193  1.0000
 Step2 - Step10   0.018329 0.0594 289   0.308  1.0000
 Step2 - Step11  -0.010377 0.0594 289  -0.175  1.0000
 Step2 - Step12   0.025261 0.0594 289   0.425  1.0000
 Step2 - Step13  -0.018012 0.0594 289  -0.303  1.0000
 Step2 - Step14   0.039466 0.0594 289   0.664  1.0000
 Step2 - Step15   0.066130 0.0594 289   1.113  0.9997
 Step2 - Step16   0.038493 0.0594 289   0.648  1.0000
 Step2 - Step17   0.120975 0.0594 289   2.036  0.8492
 Step2 - Step18   0.097076 0.0594 289   1.634  0.9763
 Step3 - Step4    0.037712 0.0594 289   0.635  1.0000
 Step3 - Step5    0.036240 0.0594 289   0.610  1.0000
 Step3 - Step6   -0.036543 0.0594 289  -0.615  1.0000
 Step3 - Step7    0.030400 0.0594 289   0.512  1.0000
 Step3 - Step8    0.033730 0.0594 289   0.568  1.0000
 Step3 - Step9    0.070952 0.0594 289   1.194  0.9993
 Step3 - Step10   0.077790 0.0594 289   1.309  0.9979
 Step3 - Step11   0.049084 0.0594 289   0.826  1.0000
 Step3 - Step12   0.084721 0.0594 289   1.426  0.9943
 Step3 - Step13   0.041449 0.0594 289   0.698  1.0000
 Step3 - Step14   0.098927 0.0594 289   1.665  0.9715
 Step3 - Step15   0.125590 0.0594 289   2.113  0.8063
 Step3 - Step16   0.097953 0.0594 289   1.648  0.9741
 Step3 - Step17   0.180436 0.0594 289   3.036  0.1902
 Step3 - Step18   0.156536 0.0594 289   2.634  0.4320
 Step4 - Step5   -0.001472 0.0594 289  -0.025  1.0000
 Step4 - Step6   -0.074254 0.0594 289  -1.250  0.9988
 Step4 - Step7   -0.007312 0.0594 289  -0.123  1.0000
 Step4 - Step8   -0.003982 0.0594 289  -0.067  1.0000
 Step4 - Step9    0.033241 0.0594 289   0.559  1.0000
 Step4 - Step10   0.040078 0.0594 289   0.674  1.0000
 Step4 - Step11   0.011372 0.0594 289   0.191  1.0000
 Step4 - Step12   0.047010 0.0594 289   0.791  1.0000
 Step4 - Step13   0.003737 0.0594 289   0.063  1.0000
 Step4 - Step14   0.061215 0.0594 289   1.030  0.9999
 Step4 - Step15   0.087878 0.0594 289   1.479  0.9915
 Step4 - Step16   0.060241 0.0594 289   1.014  0.9999
 Step4 - Step17   0.142724 0.0594 289   2.402  0.6071
 Step4 - Step18   0.118825 0.0594 289   2.000  0.8672
 Step5 - Step6   -0.072782 0.0594 289  -1.225  0.9991
 Step5 - Step7   -0.005840 0.0594 289  -0.098  1.0000
 Step5 - Step8   -0.002510 0.0594 289  -0.042  1.0000
 Step5 - Step9    0.034713 0.0594 289   0.584  1.0000
 Step5 - Step10   0.041550 0.0594 289   0.699  1.0000
 Step5 - Step11   0.012844 0.0594 289   0.216  1.0000
 Step5 - Step12   0.048481 0.0594 289   0.816  1.0000
 Step5 - Step13   0.005209 0.0594 289   0.088  1.0000
 Step5 - Step14   0.062687 0.0594 289   1.055  0.9999
 Step5 - Step15   0.089350 0.0594 289   1.504  0.9898
 Step5 - Step16   0.061713 0.0594 289   1.039  0.9999
 Step5 - Step17   0.144196 0.0594 289   2.427  0.5883
 Step5 - Step18   0.120297 0.0594 289   2.024  0.8551
 Step6 - Step7    0.066943 0.0594 289   1.127  0.9997
 Step6 - Step8    0.070272 0.0594 289   1.183  0.9994
 Step6 - Step9    0.107495 0.0594 289   1.809  0.9397
 Step6 - Step10   0.114332 0.0594 289   1.924  0.9004
 Step6 - Step11   0.085626 0.0594 289   1.441  0.9936
 Step6 - Step12   0.121264 0.0594 289   2.041  0.8467
 Step6 - Step13   0.077991 0.0594 289   1.312  0.9978
 Step6 - Step14   0.135469 0.0594 289   2.280  0.6972
 Step6 - Step15   0.162132 0.0594 289   2.728  0.3658
 Step6 - Step16   0.134496 0.0594 289   2.263  0.7088
 Step6 - Step17   0.216978 0.0594 289   3.651  0.0329
 Step6 - Step18   0.193079 0.0594 289   3.249  0.1105
 Step7 - Step8    0.003330 0.0594 289   0.056  1.0000
 Step7 - Step9    0.040552 0.0594 289   0.682  1.0000
 Step7 - Step10   0.047390 0.0594 289   0.797  1.0000
 Step7 - Step11   0.018684 0.0594 289   0.314  1.0000
 Step7 - Step12   0.054321 0.0594 289   0.914  1.0000
 Step7 - Step13   0.011049 0.0594 289   0.186  1.0000
 Step7 - Step14   0.068527 0.0594 289   1.153  0.9996
 Step7 - Step15   0.095190 0.0594 289   1.602  0.9805
 Step7 - Step16   0.067553 0.0594 289   1.137  0.9996
 Step7 - Step17   0.150036 0.0594 289   2.525  0.5134
 Step7 - Step18   0.126136 0.0594 289   2.123  0.8008
 Step8 - Step9    0.037223 0.0594 289   0.626  1.0000
 Step8 - Step10   0.044060 0.0594 289   0.741  1.0000
 Step8 - Step11   0.015354 0.0594 289   0.258  1.0000
 Step8 - Step12   0.050992 0.0594 289   0.858  1.0000
 Step8 - Step13   0.007719 0.0594 289   0.130  1.0000
 Step8 - Step14   0.065197 0.0594 289   1.097  0.9998
 Step8 - Step15   0.091860 0.0594 289   1.546  0.9864
 Step8 - Step16   0.064223 0.0594 289   1.081  0.9998
 Step8 - Step17   0.146706 0.0594 289   2.469  0.5561
 Step8 - Step18   0.122807 0.0594 289   2.067  0.8329
 Step9 - Step10   0.006838 0.0594 289   0.115  1.0000
 Step9 - Step11  -0.021869 0.0594 289  -0.368  1.0000
 Step9 - Step12   0.013769 0.0594 289   0.232  1.0000
 Step9 - Step13  -0.029503 0.0594 289  -0.496  1.0000
 Step9 - Step14   0.027974 0.0594 289   0.471  1.0000
 Step9 - Step15   0.054638 0.0594 289   0.919  1.0000
 Step9 - Step16   0.027001 0.0594 289   0.454  1.0000
 Step9 - Step17   0.109484 0.0594 289   1.842  0.9296
 Step9 - Step18   0.085584 0.0594 289   1.440  0.9936
 Step10 - Step11 -0.028706 0.0594 289  -0.483  1.0000
 Step10 - Step12  0.006931 0.0594 289   0.117  1.0000
 Step10 - Step13 -0.036341 0.0594 289  -0.612  1.0000
 Step10 - Step14  0.021137 0.0594 289   0.356  1.0000
 Step10 - Step15  0.047800 0.0594 289   0.804  1.0000
 Step10 - Step16  0.020163 0.0594 289   0.339  1.0000
 Step10 - Step17  0.102646 0.0594 289   1.727  0.9598
 Step10 - Step18  0.078746 0.0594 289   1.325  0.9976
 Step11 - Step12  0.035638 0.0594 289   0.600  1.0000
 Step11 - Step13 -0.007635 0.0594 289  -0.128  1.0000
 Step11 - Step14  0.049843 0.0594 289   0.839  1.0000
 Step11 - Step15  0.076506 0.0594 289   1.287  0.9983
 Step11 - Step16  0.048869 0.0594 289   0.822  1.0000
 Step11 - Step17  0.131352 0.0594 289   2.210  0.7451
 Step11 - Step18  0.107453 0.0594 289   1.808  0.9399
 Step12 - Step13 -0.043272 0.0594 289  -0.728  1.0000
 Step12 - Step14  0.014205 0.0594 289   0.239  1.0000
 Step12 - Step15  0.040869 0.0594 289   0.688  1.0000
 Step12 - Step16  0.013232 0.0594 289   0.223  1.0000
 Step12 - Step17  0.095715 0.0594 289   1.611  0.9794
 Step12 - Step18  0.071815 0.0594 289   1.209  0.9992
 Step13 - Step14  0.057478 0.0594 289   0.967  1.0000
 Step13 - Step15  0.084141 0.0594 289   1.416  0.9947
 Step13 - Step16  0.056504 0.0594 289   0.951  1.0000
 Step13 - Step17  0.138987 0.0594 289   2.339  0.6542
 Step13 - Step18  0.115088 0.0594 289   1.937  0.8952
 Step14 - Step15  0.026663 0.0594 289   0.449  1.0000
 Step14 - Step16 -0.000974 0.0594 289  -0.016  1.0000
 Step14 - Step17  0.081509 0.0594 289   1.372  0.9963
 Step14 - Step18  0.057610 0.0594 289   0.969  1.0000
 Step15 - Step16 -0.027637 0.0594 289  -0.465  1.0000
 Step15 - Step17  0.054846 0.0594 289   0.923  1.0000
 Step15 - Step18  0.030946 0.0594 289   0.521  1.0000
 Step16 - Step17  0.082483 0.0594 289   1.388  0.9958
 Step16 - Step18  0.058583 0.0594 289   0.986  0.9999
 Step17 - Step18 -0.023899 0.0594 289  -0.402  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 0.7546625750 -0.0007543218  0.0587060795  0.0209944734  0.0224663889 
        Step6         Step7         Step8         Step9        Step10 
 0.0952485963  0.0283060176  0.0249764333 -0.0122462075 -0.0190837961 
       Step11        Step12        Step13        Step14        Step15 
 0.0096225114 -0.0260151007  0.0172572535 -0.0402205866 -0.0668838439 
       Step16        Step17        Step18 
-0.0392469753 -0.1217297759 -0.0978302879 

Random Effects:
$subject
    (Intercept)
2   0.373768949
3   0.078446709
4  -0.217018794
5  -0.398779410
7  -0.175416496
8   0.267636015
10  0.420884094
11 -0.222318892
13 -0.131290447
14 -0.110547150
15 -0.021798274
16  0.001914506
17 -0.120023899
18 -0.132924416
19 -0.382571068
20 -0.377740419
22 -0.310866532
23  1.458645525

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.44447609  0.70476553  0.27048745  0.45147177  0.47182202 -0.07954699 

=============================================================

--- Mixed - Block 5 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.66058 0.038858    17   289  2.7237 0.0003376 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -2.22e-02 0.0398 289  -0.557  1.0000
 Step1 - Step3   -6.46e-02 0.0398 289  -1.622  0.9779
 Step1 - Step4    7.57e-03 0.0398 289   0.190  1.0000
 Step1 - Step5    7.53e-03 0.0398 289   0.189  1.0000
 Step1 - Step6   -2.99e-02 0.0398 289  -0.751  1.0000
 Step1 - Step7    2.66e-02 0.0398 289   0.668  1.0000
 Step1 - Step8    1.77e-02 0.0398 289   0.445  1.0000
 Step1 - Step9    5.36e-02 0.0398 289   1.345  0.9971
 Step1 - Step10   5.78e-02 0.0398 289   1.451  0.9931
 Step1 - Step11   2.18e-02 0.0398 289   0.549  1.0000
 Step1 - Step12   7.23e-02 0.0398 289   1.816  0.9375
 Step1 - Step13   5.16e-02 0.0398 289   1.296  0.9981
 Step1 - Step14   9.37e-02 0.0398 289   2.353  0.6437
 Step1 - Step15   7.73e-02 0.0398 289   1.941  0.8933
 Step1 - Step16   5.58e-02 0.0398 289   1.401  0.9953
 Step1 - Step17   1.05e-01 0.0398 289   2.630  0.4349
 Step1 - Step18   8.96e-02 0.0398 289   2.250  0.7182
 Step2 - Step3   -4.24e-02 0.0398 289  -1.065  0.9998
 Step2 - Step4    2.97e-02 0.0398 289   0.747  1.0000
 Step2 - Step5    2.97e-02 0.0398 289   0.746  1.0000
 Step2 - Step6   -7.72e-03 0.0398 289  -0.194  1.0000
 Step2 - Step7    4.87e-02 0.0398 289   1.224  0.9991
 Step2 - Step8    3.99e-02 0.0398 289   1.002  0.9999
 Step2 - Step9    7.57e-02 0.0398 289   1.902  0.9090
 Step2 - Step10   7.99e-02 0.0398 289   2.007  0.8635
 Step2 - Step11   4.40e-02 0.0398 289   1.105  0.9998
 Step2 - Step12   9.45e-02 0.0398 289   2.373  0.6289
 Step2 - Step13   7.38e-02 0.0398 289   1.853  0.9263
 Step2 - Step14   1.16e-01 0.0398 289   2.910  0.2540
 Step2 - Step15   9.95e-02 0.0398 289   2.498  0.5339
 Step2 - Step16   7.80e-02 0.0398 289   1.958  0.8862
 Step2 - Step17   1.27e-01 0.0398 289   3.187  0.1305
 Step2 - Step18   1.12e-01 0.0398 289   2.806  0.3149
 Step3 - Step4    7.21e-02 0.0398 289   1.812  0.9388
 Step3 - Step5    7.21e-02 0.0398 289   1.811  0.9391
 Step3 - Step6    3.47e-02 0.0398 289   0.871  1.0000
 Step3 - Step7    9.12e-02 0.0398 289   2.290  0.6902
 Step3 - Step8    8.23e-02 0.0398 289   2.067  0.8327
 Step3 - Step9    1.18e-01 0.0398 289   2.967  0.2235
 Step3 - Step10   1.22e-01 0.0398 289   3.073  0.1743
 Step3 - Step11   8.64e-02 0.0398 289   2.171  0.7713
 Step3 - Step12   1.37e-01 0.0398 289   3.438  0.0643
 Step3 - Step13   1.16e-01 0.0398 289   2.918  0.2493
 Step3 - Step14   1.58e-01 0.0398 289   3.975  0.0107
 Step3 - Step15   1.42e-01 0.0398 289   3.563  0.0438
 Step3 - Step16   1.20e-01 0.0398 289   3.023  0.1962
 Step3 - Step17   1.69e-01 0.0398 289   4.252  0.0037
 Step3 - Step18   1.54e-01 0.0398 289   3.872  0.0155
 Step4 - Step5   -3.61e-05 0.0398 289  -0.001  1.0000
 Step4 - Step6   -3.74e-02 0.0398 289  -0.941  1.0000
 Step4 - Step7    1.90e-02 0.0398 289   0.478  1.0000
 Step4 - Step8    1.02e-02 0.0398 289   0.255  1.0000
 Step4 - Step9    4.60e-02 0.0398 289   1.155  0.9996
 Step4 - Step10   5.02e-02 0.0398 289   1.261  0.9987
 Step4 - Step11   1.43e-02 0.0398 289   0.359  1.0000
 Step4 - Step12   6.47e-02 0.0398 289   1.626  0.9773
 Step4 - Step13   4.40e-02 0.0398 289   1.106  0.9998
 Step4 - Step14   8.61e-02 0.0398 289   2.163  0.7760
 Step4 - Step15   6.97e-02 0.0398 289   1.751  0.9545
 Step4 - Step16   4.82e-02 0.0398 289   1.211  0.9992
 Step4 - Step17   9.72e-02 0.0398 289   2.440  0.5779
 Step4 - Step18   8.20e-02 0.0398 289   2.060  0.8366
 Step5 - Step6   -3.74e-02 0.0398 289  -0.940  1.0000
 Step5 - Step7    1.90e-02 0.0398 289   0.478  1.0000
 Step5 - Step8    1.02e-02 0.0398 289   0.256  1.0000
 Step5 - Step9    4.60e-02 0.0398 289   1.156  0.9996
 Step5 - Step10   5.02e-02 0.0398 289   1.262  0.9987
 Step5 - Step11   1.43e-02 0.0398 289   0.359  1.0000
 Step5 - Step12   6.48e-02 0.0398 289   1.627  0.9772
 Step5 - Step13   4.41e-02 0.0398 289   1.107  0.9997
 Step5 - Step14   8.62e-02 0.0398 289   2.164  0.7754
 Step5 - Step15   6.98e-02 0.0398 289   1.752  0.9543
 Step5 - Step16   4.83e-02 0.0398 289   1.212  0.9992
 Step5 - Step17   9.72e-02 0.0398 289   2.441  0.5772
 Step5 - Step18   8.20e-02 0.0398 289   2.061  0.8361
 Step6 - Step7    5.65e-02 0.0398 289   1.418  0.9947
 Step6 - Step8    4.76e-02 0.0398 289   1.196  0.9993
 Step6 - Step9    8.34e-02 0.0398 289   2.096  0.8166
 Step6 - Step10   8.76e-02 0.0398 289   2.201  0.7512
 Step6 - Step11   5.17e-02 0.0398 289   1.299  0.9981
 Step6 - Step12   1.02e-01 0.0398 289   2.567  0.4818
 Step6 - Step13   8.15e-02 0.0398 289   2.047  0.8435
 Step6 - Step14   1.24e-01 0.0398 289   3.104  0.1615
 Step6 - Step15   1.07e-01 0.0398 289   2.692  0.3909
 Step6 - Step16   8.57e-02 0.0398 289   2.152  0.7830
 Step6 - Step17   1.35e-01 0.0398 289   3.381  0.0762
 Step6 - Step18   1.19e-01 0.0398 289   3.000  0.2071
 Step7 - Step8   -8.86e-03 0.0398 289  -0.223  1.0000
 Step7 - Step9    2.70e-02 0.0398 289   0.678  1.0000
 Step7 - Step10   3.12e-02 0.0398 289   0.783  1.0000
 Step7 - Step11  -4.74e-03 0.0398 289  -0.119  1.0000
 Step7 - Step12   4.57e-02 0.0398 289   1.149  0.9996
 Step7 - Step13   2.50e-02 0.0398 289   0.629  1.0000
 Step7 - Step14   6.71e-02 0.0398 289   1.686  0.9680
 Step7 - Step15   5.07e-02 0.0398 289   1.274  0.9985
 Step7 - Step16   2.92e-02 0.0398 289   0.734  1.0000
 Step7 - Step17   7.81e-02 0.0398 289   1.963  0.8841
 Step7 - Step18   6.30e-02 0.0398 289   1.582  0.9827
 Step8 - Step9    3.58e-02 0.0398 289   0.900  1.0000
 Step8 - Step10   4.00e-02 0.0398 289   1.006  0.9999
 Step8 - Step11   4.12e-03 0.0398 289   0.104  1.0000
 Step8 - Step12   5.46e-02 0.0398 289   1.371  0.9964
 Step8 - Step13   3.39e-02 0.0398 289   0.851  1.0000
 Step8 - Step14   7.60e-02 0.0398 289   1.908  0.9066
 Step8 - Step15   5.96e-02 0.0398 289   1.496  0.9904
 Step8 - Step16   3.81e-02 0.0398 289   0.956  1.0000
 Step8 - Step17   8.70e-02 0.0398 289   2.185  0.7617
 Step8 - Step18   7.19e-02 0.0398 289   1.805  0.9408
 Step9 - Step10   4.20e-03 0.0398 289   0.105  1.0000
 Step9 - Step11  -3.17e-02 0.0398 289  -0.797  1.0000
 Step9 - Step12   1.88e-02 0.0398 289   0.471  1.0000
 Step9 - Step13  -1.95e-03 0.0398 289  -0.049  1.0000
 Step9 - Step14   4.01e-02 0.0398 289   1.008  0.9999
 Step9 - Step15   2.37e-02 0.0398 289   0.596  1.0000
 Step9 - Step16   2.24e-03 0.0398 289   0.056  1.0000
 Step9 - Step17   5.12e-02 0.0398 289   1.285  0.9983
 Step9 - Step18   3.60e-02 0.0398 289   0.905  1.0000
 Step10 - Step11 -3.59e-02 0.0398 289  -0.902  1.0000
 Step10 - Step12  1.46e-02 0.0398 289   0.366  1.0000
 Step10 - Step13 -6.15e-03 0.0398 289  -0.154  1.0000
 Step10 - Step14  3.59e-02 0.0398 289   0.902  1.0000
 Step10 - Step15  1.95e-02 0.0398 289   0.491  1.0000
 Step10 - Step16 -1.96e-03 0.0398 289  -0.049  1.0000
 Step10 - Step17  4.70e-02 0.0398 289   1.180  0.9994
 Step10 - Step18  3.18e-02 0.0398 289   0.799  1.0000
 Step11 - Step12  5.05e-02 0.0398 289   1.268  0.9986
 Step11 - Step13  2.98e-02 0.0398 289   0.748  1.0000
 Step11 - Step14  7.18e-02 0.0398 289   1.805  0.9409
 Step11 - Step15  5.55e-02 0.0398 289   1.393  0.9956
 Step11 - Step16  3.40e-02 0.0398 289   0.853  1.0000
 Step11 - Step17  8.29e-02 0.0398 289   2.082  0.8245
 Step11 - Step18  6.77e-02 0.0398 289   1.701  0.9651
 Step12 - Step13 -2.07e-02 0.0398 289  -0.520  1.0000
 Step12 - Step14  2.14e-02 0.0398 289   0.537  1.0000
 Step12 - Step15  4.98e-03 0.0398 289   0.125  1.0000
 Step12 - Step16 -1.65e-02 0.0398 289  -0.415  1.0000
 Step12 - Step17  3.24e-02 0.0398 289   0.814  1.0000
 Step12 - Step18  1.73e-02 0.0398 289   0.434  1.0000
 Step13 - Step14  4.21e-02 0.0398 289   1.057  0.9999
 Step13 - Step15  2.57e-02 0.0398 289   0.645  1.0000
 Step13 - Step16  4.19e-03 0.0398 289   0.105  1.0000
 Step13 - Step17  5.31e-02 0.0398 289   1.334  0.9974
 Step13 - Step18  3.80e-02 0.0398 289   0.954  1.0000
 Step14 - Step15 -1.64e-02 0.0398 289  -0.412  1.0000
 Step14 - Step16 -3.79e-02 0.0398 289  -0.952  1.0000
 Step14 - Step17  1.10e-02 0.0398 289   0.277  1.0000
 Step14 - Step18 -4.11e-03 0.0398 289  -0.103  1.0000
 Step15 - Step16 -2.15e-02 0.0398 289  -0.540  1.0000
 Step15 - Step17  2.74e-02 0.0398 289   0.689  1.0000
 Step15 - Step18  1.23e-02 0.0398 289   0.309  1.0000
 Step16 - Step17  4.89e-02 0.0398 289   1.229  0.9990
 Step16 - Step18  3.38e-02 0.0398 289   0.848  1.0000
 Step17 - Step18 -1.51e-02 0.0398 289  -0.380  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 1.461502752  0.022159659  0.064577364 -0.007565349 -0.007529253  0.029882603 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.026577448 -0.017717318 -0.053560481 -0.057759057 -0.021839775 -0.072314852 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.051608266 -0.093684670 -0.077293385 -0.055796126 -0.104722932 -0.089576850 

Random Effects:
$subject
   (Intercept)
2   0.02226734
3  -0.08605940
4  -0.54223730
5  -0.83152443
7  -0.10652281
8   0.40901975
10  2.35461013
11 -0.13459313
13  0.44173402
14 -0.47233599
15  0.79049181
16  0.26695004
17 -0.66571231
18 -0.08715183
19 -0.72708449
20 -0.55644830
22 -0.46304718
23  0.38764408

with conditional variances for "subject" 

Sample Scaled Residuals:
        1         2         3         4         5         6 
0.5110612 1.8450813 1.2149304 1.6275619 1.2508821 0.1380450 

=============================================================

#3.3 Step Pairwise Model SD

# -------- Suppress lmerTest and pbkrtest warnings globally --------
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# -------- Extended Step-Wise SD LMM + Diagnostics per Block & Axis --------
run_stepwise_sd_lmm_full_diagnostics <- function(tagged_data, dataset_name = "Mixed") {
  step_markers <- c(14, 15, 16, 17)
  buffer <- 5

  step_data <- tagged_data %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()

  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)

  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)

    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })

  step_sd_summary <- window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      sd_x = sd(CoM.acc.x, na.rm = TRUE),
      sd_y = sd(CoM.acc.y, na.rm = TRUE),
      sd_z = sd(CoM.acc.z, na.rm = TRUE),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("sd_"), names_to = "Axis", values_to = "SD") %>%
    mutate(
      Axis = toupper(gsub("sd_", "", Axis)),
      Step = factor(Step),
      Block = factor(Block),
      subject = factor(subject)
    )

  axis_labels <- c("X", "Y", "Z")
  blocks <- unique(step_sd_summary$Block)

  results <- list()

  for (blk in blocks) {
    for (axis in axis_labels) {
      data_sub <- step_sd_summary %>%
        filter(Block == blk, Axis == axis)

      model <- lmer(SD ~ Step + (1 | subject), data = data_sub)
      aov_tbl <- anova(model)
      emmeans_out <- emmeans(model, pairwise ~ Step)

      key <- glue::glue("{dataset_name} - SD - Block {blk} - Axis {axis}")

      results[[key]] <- list(
        ANOVA = aov_tbl,
        Pairwise = summary(emmeans_out$contrasts),
        Emmeans = summary(emmeans_out$emmeans),
        FixedEffects = fixef(model),
        RandomEffects = ranef(model),
        ScaledResiduals = resid(model, scaled = TRUE),
        Model = model
      )
    }
  }

  return(results)
}

# -------- Run Full Diagnostics --------
stepwise_sd_lmm_diag_results <- run_stepwise_sd_lmm_full_diagnostics(tagged_data)

# -------- Print SD LMM Diagnostics --------
print_stepwise_sd_lmm_diagnostics <- function(results_list, dataset_name = "Mixed") {
  cat(glue::glue("\n=========== STEPWISE SD LMM DIAGNOSTICS: {dataset_name} ===========\n"))
  for (key in names(results_list)) {
    cat("\n---", key, "---\n")
    cat("ANOVA:\n")
    print(results_list[[key]]$ANOVA)

    cat("\nPairwise Comparisons:\n")
    print(results_list[[key]]$Pairwise)

    cat("\nFixed Effects:\n")
    print(results_list[[key]]$FixedEffects)

    cat("\nRandom Effects:\n")
    print(results_list[[key]]$RandomEffects)

    cat("\nSample Scaled Residuals:\n")
    print(head(results_list[[key]]$ScaledResiduals))

    cat("\n=============================================================\n")
  }
}

# -------- Output Extended SD Model Diagnostics --------
print_stepwise_sd_lmm_diagnostics(stepwise_sd_lmm_diag_results)
=========== STEPWISE SD LMM DIAGNOSTICS: Mixed ===========
--- Mixed - SD - Block 1 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
         Sum Sq    Mean Sq NumDF DenDF F value Pr(>F)
Step 5.3496e-05 1.0699e-05     5    85  0.6472 0.6644

Pairwise Comparisons:
 contrast       estimate      SE df t.ratio p.value
 Step1 - Step2  0.000000 0.00136 85   0.000  1.0000
 Step1 - Step3 -0.000239 0.00136 85  -0.177  1.0000
 Step1 - Step4  0.001771 0.00136 85   1.307  0.7807
 Step1 - Step5 -0.000239 0.00136 85  -0.177  1.0000
 Step1 - Step6  0.000000 0.00136 85   0.000  1.0000
 Step2 - Step3 -0.000239 0.00136 85  -0.177  1.0000
 Step2 - Step4  0.001771 0.00136 85   1.307  0.7807
 Step2 - Step5 -0.000239 0.00136 85  -0.177  1.0000
 Step2 - Step6  0.000000 0.00136 85   0.000  1.0000
 Step3 - Step4  0.002010 0.00136 85   1.483  0.6758
 Step3 - Step5  0.000000 0.00136 85   0.000  1.0000
 Step3 - Step6  0.000239 0.00136 85   0.177  1.0000
 Step4 - Step5 -0.002010 0.00136 85  -1.483  0.6758
 Step4 - Step6 -0.001771 0.00136 85  -1.307  0.7807
 Step5 - Step6  0.000239 0.00136 85   0.177  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 8.452024e-01 -2.688710e-15  2.393599e-04 -1.770771e-03  2.393599e-04 
        Step6 
-2.688773e-15 

Random Effects:
$subject
   (Intercept)
2   -0.2550918
3    0.1567868
4   -0.3506646
5   -0.3829182
7   -0.2292004
8    0.4913867
10   0.8586571
11   1.2340718
13  -0.2800431
14   0.3300590
15  -0.1917024
16  -0.2355887
17  -0.4973447
18  -0.3919900
19  -0.5341743
20  -0.3014273
22  -0.3497042
23   0.9288883

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.05355587 -0.05355587 -0.11242593  0.38196136 -0.11242593 -0.05355587 

=============================================================

--- Mixed - SD - Block 1 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
         Sum Sq    Mean Sq NumDF DenDF F value Pr(>F)
Step 5.9192e-05 1.1838e-05     5    85  1.1111 0.3606

Pairwise Comparisons:
 contrast       estimate      SE df t.ratio p.value
 Step1 - Step2  0.000000 0.00109 85   0.000  1.0000
 Step1 - Step3 -0.000616 0.00109 85  -0.566  0.9929
 Step1 - Step4 -0.002090 0.00109 85  -1.921  0.3967
 Step1 - Step5 -0.000616 0.00109 85  -0.566  0.9929
 Step1 - Step6  0.000000 0.00109 85   0.000  1.0000
 Step2 - Step3 -0.000616 0.00109 85  -0.566  0.9929
 Step2 - Step4 -0.002090 0.00109 85  -1.921  0.3967
 Step2 - Step5 -0.000616 0.00109 85  -0.566  0.9929
 Step2 - Step6  0.000000 0.00109 85   0.000  1.0000
 Step3 - Step4 -0.001474 0.00109 85  -1.355  0.7534
 Step3 - Step5  0.000000 0.00109 85   0.000  1.0000
 Step3 - Step6  0.000616 0.00109 85   0.566  0.9929
 Step4 - Step5  0.001474 0.00109 85   1.355  0.7534
 Step4 - Step6  0.002090 0.00109 85   1.921  0.3967
 Step5 - Step6  0.000616 0.00109 85   0.566  0.9929

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
8.813106e-01 1.016484e-14 6.160745e-04 2.090224e-03 6.160745e-04 1.033857e-14 

Random Effects:
$subject
    (Intercept)
2  -0.303793183
3   0.003871254
4  -0.482994299
5  -0.430014430
7  -0.312624567
8   0.526805755
10  1.506732996
11  1.408859403
13 -0.039626579
14  0.364923077
15 -0.350871092
16 -0.407872592
17 -0.511733542
18 -0.303952183
19 -0.560920437
20 -0.306794247
22 -0.558357534
23  0.758362208

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.16925243  0.16925243 -0.01948979 -0.47111415 -0.01948979  0.16925243 

=============================================================

--- Mixed - SD - Block 1 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
         Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
Step 0.00012435 2.487e-05     5    85  1.5972 0.1696

Pairwise Comparisons:
 contrast       estimate      SE df t.ratio p.value
 Step1 - Step2  0.000000 0.00132 85   0.000  1.0000
 Step1 - Step3  0.000327 0.00132 85   0.248  0.9999
 Step1 - Step4 -0.002722 0.00132 85  -2.069  0.3132
 Step1 - Step5  0.000327 0.00132 85   0.248  0.9999
 Step1 - Step6  0.000000 0.00132 85   0.000  1.0000
 Step2 - Step3  0.000327 0.00132 85   0.248  0.9999
 Step2 - Step4 -0.002722 0.00132 85  -2.069  0.3132
 Step2 - Step5  0.000327 0.00132 85   0.248  0.9999
 Step2 - Step6  0.000000 0.00132 85   0.000  1.0000
 Step3 - Step4 -0.003048 0.00132 85  -2.318  0.1985
 Step3 - Step5  0.000000 0.00132 85   0.000  1.0000
 Step3 - Step6 -0.000327 0.00132 85  -0.248  0.9999
 Step4 - Step5  0.003048 0.00132 85   2.318  0.1985
 Step4 - Step6  0.002722 0.00132 85   2.069  0.3132
 Step5 - Step6 -0.000327 0.00132 85  -0.248  0.9999

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 6 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 1.469192e+00 -2.911766e-15 -3.265772e-04  2.721796e-03 -3.265772e-04 
        Step6 
-2.911782e-15 

Random Effects:
$subject
   (Intercept)
2  -0.54120954
3   0.24588589
4  -0.64890393
5  -0.71199325
7  -0.03406864
8   1.36138122
10  1.49947612
11  2.40310888
13  0.14589447
14 -0.69327026
15 -0.20038146
16 -0.42901791
17 -1.13723045
18 -0.51858629
19 -0.71222633
20 -0.67059853
22 -0.84122595
23  1.48296597

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.08702494  0.08702494  0.16978797 -0.60274793  0.16978797  0.08702494 

=============================================================

--- Mixed - SD - Block 2 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.34866 0.031697    11   187  6.9576 8.147e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast        estimate     SE  df t.ratio p.value
 Step1 - Step2   0.013502 0.0225 187   0.600  1.0000
 Step1 - Step3   0.028275 0.0225 187   1.257  0.9833
 Step1 - Step4   0.034181 0.0225 187   1.519  0.9336
 Step1 - Step5   0.038240 0.0225 187   1.700  0.8663
 Step1 - Step6   0.045177 0.0225 187   2.008  0.6875
 Step1 - Step7   0.045440 0.0225 187   2.020  0.6795
 Step1 - Step8   0.065137 0.0225 187   2.895  0.1513
 Step1 - Step9   0.098068 0.0225 187   4.359  0.0013
 Step1 - Step10  0.106033 0.0225 187   4.713  0.0003
 Step1 - Step11  0.117109 0.0225 187   5.205  <.0001
 Step1 - Step12  0.124615 0.0225 187   5.539  <.0001
 Step2 - Step3   0.014773 0.0225 187   0.657  1.0000
 Step2 - Step4   0.020679 0.0225 187   0.919  0.9989
 Step2 - Step5   0.024738 0.0225 187   1.100  0.9944
 Step2 - Step6   0.031675 0.0225 187   1.408  0.9607
 Step2 - Step7   0.031938 0.0225 187   1.420  0.9583
 Step2 - Step8   0.051635 0.0225 187   2.295  0.4839
 Step2 - Step9   0.084566 0.0225 187   3.759  0.0119
 Step2 - Step10  0.092531 0.0225 187   4.113  0.0033
 Step2 - Step11  0.103607 0.0225 187   4.605  0.0005
 Step2 - Step12  0.111113 0.0225 187   4.939  0.0001
 Step3 - Step4   0.005906 0.0225 187   0.262  1.0000
 Step3 - Step5   0.009965 0.0225 187   0.443  1.0000
 Step3 - Step6   0.016902 0.0225 187   0.751  0.9998
 Step3 - Step7   0.017165 0.0225 187   0.763  0.9998
 Step3 - Step8   0.036862 0.0225 187   1.638  0.8925
 Step3 - Step9   0.069793 0.0225 187   3.102  0.0896
 Step3 - Step10  0.077758 0.0225 187   3.456  0.0321
 Step3 - Step11  0.088834 0.0225 187   3.948  0.0061
 Step3 - Step12  0.096341 0.0225 187   4.282  0.0017
 Step4 - Step5   0.004059 0.0225 187   0.180  1.0000
 Step4 - Step6   0.010996 0.0225 187   0.489  1.0000
 Step4 - Step7   0.011259 0.0225 187   0.500  1.0000
 Step4 - Step8   0.030957 0.0225 187   1.376  0.9667
 Step4 - Step9   0.063887 0.0225 187   2.840  0.1724
 Step4 - Step10  0.071853 0.0225 187   3.194  0.0698
 Step4 - Step11  0.082928 0.0225 187   3.686  0.0153
 Step4 - Step12  0.090435 0.0225 187   4.020  0.0047
 Step5 - Step6   0.006936 0.0225 187   0.308  1.0000
 Step5 - Step7   0.007200 0.0225 187   0.320  1.0000
 Step5 - Step8   0.026897 0.0225 187   1.196  0.9888
 Step5 - Step9   0.059828 0.0225 187   2.659  0.2554
 Step5 - Step10  0.067793 0.0225 187   3.013  0.1130
 Step5 - Step11  0.078869 0.0225 187   3.506  0.0275
 Step5 - Step12  0.086375 0.0225 187   3.839  0.0090
 Step6 - Step7   0.000263 0.0225 187   0.012  1.0000
 Step6 - Step8   0.019961 0.0225 187   0.887  0.9992
 Step6 - Step9   0.052891 0.0225 187   2.351  0.4448
 Step6 - Step10  0.060857 0.0225 187   2.705  0.2322
 Step6 - Step11  0.071933 0.0225 187   3.197  0.0691
 Step6 - Step12  0.079439 0.0225 187   3.531  0.0254
 Step7 - Step8   0.019697 0.0225 187   0.875  0.9993
 Step7 - Step9   0.052628 0.0225 187   2.339  0.4529
 Step7 - Step10  0.060593 0.0225 187   2.693  0.2380
 Step7 - Step11  0.071669 0.0225 187   3.185  0.0714
 Step7 - Step12  0.079175 0.0225 187   3.519  0.0264
 Step8 - Step9   0.032931 0.0225 187   1.464  0.9484
 Step8 - Step10  0.040896 0.0225 187   1.818  0.8063
 Step8 - Step11  0.051972 0.0225 187   2.310  0.4733
 Step8 - Step12  0.059478 0.0225 187   2.644  0.2635
 Step9 - Step10  0.007965 0.0225 187   0.354  1.0000
 Step9 - Step11  0.019041 0.0225 187   0.846  0.9995
 Step9 - Step12  0.026548 0.0225 187   1.180  0.9899
 Step10 - Step11 0.011076 0.0225 187   0.492  1.0000
 Step10 - Step12 0.018582 0.0225 187   0.826  0.9996
 Step11 - Step12 0.007506 0.0225 187   0.334  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 0.85324240 -0.01350188 -0.02827476 -0.03418065 -0.03824011 -0.04517651 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.04543987 -0.06513724 -0.09806778 -0.10603317 -0.11710905 -0.12461532 

Random Effects:
$subject
   (Intercept)
2   0.29031083
3   0.12991359
4  -0.33571298
5  -0.29128186
7  -0.18423060
8   0.18815896
10  0.85540252
11  0.99644663
13 -0.27328728
14  0.21489533
15 -0.18891518
16 -0.16585298
17 -0.30144778
18 -0.17037536
19 -0.33163909
20 -0.28980507
22 -0.18367761
23  0.04109791

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-0.3690467 -0.9543075 -1.3790925 -0.5782817 -0.3422331  0.3918117 

=============================================================

--- Mixed - SD - Block 2 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value   Pr(>F)   
Step 0.19762 0.017966    11   187  2.5201 0.005539 **
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast        estimate     SE  df t.ratio p.value
 Step1 - Step2   0.000712 0.0281 187   0.025  1.0000
 Step1 - Step3   0.015052 0.0281 187   0.535  1.0000
 Step1 - Step4   0.021699 0.0281 187   0.771  0.9998
 Step1 - Step5   0.024820 0.0281 187   0.882  0.9992
 Step1 - Step6   0.027977 0.0281 187   0.994  0.9977
 Step1 - Step7   0.041982 0.0281 187   1.492  0.9412
 Step1 - Step8   0.052133 0.0281 187   1.852  0.7865
 Step1 - Step9   0.062481 0.0281 187   2.220  0.5374
 Step1 - Step10  0.066571 0.0281 187   2.365  0.4349
 Step1 - Step11  0.084567 0.0281 187   3.005  0.1155
 Step1 - Step12  0.096316 0.0281 187   3.422  0.0357
 Step2 - Step3   0.014341 0.0281 187   0.510  1.0000
 Step2 - Step4   0.020987 0.0281 187   0.746  0.9998
 Step2 - Step5   0.024109 0.0281 187   0.857  0.9994
 Step2 - Step6   0.027266 0.0281 187   0.969  0.9982
 Step2 - Step7   0.041271 0.0281 187   1.466  0.9477
 Step2 - Step8   0.051421 0.0281 187   1.827  0.8011
 Step2 - Step9   0.061769 0.0281 187   2.195  0.5556
 Step2 - Step10  0.065859 0.0281 187   2.340  0.4523
 Step2 - Step11  0.083855 0.0281 187   2.979  0.1231
 Step2 - Step12  0.095605 0.0281 187   3.397  0.0386
 Step3 - Step4   0.006647 0.0281 187   0.236  1.0000
 Step3 - Step5   0.009768 0.0281 187   0.347  1.0000
 Step3 - Step6   0.012925 0.0281 187   0.459  1.0000
 Step3 - Step7   0.026930 0.0281 187   0.957  0.9984
 Step3 - Step8   0.037081 0.0281 187   1.318  0.9759
 Step3 - Step9   0.047428 0.0281 187   1.685  0.8728
 Step3 - Step10  0.051519 0.0281 187   1.831  0.7991
 Step3 - Step11  0.069514 0.0281 187   2.470  0.3655
 Step3 - Step12  0.081264 0.0281 187   2.887  0.1541
 Step4 - Step5   0.003121 0.0281 187   0.111  1.0000
 Step4 - Step6   0.006278 0.0281 187   0.223  1.0000
 Step4 - Step7   0.020283 0.0281 187   0.721  0.9999
 Step4 - Step8   0.030434 0.0281 187   1.081  0.9951
 Step4 - Step9   0.040781 0.0281 187   1.449  0.9519
 Step4 - Step10  0.044872 0.0281 187   1.594  0.9092
 Step4 - Step11  0.062868 0.0281 187   2.234  0.5275
 Step4 - Step12  0.074617 0.0281 187   2.651  0.2595
 Step5 - Step6   0.003157 0.0281 187   0.112  1.0000
 Step5 - Step7   0.017162 0.0281 187   0.610  1.0000
 Step5 - Step8   0.027313 0.0281 187   0.970  0.9981
 Step5 - Step9   0.037660 0.0281 187   1.338  0.9729
 Step5 - Step10  0.041751 0.0281 187   1.483  0.9434
 Step5 - Step11  0.059746 0.0281 187   2.123  0.6072
 Step5 - Step12  0.071496 0.0281 187   2.540  0.3220
 Step6 - Step7   0.014005 0.0281 187   0.498  1.0000
 Step6 - Step8   0.024156 0.0281 187   0.858  0.9994
 Step6 - Step9   0.034503 0.0281 187   1.226  0.9863
 Step6 - Step10  0.038594 0.0281 187   1.371  0.9676
 Step6 - Step11  0.056589 0.0281 187   2.011  0.6856
 Step6 - Step12  0.068339 0.0281 187   2.428  0.3926
 Step7 - Step8   0.010151 0.0281 187   0.361  1.0000
 Step7 - Step9   0.020498 0.0281 187   0.728  0.9999
 Step7 - Step10  0.024589 0.0281 187   0.874  0.9993
 Step7 - Step11  0.042584 0.0281 187   1.513  0.9353
 Step7 - Step12  0.054334 0.0281 187   1.931  0.7386
 Step8 - Step9   0.010348 0.0281 187   0.368  1.0000
 Step8 - Step10  0.014438 0.0281 187   0.513  1.0000
 Step8 - Step11  0.032434 0.0281 187   1.152  0.9917
 Step8 - Step12  0.044183 0.0281 187   1.570  0.9177
 Step9 - Step10  0.004091 0.0281 187   0.145  1.0000
 Step9 - Step11  0.022086 0.0281 187   0.785  0.9997
 Step9 - Step12  0.033836 0.0281 187   1.202  0.9882
 Step10 - Step11 0.017995 0.0281 187   0.639  1.0000
 Step10 - Step12 0.029745 0.0281 187   1.057  0.9960
 Step11 - Step12 0.011750 0.0281 187   0.417  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 0.8982466572 -0.0007116643 -0.0150524558 -0.0216990573 -0.0248203182 
        Step6         Step7         Step8         Step9        Step10 
-0.0279773472 -0.0419824515 -0.0521330118 -0.0624805350 -0.0665711440 
       Step11        Step12 
-0.0845666082 -0.0963163554 

Random Effects:
$subject
   (Intercept)
2   0.18653446
3   0.34213339
4  -0.44326650
5  -0.42667438
7  -0.16748677
8   0.67112682
10  0.82135597
11  1.09558842
13 -0.23906867
14  0.11156655
15 -0.32290000
16 -0.11070846
17 -0.31646800
18 -0.19083545
19 -0.37153796
20 -0.23112626
22 -0.47600583
23  0.06777269

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.78914079 -0.75721479 -0.40655597 -0.58005427  0.18967103 -0.09101536 

=============================================================

--- Mixed - SD - Block 2 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value Pr(>F)
Step 0.18404 0.016731    11   187  0.6722 0.7637

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.003283 0.0526 187   0.062  1.0000
 Step1 - Step3    0.014907 0.0526 187   0.283  1.0000
 Step1 - Step4    0.007145 0.0526 187   0.136  1.0000
 Step1 - Step5    0.005955 0.0526 187   0.113  1.0000
 Step1 - Step6    0.006532 0.0526 187   0.124  1.0000
 Step1 - Step7    0.010944 0.0526 187   0.208  1.0000
 Step1 - Step8    0.031299 0.0526 187   0.595  1.0000
 Step1 - Step9    0.057560 0.0526 187   1.095  0.9946
 Step1 - Step10   0.061252 0.0526 187   1.165  0.9909
 Step1 - Step11   0.081782 0.0526 187   1.555  0.9226
 Step1 - Step12   0.074173 0.0526 187   1.410  0.9602
 Step2 - Step3    0.011624 0.0526 187   0.221  1.0000
 Step2 - Step4    0.003862 0.0526 187   0.073  1.0000
 Step2 - Step5    0.002672 0.0526 187   0.051  1.0000
 Step2 - Step6    0.003249 0.0526 187   0.062  1.0000
 Step2 - Step7    0.007661 0.0526 187   0.146  1.0000
 Step2 - Step8    0.028016 0.0526 187   0.533  1.0000
 Step2 - Step9    0.054277 0.0526 187   1.032  0.9968
 Step2 - Step10   0.057969 0.0526 187   1.102  0.9943
 Step2 - Step11   0.078499 0.0526 187   1.493  0.9410
 Step2 - Step12   0.070890 0.0526 187   1.348  0.9714
 Step3 - Step4   -0.007762 0.0526 187  -0.148  1.0000
 Step3 - Step5   -0.008952 0.0526 187  -0.170  1.0000
 Step3 - Step6   -0.008375 0.0526 187  -0.159  1.0000
 Step3 - Step7   -0.003963 0.0526 187  -0.075  1.0000
 Step3 - Step8    0.016392 0.0526 187   0.312  1.0000
 Step3 - Step9    0.042653 0.0526 187   0.811  0.9996
 Step3 - Step10   0.046345 0.0526 187   0.881  0.9992
 Step3 - Step11   0.066875 0.0526 187   1.272  0.9817
 Step3 - Step12   0.059266 0.0526 187   1.127  0.9931
 Step4 - Step5   -0.001190 0.0526 187  -0.023  1.0000
 Step4 - Step6   -0.000613 0.0526 187  -0.012  1.0000
 Step4 - Step7    0.003799 0.0526 187   0.072  1.0000
 Step4 - Step8    0.024154 0.0526 187   0.459  1.0000
 Step4 - Step9    0.050415 0.0526 187   0.959  0.9983
 Step4 - Step10   0.054107 0.0526 187   1.029  0.9968
 Step4 - Step11   0.074637 0.0526 187   1.419  0.9584
 Step4 - Step12   0.067028 0.0526 187   1.275  0.9813
 Step5 - Step6    0.000577 0.0526 187   0.011  1.0000
 Step5 - Step7    0.004989 0.0526 187   0.095  1.0000
 Step5 - Step8    0.025344 0.0526 187   0.482  1.0000
 Step5 - Step9    0.051605 0.0526 187   0.981  0.9979
 Step5 - Step10   0.055298 0.0526 187   1.052  0.9962
 Step5 - Step11   0.075827 0.0526 187   1.442  0.9535
 Step5 - Step12   0.068218 0.0526 187   1.297  0.9786
 Step6 - Step7    0.004412 0.0526 187   0.084  1.0000
 Step6 - Step8    0.024767 0.0526 187   0.471  1.0000
 Step6 - Step9    0.051028 0.0526 187   0.970  0.9981
 Step6 - Step10   0.054720 0.0526 187   1.041  0.9965
 Step6 - Step11   0.075250 0.0526 187   1.431  0.9559
 Step6 - Step12   0.067641 0.0526 187   1.286  0.9800
 Step7 - Step8    0.020355 0.0526 187   0.387  1.0000
 Step7 - Step9    0.046616 0.0526 187   0.886  0.9992
 Step7 - Step10   0.050309 0.0526 187   0.957  0.9984
 Step7 - Step11   0.070838 0.0526 187   1.347  0.9716
 Step7 - Step12   0.063229 0.0526 187   1.202  0.9882
 Step8 - Step9    0.026261 0.0526 187   0.499  1.0000
 Step8 - Step10   0.029953 0.0526 187   0.570  1.0000
 Step8 - Step11   0.050483 0.0526 187   0.960  0.9983
 Step8 - Step12   0.042874 0.0526 187   0.815  0.9996
 Step9 - Step10   0.003692 0.0526 187   0.070  1.0000
 Step9 - Step11   0.024222 0.0526 187   0.461  1.0000
 Step9 - Step12   0.016613 0.0526 187   0.316  1.0000
 Step10 - Step11  0.020530 0.0526 187   0.390  1.0000
 Step10 - Step12  0.012921 0.0526 187   0.246  1.0000
 Step11 - Step12 -0.007609 0.0526 187  -0.145  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 12 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 1.595264622 -0.003282699 -0.014907015 -0.007144805 -0.005954529 -0.006531658 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.010943604 -0.031298750 -0.057559943 -0.061252162 -0.081781987 -0.074172916 

Random Effects:
$subject
   (Intercept)
2  -0.09961552
3   0.41897130
4  -0.67642800
5  -0.66663682
7   0.08098175
8   1.01795885
10  1.47994446
11  2.02761024
13 -0.42120344
14 -0.41265002
15 -0.36469037
16  0.27914076
17 -0.84977608
18  0.09748478
19 -0.70398338
20 -0.75889634
22 -0.69028739
23  0.24207521

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
0.462627499 0.117996086 0.092894093 0.004184111 0.069502311 0.064436305 

=============================================================

--- Mixed - SD - Block 3 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.24895 0.014644    17   289  3.8546 8.496e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.002850 0.0205 289   0.139  1.0000
 Step1 - Step3    0.010492 0.0205 289   0.511  1.0000
 Step1 - Step4    0.012216 0.0205 289   0.595  1.0000
 Step1 - Step5    0.008727 0.0205 289   0.425  1.0000
 Step1 - Step6    0.009718 0.0205 289   0.473  1.0000
 Step1 - Step7    0.011441 0.0205 289   0.557  1.0000
 Step1 - Step8    0.026344 0.0205 289   1.282  0.9984
 Step1 - Step9    0.030209 0.0205 289   1.470  0.9920
 Step1 - Step10   0.049561 0.0205 289   2.412  0.5992
 Step1 - Step11   0.047711 0.0205 289   2.322  0.6665
 Step1 - Step12   0.058382 0.0205 289   2.842  0.2933
 Step1 - Step13   0.059656 0.0205 289   2.904  0.2573
 Step1 - Step14   0.058031 0.0205 289   2.824  0.3037
 Step1 - Step15   0.061013 0.0205 289   2.970  0.2223
 Step1 - Step16   0.072288 0.0205 289   3.518  0.0504
 Step1 - Step17   0.081534 0.0205 289   3.968  0.0109
 Step1 - Step18   0.083350 0.0205 289   4.057  0.0079
 Step2 - Step3    0.007642 0.0205 289   0.372  1.0000
 Step2 - Step4    0.009366 0.0205 289   0.456  1.0000
 Step2 - Step5    0.005877 0.0205 289   0.286  1.0000
 Step2 - Step6    0.006868 0.0205 289   0.334  1.0000
 Step2 - Step7    0.008591 0.0205 289   0.418  1.0000
 Step2 - Step8    0.023494 0.0205 289   1.143  0.9996
 Step2 - Step9    0.027359 0.0205 289   1.332  0.9974
 Step2 - Step10   0.046711 0.0205 289   2.274  0.7016
 Step2 - Step11   0.044861 0.0205 289   2.183  0.7629
 Step2 - Step12   0.055532 0.0205 289   2.703  0.3833
 Step2 - Step13   0.056806 0.0205 289   2.765  0.3415
 Step2 - Step14   0.055181 0.0205 289   2.686  0.3952
 Step2 - Step15   0.058163 0.0205 289   2.831  0.2997
 Step2 - Step16   0.069438 0.0205 289   3.380  0.0765
 Step2 - Step17   0.078684 0.0205 289   3.830  0.0180
 Step2 - Step18   0.080500 0.0205 289   3.918  0.0131
 Step3 - Step4    0.001725 0.0205 289   0.084  1.0000
 Step3 - Step5   -0.001765 0.0205 289  -0.086  1.0000
 Step3 - Step6   -0.000774 0.0205 289  -0.038  1.0000
 Step3 - Step7    0.000949 0.0205 289   0.046  1.0000
 Step3 - Step8    0.015852 0.0205 289   0.772  1.0000
 Step3 - Step9    0.019717 0.0205 289   0.960  1.0000
 Step3 - Step10   0.039069 0.0205 289   1.902  0.9091
 Step3 - Step11   0.037219 0.0205 289   1.812  0.9389
 Step3 - Step12   0.047890 0.0205 289   2.331  0.6601
 Step3 - Step13   0.049164 0.0205 289   2.393  0.6138
 Step3 - Step14   0.047539 0.0205 289   2.314  0.6726
 Step3 - Step15   0.050521 0.0205 289   2.459  0.5636
 Step3 - Step16   0.061796 0.0205 289   3.008  0.2036
 Step3 - Step17   0.071042 0.0205 289   3.458  0.0607
 Step3 - Step18   0.072858 0.0205 289   3.546  0.0462
 Step4 - Step5   -0.003489 0.0205 289  -0.170  1.0000
 Step4 - Step6   -0.002499 0.0205 289  -0.122  1.0000
 Step4 - Step7   -0.000776 0.0205 289  -0.038  1.0000
 Step4 - Step8    0.014127 0.0205 289   0.688  1.0000
 Step4 - Step9    0.017992 0.0205 289   0.876  1.0000
 Step4 - Step10   0.037344 0.0205 289   1.818  0.9372
 Step4 - Step11   0.035495 0.0205 289   1.728  0.9598
 Step4 - Step12   0.046166 0.0205 289   2.247  0.7202
 Step4 - Step13   0.047440 0.0205 289   2.309  0.6762
 Step4 - Step14   0.045814 0.0205 289   2.230  0.7320
 Step4 - Step15   0.048797 0.0205 289   2.375  0.6273
 Step4 - Step16   0.060072 0.0205 289   2.924  0.2462
 Step4 - Step17   0.069317 0.0205 289   3.374  0.0778
 Step4 - Step18   0.071133 0.0205 289   3.462  0.0598
 Step5 - Step6    0.000991 0.0205 289   0.048  1.0000
 Step5 - Step7    0.002713 0.0205 289   0.132  1.0000
 Step5 - Step8    0.017616 0.0205 289   0.857  1.0000
 Step5 - Step9    0.021481 0.0205 289   1.046  0.9999
 Step5 - Step10   0.040833 0.0205 289   1.987  0.8730
 Step5 - Step11   0.038984 0.0205 289   1.897  0.9107
 Step5 - Step12   0.049655 0.0205 289   2.417  0.5957
 Step5 - Step13   0.050929 0.0205 289   2.479  0.5485
 Step5 - Step14   0.049303 0.0205 289   2.400  0.6087
 Step5 - Step15   0.052286 0.0205 289   2.545  0.4983
 Step5 - Step16   0.063561 0.0205 289   3.094  0.1655
 Step5 - Step17   0.072806 0.0205 289   3.544  0.0466
 Step5 - Step18   0.074623 0.0205 289   3.632  0.0351
 Step6 - Step7    0.001723 0.0205 289   0.084  1.0000
 Step6 - Step8    0.016626 0.0205 289   0.809  1.0000
 Step6 - Step9    0.020491 0.0205 289   0.997  0.9999
 Step6 - Step10   0.039843 0.0205 289   1.939  0.8942
 Step6 - Step11   0.037993 0.0205 289   1.849  0.9274
 Step6 - Step12   0.048664 0.0205 289   2.369  0.6321
 Step6 - Step13   0.049939 0.0205 289   2.431  0.5852
 Step6 - Step14   0.048313 0.0205 289   2.351  0.6449
 Step6 - Step15   0.051296 0.0205 289   2.497  0.5349
 Step6 - Step16   0.062570 0.0205 289   3.045  0.1862
 Step6 - Step17   0.071816 0.0205 289   3.495  0.0541
 Step6 - Step18   0.073632 0.0205 289   3.584  0.0410
 Step7 - Step8    0.014903 0.0205 289   0.725  1.0000
 Step7 - Step9    0.018768 0.0205 289   0.913  1.0000
 Step7 - Step10   0.038120 0.0205 289   1.855  0.9254
 Step7 - Step11   0.036270 0.0205 289   1.765  0.9512
 Step7 - Step12   0.046942 0.0205 289   2.285  0.6936
 Step7 - Step13   0.048216 0.0205 289   2.347  0.6484
 Step7 - Step14   0.046590 0.0205 289   2.268  0.7058
 Step7 - Step15   0.049573 0.0205 289   2.413  0.5988
 Step7 - Step16   0.060847 0.0205 289   2.962  0.2264
 Step7 - Step17   0.070093 0.0205 289   3.412  0.0696
 Step7 - Step18   0.071909 0.0205 289   3.500  0.0533
 Step8 - Step9    0.003865 0.0205 289   0.188  1.0000
 Step8 - Step10   0.023217 0.0205 289   1.130  0.9997
 Step8 - Step11   0.021367 0.0205 289   1.040  0.9999
 Step8 - Step12   0.032039 0.0205 289   1.559  0.9851
 Step8 - Step13   0.033313 0.0205 289   1.621  0.9780
 Step8 - Step14   0.031687 0.0205 289   1.542  0.9867
 Step8 - Step15   0.034670 0.0205 289   1.687  0.9676
 Step8 - Step16   0.045944 0.0205 289   2.236  0.7277
 Step8 - Step17   0.055190 0.0205 289   2.686  0.3949
 Step8 - Step18   0.057006 0.0205 289   2.775  0.3352
 Step9 - Step10   0.019352 0.0205 289   0.942  1.0000
 Step9 - Step11   0.017502 0.0205 289   0.852  1.0000
 Step9 - Step12   0.028173 0.0205 289   1.371  0.9964
 Step9 - Step13   0.029448 0.0205 289   1.433  0.9940
 Step9 - Step14   0.027822 0.0205 289   1.354  0.9969
 Step9 - Step15   0.030805 0.0205 289   1.499  0.9901
 Step9 - Step16   0.042079 0.0205 289   2.048  0.8428
 Step9 - Step17   0.051325 0.0205 289   2.498  0.5338
 Step9 - Step18   0.053141 0.0205 289   2.586  0.4671
 Step10 - Step11 -0.001849 0.0205 289  -0.090  1.0000
 Step10 - Step12  0.008822 0.0205 289   0.429  1.0000
 Step10 - Step13  0.010096 0.0205 289   0.491  1.0000
 Step10 - Step14  0.008470 0.0205 289   0.412  1.0000
 Step10 - Step15  0.011453 0.0205 289   0.557  1.0000
 Step10 - Step16  0.022727 0.0205 289   1.106  0.9998
 Step10 - Step17  0.031973 0.0205 289   1.556  0.9854
 Step10 - Step18  0.033789 0.0205 289   1.645  0.9747
 Step11 - Step12  0.010671 0.0205 289   0.519  1.0000
 Step11 - Step13  0.011945 0.0205 289   0.581  1.0000
 Step11 - Step14  0.010320 0.0205 289   0.502  1.0000
 Step11 - Step15  0.013302 0.0205 289   0.647  1.0000
 Step11 - Step16  0.024577 0.0205 289   1.196  0.9993
 Step11 - Step17  0.033822 0.0205 289   1.646  0.9744
 Step11 - Step18  0.035639 0.0205 289   1.735  0.9583
 Step12 - Step13  0.001274 0.0205 289   0.062  1.0000
 Step12 - Step14 -0.000351 0.0205 289  -0.017  1.0000
 Step12 - Step15  0.002631 0.0205 289   0.128  1.0000
 Step12 - Step16  0.013906 0.0205 289   0.677  1.0000
 Step12 - Step17  0.023151 0.0205 289   1.127  0.9997
 Step12 - Step18  0.024968 0.0205 289   1.215  0.9992
 Step13 - Step14 -0.001626 0.0205 289  -0.079  1.0000
 Step13 - Step15  0.001357 0.0205 289   0.066  1.0000
 Step13 - Step16  0.012632 0.0205 289   0.615  1.0000
 Step13 - Step17  0.021877 0.0205 289   1.065  0.9999
 Step13 - Step18  0.023694 0.0205 289   1.153  0.9996
 Step14 - Step15  0.002983 0.0205 289   0.145  1.0000
 Step14 - Step16  0.014257 0.0205 289   0.694  1.0000
 Step14 - Step17  0.023503 0.0205 289   1.144  0.9996
 Step14 - Step18  0.025319 0.0205 289   1.232  0.9990
 Step15 - Step16  0.011275 0.0205 289   0.549  1.0000
 Step15 - Step17  0.020520 0.0205 289   0.999  0.9999
 Step15 - Step18  0.022337 0.0205 289   1.087  0.9998
 Step16 - Step17  0.009246 0.0205 289   0.450  1.0000
 Step16 - Step18  0.011062 0.0205 289   0.538  1.0000
 Step17 - Step18  0.001816 0.0205 289   0.088  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.671461377 -0.002850006 -0.010491967 -0.012216496 -0.008727327 -0.009717854 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.011440754 -0.026343724 -0.030208819 -0.049560694 -0.047711203 -0.058382263 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.059656444 -0.058030780 -0.061013449 -0.072288136 -0.081533669 -0.083349970 

Random Effects:
$subject
   (Intercept)
2   0.23289732
3   0.02696411
4  -0.22775546
5  -0.29972565
7  -0.06629733
8   0.07711327
10  0.65172520
11  0.50326115
13 -0.18110343
14 -0.02842196
15 -0.11070271
16 -0.04576267
17 -0.05449078
18  0.09659745
19 -0.21532113
20 -0.22205811
22 -0.15956441
23  0.02264515

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.88765296 -0.06935408 -0.42180346 -0.27011748 -0.50476822 -0.22822550 

=============================================================

--- Mixed - SD - Block 3 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq   Mean Sq NumDF DenDF F value  Pr(>F)  
Step 0.14985 0.0088144    17   289   1.893 0.01839 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    2.11e-03 0.0227 289   0.093  1.0000
 Step1 - Step3    6.56e-03 0.0227 289   0.288  1.0000
 Step1 - Step4    1.01e-02 0.0227 289   0.444  1.0000
 Step1 - Step5    2.15e-03 0.0227 289   0.095  1.0000
 Step1 - Step6   -2.31e-03 0.0227 289  -0.101  1.0000
 Step1 - Step7   -1.21e-02 0.0227 289  -0.531  1.0000
 Step1 - Step8   -3.13e-04 0.0227 289  -0.014  1.0000
 Step1 - Step9    5.91e-03 0.0227 289   0.260  1.0000
 Step1 - Step10   1.90e-02 0.0227 289   0.834  1.0000
 Step1 - Step11   2.68e-02 0.0227 289   1.177  0.9994
 Step1 - Step12   2.93e-02 0.0227 289   1.289  0.9983
 Step1 - Step13   3.11e-02 0.0227 289   1.369  0.9964
 Step1 - Step14   2.96e-02 0.0227 289   1.302  0.9980
 Step1 - Step15   2.94e-02 0.0227 289   1.291  0.9982
 Step1 - Step16   4.15e-02 0.0227 289   1.825  0.9348
 Step1 - Step17   5.65e-02 0.0227 289   2.483  0.5452
 Step1 - Step18   7.14e-02 0.0227 289   3.141  0.1469
 Step2 - Step3    4.45e-03 0.0227 289   0.196  1.0000
 Step2 - Step4    8.00e-03 0.0227 289   0.352  1.0000
 Step2 - Step5    4.59e-05 0.0227 289   0.002  1.0000
 Step2 - Step6   -4.41e-03 0.0227 289  -0.194  1.0000
 Step2 - Step7   -1.42e-02 0.0227 289  -0.624  1.0000
 Step2 - Step8   -2.42e-03 0.0227 289  -0.106  1.0000
 Step2 - Step9    3.80e-03 0.0227 289   0.167  1.0000
 Step2 - Step10   1.69e-02 0.0227 289   0.742  1.0000
 Step2 - Step11   2.47e-02 0.0227 289   1.084  0.9998
 Step2 - Step12   2.72e-02 0.0227 289   1.196  0.9993
 Step2 - Step13   2.90e-02 0.0227 289   1.277  0.9984
 Step2 - Step14   2.75e-02 0.0227 289   1.210  0.9992
 Step2 - Step15   2.73e-02 0.0227 289   1.199  0.9993
 Step2 - Step16   3.94e-02 0.0227 289   1.733  0.9586
 Step2 - Step17   5.44e-02 0.0227 289   2.391  0.6156
 Step2 - Step18   6.93e-02 0.0227 289   3.048  0.1848
 Step3 - Step4    3.54e-03 0.0227 289   0.156  1.0000
 Step3 - Step5   -4.41e-03 0.0227 289  -0.194  1.0000
 Step3 - Step6   -8.87e-03 0.0227 289  -0.390  1.0000
 Step3 - Step7   -1.86e-02 0.0227 289  -0.820  1.0000
 Step3 - Step8   -6.87e-03 0.0227 289  -0.302  1.0000
 Step3 - Step9   -6.52e-04 0.0227 289  -0.029  1.0000
 Step3 - Step10   1.24e-02 0.0227 289   0.546  1.0000
 Step3 - Step11   2.02e-02 0.0227 289   0.889  1.0000
 Step3 - Step12   2.28e-02 0.0227 289   1.001  0.9999
 Step3 - Step13   2.46e-02 0.0227 289   1.081  0.9998
 Step3 - Step14   2.31e-02 0.0227 289   1.014  0.9999
 Step3 - Step15   2.28e-02 0.0227 289   1.003  0.9999
 Step3 - Step16   3.50e-02 0.0227 289   1.537  0.9872
 Step3 - Step17   4.99e-02 0.0227 289   2.195  0.7555
 Step3 - Step18   6.49e-02 0.0227 289   2.853  0.2866
 Step4 - Step5   -7.95e-03 0.0227 289  -0.350  1.0000
 Step4 - Step6   -1.24e-02 0.0227 289  -0.546  1.0000
 Step4 - Step7   -2.22e-02 0.0227 289  -0.976  1.0000
 Step4 - Step8   -1.04e-02 0.0227 289  -0.458  1.0000
 Step4 - Step9   -4.20e-03 0.0227 289  -0.184  1.0000
 Step4 - Step10   8.87e-03 0.0227 289   0.390  1.0000
 Step4 - Step11   1.67e-02 0.0227 289   0.733  1.0000
 Step4 - Step12   1.92e-02 0.0227 289   0.845  1.0000
 Step4 - Step13   2.10e-02 0.0227 289   0.925  1.0000
 Step4 - Step14   1.95e-02 0.0227 289   0.858  1.0000
 Step4 - Step15   1.93e-02 0.0227 289   0.847  1.0000
 Step4 - Step16   3.14e-02 0.0227 289   1.381  0.9960
 Step4 - Step17   4.64e-02 0.0227 289   2.039  0.8476
 Step4 - Step18   6.13e-02 0.0227 289   2.697  0.3875
 Step5 - Step6   -4.46e-03 0.0227 289  -0.196  1.0000
 Step5 - Step7   -1.42e-02 0.0227 289  -0.626  1.0000
 Step5 - Step8   -2.46e-03 0.0227 289  -0.108  1.0000
 Step5 - Step9    3.76e-03 0.0227 289   0.165  1.0000
 Step5 - Step10   1.68e-02 0.0227 289   0.740  1.0000
 Step5 - Step11   2.46e-02 0.0227 289   1.082  0.9998
 Step5 - Step12   2.72e-02 0.0227 289   1.194  0.9993
 Step5 - Step13   2.90e-02 0.0227 289   1.275  0.9985
 Step5 - Step14   2.75e-02 0.0227 289   1.208  0.9992
 Step5 - Step15   2.72e-02 0.0227 289   1.197  0.9993
 Step5 - Step16   3.94e-02 0.0227 289   1.731  0.9591
 Step5 - Step17   5.43e-02 0.0227 289   2.389  0.6172
 Step5 - Step18   6.93e-02 0.0227 289   3.046  0.1857
 Step6 - Step7   -9.78e-03 0.0227 289  -0.430  1.0000
 Step6 - Step8    1.99e-03 0.0227 289   0.088  1.0000
 Step6 - Step9    8.21e-03 0.0227 289   0.361  1.0000
 Step6 - Step10   2.13e-02 0.0227 289   0.936  1.0000
 Step6 - Step11   2.91e-02 0.0227 289   1.278  0.9984
 Step6 - Step12   3.16e-02 0.0227 289   1.390  0.9957
 Step6 - Step13   3.35e-02 0.0227 289   1.471  0.9920
 Step6 - Step14   3.19e-02 0.0227 289   1.404  0.9952
 Step6 - Step15   3.17e-02 0.0227 289   1.393  0.9957
 Step6 - Step16   4.38e-02 0.0227 289   1.927  0.8992
 Step6 - Step17   5.88e-02 0.0227 289   2.585  0.4686
 Step6 - Step18   7.38e-02 0.0227 289   3.243  0.1125
 Step7 - Step8    1.18e-02 0.0227 289   0.518  1.0000
 Step7 - Step9    1.80e-02 0.0227 289   0.791  1.0000
 Step7 - Step10   3.11e-02 0.0227 289   1.366  0.9965
 Step7 - Step11   3.89e-02 0.0227 289   1.708  0.9637
 Step7 - Step12   4.14e-02 0.0227 289   1.820  0.9364
 Step7 - Step13   4.32e-02 0.0227 289   1.901  0.9095
 Step7 - Step14   4.17e-02 0.0227 289   1.834  0.9324
 Step7 - Step15   4.15e-02 0.0227 289   1.822  0.9357
 Step7 - Step16   5.36e-02 0.0227 289   2.357  0.6409
 Step7 - Step17   6.86e-02 0.0227 289   3.014  0.2004
 Step7 - Step18   8.35e-02 0.0227 289   3.672  0.0307
 Step8 - Step9    6.22e-03 0.0227 289   0.273  1.0000
 Step8 - Step10   1.93e-02 0.0227 289   0.848  1.0000
 Step8 - Step11   2.71e-02 0.0227 289   1.191  0.9993
 Step8 - Step12   2.96e-02 0.0227 289   1.303  0.9980
 Step8 - Step13   3.15e-02 0.0227 289   1.383  0.9960
 Step8 - Step14   2.99e-02 0.0227 289   1.316  0.9978
 Step8 - Step15   2.97e-02 0.0227 289   1.305  0.9980
 Step8 - Step16   4.18e-02 0.0227 289   1.839  0.9306
 Step8 - Step17   5.68e-02 0.0227 289   2.497  0.5347
 Step8 - Step18   7.18e-02 0.0227 289   3.155  0.1418
 Step9 - Step10   1.31e-02 0.0227 289   0.575  1.0000
 Step9 - Step11   2.09e-02 0.0227 289   0.917  1.0000
 Step9 - Step12   2.34e-02 0.0227 289   1.029  0.9999
 Step9 - Step13   2.52e-02 0.0227 289   1.110  0.9997
 Step9 - Step14   2.37e-02 0.0227 289   1.042  0.9999
 Step9 - Step15   2.35e-02 0.0227 289   1.031  0.9999
 Step9 - Step16   3.56e-02 0.0227 289   1.566  0.9845
 Step9 - Step17   5.06e-02 0.0227 289   2.223  0.7364
 Step9 - Step18   6.55e-02 0.0227 289   2.881  0.2699
 Step10 - Step11  7.80e-03 0.0227 289   0.343  1.0000
 Step10 - Step12  1.03e-02 0.0227 289   0.455  1.0000
 Step10 - Step13  1.22e-02 0.0227 289   0.535  1.0000
 Step10 - Step14  1.06e-02 0.0227 289   0.468  1.0000
 Step10 - Step15  1.04e-02 0.0227 289   0.457  1.0000
 Step10 - Step16  2.25e-02 0.0227 289   0.991  0.9999
 Step10 - Step17  3.75e-02 0.0227 289   1.649  0.9740
 Step10 - Step18  5.25e-02 0.0227 289   2.307  0.6777
 Step11 - Step12  2.54e-03 0.0227 289   0.112  1.0000
 Step11 - Step13  4.37e-03 0.0227 289   0.192  1.0000
 Step11 - Step14  2.85e-03 0.0227 289   0.125  1.0000
 Step11 - Step15  2.59e-03 0.0227 289   0.114  1.0000
 Step11 - Step16  1.48e-02 0.0227 289   0.649  1.0000
 Step11 - Step17  2.97e-02 0.0227 289   1.306  0.9980
 Step11 - Step18  4.47e-02 0.0227 289   1.964  0.8836
 Step12 - Step13  1.83e-03 0.0227 289   0.080  1.0000
 Step12 - Step14  3.03e-04 0.0227 289   0.013  1.0000
 Step12 - Step15  5.04e-05 0.0227 289   0.002  1.0000
 Step12 - Step16  1.22e-02 0.0227 289   0.537  1.0000
 Step12 - Step17  2.72e-02 0.0227 289   1.194  0.9993
 Step12 - Step18  4.21e-02 0.0227 289   1.852  0.9265
 Step13 - Step14 -1.53e-03 0.0227 289  -0.067  1.0000
 Step13 - Step15 -1.78e-03 0.0227 289  -0.078  1.0000
 Step13 - Step16  1.04e-02 0.0227 289   0.456  1.0000
 Step13 - Step17  2.53e-02 0.0227 289   1.114  0.9997
 Step13 - Step18  4.03e-02 0.0227 289   1.772  0.9496
 Step14 - Step15 -2.52e-04 0.0227 289  -0.011  1.0000
 Step14 - Step16  1.19e-02 0.0227 289   0.523  1.0000
 Step14 - Step17  2.69e-02 0.0227 289   1.181  0.9994
 Step14 - Step18  4.18e-02 0.0227 289   1.839  0.9307
 Step15 - Step16  1.22e-02 0.0227 289   0.534  1.0000
 Step15 - Step17  2.71e-02 0.0227 289   1.192  0.9993
 Step15 - Step18  4.21e-02 0.0227 289   1.850  0.9272
 Step16 - Step17  1.50e-02 0.0227 289   0.658  1.0000
 Step16 - Step18  2.99e-02 0.0227 289   1.316  0.9978
 Step17 - Step18  1.50e-02 0.0227 289   0.658  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.676665387 -0.002105039 -0.006558100 -0.010102947 -0.002150915  0.002308275 
       Step7        Step8        Step9       Step10       Step11       Step12 
 0.012086261  0.000313495 -0.005906507 -0.018974636 -0.026771168 -0.029315705 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.031144131 -0.029618499 -0.029366154 -0.041522036 -0.056479318 -0.071444602 

Random Effects:
$subject
    (Intercept)
2   0.124686034
3   0.219202692
4  -0.186134444
5  -0.208807724
7  -0.093053285
8   0.219535949
10  0.663814077
11  0.168616554
13 -0.166097181
14  0.022505551
15  0.003140649
16 -0.119170801
17 -0.034699363
18 -0.055796293
19 -0.242271180
20 -0.169201275
22 -0.253962753
23  0.107692792

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
-0.80843506 -0.48892347 -0.71336998 -0.09702261  0.73889975  0.52047023 

=============================================================

--- Mixed - SD - Block 3 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
       Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
Step 0.054738 0.0032199    17   289  0.2935 0.9976

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -0.004711 0.0349 289  -0.135  1.0000
 Step1 - Step3   -0.003429 0.0349 289  -0.098  1.0000
 Step1 - Step4    0.000581 0.0349 289   0.017  1.0000
 Step1 - Step5   -0.009733 0.0349 289  -0.279  1.0000
 Step1 - Step6   -0.007225 0.0349 289  -0.207  1.0000
 Step1 - Step7   -0.029757 0.0349 289  -0.852  1.0000
 Step1 - Step8   -0.008478 0.0349 289  -0.243  1.0000
 Step1 - Step9   -0.001171 0.0349 289  -0.034  1.0000
 Step1 - Step10   0.002458 0.0349 289   0.070  1.0000
 Step1 - Step11   0.005889 0.0349 289   0.169  1.0000
 Step1 - Step12  -0.002879 0.0349 289  -0.082  1.0000
 Step1 - Step13   0.008429 0.0349 289   0.241  1.0000
 Step1 - Step14   0.011739 0.0349 289   0.336  1.0000
 Step1 - Step15   0.007507 0.0349 289   0.215  1.0000
 Step1 - Step16   0.020483 0.0349 289   0.587  1.0000
 Step1 - Step17   0.022165 0.0349 289   0.635  1.0000
 Step1 - Step18   0.027616 0.0349 289   0.791  1.0000
 Step2 - Step3    0.001282 0.0349 289   0.037  1.0000
 Step2 - Step4    0.005292 0.0349 289   0.152  1.0000
 Step2 - Step5   -0.005022 0.0349 289  -0.144  1.0000
 Step2 - Step6   -0.002514 0.0349 289  -0.072  1.0000
 Step2 - Step7   -0.025046 0.0349 289  -0.717  1.0000
 Step2 - Step8   -0.003767 0.0349 289  -0.108  1.0000
 Step2 - Step9    0.003540 0.0349 289   0.101  1.0000
 Step2 - Step10   0.007169 0.0349 289   0.205  1.0000
 Step2 - Step11   0.010600 0.0349 289   0.304  1.0000
 Step2 - Step12   0.001832 0.0349 289   0.052  1.0000
 Step2 - Step13   0.013140 0.0349 289   0.376  1.0000
 Step2 - Step14   0.016450 0.0349 289   0.471  1.0000
 Step2 - Step15   0.012218 0.0349 289   0.350  1.0000
 Step2 - Step16   0.025194 0.0349 289   0.722  1.0000
 Step2 - Step17   0.026876 0.0349 289   0.770  1.0000
 Step2 - Step18   0.032327 0.0349 289   0.926  1.0000
 Step3 - Step4    0.004010 0.0349 289   0.115  1.0000
 Step3 - Step5   -0.006305 0.0349 289  -0.181  1.0000
 Step3 - Step6   -0.003796 0.0349 289  -0.109  1.0000
 Step3 - Step7   -0.026328 0.0349 289  -0.754  1.0000
 Step3 - Step8   -0.005049 0.0349 289  -0.145  1.0000
 Step3 - Step9    0.002258 0.0349 289   0.065  1.0000
 Step3 - Step10   0.005886 0.0349 289   0.169  1.0000
 Step3 - Step11   0.009318 0.0349 289   0.267  1.0000
 Step3 - Step12   0.000550 0.0349 289   0.016  1.0000
 Step3 - Step13   0.011857 0.0349 289   0.340  1.0000
 Step3 - Step14   0.015168 0.0349 289   0.434  1.0000
 Step3 - Step15   0.010935 0.0349 289   0.313  1.0000
 Step3 - Step16   0.023911 0.0349 289   0.685  1.0000
 Step3 - Step17   0.025594 0.0349 289   0.733  1.0000
 Step3 - Step18   0.031045 0.0349 289   0.889  1.0000
 Step4 - Step5   -0.010315 0.0349 289  -0.295  1.0000
 Step4 - Step6   -0.007806 0.0349 289  -0.224  1.0000
 Step4 - Step7   -0.030338 0.0349 289  -0.869  1.0000
 Step4 - Step8   -0.009059 0.0349 289  -0.259  1.0000
 Step4 - Step9   -0.001752 0.0349 289  -0.050  1.0000
 Step4 - Step10   0.001876 0.0349 289   0.054  1.0000
 Step4 - Step11   0.005308 0.0349 289   0.152  1.0000
 Step4 - Step12  -0.003460 0.0349 289  -0.099  1.0000
 Step4 - Step13   0.007847 0.0349 289   0.225  1.0000
 Step4 - Step14   0.011158 0.0349 289   0.320  1.0000
 Step4 - Step15   0.006925 0.0349 289   0.198  1.0000
 Step4 - Step16   0.019901 0.0349 289   0.570  1.0000
 Step4 - Step17   0.021584 0.0349 289   0.618  1.0000
 Step4 - Step18   0.027035 0.0349 289   0.774  1.0000
 Step5 - Step6    0.002508 0.0349 289   0.072  1.0000
 Step5 - Step7   -0.020023 0.0349 289  -0.573  1.0000
 Step5 - Step8    0.001256 0.0349 289   0.036  1.0000
 Step5 - Step9    0.008562 0.0349 289   0.245  1.0000
 Step5 - Step10   0.012191 0.0349 289   0.349  1.0000
 Step5 - Step11   0.015622 0.0349 289   0.447  1.0000
 Step5 - Step12   0.006854 0.0349 289   0.196  1.0000
 Step5 - Step13   0.018162 0.0349 289   0.520  1.0000
 Step5 - Step14   0.021472 0.0349 289   0.615  1.0000
 Step5 - Step15   0.017240 0.0349 289   0.494  1.0000
 Step5 - Step16   0.030216 0.0349 289   0.865  1.0000
 Step5 - Step17   0.031899 0.0349 289   0.914  1.0000
 Step5 - Step18   0.037349 0.0349 289   1.070  0.9998
 Step6 - Step7   -0.022531 0.0349 289  -0.645  1.0000
 Step6 - Step8   -0.001253 0.0349 289  -0.036  1.0000
 Step6 - Step9    0.006054 0.0349 289   0.173  1.0000
 Step6 - Step10   0.009683 0.0349 289   0.277  1.0000
 Step6 - Step11   0.013114 0.0349 289   0.376  1.0000
 Step6 - Step12   0.004346 0.0349 289   0.124  1.0000
 Step6 - Step13   0.015654 0.0349 289   0.448  1.0000
 Step6 - Step14   0.018964 0.0349 289   0.543  1.0000
 Step6 - Step15   0.014732 0.0349 289   0.422  1.0000
 Step6 - Step16   0.027708 0.0349 289   0.794  1.0000
 Step6 - Step17   0.029391 0.0349 289   0.842  1.0000
 Step6 - Step18   0.034841 0.0349 289   0.998  0.9999
 Step7 - Step8    0.021279 0.0349 289   0.609  1.0000
 Step7 - Step9    0.028585 0.0349 289   0.819  1.0000
 Step7 - Step10   0.032214 0.0349 289   0.923  1.0000
 Step7 - Step11   0.035645 0.0349 289   1.021  0.9999
 Step7 - Step12   0.026877 0.0349 289   0.770  1.0000
 Step7 - Step13   0.038185 0.0349 289   1.094  0.9998
 Step7 - Step14   0.041496 0.0349 289   1.188  0.9994
 Step7 - Step15   0.037263 0.0349 289   1.067  0.9998
 Step7 - Step16   0.050239 0.0349 289   1.439  0.9937
 Step7 - Step17   0.051922 0.0349 289   1.487  0.9910
 Step7 - Step18   0.057372 0.0349 289   1.643  0.9749
 Step8 - Step9    0.007307 0.0349 289   0.209  1.0000
 Step8 - Step10   0.010935 0.0349 289   0.313  1.0000
 Step8 - Step11   0.014367 0.0349 289   0.411  1.0000
 Step8 - Step12   0.005599 0.0349 289   0.160  1.0000
 Step8 - Step13   0.016906 0.0349 289   0.484  1.0000
 Step8 - Step14   0.020217 0.0349 289   0.579  1.0000
 Step8 - Step15   0.015984 0.0349 289   0.458  1.0000
 Step8 - Step16   0.028961 0.0349 289   0.829  1.0000
 Step8 - Step17   0.030643 0.0349 289   0.878  1.0000
 Step8 - Step18   0.036094 0.0349 289   1.034  0.9999
 Step9 - Step10   0.003629 0.0349 289   0.104  1.0000
 Step9 - Step11   0.007060 0.0349 289   0.202  1.0000
 Step9 - Step12  -0.001708 0.0349 289  -0.049  1.0000
 Step9 - Step13   0.009600 0.0349 289   0.275  1.0000
 Step9 - Step14   0.012910 0.0349 289   0.370  1.0000
 Step9 - Step15   0.008678 0.0349 289   0.249  1.0000
 Step9 - Step16   0.021654 0.0349 289   0.620  1.0000
 Step9 - Step17   0.023337 0.0349 289   0.668  1.0000
 Step9 - Step18   0.028787 0.0349 289   0.824  1.0000
 Step10 - Step11  0.003431 0.0349 289   0.098  1.0000
 Step10 - Step12 -0.005337 0.0349 289  -0.153  1.0000
 Step10 - Step13  0.005971 0.0349 289   0.171  1.0000
 Step10 - Step14  0.009282 0.0349 289   0.266  1.0000
 Step10 - Step15  0.005049 0.0349 289   0.145  1.0000
 Step10 - Step16  0.018025 0.0349 289   0.516  1.0000
 Step10 - Step17  0.019708 0.0349 289   0.564  1.0000
 Step10 - Step18  0.025158 0.0349 289   0.721  1.0000
 Step11 - Step12 -0.008768 0.0349 289  -0.251  1.0000
 Step11 - Step13  0.002540 0.0349 289   0.073  1.0000
 Step11 - Step14  0.005850 0.0349 289   0.168  1.0000
 Step11 - Step15  0.001618 0.0349 289   0.046  1.0000
 Step11 - Step16  0.014594 0.0349 289   0.418  1.0000
 Step11 - Step17  0.016276 0.0349 289   0.466  1.0000
 Step11 - Step18  0.021727 0.0349 289   0.622  1.0000
 Step12 - Step13  0.011308 0.0349 289   0.324  1.0000
 Step12 - Step14  0.014618 0.0349 289   0.419  1.0000
 Step12 - Step15  0.010386 0.0349 289   0.297  1.0000
 Step12 - Step16  0.023362 0.0349 289   0.669  1.0000
 Step12 - Step17  0.025045 0.0349 289   0.717  1.0000
 Step12 - Step18  0.030495 0.0349 289   0.873  1.0000
 Step13 - Step14  0.003310 0.0349 289   0.095  1.0000
 Step13 - Step15 -0.000922 0.0349 289  -0.026  1.0000
 Step13 - Step16  0.012054 0.0349 289   0.345  1.0000
 Step13 - Step17  0.013737 0.0349 289   0.393  1.0000
 Step13 - Step18  0.019187 0.0349 289   0.550  1.0000
 Step14 - Step15 -0.004232 0.0349 289  -0.121  1.0000
 Step14 - Step16  0.008744 0.0349 289   0.250  1.0000
 Step14 - Step17  0.010426 0.0349 289   0.299  1.0000
 Step14 - Step18  0.015877 0.0349 289   0.455  1.0000
 Step15 - Step16  0.012976 0.0349 289   0.372  1.0000
 Step15 - Step17  0.014659 0.0349 289   0.420  1.0000
 Step15 - Step18  0.020109 0.0349 289   0.576  1.0000
 Step16 - Step17  0.001683 0.0349 289   0.048  1.0000
 Step16 - Step18  0.007133 0.0349 289   0.204  1.0000
 Step17 - Step18  0.005450 0.0349 289   0.156  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 1.3175413701  0.0047110150  0.0034287776 -0.0005812146  0.0097333153 
        Step6         Step7         Step8         Step9        Step10 
 0.0072252295  0.0297565650  0.0084777989  0.0011712252 -0.0024575753 
       Step11        Step12        Step13        Step14        Step15 
-0.0058889160  0.0028792565 -0.0084286014 -0.0117390951 -0.0075066189 
       Step16        Step17        Step18 
-0.0204827125 -0.0221653387 -0.0276158268 

Random Effects:
$subject
   (Intercept)
2   0.13291393
3   0.48434932
4  -0.55370065
5  -0.62504671
7   0.26931118
8   0.16547275
10  1.84656947
11  0.32818874
13 -0.27907137
14  0.10368586
15 -0.19161125
16  0.06298122
17 -0.35856743
18  0.31999253
19 -0.59917057
20 -0.56464026
22 -0.56576503
23  0.02410827

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.29342298  0.98103947  0.39299442  0.22379449 -0.01686636 -0.45801462 

=============================================================

--- Mixed - SD - Block 4 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.2558 0.015047    17   289  2.7456 0.0003019 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.004082 0.0247 289   0.165  1.0000
 Step1 - Step3   -0.010434 0.0247 289  -0.423  1.0000
 Step1 - Step4   -0.003139 0.0247 289  -0.127  1.0000
 Step1 - Step5    0.002250 0.0247 289   0.091  1.0000
 Step1 - Step6   -0.006750 0.0247 289  -0.274  1.0000
 Step1 - Step7   -0.006006 0.0247 289  -0.243  1.0000
 Step1 - Step8   -0.002087 0.0247 289  -0.085  1.0000
 Step1 - Step9    0.014821 0.0247 289   0.601  1.0000
 Step1 - Step10   0.019053 0.0247 289   0.772  1.0000
 Step1 - Step11   0.015871 0.0247 289   0.643  1.0000
 Step1 - Step12   0.041450 0.0247 289   1.680  0.9690
 Step1 - Step13   0.059539 0.0247 289   2.413  0.5988
 Step1 - Step14   0.049240 0.0247 289   1.995  0.8692
 Step1 - Step15   0.043660 0.0247 289   1.769  0.9502
 Step1 - Step16   0.072092 0.0247 289   2.921  0.2475
 Step1 - Step17   0.069764 0.0247 289   2.827  0.3021
 Step1 - Step18   0.057912 0.0247 289   2.347  0.6484
 Step2 - Step3   -0.014515 0.0247 289  -0.588  1.0000
 Step2 - Step4   -0.007221 0.0247 289  -0.293  1.0000
 Step2 - Step5   -0.001832 0.0247 289  -0.074  1.0000
 Step2 - Step6   -0.010832 0.0247 289  -0.439  1.0000
 Step2 - Step7   -0.010088 0.0247 289  -0.409  1.0000
 Step2 - Step8   -0.006169 0.0247 289  -0.250  1.0000
 Step2 - Step9    0.010739 0.0247 289   0.435  1.0000
 Step2 - Step10   0.014971 0.0247 289   0.607  1.0000
 Step2 - Step11   0.011789 0.0247 289   0.478  1.0000
 Step2 - Step12   0.037368 0.0247 289   1.514  0.9890
 Step2 - Step13   0.055457 0.0247 289   2.247  0.7200
 Step2 - Step14   0.045158 0.0247 289   1.830  0.9335
 Step2 - Step15   0.039578 0.0247 289   1.604  0.9802
 Step2 - Step16   0.068010 0.0247 289   2.756  0.3473
 Step2 - Step17   0.065682 0.0247 289   2.662  0.4123
 Step2 - Step18   0.053830 0.0247 289   2.181  0.7643
 Step3 - Step4    0.007294 0.0247 289   0.296  1.0000
 Step3 - Step5    0.012683 0.0247 289   0.514  1.0000
 Step3 - Step6    0.003684 0.0247 289   0.149  1.0000
 Step3 - Step7    0.004428 0.0247 289   0.179  1.0000
 Step3 - Step8    0.008346 0.0247 289   0.338  1.0000
 Step3 - Step9    0.025255 0.0247 289   1.023  0.9999
 Step3 - Step10   0.029486 0.0247 289   1.195  0.9993
 Step3 - Step11   0.026305 0.0247 289   1.066  0.9998
 Step3 - Step12   0.051883 0.0247 289   2.103  0.8127
 Step3 - Step13   0.069973 0.0247 289   2.836  0.2969
 Step3 - Step14   0.059673 0.0247 289   2.418  0.5947
 Step3 - Step15   0.054094 0.0247 289   2.192  0.7573
 Step3 - Step16   0.082526 0.0247 289   3.344  0.0847
 Step3 - Step17   0.080197 0.0247 289   3.250  0.1102
 Step3 - Step18   0.068345 0.0247 289   2.770  0.3384
 Step4 - Step5    0.005389 0.0247 289   0.218  1.0000
 Step4 - Step6   -0.003611 0.0247 289  -0.146  1.0000
 Step4 - Step7   -0.002867 0.0247 289  -0.116  1.0000
 Step4 - Step8    0.001052 0.0247 289   0.043  1.0000
 Step4 - Step9    0.017960 0.0247 289   0.728  1.0000
 Step4 - Step10   0.022192 0.0247 289   0.899  1.0000
 Step4 - Step11   0.019010 0.0247 289   0.770  1.0000
 Step4 - Step12   0.044589 0.0247 289   1.807  0.9402
 Step4 - Step13   0.062678 0.0247 289   2.540  0.5020
 Step4 - Step14   0.052379 0.0247 289   2.123  0.8009
 Step4 - Step15   0.046799 0.0247 289   1.896  0.9110
 Step4 - Step16   0.075231 0.0247 289   3.049  0.1847
 Step4 - Step17   0.072903 0.0247 289   2.954  0.2301
 Step4 - Step18   0.061051 0.0247 289   2.474  0.5522
 Step5 - Step6   -0.009000 0.0247 289  -0.365  1.0000
 Step5 - Step7   -0.008255 0.0247 289  -0.335  1.0000
 Step5 - Step8   -0.004337 0.0247 289  -0.176  1.0000
 Step5 - Step9    0.012572 0.0247 289   0.509  1.0000
 Step5 - Step10   0.016803 0.0247 289   0.681  1.0000
 Step5 - Step11   0.013622 0.0247 289   0.552  1.0000
 Step5 - Step12   0.039200 0.0247 289   1.589  0.9820
 Step5 - Step13   0.057290 0.0247 289   2.322  0.6670
 Step5 - Step14   0.046990 0.0247 289   1.904  0.9081
 Step5 - Step15   0.041411 0.0247 289   1.678  0.9693
 Step5 - Step16   0.069843 0.0247 289   2.830  0.3001
 Step5 - Step17   0.067514 0.0247 289   2.736  0.3607
 Step5 - Step18   0.055662 0.0247 289   2.256  0.7142
 Step6 - Step7    0.000744 0.0247 289   0.030  1.0000
 Step6 - Step8    0.004663 0.0247 289   0.189  1.0000
 Step6 - Step9    0.021571 0.0247 289   0.874  1.0000
 Step6 - Step10   0.025803 0.0247 289   1.046  0.9999
 Step6 - Step11   0.022621 0.0247 289   0.917  1.0000
 Step6 - Step12   0.048200 0.0247 289   1.953  0.8883
 Step6 - Step13   0.066289 0.0247 289   2.686  0.3949
 Step6 - Step14   0.055990 0.0247 289   2.269  0.7049
 Step6 - Step15   0.050410 0.0247 289   2.043  0.8456
 Step6 - Step16   0.078842 0.0247 289   3.195  0.1277
 Step6 - Step17   0.076514 0.0247 289   3.101  0.1627
 Step6 - Step18   0.064662 0.0247 289   2.620  0.4422
 Step7 - Step8    0.003918 0.0247 289   0.159  1.0000
 Step7 - Step9    0.020827 0.0247 289   0.844  1.0000
 Step7 - Step10   0.025059 0.0247 289   1.015  0.9999
 Step7 - Step11   0.021877 0.0247 289   0.887  1.0000
 Step7 - Step12   0.047455 0.0247 289   1.923  0.9008
 Step7 - Step13   0.065545 0.0247 289   2.656  0.4162
 Step7 - Step14   0.055245 0.0247 289   2.239  0.7259
 Step7 - Step15   0.049666 0.0247 289   2.013  0.8609
 Step7 - Step16   0.078098 0.0247 289   3.165  0.1382
 Step7 - Step17   0.075770 0.0247 289   3.070  0.1752
 Step7 - Step18   0.063917 0.0247 289   2.590  0.4644
 Step8 - Step9    0.016908 0.0247 289   0.685  1.0000
 Step8 - Step10   0.021140 0.0247 289   0.857  1.0000
 Step8 - Step11   0.017959 0.0247 289   0.728  1.0000
 Step8 - Step12   0.043537 0.0247 289   1.764  0.9514
 Step8 - Step13   0.061627 0.0247 289   2.497  0.5344
 Step8 - Step14   0.051327 0.0247 289   2.080  0.8255
 Step8 - Step15   0.045748 0.0247 289   1.854  0.9259
 Step8 - Step16   0.074180 0.0247 289   3.006  0.2044
 Step8 - Step17   0.071851 0.0247 289   2.912  0.2528
 Step8 - Step18   0.059999 0.0247 289   2.431  0.5847
 Step9 - Step10   0.004232 0.0247 289   0.171  1.0000
 Step9 - Step11   0.001050 0.0247 289   0.043  1.0000
 Step9 - Step12   0.026629 0.0247 289   1.079  0.9998
 Step9 - Step13   0.044718 0.0247 289   1.812  0.9387
 Step9 - Step14   0.034419 0.0247 289   1.395  0.9956
 Step9 - Step15   0.028839 0.0247 289   1.169  0.9995
 Step9 - Step16   0.057271 0.0247 289   2.321  0.6675
 Step9 - Step17   0.054943 0.0247 289   2.226  0.7343
 Step9 - Step18   0.043091 0.0247 289   1.746  0.9557
 Step10 - Step11 -0.003181 0.0247 289  -0.129  1.0000
 Step10 - Step12  0.022397 0.0247 289   0.908  1.0000
 Step10 - Step13  0.040487 0.0247 289   1.641  0.9753
 Step10 - Step14  0.030187 0.0247 289   1.223  0.9991
 Step10 - Step15  0.024607 0.0247 289   0.997  0.9999
 Step10 - Step16  0.053039 0.0247 289   2.149  0.7846
 Step10 - Step17  0.050711 0.0247 289   2.055  0.8392
 Step10 - Step18  0.038859 0.0247 289   1.575  0.9836
 Step11 - Step12  0.025578 0.0247 289   1.037  0.9999
 Step11 - Step13  0.043668 0.0247 289   1.770  0.9501
 Step11 - Step14  0.033368 0.0247 289   1.352  0.9969
 Step11 - Step15  0.027789 0.0247 289   1.126  0.9997
 Step11 - Step16  0.056221 0.0247 289   2.278  0.6983
 Step11 - Step17  0.053893 0.0247 289   2.184  0.7626
 Step11 - Step18  0.042040 0.0247 289   1.704  0.9646
 Step12 - Step13  0.018090 0.0247 289   0.733  1.0000
 Step12 - Step14  0.007790 0.0247 289   0.316  1.0000
 Step12 - Step15  0.002211 0.0247 289   0.090  1.0000
 Step12 - Step16  0.030643 0.0247 289   1.242  0.9989
 Step12 - Step17  0.028314 0.0247 289   1.147  0.9996
 Step12 - Step18  0.016462 0.0247 289   0.667  1.0000
 Step13 - Step14 -0.010300 0.0247 289  -0.417  1.0000
 Step13 - Step15 -0.015879 0.0247 289  -0.643  1.0000
 Step13 - Step16  0.012553 0.0247 289   0.509  1.0000
 Step13 - Step17  0.010225 0.0247 289   0.414  1.0000
 Step13 - Step18 -0.001628 0.0247 289  -0.066  1.0000
 Step14 - Step15 -0.005579 0.0247 289  -0.226  1.0000
 Step14 - Step16  0.022853 0.0247 289   0.926  1.0000
 Step14 - Step17  0.020524 0.0247 289   0.832  1.0000
 Step14 - Step18  0.008672 0.0247 289   0.351  1.0000
 Step15 - Step16  0.028432 0.0247 289   1.152  0.9996
 Step15 - Step17  0.026104 0.0247 289   1.058  0.9999
 Step15 - Step18  0.014251 0.0247 289   0.578  1.0000
 Step16 - Step17 -0.002328 0.0247 289  -0.094  1.0000
 Step16 - Step18 -0.014181 0.0247 289  -0.575  1.0000
 Step17 - Step18 -0.011852 0.0247 289  -0.480  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 0.760251575 -0.004081952  0.010433537  0.003139048 -0.002249502  0.006750027 
       Step7        Step8        Step9       Step10       Step11       Step12 
 0.006005804  0.002087329 -0.014821024 -0.019052724 -0.015871234 -0.041449618 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.059539334 -0.049239621 -0.043660179 -0.072092211 -0.069763954 -0.057911575 

Random Effects:
$subject
    (Intercept)
2   0.133493523
3  -0.089255505
4  -0.292488130
5  -0.412203426
7  -0.092821268
8   0.394583850
10  1.115495062
11  0.436833169
13 -0.196860275
14 -0.019002968
15 -0.209721780
16  0.146724719
17 -0.138276478
18 -0.009218011
19 -0.265866345
20 -0.246121905
22 -0.216634483
23 -0.038659749

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
 0.1221600 -0.3364183  0.2445792 -0.1955896 -0.3375715 -0.1649986 

=============================================================

--- Mixed - SD - Block 4 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value    Pr(>F)    
Step 0.91232 0.053666    17   289   5.283 3.563e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -0.010572 0.0336 289  -0.315  1.0000
 Step1 - Step3    0.017260 0.0336 289   0.514  1.0000
 Step1 - Step4    0.018979 0.0336 289   0.565  1.0000
 Step1 - Step5    0.018681 0.0336 289   0.556  1.0000
 Step1 - Step6    0.045146 0.0336 289   1.344  0.9971
 Step1 - Step7    0.024826 0.0336 289   0.739  1.0000
 Step1 - Step8    0.060440 0.0336 289   1.799  0.9424
 Step1 - Step9    0.062160 0.0336 289   1.850  0.9271
 Step1 - Step10   0.074862 0.0336 289   2.228  0.7331
 Step1 - Step11   0.086740 0.0336 289   2.582  0.4706
 Step1 - Step12   0.107573 0.0336 289   3.202  0.1254
 Step1 - Step13   0.144386 0.0336 289   4.298  0.0031
 Step1 - Step14   0.122415 0.0336 289   3.644  0.0338
 Step1 - Step15   0.111555 0.0336 289   3.321  0.0906
 Step1 - Step16   0.154417 0.0336 289   4.596  0.0009
 Step1 - Step17   0.144269 0.0336 289   4.294  0.0031
 Step1 - Step18   0.135487 0.0336 289   4.033  0.0086
 Step2 - Step3    0.027833 0.0336 289   0.828  1.0000
 Step2 - Step4    0.029551 0.0336 289   0.880  1.0000
 Step2 - Step5    0.029254 0.0336 289   0.871  1.0000
 Step2 - Step6    0.055718 0.0336 289   1.658  0.9725
 Step2 - Step7    0.035398 0.0336 289   1.054  0.9999
 Step2 - Step8    0.071012 0.0336 289   2.114  0.8062
 Step2 - Step9    0.072732 0.0336 289   2.165  0.7748
 Step2 - Step10   0.085434 0.0336 289   2.543  0.4997
 Step2 - Step11   0.097312 0.0336 289   2.897  0.2613
 Step2 - Step12   0.118146 0.0336 289   3.517  0.0506
 Step2 - Step13   0.154958 0.0336 289   4.612  0.0008
 Step2 - Step14   0.132987 0.0336 289   3.958  0.0113
 Step2 - Step15   0.122127 0.0336 289   3.635  0.0347
 Step2 - Step16   0.164989 0.0336 289   4.911  0.0002
 Step2 - Step17   0.154842 0.0336 289   4.609  0.0008
 Step2 - Step18   0.146060 0.0336 289   4.348  0.0025
 Step3 - Step4    0.001719 0.0336 289   0.051  1.0000
 Step3 - Step5    0.001421 0.0336 289   0.042  1.0000
 Step3 - Step6    0.027886 0.0336 289   0.830  1.0000
 Step3 - Step7    0.007566 0.0336 289   0.225  1.0000
 Step3 - Step8    0.043179 0.0336 289   1.285  0.9983
 Step3 - Step9    0.044899 0.0336 289   1.336  0.9973
 Step3 - Step10   0.057601 0.0336 289   1.715  0.9625
 Step3 - Step11   0.069479 0.0336 289   2.068  0.8321
 Step3 - Step12   0.090313 0.0336 289   2.688  0.3935
 Step3 - Step13   0.127125 0.0336 289   3.784  0.0211
 Step3 - Step14   0.105154 0.0336 289   3.130  0.1511
 Step3 - Step15   0.094295 0.0336 289   2.807  0.3147
 Step3 - Step16   0.137157 0.0336 289   4.083  0.0071
 Step3 - Step17   0.127009 0.0336 289   3.780  0.0213
 Step3 - Step18   0.118227 0.0336 289   3.519  0.0503
 Step4 - Step5   -0.000298 0.0336 289  -0.009  1.0000
 Step4 - Step6    0.026167 0.0336 289   0.779  1.0000
 Step4 - Step7    0.005847 0.0336 289   0.174  1.0000
 Step4 - Step8    0.041461 0.0336 289   1.234  0.9990
 Step4 - Step9    0.043181 0.0336 289   1.285  0.9983
 Step4 - Step10   0.055883 0.0336 289   1.663  0.9718
 Step4 - Step11   0.067761 0.0336 289   2.017  0.8588
 Step4 - Step12   0.088594 0.0336 289   2.637  0.4300
 Step4 - Step13   0.125407 0.0336 289   3.733  0.0251
 Step4 - Step14   0.103436 0.0336 289   3.079  0.1717
 Step4 - Step15   0.092576 0.0336 289   2.756  0.3476
 Step4 - Step16   0.135438 0.0336 289   4.031  0.0087
 Step4 - Step17   0.125290 0.0336 289   3.729  0.0254
 Step4 - Step18   0.116508 0.0336 289   3.468  0.0588
 Step5 - Step6    0.026465 0.0336 289   0.788  1.0000
 Step5 - Step7    0.006145 0.0336 289   0.183  1.0000
 Step5 - Step8    0.041758 0.0336 289   1.243  0.9989
 Step5 - Step9    0.043479 0.0336 289   1.294  0.9982
 Step5 - Step10   0.056180 0.0336 289   1.672  0.9703
 Step5 - Step11   0.068058 0.0336 289   2.026  0.8544
 Step5 - Step12   0.088892 0.0336 289   2.646  0.4236
 Step5 - Step13   0.125704 0.0336 289   3.742  0.0244
 Step5 - Step14   0.103734 0.0336 289   3.088  0.1680
 Step5 - Step15   0.092874 0.0336 289   2.764  0.3418
 Step5 - Step16   0.135736 0.0336 289   4.040  0.0084
 Step5 - Step17   0.125588 0.0336 289   3.738  0.0247
 Step5 - Step18   0.116806 0.0336 289   3.477  0.0573
 Step6 - Step7   -0.020320 0.0336 289  -0.605  1.0000
 Step6 - Step8    0.015294 0.0336 289   0.455  1.0000
 Step6 - Step9    0.017014 0.0336 289   0.506  1.0000
 Step6 - Step10   0.029716 0.0336 289   0.885  1.0000
 Step6 - Step11   0.041594 0.0336 289   1.238  0.9989
 Step6 - Step12   0.062427 0.0336 289   1.858  0.9245
 Step6 - Step13   0.099240 0.0336 289   2.954  0.2303
 Step6 - Step14   0.077269 0.0336 289   2.300  0.6827
 Step6 - Step15   0.066409 0.0336 289   1.977  0.8779
 Step6 - Step16   0.109271 0.0336 289   3.253  0.1095
 Step6 - Step17   0.099123 0.0336 289   2.950  0.2321
 Step6 - Step18   0.090341 0.0336 289   2.689  0.3929
 Step7 - Step8    0.035613 0.0336 289   1.060  0.9999
 Step7 - Step9    0.037334 0.0336 289   1.111  0.9997
 Step7 - Step10   0.050035 0.0336 289   1.489  0.9908
 Step7 - Step11   0.061913 0.0336 289   1.843  0.9295
 Step7 - Step12   0.082747 0.0336 289   2.463  0.5605
 Step7 - Step13   0.119559 0.0336 289   3.559  0.0444
 Step7 - Step14   0.097589 0.0336 289   2.905  0.2567
 Step7 - Step15   0.086729 0.0336 289   2.582  0.4708
 Step7 - Step16   0.129591 0.0336 289   3.857  0.0163
 Step7 - Step17   0.119443 0.0336 289   3.555  0.0449
 Step7 - Step18   0.110661 0.0336 289   3.294  0.0977
 Step8 - Step9    0.001720 0.0336 289   0.051  1.0000
 Step8 - Step10   0.014422 0.0336 289   0.429  1.0000
 Step8 - Step11   0.026300 0.0336 289   0.783  1.0000
 Step8 - Step12   0.047134 0.0336 289   1.403  0.9953
 Step8 - Step13   0.083946 0.0336 289   2.499  0.5333
 Step8 - Step14   0.061975 0.0336 289   1.845  0.9289
 Step8 - Step15   0.051116 0.0336 289   1.521  0.9885
 Step8 - Step16   0.093977 0.0336 289   2.797  0.3206
 Step8 - Step17   0.083830 0.0336 289   2.495  0.5360
 Step8 - Step18   0.075048 0.0336 289   2.234  0.7293
 Step9 - Step10   0.012702 0.0336 289   0.378  1.0000
 Step9 - Step11   0.024580 0.0336 289   0.732  1.0000
 Step9 - Step12   0.045413 0.0336 289   1.352  0.9969
 Step9 - Step13   0.082226 0.0336 289   2.447  0.5724
 Step9 - Step14   0.060255 0.0336 289   1.794  0.9439
 Step9 - Step15   0.049395 0.0336 289   1.470  0.9920
 Step9 - Step16   0.092257 0.0336 289   2.746  0.3539
 Step9 - Step17   0.082110 0.0336 289   2.444  0.5750
 Step9 - Step18   0.073328 0.0336 289   2.183  0.7635
 Step10 - Step11  0.011878 0.0336 289   0.354  1.0000
 Step10 - Step12  0.032712 0.0336 289   0.974  1.0000
 Step10 - Step13  0.069524 0.0336 289   2.069  0.8314
 Step10 - Step14  0.047553 0.0336 289   1.415  0.9948
 Step10 - Step15  0.036694 0.0336 289   1.092  0.9998
 Step10 - Step16  0.079555 0.0336 289   2.368  0.6326
 Step10 - Step17  0.069408 0.0336 289   2.066  0.8333
 Step10 - Step18  0.060626 0.0336 289   1.805  0.9409
 Step11 - Step12  0.020834 0.0336 289   0.620  1.0000
 Step11 - Step13  0.057646 0.0336 289   1.716  0.9622
 Step11 - Step14  0.035675 0.0336 289   1.062  0.9999
 Step11 - Step15  0.024816 0.0336 289   0.739  1.0000
 Step11 - Step16  0.067677 0.0336 289   2.014  0.8600
 Step11 - Step17  0.057530 0.0336 289   1.712  0.9629
 Step11 - Step18  0.048748 0.0336 289   1.451  0.9931
 Step12 - Step13  0.036812 0.0336 289   1.096  0.9998
 Step12 - Step14  0.014841 0.0336 289   0.442  1.0000
 Step12 - Step15  0.003982 0.0336 289   0.119  1.0000
 Step12 - Step16  0.046844 0.0336 289   1.394  0.9956
 Step12 - Step17  0.036696 0.0336 289   1.092  0.9998
 Step12 - Step18  0.027914 0.0336 289   0.831  1.0000
 Step13 - Step14 -0.021971 0.0336 289  -0.654  1.0000
 Step13 - Step15 -0.032830 0.0336 289  -0.977  1.0000
 Step13 - Step16  0.010031 0.0336 289   0.299  1.0000
 Step13 - Step17 -0.000116 0.0336 289  -0.003  1.0000
 Step13 - Step18 -0.008898 0.0336 289  -0.265  1.0000
 Step14 - Step15 -0.010860 0.0336 289  -0.323  1.0000
 Step14 - Step16  0.032002 0.0336 289   0.953  1.0000
 Step14 - Step17  0.021855 0.0336 289   0.651  1.0000
 Step14 - Step18  0.013073 0.0336 289   0.389  1.0000
 Step15 - Step16  0.042862 0.0336 289   1.276  0.9985
 Step15 - Step17  0.032714 0.0336 289   0.974  1.0000
 Step15 - Step18  0.023932 0.0336 289   0.712  1.0000
 Step16 - Step17 -0.010148 0.0336 289  -0.302  1.0000
 Step16 - Step18 -0.018930 0.0336 289  -0.563  1.0000
 Step17 - Step18 -0.008782 0.0336 289  -0.261  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
(Intercept)       Step2       Step3       Step4       Step5       Step6 
 0.84729822  0.01057221 -0.01726047 -0.01897903 -0.01868129 -0.04514604 
      Step7       Step8       Step9      Step10      Step11      Step12 
-0.02482628 -0.06043960 -0.06215989 -0.07486165 -0.08673962 -0.10757336 
     Step13      Step14      Step15      Step16      Step17      Step18 
-0.14438567 -0.12241483 -0.11155518 -0.15441707 -0.14426947 -0.13548749 

Random Effects:
$subject
   (Intercept)
2   0.23686269
3   0.14056269
4  -0.25091267
5  -0.35722401
7  -0.26037530
8   0.47784901
10  1.01008640
11  0.45755492
13 -0.25056942
14 -0.06607123
15 -0.20351636
16  0.04212556
17 -0.11054393
18 -0.01857692
19 -0.36030068
20 -0.24815343
22 -0.32189577
23  0.08309845

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
-2.1070941 -0.9853128 -0.9498442 -1.6010645 -0.7385196 -0.6184307 

=============================================================

--- Mixed - SD - Block 4 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
     Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step 1.7068  0.1004    17   289  4.7411 6.822e-09 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2    0.007507 0.0485 289   0.155  1.0000
 Step1 - Step3    0.011289 0.0485 289   0.233  1.0000
 Step1 - Step4    0.023877 0.0485 289   0.492  1.0000
 Step1 - Step5    0.035562 0.0485 289   0.733  1.0000
 Step1 - Step6    0.021569 0.0485 289   0.445  1.0000
 Step1 - Step7    0.029218 0.0485 289   0.602  1.0000
 Step1 - Step8    0.027924 0.0485 289   0.576  1.0000
 Step1 - Step9    0.053863 0.0485 289   1.110  0.9997
 Step1 - Step10   0.077944 0.0485 289   1.607  0.9798
 Step1 - Step11   0.066793 0.0485 289   1.377  0.9962
 Step1 - Step12   0.135987 0.0485 289   2.803  0.3168
 Step1 - Step13   0.183665 0.0485 289   3.786  0.0209
 Step1 - Step14   0.166552 0.0485 289   3.434  0.0652
 Step1 - Step15   0.135800 0.0485 289   2.800  0.3192
 Step1 - Step16   0.201231 0.0485 289   4.148  0.0055
 Step1 - Step17   0.215160 0.0485 289   4.436  0.0017
 Step1 - Step18   0.164141 0.0485 289   3.384  0.0756
 Step2 - Step3    0.003783 0.0485 289   0.078  1.0000
 Step2 - Step4    0.016370 0.0485 289   0.337  1.0000
 Step2 - Step5    0.028055 0.0485 289   0.578  1.0000
 Step2 - Step6    0.014062 0.0485 289   0.290  1.0000
 Step2 - Step7    0.021712 0.0485 289   0.448  1.0000
 Step2 - Step8    0.020417 0.0485 289   0.421  1.0000
 Step2 - Step9    0.046356 0.0485 289   0.956  1.0000
 Step2 - Step10   0.070437 0.0485 289   1.452  0.9930
 Step2 - Step11   0.059286 0.0485 289   1.222  0.9991
 Step2 - Step12   0.128480 0.0485 289   2.649  0.4216
 Step2 - Step13   0.176159 0.0485 289   3.632  0.0351
 Step2 - Step14   0.159046 0.0485 289   3.279  0.1019
 Step2 - Step15   0.128294 0.0485 289   2.645  0.4244
 Step2 - Step16   0.193725 0.0485 289   3.994  0.0100
 Step2 - Step17   0.207653 0.0485 289   4.281  0.0033
 Step2 - Step18   0.156634 0.0485 289   3.229  0.1166
 Step3 - Step4    0.012588 0.0485 289   0.260  1.0000
 Step3 - Step5    0.024272 0.0485 289   0.500  1.0000
 Step3 - Step6    0.010280 0.0485 289   0.212  1.0000
 Step3 - Step7    0.017929 0.0485 289   0.370  1.0000
 Step3 - Step8    0.016635 0.0485 289   0.343  1.0000
 Step3 - Step9    0.042573 0.0485 289   0.878  1.0000
 Step3 - Step10   0.066654 0.0485 289   1.374  0.9963
 Step3 - Step11   0.055503 0.0485 289   1.144  0.9996
 Step3 - Step12   0.124698 0.0485 289   2.571  0.4789
 Step3 - Step13   0.172376 0.0485 289   3.554  0.0451
 Step3 - Step14   0.155263 0.0485 289   3.201  0.1258
 Step3 - Step15   0.124511 0.0485 289   2.567  0.4818
 Step3 - Step16   0.189942 0.0485 289   3.916  0.0132
 Step3 - Step17   0.203870 0.0485 289   4.203  0.0045
 Step3 - Step18   0.152851 0.0485 289   3.151  0.1432
 Step4 - Step5    0.011684 0.0485 289   0.241  1.0000
 Step4 - Step6   -0.002308 0.0485 289  -0.048  1.0000
 Step4 - Step7    0.005341 0.0485 289   0.110  1.0000
 Step4 - Step8    0.004047 0.0485 289   0.083  1.0000
 Step4 - Step9    0.029986 0.0485 289   0.618  1.0000
 Step4 - Step10   0.054066 0.0485 289   1.115  0.9997
 Step4 - Step11   0.042916 0.0485 289   0.885  1.0000
 Step4 - Step12   0.112110 0.0485 289   2.311  0.6746
 Step4 - Step13   0.159788 0.0485 289   3.294  0.0976
 Step4 - Step14   0.142675 0.0485 289   2.941  0.2369
 Step4 - Step15   0.111923 0.0485 289   2.307  0.6774
 Step4 - Step16   0.177354 0.0485 289   3.656  0.0324
 Step4 - Step17   0.191283 0.0485 289   3.943  0.0120
 Step4 - Step18   0.140264 0.0485 289   2.892  0.2641
 Step5 - Step6   -0.013992 0.0485 289  -0.288  1.0000
 Step5 - Step7   -0.006343 0.0485 289  -0.131  1.0000
 Step5 - Step8   -0.007638 0.0485 289  -0.157  1.0000
 Step5 - Step9    0.018301 0.0485 289   0.377  1.0000
 Step5 - Step10   0.042382 0.0485 289   0.874  1.0000
 Step5 - Step11   0.031231 0.0485 289   0.644  1.0000
 Step5 - Step12   0.100425 0.0485 289   2.070  0.8309
 Step5 - Step13   0.148104 0.0485 289   3.053  0.1827
 Step5 - Step14   0.130991 0.0485 289   2.700  0.3850
 Step5 - Step15   0.100239 0.0485 289   2.066  0.8330
 Step5 - Step16   0.165670 0.0485 289   3.415  0.0689
 Step5 - Step17   0.179598 0.0485 289   3.702  0.0278
 Step5 - Step18   0.128579 0.0485 289   2.651  0.4201
 Step6 - Step7    0.007649 0.0485 289   0.158  1.0000
 Step6 - Step8    0.006355 0.0485 289   0.131  1.0000
 Step6 - Step9    0.032294 0.0485 289   0.666  1.0000
 Step6 - Step10   0.056375 0.0485 289   1.162  0.9995
 Step6 - Step11   0.045224 0.0485 289   0.932  1.0000
 Step6 - Step12   0.114418 0.0485 289   2.359  0.6395
 Step6 - Step13   0.162096 0.0485 289   3.342  0.0853
 Step6 - Step14   0.144983 0.0485 289   2.989  0.2127
 Step6 - Step15   0.114231 0.0485 289   2.355  0.6423
 Step6 - Step16   0.179662 0.0485 289   3.704  0.0277
 Step6 - Step17   0.193591 0.0485 289   3.991  0.0101
 Step6 - Step18   0.142572 0.0485 289   2.939  0.2380
 Step7 - Step8   -0.001295 0.0485 289  -0.027  1.0000
 Step7 - Step9    0.024644 0.0485 289   0.508  1.0000
 Step7 - Step10   0.048725 0.0485 289   1.004  0.9999
 Step7 - Step11   0.037574 0.0485 289   0.775  1.0000
 Step7 - Step12   0.106768 0.0485 289   2.201  0.7514
 Step7 - Step13   0.154447 0.0485 289   3.184  0.1315
 Step7 - Step14   0.137334 0.0485 289   2.831  0.2996
 Step7 - Step15   0.106582 0.0485 289   2.197  0.7539
 Step7 - Step16   0.172013 0.0485 289   3.546  0.0462
 Step7 - Step17   0.185941 0.0485 289   3.833  0.0178
 Step7 - Step18   0.134922 0.0485 289   2.781  0.3307
 Step8 - Step9    0.025939 0.0485 289   0.535  1.0000
 Step8 - Step10   0.050020 0.0485 289   1.031  0.9999
 Step8 - Step11   0.038869 0.0485 289   0.801  1.0000
 Step8 - Step12   0.108063 0.0485 289   2.228  0.7335
 Step8 - Step13   0.155742 0.0485 289   3.211  0.1225
 Step8 - Step14   0.138628 0.0485 289   2.858  0.2835
 Step8 - Step15   0.107876 0.0485 289   2.224  0.7361
 Step8 - Step16   0.173307 0.0485 289   3.573  0.0425
 Step8 - Step17   0.187236 0.0485 289   3.860  0.0162
 Step8 - Step18   0.136217 0.0485 289   2.808  0.3138
 Step9 - Step10   0.024081 0.0485 289   0.496  1.0000
 Step9 - Step11   0.012930 0.0485 289   0.267  1.0000
 Step9 - Step12   0.082124 0.0485 289   1.693  0.9666
 Step9 - Step13   0.129803 0.0485 289   2.676  0.4022
 Step9 - Step14   0.112689 0.0485 289   2.323  0.6658
 Step9 - Step15   0.081937 0.0485 289   1.689  0.9673
 Step9 - Step16   0.147369 0.0485 289   3.038  0.1895
 Step9 - Step17   0.161297 0.0485 289   3.325  0.0894
 Step9 - Step18   0.110278 0.0485 289   2.273  0.7017
 Step10 - Step11 -0.011151 0.0485 289  -0.230  1.0000
 Step10 - Step12  0.058043 0.0485 289   1.197  0.9993
 Step10 - Step13  0.105722 0.0485 289   2.179  0.7655
 Step10 - Step14  0.088609 0.0485 289   1.827  0.9345
 Step10 - Step15  0.057857 0.0485 289   1.193  0.9993
 Step10 - Step16  0.123288 0.0485 289   2.542  0.5008
 Step10 - Step17  0.137216 0.0485 289   2.829  0.3010
 Step10 - Step18  0.086197 0.0485 289   1.777  0.9483
 Step11 - Step12  0.069194 0.0485 289   1.426  0.9943
 Step11 - Step13  0.116873 0.0485 289   2.409  0.6014
 Step11 - Step14  0.099760 0.0485 289   2.057  0.8383
 Step11 - Step15  0.069008 0.0485 289   1.423  0.9945
 Step11 - Step16  0.134439 0.0485 289   2.772  0.3372
 Step11 - Step17  0.148367 0.0485 289   3.059  0.1803
 Step11 - Step18  0.097348 0.0485 289   2.007  0.8637
 Step12 - Step13  0.047678 0.0485 289   0.983  1.0000
 Step12 - Step14  0.030565 0.0485 289   0.630  1.0000
 Step12 - Step15 -0.000187 0.0485 289  -0.004  1.0000
 Step12 - Step16  0.065244 0.0485 289   1.345  0.9971
 Step12 - Step17  0.079173 0.0485 289   1.632  0.9765
 Step12 - Step18  0.028154 0.0485 289   0.580  1.0000
 Step13 - Step14 -0.017113 0.0485 289  -0.353  1.0000
 Step13 - Step15 -0.047865 0.0485 289  -0.987  0.9999
 Step13 - Step16  0.017566 0.0485 289   0.362  1.0000
 Step13 - Step17  0.031494 0.0485 289   0.649  1.0000
 Step13 - Step18 -0.019525 0.0485 289  -0.403  1.0000
 Step14 - Step15 -0.030752 0.0485 289  -0.634  1.0000
 Step14 - Step16  0.034679 0.0485 289   0.715  1.0000
 Step14 - Step17  0.048608 0.0485 289   1.002  0.9999
 Step14 - Step18 -0.002411 0.0485 289  -0.050  1.0000
 Step15 - Step16  0.065431 0.0485 289   1.349  0.9970
 Step15 - Step17  0.079360 0.0485 289   1.636  0.9759
 Step15 - Step18  0.028340 0.0485 289   0.584  1.0000
 Step16 - Step17  0.013928 0.0485 289   0.287  1.0000
 Step16 - Step18 -0.037091 0.0485 289  -0.765  1.0000
 Step17 - Step18 -0.051019 0.0485 289  -1.052  0.9999

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 1.546187223 -0.007506652 -0.011289454 -0.023877137 -0.035561495 -0.021569017 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.029218490 -0.027923969 -0.053862753 -0.077943517 -0.066792657 -0.135986973 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.183665476 -0.166552178 -0.135800239 -0.201231423 -0.215159900 -0.164140685 

Random Effects:
$subject
   (Intercept)
2  -0.20444388
3   0.16793208
4  -0.52273921
5  -0.76710749
7   0.19331618
8   0.93172801
10  1.83374291
11  0.75301851
13 -0.33530390
14 -0.01222930
15 -0.38026005
16  0.01250088
17 -0.37972232
18  0.29008591
19 -0.67066623
20 -0.53197340
22 -0.68132186
23  0.30344316

with conditional variances for "subject" 

Sample Scaled Residuals:
         1          2          3          4          5          6 
 0.2470682  0.6430676 -0.1631906 -0.1460216  0.3377222 -0.2740907 

=============================================================

--- Mixed - SD - Block 5 - Axis X ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
       Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
Step 0.065754 0.0038679    17   289  1.1268 0.3271

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -6.42e-04 0.0195 289  -0.033  1.0000
 Step1 - Step3   -7.62e-03 0.0195 289  -0.390  1.0000
 Step1 - Step4    7.08e-03 0.0195 289   0.363  1.0000
 Step1 - Step5    8.37e-03 0.0195 289   0.428  1.0000
 Step1 - Step6   -1.51e-02 0.0195 289  -0.775  1.0000
 Step1 - Step7    9.12e-03 0.0195 289   0.467  1.0000
 Step1 - Step8    1.58e-02 0.0195 289   0.807  1.0000
 Step1 - Step9    1.69e-02 0.0195 289   0.866  1.0000
 Step1 - Step10   1.18e-02 0.0195 289   0.603  1.0000
 Step1 - Step11   1.26e-02 0.0195 289   0.648  1.0000
 Step1 - Step12   2.44e-02 0.0195 289   1.250  0.9988
 Step1 - Step13   2.52e-02 0.0195 289   1.290  0.9982
 Step1 - Step14   2.53e-02 0.0195 289   1.295  0.9982
 Step1 - Step15   3.04e-02 0.0195 289   1.556  0.9854
 Step1 - Step16   3.04e-02 0.0195 289   1.559  0.9852
 Step1 - Step17   3.69e-02 0.0195 289   1.890  0.9133
 Step1 - Step18   3.37e-02 0.0195 289   1.725  0.9603
 Step2 - Step3   -6.98e-03 0.0195 289  -0.357  1.0000
 Step2 - Step4    7.73e-03 0.0195 289   0.396  1.0000
 Step2 - Step5    9.01e-03 0.0195 289   0.461  1.0000
 Step2 - Step6   -1.45e-02 0.0195 289  -0.742  1.0000
 Step2 - Step7    9.76e-03 0.0195 289   0.500  1.0000
 Step2 - Step8    1.64e-02 0.0195 289   0.840  1.0000
 Step2 - Step9    1.76e-02 0.0195 289   0.899  1.0000
 Step2 - Step10   1.24e-02 0.0195 289   0.636  1.0000
 Step2 - Step11   1.33e-02 0.0195 289   0.680  1.0000
 Step2 - Step12   2.51e-02 0.0195 289   1.283  0.9983
 Step2 - Step13   2.58e-02 0.0195 289   1.323  0.9976
 Step2 - Step14   2.59e-02 0.0195 289   1.328  0.9975
 Step2 - Step15   3.10e-02 0.0195 289   1.589  0.9819
 Step2 - Step16   3.11e-02 0.0195 289   1.591  0.9817
 Step2 - Step17   3.76e-02 0.0195 289   1.923  0.9008
 Step2 - Step18   3.43e-02 0.0195 289   1.758  0.9530
 Step3 - Step4    1.47e-02 0.0195 289   0.753  1.0000
 Step3 - Step5    1.60e-02 0.0195 289   0.819  1.0000
 Step3 - Step6   -7.52e-03 0.0195 289  -0.385  1.0000
 Step3 - Step7    1.67e-02 0.0195 289   0.857  1.0000
 Step3 - Step8    2.34e-02 0.0195 289   1.198  0.9993
 Step3 - Step9    2.45e-02 0.0195 289   1.256  0.9987
 Step3 - Step10   1.94e-02 0.0195 289   0.994  0.9999
 Step3 - Step11   2.03e-02 0.0195 289   1.038  0.9999
 Step3 - Step12   3.20e-02 0.0195 289   1.641  0.9753
 Step3 - Step13   3.28e-02 0.0195 289   1.681  0.9689
 Step3 - Step14   3.29e-02 0.0195 289   1.685  0.9681
 Step3 - Step15   3.80e-02 0.0195 289   1.947  0.8911
 Step3 - Step16   3.81e-02 0.0195 289   1.949  0.8902
 Step3 - Step17   4.45e-02 0.0195 289   2.281  0.6967
 Step3 - Step18   4.13e-02 0.0195 289   2.115  0.8053
 Step4 - Step5    1.28e-03 0.0195 289   0.066  1.0000
 Step4 - Step6   -2.22e-02 0.0195 289  -1.138  0.9996
 Step4 - Step7    2.03e-03 0.0195 289   0.104  1.0000
 Step4 - Step8    8.68e-03 0.0195 289   0.445  1.0000
 Step4 - Step9    9.82e-03 0.0195 289   0.503  1.0000
 Step4 - Step10   4.70e-03 0.0195 289   0.241  1.0000
 Step4 - Step11   5.56e-03 0.0195 289   0.285  1.0000
 Step4 - Step12   1.73e-02 0.0195 289   0.888  1.0000
 Step4 - Step13   1.81e-02 0.0195 289   0.928  1.0000
 Step4 - Step14   1.82e-02 0.0195 289   0.932  1.0000
 Step4 - Step15   2.33e-02 0.0195 289   1.194  0.9993
 Step4 - Step16   2.34e-02 0.0195 289   1.196  0.9993
 Step4 - Step17   2.98e-02 0.0195 289   1.527  0.9880
 Step4 - Step18   2.66e-02 0.0195 289   1.362  0.9966
 Step5 - Step6   -2.35e-02 0.0195 289  -1.204  0.9993
 Step5 - Step7    7.52e-04 0.0195 289   0.039  1.0000
 Step5 - Step8    7.40e-03 0.0195 289   0.379  1.0000
 Step5 - Step9    8.54e-03 0.0195 289   0.438  1.0000
 Step5 - Step10   3.42e-03 0.0195 289   0.175  1.0000
 Step5 - Step11   4.28e-03 0.0195 289   0.219  1.0000
 Step5 - Step12   1.61e-02 0.0195 289   0.822  1.0000
 Step5 - Step13   1.68e-02 0.0195 289   0.862  1.0000
 Step5 - Step14   1.69e-02 0.0195 289   0.866  1.0000
 Step5 - Step15   2.20e-02 0.0195 289   1.128  0.9997
 Step5 - Step16   2.21e-02 0.0195 289   1.130  0.9997
 Step5 - Step17   2.85e-02 0.0195 289   1.462  0.9925
 Step5 - Step18   2.53e-02 0.0195 289   1.297  0.9981
 Step6 - Step7    2.43e-02 0.0195 289   1.242  0.9989
 Step6 - Step8    3.09e-02 0.0195 289   1.583  0.9827
 Step6 - Step9    3.21e-02 0.0195 289   1.641  0.9752
 Step6 - Step10   2.69e-02 0.0195 289   1.379  0.9961
 Step6 - Step11   2.78e-02 0.0195 289   1.423  0.9945
 Step6 - Step12   3.96e-02 0.0195 289   2.026  0.8544
 Step6 - Step13   4.03e-02 0.0195 289   2.066  0.8335
 Step6 - Step14   4.04e-02 0.0195 289   2.070  0.8310
 Step6 - Step15   4.55e-02 0.0195 289   2.332  0.6595
 Step6 - Step16   4.56e-02 0.0195 289   2.334  0.6580
 Step6 - Step17   5.21e-02 0.0195 289   2.666  0.4095
 Step6 - Step18   4.88e-02 0.0195 289   2.500  0.5322
 Step7 - Step8    6.65e-03 0.0195 289   0.341  1.0000
 Step7 - Step9    7.79e-03 0.0195 289   0.399  1.0000
 Step7 - Step10   2.67e-03 0.0195 289   0.136  1.0000
 Step7 - Step11   3.53e-03 0.0195 289   0.181  1.0000
 Step7 - Step12   1.53e-02 0.0195 289   0.784  1.0000
 Step7 - Step13   1.61e-02 0.0195 289   0.823  1.0000
 Step7 - Step14   1.62e-02 0.0195 289   0.828  1.0000
 Step7 - Step15   2.13e-02 0.0195 289   1.090  0.9998
 Step7 - Step16   2.13e-02 0.0195 289   1.092  0.9998
 Step7 - Step17   2.78e-02 0.0195 289   1.423  0.9944
 Step7 - Step18   2.46e-02 0.0195 289   1.258  0.9987
 Step8 - Step9    1.14e-03 0.0195 289   0.058  1.0000
 Step8 - Step10  -3.99e-03 0.0195 289  -0.204  1.0000
 Step8 - Step11  -3.12e-03 0.0195 289  -0.160  1.0000
 Step8 - Step12   8.65e-03 0.0195 289   0.443  1.0000
 Step8 - Step13   9.43e-03 0.0195 289   0.483  1.0000
 Step8 - Step14   9.52e-03 0.0195 289   0.487  1.0000
 Step8 - Step15   1.46e-02 0.0195 289   0.749  1.0000
 Step8 - Step16   1.47e-02 0.0195 289   0.751  1.0000
 Step8 - Step17   2.11e-02 0.0195 289   1.083  0.9998
 Step8 - Step18   1.79e-02 0.0195 289   0.918  1.0000
 Step9 - Step10  -5.13e-03 0.0195 289  -0.263  1.0000
 Step9 - Step11  -4.26e-03 0.0195 289  -0.218  1.0000
 Step9 - Step12   7.51e-03 0.0195 289   0.385  1.0000
 Step9 - Step13   8.29e-03 0.0195 289   0.424  1.0000
 Step9 - Step14   8.38e-03 0.0195 289   0.429  1.0000
 Step9 - Step15   1.35e-02 0.0195 289   0.691  1.0000
 Step9 - Step16   1.35e-02 0.0195 289   0.693  1.0000
 Step9 - Step17   2.00e-02 0.0195 289   1.024  0.9999
 Step9 - Step18   1.68e-02 0.0195 289   0.859  1.0000
 Step10 - Step11  8.63e-04 0.0195 289   0.044  1.0000
 Step10 - Step12  1.26e-02 0.0195 289   0.647  1.0000
 Step10 - Step13  1.34e-02 0.0195 289   0.687  1.0000
 Step10 - Step14  1.35e-02 0.0195 289   0.691  1.0000
 Step10 - Step15  1.86e-02 0.0195 289   0.953  1.0000
 Step10 - Step16  1.87e-02 0.0195 289   0.955  1.0000
 Step10 - Step17  2.51e-02 0.0195 289   1.287  0.9983
 Step10 - Step18  2.19e-02 0.0195 289   1.122  0.9997
 Step11 - Step12  1.18e-02 0.0195 289   0.603  1.0000
 Step11 - Step13  1.26e-02 0.0195 289   0.643  1.0000
 Step11 - Step14  1.26e-02 0.0195 289   0.647  1.0000
 Step11 - Step15  1.77e-02 0.0195 289   0.909  1.0000
 Step11 - Step16  1.78e-02 0.0195 289   0.911  1.0000
 Step11 - Step17  2.43e-02 0.0195 289   1.243  0.9989
 Step11 - Step18  2.10e-02 0.0195 289   1.077  0.9998
 Step12 - Step13  7.79e-04 0.0195 289   0.040  1.0000
 Step12 - Step14  8.65e-04 0.0195 289   0.044  1.0000
 Step12 - Step15  5.98e-03 0.0195 289   0.306  1.0000
 Step12 - Step16  6.02e-03 0.0195 289   0.308  1.0000
 Step12 - Step17  1.25e-02 0.0195 289   0.640  1.0000
 Step12 - Step18  9.27e-03 0.0195 289   0.475  1.0000
 Step13 - Step14  8.60e-05 0.0195 289   0.004  1.0000
 Step13 - Step15  5.20e-03 0.0195 289   0.266  1.0000
 Step13 - Step16  5.24e-03 0.0195 289   0.268  1.0000
 Step13 - Step17  1.17e-02 0.0195 289   0.600  1.0000
 Step13 - Step18  8.49e-03 0.0195 289   0.435  1.0000
 Step14 - Step15  5.11e-03 0.0195 289   0.262  1.0000
 Step14 - Step16  5.15e-03 0.0195 289   0.264  1.0000
 Step14 - Step17  1.16e-02 0.0195 289   0.596  1.0000
 Step14 - Step18  8.40e-03 0.0195 289   0.430  1.0000
 Step15 - Step16  4.23e-05 0.0195 289   0.002  1.0000
 Step15 - Step17  6.52e-03 0.0195 289   0.334  1.0000
 Step15 - Step18  3.29e-03 0.0195 289   0.169  1.0000
 Step16 - Step17  6.48e-03 0.0195 289   0.332  1.0000
 Step16 - Step18  3.25e-03 0.0195 289   0.166  1.0000
 Step17 - Step18 -3.23e-03 0.0195 289  -0.165  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 0.6416571230  0.0006422534  0.0076217536 -0.0070849041 -0.0083650595 
        Step6         Step7         Step8         Step9        Step10 
 0.0151410671 -0.0091173718 -0.0157683118 -0.0169096281 -0.0117825693 
       Step11        Step12        Step13        Step14        Step15 
-0.0126458434 -0.0244196584 -0.0251987634 -0.0252847810 -0.0303950162 
       Step16        Step17        Step18 
-0.0304373015 -0.0369146344 -0.0336866821 

Random Effects:
$subject
   (Intercept)
2   0.04809144
3  -0.07132608
4  -0.11918782
5  -0.29774643
7  -0.24606343
8   0.46188258
10  0.62466687
11  0.04343660
13 -0.05255563
14  0.01584357
15  0.18357038
16 -0.09157103
17 -0.11897484
18 -0.07984503
19 -0.25669845
20 -0.14841635
22 -0.13052233
23  0.23541597

with conditional variances for "subject" 

Sample Scaled Residuals:
        1         2         3         4         5         6 
1.1699274 2.0613735 1.4959752 1.3834955 1.4460097 0.3626504 

=============================================================

--- Mixed - SD - Block 5 - Axis Y ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq  Mean Sq NumDF DenDF F value Pr(>F)
Step 0.69634 0.040961    17   289   1.261  0.217

Pairwise Comparisons:
 contrast        estimate     SE  df t.ratio p.value
 Step1 - Step2    0.00040 0.0601 289   0.007  1.0000
 Step1 - Step3   -0.05436 0.0601 289  -0.905  1.0000
 Step1 - Step4   -0.02137 0.0601 289  -0.356  1.0000
 Step1 - Step5   -0.02281 0.0601 289  -0.380  1.0000
 Step1 - Step6   -0.09259 0.0601 289  -1.541  0.9868
 Step1 - Step7   -0.03412 0.0601 289  -0.568  1.0000
 Step1 - Step8   -0.02781 0.0601 289  -0.463  1.0000
 Step1 - Step9    0.00560 0.0601 289   0.093  1.0000
 Step1 - Step10   0.00878 0.0601 289   0.146  1.0000
 Step1 - Step11  -0.01623 0.0601 289  -0.270  1.0000
 Step1 - Step12   0.01316 0.0601 289   0.219  1.0000
 Step1 - Step13  -0.02955 0.0601 289  -0.492  1.0000
 Step1 - Step14   0.02652 0.0601 289   0.441  1.0000
 Step1 - Step15   0.05532 0.0601 289   0.921  1.0000
 Step1 - Step16   0.02211 0.0601 289   0.368  1.0000
 Step1 - Step17   0.10540 0.0601 289   1.754  0.9538
 Step1 - Step18   0.08659 0.0601 289   1.441  0.9936
 Step2 - Step3   -0.05476 0.0601 289  -0.912  1.0000
 Step2 - Step4   -0.02177 0.0601 289  -0.362  1.0000
 Step2 - Step5   -0.02321 0.0601 289  -0.386  1.0000
 Step2 - Step6   -0.09299 0.0601 289  -1.548  0.9862
 Step2 - Step7   -0.03452 0.0601 289  -0.575  1.0000
 Step2 - Step8   -0.02821 0.0601 289  -0.470  1.0000
 Step2 - Step9    0.00520 0.0601 289   0.087  1.0000
 Step2 - Step10   0.00838 0.0601 289   0.139  1.0000
 Step2 - Step11  -0.01663 0.0601 289  -0.277  1.0000
 Step2 - Step12   0.01276 0.0601 289   0.212  1.0000
 Step2 - Step13  -0.02994 0.0601 289  -0.498  1.0000
 Step2 - Step14   0.02612 0.0601 289   0.435  1.0000
 Step2 - Step15   0.05492 0.0601 289   0.914  1.0000
 Step2 - Step16   0.02171 0.0601 289   0.361  1.0000
 Step2 - Step17   0.10500 0.0601 289   1.748  0.9553
 Step2 - Step18   0.08619 0.0601 289   1.435  0.9939
 Step3 - Step4    0.03300 0.0601 289   0.549  1.0000
 Step3 - Step5    0.03155 0.0601 289   0.525  1.0000
 Step3 - Step6   -0.03823 0.0601 289  -0.636  1.0000
 Step3 - Step7    0.02024 0.0601 289   0.337  1.0000
 Step3 - Step8    0.02656 0.0601 289   0.442  1.0000
 Step3 - Step9    0.05997 0.0601 289   0.998  0.9999
 Step3 - Step10   0.06314 0.0601 289   1.051  0.9999
 Step3 - Step11   0.03814 0.0601 289   0.635  1.0000
 Step3 - Step12   0.06752 0.0601 289   1.124  0.9997
 Step3 - Step13   0.02482 0.0601 289   0.413  1.0000
 Step3 - Step14   0.08088 0.0601 289   1.346  0.9971
 Step3 - Step15   0.10968 0.0601 289   1.826  0.9348
 Step3 - Step16   0.07647 0.0601 289   1.273  0.9985
 Step3 - Step17   0.15976 0.0601 289   2.659  0.4140
 Step3 - Step18   0.14095 0.0601 289   2.346  0.6488
 Step4 - Step5   -0.00144 0.0601 289  -0.024  1.0000
 Step4 - Step6   -0.07123 0.0601 289  -1.186  0.9994
 Step4 - Step7   -0.01276 0.0601 289  -0.212  1.0000
 Step4 - Step8   -0.00644 0.0601 289  -0.107  1.0000
 Step4 - Step9    0.02697 0.0601 289   0.449  1.0000
 Step4 - Step10   0.03015 0.0601 289   0.502  1.0000
 Step4 - Step11   0.00514 0.0601 289   0.086  1.0000
 Step4 - Step12   0.03453 0.0601 289   0.575  1.0000
 Step4 - Step13  -0.00818 0.0601 289  -0.136  1.0000
 Step4 - Step14   0.04789 0.0601 289   0.797  1.0000
 Step4 - Step15   0.07669 0.0601 289   1.276  0.9984
 Step4 - Step16   0.04348 0.0601 289   0.724  1.0000
 Step4 - Step17   0.12677 0.0601 289   2.110  0.8083
 Step4 - Step18   0.10796 0.0601 289   1.797  0.9430
 Step5 - Step6   -0.06978 0.0601 289  -1.162  0.9995
 Step5 - Step7   -0.01132 0.0601 289  -0.188  1.0000
 Step5 - Step8   -0.00500 0.0601 289  -0.083  1.0000
 Step5 - Step9    0.02841 0.0601 289   0.473  1.0000
 Step5 - Step10   0.03159 0.0601 289   0.526  1.0000
 Step5 - Step11   0.00658 0.0601 289   0.110  1.0000
 Step5 - Step12   0.03597 0.0601 289   0.599  1.0000
 Step5 - Step13  -0.00674 0.0601 289  -0.112  1.0000
 Step5 - Step14   0.04933 0.0601 289   0.821  1.0000
 Step5 - Step15   0.07813 0.0601 289   1.300  0.9981
 Step5 - Step16   0.04492 0.0601 289   0.748  1.0000
 Step5 - Step17   0.12821 0.0601 289   2.134  0.7940
 Step5 - Step18   0.10940 0.0601 289   1.821  0.9362
 Step6 - Step7    0.05847 0.0601 289   0.973  1.0000
 Step6 - Step8    0.06479 0.0601 289   1.078  0.9998
 Step6 - Step9    0.09820 0.0601 289   1.635  0.9761
 Step6 - Step10   0.10137 0.0601 289   1.687  0.9676
 Step6 - Step11   0.07637 0.0601 289   1.271  0.9985
 Step6 - Step12   0.10575 0.0601 289   1.760  0.9524
 Step6 - Step13   0.06305 0.0601 289   1.049  0.9999
 Step6 - Step14   0.11911 0.0601 289   1.983  0.8752
 Step6 - Step15   0.14791 0.0601 289   2.462  0.5613
 Step6 - Step16   0.11471 0.0601 289   1.909  0.9062
 Step6 - Step17   0.19799 0.0601 289   3.296  0.0972
 Step6 - Step18   0.17918 0.0601 289   2.983  0.2158
 Step7 - Step8    0.00632 0.0601 289   0.105  1.0000
 Step7 - Step9    0.03973 0.0601 289   0.661  1.0000
 Step7 - Step10   0.04290 0.0601 289   0.714  1.0000
 Step7 - Step11   0.01790 0.0601 289   0.298  1.0000
 Step7 - Step12   0.04729 0.0601 289   0.787  1.0000
 Step7 - Step13   0.00458 0.0601 289   0.076  1.0000
 Step7 - Step14   0.06064 0.0601 289   1.009  0.9999
 Step7 - Step15   0.08944 0.0601 289   1.489  0.9909
 Step7 - Step16   0.05624 0.0601 289   0.936  1.0000
 Step7 - Step17   0.13952 0.0601 289   2.322  0.6664
 Step7 - Step18   0.12071 0.0601 289   2.009  0.8625
 Step8 - Step9    0.03341 0.0601 289   0.556  1.0000
 Step8 - Step10   0.03659 0.0601 289   0.609  1.0000
 Step8 - Step11   0.01158 0.0601 289   0.193  1.0000
 Step8 - Step12   0.04097 0.0601 289   0.682  1.0000
 Step8 - Step13  -0.00174 0.0601 289  -0.029  1.0000
 Step8 - Step14   0.05433 0.0601 289   0.904  1.0000
 Step8 - Step15   0.08313 0.0601 289   1.384  0.9960
 Step8 - Step16   0.04992 0.0601 289   0.831  1.0000
 Step8 - Step17   0.13321 0.0601 289   2.217  0.7406
 Step8 - Step18   0.11440 0.0601 289   1.904  0.9081
 Step9 - Step10   0.00318 0.0601 289   0.053  1.0000
 Step9 - Step11  -0.02183 0.0601 289  -0.363  1.0000
 Step9 - Step12   0.00756 0.0601 289   0.126  1.0000
 Step9 - Step13  -0.03515 0.0601 289  -0.585  1.0000
 Step9 - Step14   0.02092 0.0601 289   0.348  1.0000
 Step9 - Step15   0.04972 0.0601 289   0.828  1.0000
 Step9 - Step16   0.01651 0.0601 289   0.275  1.0000
 Step9 - Step17   0.09980 0.0601 289   1.661  0.9721
 Step9 - Step18   0.08099 0.0601 289   1.348  0.9970
 Step10 - Step11 -0.02501 0.0601 289  -0.416  1.0000
 Step10 - Step12  0.00438 0.0601 289   0.073  1.0000
 Step10 - Step13 -0.03832 0.0601 289  -0.638  1.0000
 Step10 - Step14  0.01774 0.0601 289   0.295  1.0000
 Step10 - Step15  0.04654 0.0601 289   0.775  1.0000
 Step10 - Step16  0.01333 0.0601 289   0.222  1.0000
 Step10 - Step17  0.09662 0.0601 289   1.608  0.9797
 Step10 - Step18  0.07781 0.0601 289   1.295  0.9981
 Step11 - Step12  0.02939 0.0601 289   0.489  1.0000
 Step11 - Step13 -0.01332 0.0601 289  -0.222  1.0000
 Step11 - Step14  0.04275 0.0601 289   0.712  1.0000
 Step11 - Step15  0.07155 0.0601 289   1.191  0.9993
 Step11 - Step16  0.03834 0.0601 289   0.638  1.0000
 Step11 - Step17  0.12163 0.0601 289   2.025  0.8550
 Step11 - Step18  0.10282 0.0601 289   1.711  0.9631
 Step12 - Step13 -0.04271 0.0601 289  -0.711  1.0000
 Step12 - Step14  0.01336 0.0601 289   0.222  1.0000
 Step12 - Step15  0.04216 0.0601 289   0.702  1.0000
 Step12 - Step16  0.00895 0.0601 289   0.149  1.0000
 Step12 - Step17  0.09224 0.0601 289   1.535  0.9873
 Step12 - Step18  0.07343 0.0601 289   1.222  0.9991
 Step13 - Step14  0.05606 0.0601 289   0.933  1.0000
 Step13 - Step15  0.08486 0.0601 289   1.413  0.9949
 Step13 - Step16  0.05166 0.0601 289   0.860  1.0000
 Step13 - Step17  0.13494 0.0601 289   2.246  0.7208
 Step13 - Step18  0.11614 0.0601 289   1.933  0.8967
 Step14 - Step15  0.02880 0.0601 289   0.479  1.0000
 Step14 - Step16 -0.00441 0.0601 289  -0.073  1.0000
 Step14 - Step17  0.07888 0.0601 289   1.313  0.9978
 Step14 - Step18  0.06007 0.0601 289   1.000  0.9999
 Step15 - Step16 -0.03321 0.0601 289  -0.553  1.0000
 Step15 - Step17  0.05008 0.0601 289   0.834  1.0000
 Step15 - Step18  0.03127 0.0601 289   0.521  1.0000
 Step16 - Step17  0.08329 0.0601 289   1.386  0.9959
 Step16 - Step18  0.06448 0.0601 289   1.073  0.9998
 Step17 - Step18 -0.01881 0.0601 289  -0.313  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
  (Intercept)         Step2         Step3         Step4         Step5 
 0.7164847082 -0.0003997668  0.0543621459  0.0213668393  0.0228089934 
        Step6         Step7         Step8         Step9        Step10 
 0.0925934920  0.0341243851  0.0278068363 -0.0056034314 -0.0087796362 
       Step11        Step12        Step13        Step14        Step15 
 0.0162264815 -0.0131610538  0.0295452020 -0.0265188585 -0.0553189413 
       Step16        Step17        Step18 
-0.0221122733 -0.1053993706 -0.0865899610 

Random Effects:
$subject
    (Intercept)
2   0.231870708
3   0.031041493
4  -0.202542504
5  -0.382931103
7  -0.145524181
8   0.267665349
10  0.444212727
11 -0.193619476
13 -0.110748426
14 -0.095764829
15  0.009626768
16 -0.038985325
17 -0.118293557
18 -0.168432315
19 -0.375329567
20 -0.362454336
22 -0.280901193
23  1.491109765

with conditional variances for "subject" 

Sample Scaled Residuals:
          1           2           3           4           5           6 
 0.53586800  0.64293419  0.09449059  0.43919461  0.43030755 -0.15644541 

=============================================================

--- Mixed - SD - Block 5 - Axis Z ---
ANOVA:
Type III Analysis of Variance Table with Satterthwaite's method
      Sum Sq   Mean Sq NumDF DenDF F value Pr(>F)
Step 0.13543 0.0079664    17   289  0.5164 0.9442

Pairwise Comparisons:
 contrast         estimate     SE  df t.ratio p.value
 Step1 - Step2   -9.59e-03 0.0414 289  -0.232  1.0000
 Step1 - Step3   -2.16e-02 0.0414 289  -0.521  1.0000
 Step1 - Step4    1.55e-03 0.0414 289   0.038  1.0000
 Step1 - Step5    1.06e-02 0.0414 289   0.255  1.0000
 Step1 - Step6   -1.09e-02 0.0414 289  -0.264  1.0000
 Step1 - Step7    7.29e-03 0.0414 289   0.176  1.0000
 Step1 - Step8    7.48e-03 0.0414 289   0.181  1.0000
 Step1 - Step9    2.71e-02 0.0414 289   0.655  1.0000
 Step1 - Step10   1.76e-02 0.0414 289   0.424  1.0000
 Step1 - Step11  -7.29e-03 0.0414 289  -0.176  1.0000
 Step1 - Step12   2.69e-02 0.0414 289   0.649  1.0000
 Step1 - Step13   2.42e-02 0.0414 289   0.585  1.0000
 Step1 - Step14   4.57e-02 0.0414 289   1.104  0.9998
 Step1 - Step15   3.15e-02 0.0414 289   0.762  1.0000
 Step1 - Step16   1.75e-02 0.0414 289   0.423  1.0000
 Step1 - Step17   5.36e-02 0.0414 289   1.295  0.9982
 Step1 - Step18   4.30e-02 0.0414 289   1.038  0.9999
 Step2 - Step3   -1.20e-02 0.0414 289  -0.290  1.0000
 Step2 - Step4    1.11e-02 0.0414 289   0.269  1.0000
 Step2 - Step5    2.01e-02 0.0414 289   0.487  1.0000
 Step2 - Step6   -1.32e-03 0.0414 289  -0.032  1.0000
 Step2 - Step7    1.69e-02 0.0414 289   0.408  1.0000
 Step2 - Step8    1.71e-02 0.0414 289   0.412  1.0000
 Step2 - Step9    3.67e-02 0.0414 289   0.886  1.0000
 Step2 - Step10   2.71e-02 0.0414 289   0.656  1.0000
 Step2 - Step11   2.29e-03 0.0414 289   0.055  1.0000
 Step2 - Step12   3.65e-02 0.0414 289   0.881  1.0000
 Step2 - Step13   3.38e-02 0.0414 289   0.817  1.0000
 Step2 - Step14   5.53e-02 0.0414 289   1.336  0.9973
 Step2 - Step15   4.11e-02 0.0414 289   0.993  0.9999
 Step2 - Step16   2.71e-02 0.0414 289   0.654  1.0000
 Step2 - Step17   6.32e-02 0.0414 289   1.526  0.9881
 Step2 - Step18   5.25e-02 0.0414 289   1.269  0.9986
 Step3 - Step4    2.31e-02 0.0414 289   0.559  1.0000
 Step3 - Step5    3.21e-02 0.0414 289   0.776  1.0000
 Step3 - Step6    1.07e-02 0.0414 289   0.258  1.0000
 Step3 - Step7    2.89e-02 0.0414 289   0.697  1.0000
 Step3 - Step8    2.91e-02 0.0414 289   0.702  1.0000
 Step3 - Step9    4.87e-02 0.0414 289   1.176  0.9994
 Step3 - Step10   3.91e-02 0.0414 289   0.945  1.0000
 Step3 - Step11   1.43e-02 0.0414 289   0.345  1.0000
 Step3 - Step12   4.85e-02 0.0414 289   1.171  0.9995
 Step3 - Step13   4.58e-02 0.0414 289   1.106  0.9998
 Step3 - Step14   6.73e-02 0.0414 289   1.625  0.9775
 Step3 - Step15   5.31e-02 0.0414 289   1.283  0.9984
 Step3 - Step16   3.91e-02 0.0414 289   0.944  1.0000
 Step3 - Step17   7.52e-02 0.0414 289   1.816  0.9377
 Step3 - Step18   6.45e-02 0.0414 289   1.559  0.9852
 Step4 - Step5    9.00e-03 0.0414 289   0.218  1.0000
 Step4 - Step6   -1.25e-02 0.0414 289  -0.301  1.0000
 Step4 - Step7    5.74e-03 0.0414 289   0.139  1.0000
 Step4 - Step8    5.93e-03 0.0414 289   0.143  1.0000
 Step4 - Step9    2.55e-02 0.0414 289   0.617  1.0000
 Step4 - Step10   1.60e-02 0.0414 289   0.387  1.0000
 Step4 - Step11  -8.85e-03 0.0414 289  -0.214  1.0000
 Step4 - Step12   2.53e-02 0.0414 289   0.612  1.0000
 Step4 - Step13   2.27e-02 0.0414 289   0.548  1.0000
 Step4 - Step14   4.42e-02 0.0414 289   1.066  0.9998
 Step4 - Step15   3.00e-02 0.0414 289   0.724  1.0000
 Step4 - Step16   1.59e-02 0.0414 289   0.385  1.0000
 Step4 - Step17   5.20e-02 0.0414 289   1.257  0.9987
 Step4 - Step18   4.14e-02 0.0414 289   1.000  0.9999
 Step5 - Step6   -2.15e-02 0.0414 289  -0.519  1.0000
 Step5 - Step7   -3.27e-03 0.0414 289  -0.079  1.0000
 Step5 - Step8   -3.08e-03 0.0414 289  -0.074  1.0000
 Step5 - Step9    1.65e-02 0.0414 289   0.400  1.0000
 Step5 - Step10   7.00e-03 0.0414 289   0.169  1.0000
 Step5 - Step11  -1.79e-02 0.0414 289  -0.431  1.0000
 Step5 - Step12   1.63e-02 0.0414 289   0.394  1.0000
 Step5 - Step13   1.37e-02 0.0414 289   0.330  1.0000
 Step5 - Step14   3.51e-02 0.0414 289   0.849  1.0000
 Step5 - Step15   2.10e-02 0.0414 289   0.507  1.0000
 Step5 - Step16   6.94e-03 0.0414 289   0.168  1.0000
 Step5 - Step17   4.30e-02 0.0414 289   1.040  0.9999
 Step5 - Step18   3.24e-02 0.0414 289   0.783  1.0000
 Step6 - Step7    1.82e-02 0.0414 289   0.440  1.0000
 Step6 - Step8    1.84e-02 0.0414 289   0.444  1.0000
 Step6 - Step9    3.80e-02 0.0414 289   0.918  1.0000
 Step6 - Step10   2.85e-02 0.0414 289   0.688  1.0000
 Step6 - Step11   3.62e-03 0.0414 289   0.087  1.0000
 Step6 - Step12   3.78e-02 0.0414 289   0.913  1.0000
 Step6 - Step13   3.51e-02 0.0414 289   0.849  1.0000
 Step6 - Step14   5.66e-02 0.0414 289   1.368  0.9965
 Step6 - Step15   4.24e-02 0.0414 289   1.025  0.9999
 Step6 - Step16   2.84e-02 0.0414 289   0.686  1.0000
 Step6 - Step17   6.45e-02 0.0414 289   1.558  0.9852
 Step6 - Step18   5.39e-02 0.0414 289   1.301  0.9980
 Step7 - Step8    1.89e-04 0.0414 289   0.005  1.0000
 Step7 - Step9    1.98e-02 0.0414 289   0.479  1.0000
 Step7 - Step10   1.03e-02 0.0414 289   0.248  1.0000
 Step7 - Step11  -1.46e-02 0.0414 289  -0.352  1.0000
 Step7 - Step12   1.96e-02 0.0414 289   0.473  1.0000
 Step7 - Step13   1.69e-02 0.0414 289   0.409  1.0000
 Step7 - Step14   3.84e-02 0.0414 289   0.928  1.0000
 Step7 - Step15   2.42e-02 0.0414 289   0.586  1.0000
 Step7 - Step16   1.02e-02 0.0414 289   0.247  1.0000
 Step7 - Step17   4.63e-02 0.0414 289   1.119  0.9997
 Step7 - Step18   3.57e-02 0.0414 289   0.862  1.0000
 Step8 - Step9    1.96e-02 0.0414 289   0.474  1.0000
 Step8 - Step10   1.01e-02 0.0414 289   0.244  1.0000
 Step8 - Step11  -1.48e-02 0.0414 289  -0.357  1.0000
 Step8 - Step12   1.94e-02 0.0414 289   0.469  1.0000
 Step8 - Step13   1.67e-02 0.0414 289   0.405  1.0000
 Step8 - Step14   3.82e-02 0.0414 289   0.923  1.0000
 Step8 - Step15   2.41e-02 0.0414 289   0.581  1.0000
 Step8 - Step16   1.00e-02 0.0414 289   0.242  1.0000
 Step8 - Step17   4.61e-02 0.0414 289   1.114  0.9997
 Step8 - Step18   3.55e-02 0.0414 289   0.857  1.0000
 Step9 - Step10  -9.54e-03 0.0414 289  -0.230  1.0000
 Step9 - Step11  -3.44e-02 0.0414 289  -0.831  1.0000
 Step9 - Step12  -2.12e-04 0.0414 289  -0.005  1.0000
 Step9 - Step13  -2.87e-03 0.0414 289  -0.069  1.0000
 Step9 - Step14   1.86e-02 0.0414 289   0.449  1.0000
 Step9 - Step15   4.43e-03 0.0414 289   0.107  1.0000
 Step9 - Step16  -9.60e-03 0.0414 289  -0.232  1.0000
 Step9 - Step17   2.65e-02 0.0414 289   0.640  1.0000
 Step9 - Step18   1.59e-02 0.0414 289   0.383  1.0000
 Step10 - Step11 -2.49e-02 0.0414 289  -0.600  1.0000
 Step10 - Step12  9.33e-03 0.0414 289   0.225  1.0000
 Step10 - Step13  6.66e-03 0.0414 289   0.161  1.0000
 Step10 - Step14  2.81e-02 0.0414 289   0.680  1.0000
 Step10 - Step15  1.40e-02 0.0414 289   0.337  1.0000
 Step10 - Step16 -5.99e-05 0.0414 289  -0.001  1.0000
 Step10 - Step17  3.60e-02 0.0414 289   0.870  1.0000
 Step10 - Step18  2.54e-02 0.0414 289   0.614  1.0000
 Step11 - Step12  3.42e-02 0.0414 289   0.826  1.0000
 Step11 - Step13  3.15e-02 0.0414 289   0.761  1.0000
 Step11 - Step14  5.30e-02 0.0414 289   1.280  0.9984
 Step11 - Step15  3.88e-02 0.0414 289   0.938  1.0000
 Step11 - Step16  2.48e-02 0.0414 289   0.599  1.0000
 Step11 - Step17  6.09e-02 0.0414 289   1.471  0.9920
 Step11 - Step18  5.03e-02 0.0414 289   1.214  0.9992
 Step12 - Step13 -2.66e-03 0.0414 289  -0.064  1.0000
 Step12 - Step14  1.88e-02 0.0414 289   0.455  1.0000
 Step12 - Step15  4.64e-03 0.0414 289   0.112  1.0000
 Step12 - Step16 -9.39e-03 0.0414 289  -0.227  1.0000
 Step12 - Step17  2.67e-02 0.0414 289   0.645  1.0000
 Step12 - Step18  1.61e-02 0.0414 289   0.388  1.0000
 Step13 - Step14  2.15e-02 0.0414 289   0.519  1.0000
 Step13 - Step15  7.30e-03 0.0414 289   0.176  1.0000
 Step13 - Step16 -6.72e-03 0.0414 289  -0.162  1.0000
 Step13 - Step17  2.94e-02 0.0414 289   0.709  1.0000
 Step13 - Step18  1.87e-02 0.0414 289   0.453  1.0000
 Step14 - Step15 -1.42e-02 0.0414 289  -0.342  1.0000
 Step14 - Step16 -2.82e-02 0.0414 289  -0.681  1.0000
 Step14 - Step17  7.89e-03 0.0414 289   0.191  1.0000
 Step14 - Step18 -2.74e-03 0.0414 289  -0.066  1.0000
 Step15 - Step16 -1.40e-02 0.0414 289  -0.339  1.0000
 Step15 - Step17  2.21e-02 0.0414 289   0.533  1.0000
 Step15 - Step18  1.14e-02 0.0414 289   0.276  1.0000
 Step16 - Step17  3.61e-02 0.0414 289   0.872  1.0000
 Step16 - Step18  2.55e-02 0.0414 289   0.615  1.0000
 Step17 - Step18 -1.06e-02 0.0414 289  -0.257  1.0000

Degrees-of-freedom method: kenward-roger 
P value adjustment: tukey method for comparing a family of 18 estimates 

Fixed Effects:
 (Intercept)        Step2        Step3        Step4        Step5        Step6 
 1.278491439  0.009585867  0.021577171 -0.001552903 -0.010557839  0.010910687 
       Step7        Step8        Step9       Step10       Step11       Step12 
-0.007289094 -0.007477986 -0.027099393 -0.017560955  0.007292232 -0.026887470 
      Step13       Step14       Step15       Step16       Step17       Step18 
-0.024225566 -0.045704534 -0.031530425 -0.017501088 -0.053597721 -0.042960723 

Random Effects:
$subject
   (Intercept)
2   0.08381805
3  -0.06876900
4  -0.38605698
5  -0.68900389
7  -0.22135937
8   0.51895893
10  1.74313146
11 -0.08312183
13  0.31324720
14 -0.32353367
15  0.70247387
16  0.12199951
17 -0.52083593
18 -0.10028139
19 -0.57155079
20 -0.53250219
22 -0.49580635
23  0.50919235

with conditional variances for "subject" 

Sample Scaled Residuals:
        1         2         3         4         5         6 
0.6062832 2.3399335 1.7985767 1.8151180 1.5004825 0.4211344 

=============================================================

4. Additional models

4.1 SD of Acceleration - changes over time

# --- Compute SD per trial and assign trial index ---
compute_sd <- function(df) {
  df %>%
    group_by(subject, Block, trial, phase) %>%
    summarise(
      sd_x = sd(CoM.acc.x, na.rm = TRUE),
      sd_y = sd(CoM.acc.y, na.rm = TRUE),
      sd_z = sd(CoM.acc.z, na.rm = TRUE),
      .groups = "drop"
    ) %>%
    group_by(subject, Block, phase) %>%
    arrange(trial) %>%
    mutate(TrialInBlock = row_number()) %>%
    ungroup()
}

# --- Run LMMs for SD and extract ANOVA p-values ---
run_sd_model_analysis <- function(tagged_df, label) {
  sd_df <- compute_sd(tagged_df) %>%
    mutate(
      Block = factor(Block),
      subject = factor(subject),
      phase = factor(phase)
    )

  get_anova <- function(axis) {
    model <- lmer(as.formula(paste0("sd_", axis, " ~ TrialInBlock * Block * phase + (1 + Block | subject)")),
                  data = sd_df)
    anova(model)
  }

  an_x <- get_anova("x")
  an_y <- get_anova("y")
  an_z <- get_anova("z")

  tibble(
    Dataset = label,
    Axis = c("X", "Y", "Z"),
    `TrialInBlock p-value` = c(an_x["TrialInBlock", "Pr(>F)"], an_y["TrialInBlock", "Pr(>F)"], an_z["TrialInBlock", "Pr(>F)"]),
    `Block p-value`         = c(an_x["Block", "Pr(>F)"], an_y["Block", "Pr(>F)"], an_z["Block", "Pr(>F)"]),
    `Phase p-value`         = c(an_x["phase", "Pr(>F)"], an_y["phase", "Pr(>F)"], an_z["phase", "Pr(>F)"]),
    `TrialInBlock:Block p`  = c(an_x["TrialInBlock:Block", "Pr(>F)"], an_y["TrialInBlock:Block", "Pr(>F)"], an_z["TrialInBlock:Block", "Pr(>F)"]),
    `TrialInBlock:Phase p`  = c(an_x["TrialInBlock:phase", "Pr(>F)"], an_y["TrialInBlock:phase", "Pr(>F)"], an_z["TrialInBlock:phase", "Pr(>F)"]),
    `Block:Phase p`         = c(an_x["Block:phase", "Pr(>F)"], an_y["Block:phase", "Pr(>F)"], an_z["Block:phase", "Pr(>F)"]),
    `3-way p-value`         = c(an_x["TrialInBlock:Block:phase", "Pr(>F)"],
                                an_y["TrialInBlock:Block:phase", "Pr(>F)"],
                                an_z["TrialInBlock:Block:phase", "Pr(>F)"])
  )
}


# Use already-tagged data if available
sd_mixed_pvals <- run_sd_model_analysis(tagged_data, "Mixed")
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.00251375 (tol = 0.002, component 1)
print(sd_mixed_pvals)
# A tibble: 3 × 9
  Dataset Axis  `TrialInBlock p-value` `Block p-value` `Phase p-value`
  <chr>   <chr>                  <dbl>           <dbl>           <dbl>
1 Mixed   X                   0.125          0.0000460               0
2 Mixed   Y                   0.0904         0.00158                 0
3 Mixed   Z                   0.000567       0.00182                 0
# ℹ 4 more variables: `TrialInBlock:Block p` <dbl>,
#   `TrialInBlock:Phase p` <dbl>, `Block:Phase p` <dbl>, `3-way p-value` <dbl>
# --- Suppress emmeans/pbkrtest warnings globally ---
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# --- Compute SD per trial and assign trial index ---
compute_sd <- function(df) {
  df %>%
    group_by(subject, Block, trial, phase) %>%
    summarise(
      sd_x = sd(CoM.acc.x, na.rm = TRUE),
      sd_y = sd(CoM.acc.y, na.rm = TRUE),
      sd_z = sd(CoM.acc.z, na.rm = TRUE),
      .groups = "drop"
    ) %>%
    group_by(subject, Block, phase) %>%
    arrange(trial) %>%
    mutate(TrialInBlock = row_number()) %>%
    ungroup()
}

# --- Extended: Run SD LMM with Full Output per Axis ---
run_sd_model_diagnostics <- function(tagged_df, label) {
  sd_df <- compute_sd(tagged_df) %>%
    mutate(
      Block = factor(Block),
      subject = factor(subject),
      phase = factor(phase)
    )

  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    model <- lmer(
      as.formula(paste0("sd_", axis, " ~ TrialInBlock * Block * phase + (1 + Block | subject)")),
      data = sd_df
    )

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      ANOVA = anova(model),
      Emmeans = emmeans(model, ~ Block * phase),
      FixedEffects = fixef(model),
      RandomEffects = ranef(model),
      ScaledResiduals = resid(model, scaled = TRUE),
      Model = model
    )
  }

  return(results)
}

# --- Run Extended SD Diagnostics ---
sd_mixed_diagnostics <- run_sd_model_diagnostics(tagged_data, "Mixed")
NOTE: Results may be misleading due to involvement in interactions
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.00251375 (tol = 0.002, component 1)
NOTE: Results may be misleading due to involvement in interactions
NOTE: Results may be misleading due to involvement in interactions
# --- Print Diagnostics Example (Axis X) ---
cat("\n=== SD LMM: Axis X ===\n")

=== SD LMM: Axis X ===
print(sd_mixed_diagnostics$Mixed_X$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                          Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               0.135   0.135     1 5746.5    2.3590    0.1246    
Block                      1.972   0.493     4   38.6    8.5982 4.597e-05 ***
phase                    249.104 249.104     1 6434.0 4345.2038 < 2.2e-16 ***
TrialInBlock:Block         1.553   0.388     4 4790.3    6.7711 1.975e-05 ***
TrialInBlock:phase        17.954  17.954     1 6434.8  313.1832 < 2.2e-16 ***
Block:phase                6.784   1.696     4 6434.0   29.5819 < 2.2e-16 ***
TrialInBlock:Block:phase   7.883   1.971     4 6434.8   34.3752 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(sd_mixed_diagnostics$Mixed_X$Emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.8589 0.0463 17.8   0.7616    0.956
 2     Execution   0.7722 0.0460 18.1   0.6757    0.869
 3     Execution   0.5958 0.0348 21.3   0.5235    0.668
 4     Execution   0.7512 0.0372 18.0   0.6730    0.829
 5     Execution   0.5829 0.0234 19.8   0.5341    0.632
 1     Preparation 0.0665 0.0462 17.7  -0.0307    0.164
 2     Preparation 0.1416 0.0459 18.0   0.0451    0.238
 3     Preparation 0.2170 0.0346 20.9   0.1450    0.289
 4     Preparation 0.1057 0.0372 18.0   0.0275    0.184
 5     Preparation 0.1058 0.0233 19.8   0.0570    0.154

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(sd_mixed_diagnostics$Mixed_X$FixedEffects)
                         (Intercept)                         TrialInBlock 
                        0.8670157681                        -0.0004070869 
                              Block2                               Block3 
                        0.0559088391                        -0.0360016658 
                              Block4                               Block5 
                       -0.0267292326                        -0.2966271553 
                    phasePreparation                  TrialInBlock:Block2 
                       -0.8045860884                        -0.0071820838 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                       -0.0114413892                        -0.0040774891 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                        0.0010358221                         0.0006132538 
             Block2:phasePreparation              Block3:phasePreparation 
                       -0.1321684047                        -0.0065997845 
             Block4:phasePreparation              Block5:phasePreparation 
                       -0.0350077883                         0.2389905765 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                        0.0148035495                         0.0211674507 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                        0.0091604473                         0.0038433568 
print(sd_mixed_diagnostics$Mixed_X$RandomEffects)
$subject
    (Intercept)      Block2        Block3      Block4       Block5
2  -0.002988795  0.14156712  0.1581594223  0.08769465  0.059652684
3   0.212609300 -0.20029327 -0.2619025889 -0.27899585 -0.250960985
4  -0.085181378 -0.05349970 -0.0210815156 -0.01082793  0.060289294
5  -0.114621143 -0.06346916 -0.0538648037 -0.09673877 -0.035267752
7  -0.082730012  0.03177071  0.0723551492  0.06539204  0.005344579
8   0.023389807  0.04016877 -0.0008738165  0.05538312  0.048245656
10  0.320251535  0.17728157  0.0556958401  0.09787794 -0.082884933
11  0.420755543 -0.04364919 -0.2389522326 -0.17238057 -0.343794765
13 -0.105300030 -0.01409427  0.0304672747  0.08532433  0.075952557
14  0.121575104 -0.04358855 -0.0843247333 -0.08775479 -0.063264006
15 -0.120445885  0.01060097  0.0514848796  0.01798462  0.187721830
16 -0.103117330  0.06730267  0.1317134148  0.17176740  0.072982024
17 -0.192825214  0.04684707  0.1279847332  0.09152784  0.153400768
18 -0.097032137  0.05689834  0.1338593646  0.13412624  0.065676588
19 -0.199767968  0.01788578  0.0733258041  0.05520932  0.084107052
20 -0.126808714 -0.00562211  0.0126196789 -0.02084153  0.061604516
22 -0.156404295  0.02848354  0.0755602517  0.05215784  0.130604689
23  0.288641611 -0.19459030 -0.2622261227 -0.24690591 -0.229409796

with conditional variances for "subject" 
print(head(sd_mixed_diagnostics$Mixed_X$ScaledResiduals))
         1          2          3          4          5          6 
-0.2362797 -0.1681371  0.1413259 -1.0167938  0.3667212 -0.5659619 
# --- Print Diagnostics Example (Axis X) ---
cat("\n=== SD LMM: Axis Y ===\n")

=== SD LMM: Axis Y ===
print(sd_mixed_diagnostics$Mixed_Y$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                          Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               0.232   0.232     1 5188.0    2.8680  0.090415 .  
Block                      1.718   0.430     4   39.9    5.3171  0.001578 ** 
phase                    279.561 279.561     1 6435.5 3460.2860 < 2.2e-16 ***
TrialInBlock:Block         0.663   0.166     4 5224.0    2.0511  0.084541 .  
TrialInBlock:phase        20.396  20.396     1 6436.2  252.4581 < 2.2e-16 ***
Block:phase                5.904   1.476     4 6435.5   18.2685 6.184e-15 ***
TrialInBlock:Block:phase   9.118   2.279     4 6436.2   28.2133 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(sd_mixed_diagnostics$Mixed_Y$Emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   0.9118 0.0586 17.7   0.7885    1.035
 2     Execution   0.8268 0.0548 18.1   0.7116    0.942
 3     Execution   0.6162 0.0367 22.7   0.5402    0.692
 4     Execution   0.7805 0.0422 18.1   0.6918    0.869
 5     Execution   0.6118 0.0242 20.8   0.5614    0.662
 1     Preparation 0.0672 0.0585 17.6  -0.0560    0.190
 2     Preparation 0.1630 0.0548 18.0   0.0479    0.278
 3     Preparation 0.2246 0.0364 22.1   0.1490    0.300
 4     Preparation 0.1009 0.0422 18.1   0.0123    0.190
 5     Preparation 0.1000 0.0242 20.7   0.0496    0.150

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(sd_mixed_diagnostics$Mixed_Y$FixedEffects)
                         (Intercept)                         TrialInBlock 
                        0.8897810297                         0.0011082715 
                              Block2                               Block3 
                        0.0822160265                        -0.0101378448 
                              Block4                               Block5 
                       -0.0282883665                        -0.2550414971 
                    phasePreparation                  TrialInBlock:Block2 
                       -0.8348514013                        -0.0084211023 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                       -0.0143766421                        -0.0051883951 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                       -0.0022635025                        -0.0004895652 
             Block2:phasePreparation              Block3:phasePreparation 
                       -0.1570715557                        -0.0244418559 
             Block4:phasePreparation              Block5:phasePreparation 
                       -0.0371109447                         0.2002025356 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                        0.0170130632                         0.0240441539 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                        0.0101794347                         0.0066785128 
print(sd_mixed_diagnostics$Mixed_Y$RandomEffects)
$subject
   (Intercept)       Block2      Block3      Block4      Block5
2  -0.08234594  0.185087259  0.21785201  0.17962949  0.17679332
3   0.04611270  0.030726485  0.03928753  0.02114883 -0.01357963
4  -0.18744612 -0.017242124  0.08289313  0.04887136  0.15646520
5  -0.22431229 -0.007321099  0.06374761  0.02113200  0.08861165
7  -0.11122260  0.029650181  0.06720228  0.03336942  0.12308974
8   0.14526321  0.086655267 -0.05307747  0.01753172 -0.09464450
10  0.45010656  0.015506627 -0.07733778 -0.01851272 -0.22497245
11  0.50219223  0.052184107 -0.38386833 -0.19761004 -0.53817922
13  0.08345246 -0.174887857 -0.19853261 -0.17321943 -0.11352360
14  0.13354972 -0.095393264 -0.13814968 -0.12584080 -0.13187409
15 -0.12732127 -0.048888855  0.07609548  0.03206445  0.16208994
16 -0.12626597  0.073484805  0.15052722  0.13297897  0.16768904
17 -0.25109265  0.127282488  0.21870252  0.16863979  0.23151458
18 -0.09146300  0.015964763  0.13349575  0.08206185  0.06999104
19 -0.21066210  0.020881983  0.03255722  0.01429839  0.06453651
20 -0.15620016  0.052418546  0.04419543  0.01924245  0.03648449
22 -0.20574993  0.010400748  0.08228253  0.04755815  0.15636494
23  0.41340515 -0.356510062 -0.35787284 -0.30334390 -0.31685696

with conditional variances for "subject" 
print(head(sd_mixed_diagnostics$Mixed_Y$ScaledResiduals))
         1          2          3          4          5          6 
-0.1962739 -0.2278271  0.4396876 -0.6653148 -0.1065930 -0.6182290 
# --- Print Diagnostics Example (Axis X) ---
cat("\n=== SD LMM: Axis Z ===\n")

=== SD LMM: Axis Z ===
print(sd_mixed_diagnostics$Mixed_Z$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                         Sum Sq Mean Sq NumDF  DenDF   F value    Pr(>F)    
TrialInBlock               2.52    2.52     1 5510.2   11.8939 0.0005674 ***
Block                      4.44    1.11     4   38.5    5.2332 0.0018246 ** 
phase                    782.80  782.80     1 6435.6 3691.2368 < 2.2e-16 ***
TrialInBlock:Block         3.26    0.81     4 5576.1    3.8377 0.0040594 ** 
TrialInBlock:phase        50.32   50.32     1 6436.2  237.2811 < 2.2e-16 ***
Block:phase               16.84    4.21     4 6435.7   19.8532 2.922e-16 ***
TrialInBlock:Block:phase  26.47    6.62     4 6436.3   31.1994 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(sd_mixed_diagnostics$Mixed_Z$Emmeans))
 Block phase       emmean     SE   df lower.CL upper.CL
 1     Execution   1.4196 0.0878 17.8   1.2351    1.604
 2     Execution   1.3741 0.0888 18.1   1.1877    1.561
 3     Execution   1.0528 0.0687 21.1   0.9100    1.196
 4     Execution   1.3081 0.0666 18.2   1.1682    1.448
 5     Execution   1.0221 0.0508 19.1   0.9158    1.128
 1     Preparation 0.0748 0.0876 17.7  -0.1095    0.259
 2     Preparation 0.2279 0.0887 18.0   0.0415    0.414
 3     Preparation 0.3327 0.0684 20.7   0.1904    0.475
 4     Preparation 0.1288 0.0666 18.2  -0.0111    0.269
 5     Preparation 0.1267 0.0508 19.1   0.0204    0.233

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(sd_mixed_diagnostics$Mixed_Z$FixedEffects)
                         (Intercept)                         TrialInBlock 
                         1.341741268                          0.003922163 
                              Block2                               Block3 
                         0.185823520                          0.149101971 
                              Block4                               Block5 
                         0.120401517                         -0.321050371 
                    phasePreparation                  TrialInBlock:Block2 
                        -1.298535171                         -0.011649781 
                 TrialInBlock:Block3                  TrialInBlock:Block4 
                        -0.025982147                         -0.011679048 
                 TrialInBlock:Block5        TrialInBlock:phasePreparation 
                        -0.003849036                         -0.002329397 
             Block2:phasePreparation              Block3:phasePreparation 
                        -0.307614345                         -0.216104710 
             Block4:phasePreparation              Block5:phasePreparation 
                        -0.226894068                          0.227467258 
TrialInBlock:Block2:phasePreparation TrialInBlock:Block3:phasePreparation 
                         0.025491280                          0.042344641 
TrialInBlock:Block4:phasePreparation TrialInBlock:Block5:phasePreparation 
                         0.019758505                          0.011175646 
print(sd_mixed_diagnostics$Mixed_Z$RandomEffects)
$subject
   (Intercept)        Block2       Block3      Block4      Block5
2  -0.30814638  0.2294529029  0.355770427  0.26626784  0.32513676
3   0.33931050 -0.2224618321 -0.274188557 -0.26835375 -0.34185102
4  -0.16498059 -0.1098020214 -0.044309010 -0.03275700  0.12512196
5  -0.32110439 -0.0249757532  0.007379763 -0.01210276 -0.01133951
7  -0.01433727  0.0191648020  0.113187192  0.10448933 -0.01003884
8   0.23908248  0.1732785798 -0.045565883  0.04541524 -0.04813707
10  0.48215997  0.1960701192  0.173182408  0.10486479  0.03346474
11  0.86180585  0.0216850999 -0.638736567 -0.45985346 -0.84410570
13  0.12409308 -0.2496958168 -0.280339405 -0.22561690  0.01598564
14 -0.03086219 -0.0048061321  0.090539945  0.05475269 -0.03247776
15 -0.13856395 -0.1082509979 -0.045030319 -0.06627008  0.31934134
16 -0.08506709  0.2409337594  0.259708867  0.22973424  0.19159645
17 -0.45334855  0.0935573501  0.313503133  0.24907473  0.31135975
18 -0.08421651  0.0808597662  0.349342671  0.25776675  0.04866049
19 -0.31123439 -0.0307044060 -0.024431129 -0.02492679  0.03281403
20 -0.25232766  0.0136265854  0.020800977  0.01380094  0.07789839
22 -0.39354146 -0.0009274911  0.047353663  0.03946954  0.19078152
23  0.51127856 -0.3170045144 -0.378168178 -0.27575534 -0.38421115

with conditional variances for "subject" 
print(head(sd_mixed_diagnostics$Mixed_Z$ScaledResiduals))
           1            2            3            4            5            6 
 0.405538236  0.082510827 -0.253608734 -1.000084912  0.003132928 -0.709006436 

4.2 LMM step level

# Extract Step-Level RMS with ±3 Line Buffer Around Markers 
extract_step_rms <- function(df, label) {
  buffer <- 3
  step_markers <- c(14, 15, 16, 17)

  step_data <- df %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()

  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)

  # Extract ±3 rows around each marker
  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)

    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })

  # Compute RMS over buffered region
  window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = gsub("rms_", "", Axis),
      Dataset = label,
      Step = factor(Step),         # ✅ Now a factor
      subject = factor(subject),
      Block = factor(Block)
    )
}


# --- Run Step-Level LMMs and Extract ANOVA p-values ---
run_step_model <- function(df, label) {
  get_anova <- function(axis_label) {
    model <- lmer(RMS ~ Step * Block + (1 | subject), data = filter(df, Axis == axis_label))
    anova(model)
  }

  ax <- get_anova("x")
  ay <- get_anova("y")
  az <- get_anova("z")

  tibble(
    Dataset = label,
    Axis = c("X", "Y", "Z"),
    `Step p-value` = c(ax["Step", "Pr(>F)"], ay["Step", "Pr(>F)"], az["Step", "Pr(>F)"]),
    `Block p-value` = c(ax["Block", "Pr(>F)"], ay["Block", "Pr(>F)"], az["Block", "Pr(>F)"]),
    `Interaction p-value` = c(ax["Step:Block", "Pr(>F)"], ay["Step:Block", "Pr(>F)"], az["Step:Block", "Pr(>F)"])
  )
}


# --- Execute Updated Step-Level RMS Analysis ---
step_rms_data <- extract_step_rms(tagged_data, "Mixed")
step_model_results <- run_step_model(step_rms_data, "Mixed")
fixed-effect model matrix is rank deficient so dropping 18 columns / coefficients
Missing cells for: Step7:Block1, Step8:Block1, Step9:Block1, Step10:Block1, Step11:Block1, Step12:Block1, Step13:Block1, Step14:Block1, Step15:Block1, Step16:Block1, Step17:Block1, Step18:Block1, Step13:Block2, Step14:Block2, Step15:Block2, Step16:Block2, Step17:Block2, Step18:Block2.  
Interpret type III hypotheses with care.
fixed-effect model matrix is rank deficient so dropping 18 columns / coefficients
Missing cells for: Step7:Block1, Step8:Block1, Step9:Block1, Step10:Block1, Step11:Block1, Step12:Block1, Step13:Block1, Step14:Block1, Step15:Block1, Step16:Block1, Step17:Block1, Step18:Block1, Step13:Block2, Step14:Block2, Step15:Block2, Step16:Block2, Step17:Block2, Step18:Block2.  
Interpret type III hypotheses with care.
fixed-effect model matrix is rank deficient so dropping 18 columns / coefficients
Missing cells for: Step7:Block1, Step8:Block1, Step9:Block1, Step10:Block1, Step11:Block1, Step12:Block1, Step13:Block1, Step14:Block1, Step15:Block1, Step16:Block1, Step17:Block1, Step18:Block1, Step13:Block2, Step14:Block2, Step15:Block2, Step16:Block2, Step17:Block2, Step18:Block2.  
Interpret type III hypotheses with care.
# --- Output ---
print(step_model_results)
# A tibble: 3 × 5
  Dataset Axis  `Step p-value` `Block p-value` `Interaction p-value`
  <chr>   <chr>          <dbl>           <dbl>                 <dbl>
1 Mixed   X            0.0125         5.77e-36                  1.00
2 Mixed   Y            0.00339        7.44e-15                  1.00
3 Mixed   Z            0.0537         2.89e-28                  1.00
# -------- Suppress Emmeans Warnings Globally --------
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# --- Extract Step-Level RMS with ±3 Row Buffer Around Markers ---
extract_step_rms <- function(df, label) {
  buffer <- 3
  step_markers <- c(14, 15, 16, 17)

  step_data <- df %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()

  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)

  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)

    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })

  window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = gsub("rms_", "", Axis),
      Dataset = label,
      Step = as.numeric(Step),
      subject = factor(subject),
      Block = factor(Block)
    )
}

# --- Run Step-Level LMMs with Full Diagnostics ---
run_step_model_diagnostics <- function(df, label) {
  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    data_sub <- df %>% filter(Axis == axis)
    model <- lmer(RMS ~ Step * Block + (1 | subject), data = data_sub)

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      ANOVA = anova(model),
      Emmeans = emmeans(model, ~ Step * Block),
      FixedEffects = fixef(model),
      RandomEffects = ranef(model),
      ScaledResiduals = resid(model, scaled = TRUE),
      Model = model
    )
  }

  return(results)
}

# --- Run Analysis and Extract Diagnostics ---
step_rms_data <- extract_step_rms(tagged_data, "Mixed")
step_model_diag_results <- run_step_model_diagnostics(step_rms_data, "Mixed")

# --- Print Diagnostics Example for Axis X ---
cat("\n=== STEP-LEVEL RMS LMM: Axis X ===\n")

=== STEP-LEVEL RMS LMM: Axis X ===
print(step_model_diag_results$Mixed_X$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step       0.23877 0.23877     1  1269  6.9077  0.008686 ** 
Block      2.41418 0.60355     4  1269 17.4610 5.874e-14 ***
Step:Block 0.31355 0.07839     4  1269  2.2678  0.059955 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(step_model_diag_results$Mixed_X$Emmeans))
 Step Block emmean     SE   df lower.CL upper.CL
  8.5 1      0.926 0.0896 43.8    0.745    1.106
  8.5 2      0.780 0.0720 18.3    0.629    0.931
  8.5 3      0.655 0.0713 17.6    0.505    0.805
  8.5 4      0.759 0.0713 17.6    0.609    0.909
  8.5 5      0.654 0.0713 17.6    0.504    0.804

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(step_model_diag_results$Mixed_X$FixedEffects)
 (Intercept)         Step       Block2       Block3       Block4       Block5 
 0.915119362  0.001237707 -0.001022194 -0.210534955 -0.100201149 -0.229933792 
 Step:Block2  Step:Block3  Step:Block4  Step:Block5 
-0.017027599 -0.007057896 -0.007769410 -0.004876759 
print(step_model_diag_results$Mixed_X$RandomEffects)
$subject
   (Intercept)
2   0.11002898
3   0.03724100
4  -0.24933085
5  -0.34342046
7  -0.15999779
8   0.31398331
10  0.81534049
11  0.52169432
13 -0.18853320
14  0.03463009
15 -0.06972254
16 -0.06112373
17 -0.18563684
18 -0.03037388
19 -0.28291659
20 -0.24510198
22 -0.14256874
23  0.12580842

with conditional variances for "subject" 
print(head(step_model_diag_results$Mixed_X$ScaledResiduals))
        1         2         3         4         5         6 
-2.407074 -2.365733 -2.359757 -2.366414 -2.201504 -2.278840 
# --- Print Diagnostics Example for Axis Y ---
cat("\n=== STEP-LEVEL RMS LMM: Axis Y ===\n")

=== STEP-LEVEL RMS LMM: Axis Y ===
print(step_model_diag_results$Mixed_Y$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
            Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step       0.44036 0.44036     1  1269  6.1963   0.01293 *  
Block      2.38367 0.59592     4  1269  8.3853 1.123e-06 ***
Step:Block 0.36458 0.09115     4  1269  1.2825   0.27483    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(step_model_diag_results$Mixed_Y$Emmeans))
 Step Block emmean     SE   df lower.CL upper.CL
  8.5 1      0.920 0.1120 67.1    0.697    1.143
  8.5 2      0.852 0.0814 19.2    0.682    1.022
  8.5 3      0.676 0.0801 17.9    0.507    0.844
  8.5 4      0.812 0.0801 17.9    0.644    0.980
  8.5 5      0.750 0.0801 17.9    0.582    0.918

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(step_model_diag_results$Mixed_Y$FixedEffects)
 (Intercept)         Step       Block2       Block3       Block4       Block5 
 0.935720192 -0.001859348  0.011416990 -0.219819184 -0.009199095 -0.098823885 
 Step:Block2  Step:Block3  Step:Block4  Step:Block5 
-0.009354914 -0.002880084 -0.011599384 -0.008347937 
print(step_model_diag_results$Mixed_Y$RandomEffects)
$subject
    (Intercept)
2   0.215930304
3   0.181924219
4  -0.295210899
5  -0.351153879
7  -0.199510787
8   0.404200990
10  0.767464280
11  0.428233663
13 -0.188243262
14  0.005818085
15 -0.130100848
16 -0.078256254
17 -0.160586355
18 -0.075812111
19 -0.347035341
20 -0.274834330
22 -0.351687924
23  0.448860452

with conditional variances for "subject" 
print(head(step_model_diag_results$Mixed_Y$ScaledResiduals))
        1         2         3         4         5         6 
-2.024183 -2.162425 -2.129534 -2.122559 -2.028701 -1.911946 
# --- Print Diagnostics Example for Axis Z ---
cat("\n=== STEP-LEVEL RMS LMM: Axis Z ===\n")

=== STEP-LEVEL RMS LMM: Axis Z ===
print(step_model_diag_results$Mixed_Z$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
           Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
Step       0.5721 0.57209     1  1269  3.6005   0.05799 .  
Block      9.0610 2.26524     4  1269 14.2565 2.181e-11 ***
Step:Block 1.4199 0.35499     4  1269  2.2341   0.06333 .  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(step_model_diag_results$Mixed_Z$Emmeans))
 Step Block emmean    SE   df lower.CL upper.CL
  8.5 1       1.94 0.201 39.4     1.54     2.35
  8.5 2       1.72 0.166 18.1     1.37     2.06
  8.5 3       1.44 0.164 17.5     1.09     1.78
  8.5 4       1.65 0.164 17.5     1.30     2.00
  8.5 5       1.43 0.164 17.5     1.09     1.78

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(step_model_diag_results$Mixed_Z$FixedEffects)
 (Intercept)         Step       Block2       Block3       Block4       Block5 
 1.907241742  0.004300091 -0.062824207 -0.428918866 -0.072468609 -0.387961951 
 Step:Block2  Step:Block3  Step:Block4  Step:Block5 
-0.019328358 -0.009085057 -0.026036291 -0.014328949 
print(step_model_diag_results$Mixed_Z$RandomEffects)
$subject
   (Intercept)
2  -0.09776719
3   0.29920593
4  -0.65956180
5  -0.81472718
7   0.13898391
8   0.55945688
10  1.96205535
11  0.83171422
13 -0.13930132
14 -0.26992210
15 -0.04939117
16  0.15528059
17 -0.64051400
18  0.33940562
19 -0.73185992
20 -0.59496903
22 -0.59578675
23  0.30769796

with conditional variances for "subject" 
print(head(step_model_diag_results$Mixed_Z$ScaledResiduals))
        1         2         3         4         5         6 
-1.707922 -1.851905 -2.013106 -2.023894 -2.268428 -2.198652 

#4.3 Model: Does Sequence Length Influence RMS?

# --- Compute RMS with Sequence Length per Trial ---
compute_step_rms_with_sequence_length <- function(df, label) {
  df %>%
    filter(phase == "Execution", Marker.Text %in% c(14, 15, 16, 17)) %>%
    group_by(subject, Block, trial) %>%
    mutate(SequenceLength = n()) %>%
    group_by(subject, Block, trial, Marker.Text, SequenceLength) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = gsub("rms_", "", Axis),
      Dataset = label,
      subject = factor(subject),
      SequenceLength = factor(SequenceLength)
    )
}

# --- LMM per Axis for Sequence Length Effect ---
run_sequence_length_model <- function(df, label) {
  get_anova <- function(axis_label) {
    model <- lmer(RMS ~ SequenceLength + (1 | subject), data = filter(df, Axis == axis_label))
    anova(model)
  }

  ax <- get_anova("x")
  ay <- get_anova("y")
  az <- get_anova("z")

  tibble(
    Dataset = label,
    Axis = c("X", "Y", "Z"),
    `SequenceLength p-value` = c(ax["SequenceLength", "Pr(>F)"],
                                 ay["SequenceLength", "Pr(>F)"],
                                 az["SequenceLength", "Pr(>F)"])
  )
}

# --- Run Sequence Length Analysis on Mixed Data ---
step_rms_seq_mixed <- compute_step_rms_with_sequence_length(tagged_data, "Mixed")
seq_length_pvals <- run_sequence_length_model(step_rms_seq_mixed, "Mixed")

# --- Display Results ---
print(seq_length_pvals)
# A tibble: 3 × 3
  Dataset Axis  `SequenceLength p-value`
  <chr>   <chr>                    <dbl>
1 Mixed   X                0.00000000547
2 Mixed   Y                0.0000863    
3 Mixed   Z                0.000000826  
# --- Suppress lmerTest/pbkrtest warnings globally ---
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# --- Compute RMS with Sequence Length per Trial ---
compute_step_rms_with_sequence_length <- function(df, label) {
  df %>%
    filter(phase == "Execution", Marker.Text %in% c(14, 15, 16, 17)) %>%
    group_by(subject, Block, trial) %>%
    mutate(SequenceLength = n()) %>%
    group_by(subject, Block, trial, Marker.Text, SequenceLength) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = gsub("rms_", "", Axis),
      Dataset = label,
      subject = factor(subject),
      SequenceLength = factor(SequenceLength)
    )
}

# --- Extended: LMM per Axis for Sequence Length Effect + Diagnostics ---
run_sequence_length_model_diagnostics <- function(df, label) {
  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    model <- lmer(RMS ~ SequenceLength + (1 | subject), data = filter(df, Axis == axis))

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      ANOVA = anova(model),
      Emmeans = emmeans(model, ~ SequenceLength),
      FixedEffects = fixef(model),
      RandomEffects = ranef(model),
      ScaledResiduals = resid(model, scaled = TRUE),
      Model = model
    )
  }

  return(results)
}

# --- Run Model and Extract Diagnostics ---
step_rms_seq_mixed <- compute_step_rms_with_sequence_length(tagged_data, "Mixed")
seq_length_diag <- run_sequence_length_model_diagnostics(step_rms_seq_mixed, "Mixed")

# --- Display Diagnostics for Axis X ---
cat("\n=== SEQUENCE LENGTH RMS MODEL: Axis X ===\n")

=== SEQUENCE LENGTH RMS MODEL: Axis X ===
print(seq_length_diag$Mixed_X$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
SequenceLength 12.509  2.5017     5 12832  9.4326 5.467e-09 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_diag$Mixed_X$Emmeans))
 SequenceLength  emmean     SE     df lower.CL upper.CL
 4               0.7637 0.1930 1641.3    0.386    1.141
 5               0.8554 0.1360  445.2    0.588    1.123
 6               0.6433 0.0600   17.4    0.517    0.770
 11             -0.0672 0.1920 1626.5   -0.444    0.309
 12              0.6300 0.0601   17.4    0.504    0.757
 18              0.5853 0.0601   17.5    0.459    0.712

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_diag$Mixed_X$FixedEffects)
     (Intercept)  SequenceLength5  SequenceLength6 SequenceLength11 
      0.76370009       0.09171029      -0.12044732      -0.83088215 
SequenceLength12 SequenceLength18 
     -0.13366738      -0.17843204 
print(seq_length_diag$Mixed_X$RandomEffects)
$subject
   (Intercept)
2   0.02489508
3   0.08326921
4  -0.21935031
5  -0.28237119
7  -0.15103986
8   0.26310369
10  0.67778730
11  0.41232158
13 -0.18595566
14  0.06469506
15 -0.01953860
16 -0.03857193
17 -0.18366675
18 -0.06357062
19 -0.25103141
20 -0.19254560
22 -0.11384027
23  0.17541029

with conditional variances for "subject" 
print(head(seq_length_diag$Mixed_X$ScaledResiduals))
         1          2          3          4          5          6 
-0.6827629 -0.8548025  0.0423730 -0.1269665 -0.7462673 -0.5825483 
# --- Display Diagnostics for Axis Y ---
cat("\n=== SEQUENCE LENGTH RMS MODEL: Axis Y ===\n")

=== SEQUENCE LENGTH RMS MODEL: Axis Y ===
print(seq_length_diag$Mixed_Y$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
SequenceLength 8.5664  1.7133     5 12832  5.2197 8.629e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_diag$Mixed_Y$Emmeans))
 SequenceLength emmean     SE     df lower.CL upper.CL
 4               0.661 0.2140 1654.1    0.241    1.081
 5               0.462 0.1510  448.7    0.165    0.759
 6               0.661 0.0666   17.4    0.520    0.801
 11              0.275 0.2140 1639.3   -0.144    0.694
 12              0.669 0.0667   17.4    0.529    0.810
 18              0.615 0.0667   17.5    0.475    0.756

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_diag$Mixed_Y$FixedEffects)
     (Intercept)  SequenceLength5  SequenceLength6 SequenceLength11 
    0.6613243056    -0.1994382630    -0.0007259362    -0.3866337575 
SequenceLength12 SequenceLength18 
    0.0081033492    -0.0460787019 
print(seq_length_diag$Mixed_Y$RandomEffects)
$subject
   (Intercept)
2   0.16437097
3   0.16331899
4  -0.27385113
5  -0.29253679
7  -0.15742241
8   0.34376582
10  0.70260269
11  0.37257745
13 -0.18343453
14  0.08767554
15 -0.12664871
16 -0.04886466
17 -0.14491544
18 -0.04644085
19 -0.27856427
20 -0.21896539
22 -0.28502361
23  0.22235631

with conditional variances for "subject" 
print(head(seq_length_diag$Mixed_Y$ScaledResiduals))
         1          2          3          4          5          6 
-0.9029029 -1.3907004 -0.9201271 -1.0519783 -1.3013022 -1.2657374 
# --- Display Diagnostics for Axis Z ---
cat("\n=== SEQUENCE LENGTH RMS MODEL: Axis Z ===\n")

=== SEQUENCE LENGTH RMS MODEL: Axis Z ===
print(seq_length_diag$Mixed_Z$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
SequenceLength 38.542  7.7084     5 12832  7.2702 8.257e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_diag$Mixed_Z$Emmeans))
 SequenceLength emmean    SE     df lower.CL upper.CL
 4              1.6260 0.390 1124.9    0.861    2.391
 5              1.2101 0.279  310.6    0.662    1.758
 6              1.4232 0.135   17.3    1.139    1.707
 11             0.0696 0.389 1114.3   -0.693    0.832
 12             1.3848 0.135   17.3    1.101    1.669
 18             1.3171 0.135   17.4    1.033    1.601

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_diag$Mixed_Z$FixedEffects)
     (Intercept)  SequenceLength5  SequenceLength6 SequenceLength11 
       1.6259910       -0.4159359       -0.2028338       -1.5564279 
SequenceLength12 SequenceLength18 
      -0.2411451       -0.3089131 
print(seq_length_diag$Mixed_Z$RandomEffects)
$subject
   (Intercept)
2  -0.14574863
3   0.29801432
4  -0.60504327
5  -0.72630042
7   0.17801680
8   0.52524867
10  1.41134086
11  0.69413886
13 -0.10292345
14 -0.32161570
15  0.03962644
16  0.19739584
17 -0.61375376
18  0.33765739
19 -0.63553399
20 -0.48683277
22 -0.46516627
23  0.42147909

with conditional variances for "subject" 
print(head(seq_length_diag$Mixed_Z$ScaledResiduals))
          1           2           3           4           5           6 
-0.73126265 -0.36255661 -0.95756250 -0.10941782  0.18974358 -0.08769942 

#4.4 Model: Does Sequence Length Influence SD?

# --- Compute SD with Sequence Length per Trial ---
compute_step_sd_with_sequence_length <- function(df, label) {
  df %>%
    filter(phase == "Execution", Marker.Text %in% c(14, 15, 16, 17)) %>%
    group_by(subject, Block, trial) %>%
    mutate(SequenceLength = n()) %>%
    group_by(subject, Block, trial, Marker.Text, SequenceLength) %>%
    summarise(
      sd_x = sd(CoM.acc.x, na.rm = TRUE),
      sd_y = sd(CoM.acc.y, na.rm = TRUE),
      sd_z = sd(CoM.acc.z, na.rm = TRUE),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("sd_"), names_to = "Axis", values_to = "SD") %>%
    mutate(
      Axis = gsub("sd_", "", Axis),
      Dataset = label,
      subject = factor(subject),
      SequenceLength = factor(SequenceLength)
    )
}

# --- LMM per Axis for Sequence Length Effect on SD ---
run_sequence_length_sd_model <- function(df, label) {
  get_anova <- function(axis_label) {
    model <- lmer(SD ~ SequenceLength + (1 | subject), data = filter(df, Axis == axis_label))
    anova(model)
  }

  ax <- get_anova("x")
  ay <- get_anova("y")
  az <- get_anova("z")

  tibble(
    Dataset = label,
    Axis = c("X", "Y", "Z"),
    `SequenceLength p-value` = c(ax["SequenceLength", "Pr(>F)"],
                                 ay["SequenceLength", "Pr(>F)"],
                                 az["SequenceLength", "Pr(>F)"])
  )
}

# --- Run Sequence Length SD Analysis on Mixed Data ---
step_sd_seq_mixed <- compute_step_sd_with_sequence_length(tagged_data, "Mixed")
seq_length_sd_pvals <- run_sequence_length_sd_model(step_sd_seq_mixed, "Mixed")

# --- Display SD Model Results ---
print(seq_length_sd_pvals)
# A tibble: 3 × 3
  Dataset Axis  `SequenceLength p-value`
  <chr>   <chr>                    <dbl>
1 Mixed   X                    0.000210 
2 Mixed   Y                    0.0214   
3 Mixed   Z                    0.0000533
# --- Suppress emmeans/pbkrtest warnings globally ---
emmeans::emm_options(
  lmerTest.limit = Inf,
  pbkrtest.limit = Inf
)

# --- Compute SD with Sequence Length per Trial ---
compute_step_sd_with_sequence_length <- function(df, label) {
  df %>%
    filter(phase == "Execution", Marker.Text %in% c(14, 15, 16, 17)) %>%
    group_by(subject, Block, trial) %>%
    mutate(SequenceLength = n()) %>%
    group_by(subject, Block, trial, Marker.Text, SequenceLength) %>%
    summarise(
      sd_x = sd(CoM.acc.x, na.rm = TRUE),
      sd_y = sd(CoM.acc.y, na.rm = TRUE),
      sd_z = sd(CoM.acc.z, na.rm = TRUE),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("sd_"), names_to = "Axis", values_to = "SD") %>%
    mutate(
      Axis = gsub("sd_", "", Axis),
      Dataset = label,
      subject = factor(subject),
      SequenceLength = factor(SequenceLength)
    )
}

# --- Extended: LMM per Axis for Sequence Length Effect on SD ---
run_sequence_length_sd_model_diagnostics <- function(df, label) {
  axes <- c("x", "y", "z")
  results <- list()

  for (axis in axes) {
    model <- lmer(SD ~ SequenceLength + (1 | subject), data = filter(df, Axis == axis))

    key <- paste0(label, "_", toupper(axis))

    results[[key]] <- list(
      ANOVA = anova(model),
      Emmeans = emmeans(model, ~ SequenceLength),
      FixedEffects = fixef(model),
      RandomEffects = ranef(model),
      ScaledResiduals = resid(model, scaled = TRUE),
      Model = model
    )
  }

  return(results)
}

# --- Run Model and Extract Diagnostics ---
step_sd_seq_mixed <- compute_step_sd_with_sequence_length(tagged_data, "Mixed")
seq_length_sd_diag <- run_sequence_length_sd_model_diagnostics(step_sd_seq_mixed, "Mixed")

# --- Display Diagnostics for Axis X ---
cat("\n=== SEQUENCE LENGTH SD MODEL: Axis X ===\n")

=== SEQUENCE LENGTH SD MODEL: Axis X ===
print(seq_length_sd_diag$Mixed_X$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
SequenceLength 5.1399   1.285     4 10494   5.479 0.0002103 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_sd_diag$Mixed_X$Emmeans))
 SequenceLength emmean     SE     df lower.CL upper.CL
 5               0.865 0.1910 2419.6    0.491    1.239
 6               0.526 0.0530   18.0    0.415    0.637
 11             -0.079 0.1790 1985.8   -0.431    0.273
 12              0.547 0.0526   17.4    0.436    0.658
 18              0.522 0.0526   17.5    0.411    0.633

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_sd_diag$Mixed_X$FixedEffects)
     (Intercept)  SequenceLength6 SequenceLength11 SequenceLength12 
       0.8647651       -0.3388310       -0.9437831       -0.3178414 
SequenceLength18 
      -0.3424989 
print(seq_length_sd_diag$Mixed_X$RandomEffects)
$subject
   (Intercept)
2   0.05357079
3   0.05179505
4  -0.17197087
5  -0.23596647
7  -0.09540464
8   0.16549144
10  0.63696777
11  0.33174416
13 -0.13389309
14  0.15327494
15 -0.09959260
16 -0.02519785
17 -0.12802594
18 -0.05634306
19 -0.20015367
20 -0.16863686
22 -0.17314635
23  0.09548725

with conditional variances for "subject" 
print(head(seq_length_sd_diag$Mixed_X$ScaledResiduals))
         1          3          5          7          9         11 
-0.8944736 -1.0235233 -1.1320258 -0.8847848 -0.8272984 -1.0565356 
# --- Display Diagnostics for Axis Y ---
cat("\n=== SEQUENCE LENGTH SD MODEL: Axis Y ===\n")

=== SEQUENCE LENGTH SD MODEL: Axis Y ===
print(seq_length_sd_diag$Mixed_Y$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
SequenceLength  3.436   0.859     4 10494  2.8777 0.02143 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_sd_diag$Mixed_Y$Emmeans))
 SequenceLength emmean     SE     df lower.CL upper.CL
 5               0.374 0.2150 2605.1  -0.0469    0.796
 6               0.554 0.0583   18.1   0.4319    0.677
 11              0.224 0.2020 2144.8  -0.1721    0.620
 12              0.576 0.0578   17.4   0.4541    0.698
 18              0.543 0.0579   17.5   0.4207    0.664

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_sd_diag$Mixed_Y$FixedEffects)
     (Intercept)  SequenceLength6 SequenceLength11 SequenceLength12 
       0.3743739        0.1801059       -0.1502666        0.2014899 
SequenceLength18 
       0.1681699 
print(seq_length_sd_diag$Mixed_Y$RandomEffects)
$subject
   (Intercept)
2   0.10951141
3   0.12664285
4  -0.19684764
5  -0.25913656
7  -0.06860125
8   0.26833537
10  0.61703214
11  0.32411261
13 -0.14357021
14  0.12144695
15 -0.12156601
16 -0.05942662
17 -0.11835536
18 -0.08892038
19 -0.26722993
20 -0.19137652
22 -0.26257925
23  0.21052840

with conditional variances for "subject" 
print(head(seq_length_sd_diag$Mixed_Y$ScaledResiduals))
         1          3          5          7          9         11 
-0.4348516 -1.0671381 -1.1047401 -1.0053693 -0.2228061 -0.3297785 
# --- Display Diagnostics for Axis Z ---
cat("\n=== SEQUENCE LENGTH SD MODEL: Axis Z ===\n")

=== SEQUENCE LENGTH SD MODEL: Axis Z ===
print(seq_length_sd_diag$Mixed_Z$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
               Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
SequenceLength 22.772  5.6931     4 10494  6.2253 5.333e-05 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(seq_length_sd_diag$Mixed_Z$Emmeans))
 SequenceLength emmean     SE     df lower.CL upper.CL
 5              1.2085 0.3740 3203.6    0.475    1.942
 6              0.8894 0.0950   18.2    0.690    1.089
 11             0.0981 0.3520 2666.3   -0.591    0.788
 12             0.9910 0.0940   17.5    0.793    1.189
 18             0.9749 0.0941   17.6    0.777    1.173

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(seq_length_sd_diag$Mixed_Z$FixedEffects)
     (Intercept)  SequenceLength6 SequenceLength11 SequenceLength12 
       1.2085449       -0.3191928       -1.1104780       -0.2175467 
SequenceLength18 
      -0.2336458 
print(seq_length_sd_diag$Mixed_Z$RandomEffects)
$subject
     (Intercept)
2  -5.668181e-03
3   2.204648e-01
4  -3.089863e-01
5  -4.538521e-01
7   9.664095e-02
8   5.206798e-01
10  9.713584e-01
11  5.823385e-01
13 -9.885303e-02
14 -1.358140e-01
15 -2.836437e-02
16 -4.906112e-03
17 -3.613736e-01
18 -4.733085e-05
19 -3.992486e-01
20 -3.788382e-01
22 -4.349800e-01
23  2.194495e-01

with conditional variances for "subject" 
print(head(seq_length_sd_diag$Mixed_Z$ScaledResiduals))
          1           3           5           7           9          11 
-0.77140783 -0.84919395  0.04769161 -0.89023568  1.36427252 -0.80744817 

#5 top 50% vs bottom 50%

# --- Tag Top vs Bottom Performers ---
tag_performance_group <- function(df) {
  top_ids <- c(17, 7, 23, 16, 10, 14, 13, 2, 8)
  df %>%
    mutate(
      PerformanceGroup = ifelse(subject %in% top_ids, "Top", "Bottom"),
      PerformanceGroup = factor(PerformanceGroup, levels = c("Top", "Bottom"))
    )
}


# --- Compute Step-Level RMS with Buffer + Performance Group ---
compute_step_rms_grouped <- function(df) {
  buffer <- 3
  step_markers <- c(14, 15, 16, 17)
  
  step_data <- df %>%
    filter(phase == "Execution", Marker.Text %in% step_markers) %>%
    assign_steps_by_block() %>%
    arrange(subject, Block, trial, ms) %>%
    group_by(subject, Block, trial) %>%
    mutate(row_id = row_number()) %>%
    ungroup()
  
  step_indices <- step_data %>%
    select(subject, Block, trial, row_id, Step)
  
  window_data <- map_dfr(1:nrow(step_indices), function(i) {
    step <- step_indices[i, ]
    rows <- (step$row_id - buffer):(step$row_id + buffer)
    
    step_data %>%
      filter(subject == step$subject,
             Block == step$Block,
             trial == step$trial,
             row_id %in% rows) %>%
      mutate(Step = step$Step)
  })
  
  window_data %>%
    group_by(subject, Block, Step) %>%
    summarise(
      rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
      rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
      rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
      .groups = "drop"
    ) %>%
    pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
    mutate(
      Axis = gsub("rms_", "", Axis),
      Step = as.numeric(Step),
      subject = factor(subject),
      Block = factor(Block)
    ) %>%
    tag_performance_group()
}


# --- Run LMM to Compare Top vs Bottom ---
run_group_comparison_model <- function(df, label) {
  axes <- c("x", "y", "z")
  results <- list()
  
  for (axis in axes) {
    model <- lmer(
      RMS ~ Step * Block * PerformanceGroup + (1 | subject),
      data = filter(df, Axis == axis)
    )
    
    key <- paste0(label, "_", toupper(axis))
    results[[key]] <- list(
      ANOVA = anova(model),
      Emmeans = emmeans(model, ~ Step * Block * PerformanceGroup),
      FixedEffects = fixef(model),
      RandomEffects = ranef(model),
      ScaledResiduals = resid(model, scaled = TRUE),
      Model = model
    )
  }
  
  return(results)
}


# --- Compute and Run ---
step_rms_grouped <- compute_step_rms_grouped(tagged_data)
top_bottom_results <- run_group_comparison_model(step_rms_grouped, "StepRMS_PerfGroup")

# --- Inspect X-Axis Results ---
cat("\n=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis X ===\n")

=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis X ===
print(top_bottom_results$StepRMS_PerfGroup_X$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq Mean Sq NumDF   DenDF F value    Pr(>F)    
Step                        0.23877 0.23877     1 1260.00  7.0907  0.007847 ** 
Block                       2.41418 0.60355     4 1260.00 17.9236 2.521e-14 ***
PerformanceGroup            0.04629 0.04629     1   16.82  1.3745  0.257371    
Step:Block                  0.31355 0.07839     4 1260.00  2.3279  0.054362 .  
Step:PerformanceGroup       0.00013 0.00013     1 1260.00  0.0040  0.949598    
Block:PerformanceGroup      0.20777 0.05194     4 1260.00  1.5426  0.187512    
Step:Block:PerformanceGroup 0.03661 0.00915     4 1260.00  0.2718  0.896234    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(top_bottom_results$StepRMS_PerfGroup_X$Emmeans))
 Step Block PerformanceGroup emmean     SE   df lower.CL upper.CL
  8.5 1     Top               0.993 0.1250 41.6    0.742    1.245
  8.5 2     Top               0.847 0.0998 17.2    0.636    1.057
  8.5 3     Top               0.713 0.0988 16.6    0.504    0.921
  8.5 4     Top               0.898 0.0988 16.6    0.689    1.107
  8.5 5     Top               0.741 0.0988 16.6    0.532    0.950
  8.5 1     Bottom            0.858 0.1250 41.6    0.607    1.109
  8.5 2     Bottom            0.713 0.0998 17.2    0.503    0.924
  8.5 3     Bottom            0.598 0.0988 16.6    0.389    0.807
  8.5 4     Bottom            0.620 0.0988 16.6    0.412    0.829
  8.5 5     Bottom            0.567 0.0988 16.6    0.359    0.776

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(top_bottom_results$StepRMS_PerfGroup_X$FixedEffects)
                       (Intercept)                               Step 
                      1.0232570767                      -0.0035240667 
                            Block2                             Block3 
                     -0.0573792029                      -0.2653315214 
                            Block4                             Block5 
                     -0.0915947287                      -0.2567999848 
            PerformanceGroupBottom                        Step:Block2 
                     -0.2162754294                      -0.0105202952 
                       Step:Block3                        Step:Block4 
                     -0.0018176046                      -0.0003923818 
                       Step:Block5        Step:PerformanceGroupBottom 
                      0.0005326844                       0.0095235474 
     Block2:PerformanceGroupBottom      Block3:PerformanceGroupBottom 
                      0.1127140176                       0.1095931338 
     Block4:PerformanceGroupBottom      Block5:PerformanceGroupBottom 
                     -0.0172128406                       0.0537323855 
Step:Block2:PerformanceGroupBottom Step:Block3:PerformanceGroupBottom 
                     -0.0130146071                      -0.0104805832 
Step:Block4:PerformanceGroupBottom Step:Block5:PerformanceGroupBottom 
                     -0.0147540559                      -0.0108188871 
print(top_bottom_results$StepRMS_PerfGroup_X$RandomEffects)
$subject
   (Intercept)
2   0.02063865
3   0.12662081
4  -0.15993058
5  -0.25401347
7  -0.24936885
8   0.22457842
10  0.72589981
11  0.61103956
13 -0.27790222
14 -0.05475486
15  0.01966492
16 -0.15050185
17 -0.27500607
18  0.05901077
19 -0.19351392
20 -0.15570200
22 -0.05317609
23  0.03641696

with conditional variances for "subject" 
print(head(top_bottom_results$StepRMS_PerfGroup_X$ScaledResiduals))
        1         2         3         4         5         6 
-2.514963 -2.447129 -2.415125 -2.395921 -2.202891 -2.255295 
cat("\n=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis Y ===\n")

=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis Y ===
print(top_bottom_results$StepRMS_PerfGroup_Y$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq Mean Sq NumDF   DenDF F value    Pr(>F)    
Step                        0.44036 0.44036     1 1260.00  6.4295 0.0113442 *  
Block                       2.38367 0.59592     4 1260.00  8.7008 6.291e-07 ***
PerformanceGroup            0.31771 0.31771     1   17.48  4.6388 0.0454853 *  
Step:Block                  0.36458 0.09115     4 1260.00  1.3308 0.2563668    
Step:PerformanceGroup       0.07288 0.07288     1 1260.00  1.0641 0.3024866    
Block:PerformanceGroup      1.34674 0.33669     4 1260.00  4.9158 0.0006191 ***
Step:Block:PerformanceGroup 0.30489 0.07622     4 1260.00  1.1129 0.3488521    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(top_bottom_results$StepRMS_PerfGroup_Y$Emmeans))
 Step Block PerformanceGroup emmean    SE   df lower.CL upper.CL
  8.5 1     Top               1.081 0.152 69.5    0.779    1.384
  8.5 2     Top               0.936 0.108 18.2    0.709    1.163
  8.5 3     Top               0.754 0.106 17.0    0.530    0.978
  8.5 4     Top               0.940 0.106 17.0    0.716    1.164
  8.5 5     Top               0.969 0.106 17.0    0.745    1.193
  8.5 1     Bottom            0.759 0.152 69.5    0.456    1.061
  8.5 2     Bottom            0.768 0.108 18.2    0.541    0.995
  8.5 3     Bottom            0.597 0.106 17.0    0.373    0.821
  8.5 4     Bottom            0.685 0.106 17.0    0.460    0.909
  8.5 5     Bottom            0.531 0.106 17.0    0.307    0.755

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(top_bottom_results$StepRMS_PerfGroup_Y$FixedEffects)
                       (Intercept)                               Step 
                       1.106875568                       -0.003007596 
                            Block2                             Block3 
                       0.010226216                       -0.310633623 
                            Block4                             Block5 
                      -0.050906970                       -0.006449728 
            PerformanceGroupBottom                        Step:Block2 
                      -0.342310751                       -0.018299576 
                       Step:Block3                        Step:Block4 
                      -0.001928342                       -0.010668633 
                       Step:Block5        Step:PerformanceGroupBottom 
                      -0.012418844                        0.002296496 
     Block2:PerformanceGroupBottom      Block3:PerformanceGroupBottom 
                       0.002381548                        0.181628879 
     Block4:PerformanceGroupBottom      Block5:PerformanceGroupBottom 
                       0.083415750                       -0.184748314 
Step:Block2:PerformanceGroupBottom Step:Block3:PerformanceGroupBottom 
                       0.017889324                       -0.001903484 
Step:Block4:PerformanceGroupBottom Step:Block5:PerformanceGroupBottom 
                      -0.001861503                        0.008141814 
print(top_bottom_results$StepRMS_PerfGroup_Y$RandomEffects)
$subject
    (Intercept)
2   0.080783799
3   0.316720216
4  -0.159994548
5  -0.215888243
7  -0.334291290
8   0.268888618
10  0.631831875
11  0.562812662
13 -0.323033692
14 -0.129143313
15  0.004970042
16 -0.213143582
17 -0.295401150
18  0.059210951
19 -0.211773333
20 -0.139635931
22 -0.216421817
23  0.313508736

with conditional variances for "subject" 
print(head(top_bottom_results$StepRMS_PerfGroup_Y$ScaledResiduals))
        1         2         3         4         5         6 
-2.195117 -2.331548 -2.293657 -2.282164 -2.182169 -2.058850 
cat("\n=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis Z ===\n")

=== TOP vs BOTTOM PERFORMER ANALYSIS: Axis Z ===
print(top_bottom_results$StepRMS_PerfGroup_Z$ANOVA)
Type III Analysis of Variance Table with Satterthwaite's method
                            Sum Sq Mean Sq NumDF   DenDF F value    Pr(>F)    
Step                        0.5721 0.57209     1 1260.00  3.7189   0.05403 .  
Block                       9.0610 2.26524     4 1260.00 14.7251 9.211e-12 ***
PerformanceGroup            0.2571 0.25706     1   16.71  1.6710   0.21371    
Step:Block                  1.4199 0.35499     4 1260.00  2.3076   0.05620 .  
Step:PerformanceGroup       0.0209 0.02091     1 1260.00  0.1359   0.71242    
Block:PerformanceGroup      1.5166 0.37915     4 1260.00  2.4646   0.04343 *  
Step:Block:PerformanceGroup 0.8110 0.20275     4 1260.00  1.3180   0.26117    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(top_bottom_results$StepRMS_PerfGroup_Z$Emmeans))
 Step Block PerformanceGroup emmean    SE   df lower.CL upper.CL
  8.5 1     Top                2.04 0.278 37.6    1.477     2.60
  8.5 2     Top                1.80 0.228 17.1    1.320     2.28
  8.5 3     Top                1.66 0.226 16.5    1.178     2.13
  8.5 4     Top                1.92 0.226 16.5    1.437     2.39
  8.5 5     Top                1.73 0.226 16.5    1.252     2.21
  8.5 1     Bottom             1.85 0.278 37.6    1.284     2.41
  8.5 2     Bottom             1.63 0.228 17.1    1.151     2.11
  8.5 3     Bottom             1.22 0.226 16.5    0.741     1.70
  8.5 4     Bottom             1.39 0.226 16.5    0.907     1.86
  8.5 5     Bottom             1.14 0.226 16.5    0.660     1.62

Degrees-of-freedom method: kenward-roger 
Confidence level used: 0.95 
print(top_bottom_results$StepRMS_PerfGroup_Z$FixedEffects)
                       (Intercept)                               Step 
                      1.9798197650                       0.0070763960 
                            Block2                             Block3 
                      0.0622920952                      -0.3092209024 
                            Block4                             Block5 
                      0.0929333079                      -0.1240243787 
            PerformanceGroupBottom                        Step:Block2 
                     -0.1451560468                      -0.0353677728 
                       Step:Block3                        Step:Block4 
                     -0.0087974049                      -0.0256342517 
                       Step:Block5        Step:PerformanceGroupBottom 
                     -0.0218997384                      -0.0055526106 
     Block2:PerformanceGroupBottom      Block3:PerformanceGroupBottom 
                     -0.2502326036                      -0.2393959275 
     Block4:PerformanceGroupBottom      Block5:PerformanceGroupBottom 
                     -0.3308038330                      -0.5278751442 
Step:Block2:PerformanceGroupBottom Step:Block3:PerformanceGroupBottom 
                      0.0320788302                      -0.0005753052 
Step:Block4:PerformanceGroupBottom Step:Block5:PerformanceGroupBottom 
                     -0.0008040793                       0.0151415792 
print(top_bottom_results$StepRMS_PerfGroup_Z$RandomEffects)
$subject
   (Intercept)
2  -0.31728819
3   0.51870711
4  -0.43996627
5  -0.59511638
7  -0.08056039
8   0.33987120
10  1.74233164
11  1.05116300
13 -0.35881823
14 -0.48942616
15  0.17014432
16 -0.06426532
17 -0.85998160
18  0.55890285
19 -0.51225727
20 -0.37537986
22 -0.37619749
23  0.08813705

with conditional variances for "subject" 
print(head(top_bottom_results$StepRMS_PerfGroup_Z$ScaledResiduals))
        1         2         3         4         5         6 
-1.368196 -1.521605 -1.692512 -1.710554 -1.966153 -1.902318 

#5.1 step lvl rms

# --- Summarize Data for Plotting by Block ---
plot_summary_by_block <- step_rms_grouped %>%
  group_by(Block, Step, Axis, PerformanceGroup) %>%
  summarise(
    MeanRMS = mean(RMS, na.rm = TRUE),
    SERMS = sd(RMS, na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  )

# --- Plot Function per Block and Axis ---
plot_rms_by_step_group_blocked <- function(summary_data, axis_label) {
  blocks <- unique(summary_data$Block)
  
  plots <- lapply(blocks, function(blk) {
    df_blk <- filter(summary_data, Block == blk, Axis == axis_label)
    
    ggplot(df_blk, aes(x = Step, y = MeanRMS, color = PerformanceGroup)) +
      geom_line(size = 1.2) +
      geom_point(size = 2) +
      geom_errorbar(aes(ymin = MeanRMS - SERMS, ymax = MeanRMS + SERMS), width = 0.2) +
      labs(
        title = paste("Block", blk, "- RMS (Axis", toupper(axis_label), ") by Step & Performance Group"),
        x = "Step",
        y = "Mean RMS Acceleration",
        color = "Group"
      ) +
      theme_minimal(base_size = 13)
  })
  
  return(plots)
}

# --- Plot for Axis X (returns list of ggplot objects, one per block) ---
plots_x <- plot_rms_by_step_group_blocked(plot_summary_by_block, "x")
plots_y <- plot_rms_by_step_group_blocked(plot_summary_by_block, "y")
plots_z <- plot_rms_by_step_group_blocked(plot_summary_by_block, "z")




# --- Display (e.g., first plot) ---
print(plots_x[[1]])  # Change index to view Block 2, 3, etc.

print(plots_x[[2]])

print(plots_x[[3]])

print(plots_x[[4]])

print(plots_x[[5]])

print(plots_y[[1]])  # Change index to view Block 2, 3, etc.

print(plots_y[[2]])

print(plots_y[[3]])

print(plots_y[[4]])

print(plots_y[[5]])

print(plots_z[[1]])  # Change index to view Block 2, 3, etc.

print(plots_z[[2]])

print(plots_z[[3]])

print(plots_z[[4]])

print(plots_z[[5]])

#5.2 Block avg RMS

# --- Assign Top/Bottom Groups ---
top_subjects <- c(17, 7, 23, 16, 10, 14, 13, 2, 8)

tagged_data <- tagged_data %>%
  mutate(
    PerformanceGroup = ifelse(subject %in% top_subjects, "Top", "Bottom"),
    subject = factor(subject),
    Block = factor(Block),
    phase = factor(phase)
  )


# --- Compute RMS per Block, Phase, and Subject ---
block_rms_summary <- tagged_data %>%
  group_by(subject, Block, phase, PerformanceGroup) %>%
  summarise(
    rms_x = sqrt(mean(CoM.acc.x^2, na.rm = TRUE)),
    rms_y = sqrt(mean(CoM.acc.y^2, na.rm = TRUE)),
    rms_z = sqrt(mean(CoM.acc.z^2, na.rm = TRUE)),
    .groups = "drop"
  ) %>%
  pivot_longer(cols = starts_with("rms_"), names_to = "Axis", values_to = "RMS") %>%
  mutate(Axis = gsub("rms_", "", Axis))


# --- LMM: Does Performance Group Affect RMS? ---
library(lmerTest)

run_group_block_rms_model <- function(axis) {
  lmer(RMS ~ PerformanceGroup * Block * phase + (1 | subject),
       data = filter(block_rms_summary, Axis == axis))
}

model_x <- run_group_block_rms_model("x")
model_y <- run_group_block_rms_model("y")
model_z <- run_group_block_rms_model("z")

anova(model_x)
Type III Analysis of Variance Table with Satterthwaite's method
                              Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.0665  0.0665     1    16   2.7902   0.11429    
Block                         0.2654  0.0664     4   144   2.7851   0.02885 *  
phase                        11.7375 11.7375     1   144 492.6213 < 2.2e-16 ***
PerformanceGroup:Block        0.0634  0.0159     4   144   0.6654   0.61703    
PerformanceGroup:phase        0.1430  0.1430     1   144   5.9999   0.01551 *  
Block:phase                   1.0974  0.2744     4   144  11.5147 3.874e-08 ***
PerformanceGroup:Block:phase  0.0123  0.0031     4   144   0.1290   0.97165    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(model_y)
Type III Analysis of Variance Table with Satterthwaite's method
                              Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.1166  0.1166     1    16   2.7670  0.115689    
Block                         0.3670  0.0918     4   144   2.1781  0.074368 .  
phase                        13.3322 13.3322     1   144 316.4564 < 2.2e-16 ***
PerformanceGroup:Block        0.0473  0.0118     4   144   0.2804  0.890276    
PerformanceGroup:phase        0.4641  0.4641     1   144  11.0158  0.001144 ** 
Block:phase                   1.2060  0.3015     4   144   7.1564  2.77e-05 ***
PerformanceGroup:Block:phase  0.0937  0.0234     4   144   0.5563  0.694730    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(model_z)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.247   0.247     1    16   2.7790  0.114960    
Block                         1.034   0.258     4   144   2.9125  0.023595 *  
phase                        36.376  36.376     1   144 409.9435 < 2.2e-16 ***
PerformanceGroup:Block        0.300   0.075     4   144   0.8446  0.499088    
PerformanceGroup:phase        0.717   0.717     1   144   8.0850  0.005113 ** 
Block:phase                   2.847   0.712     4   144   8.0198 7.259e-06 ***
PerformanceGroup:Block:phase  0.070   0.018     4   144   0.1985  0.938791    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# --- Plot Group Differences by Axis, Phase, and Block ---
plot_block_summary <- block_rms_summary %>%
  group_by(PerformanceGroup, Block, phase, Axis) %>%
  summarise(
    MeanRMS = mean(RMS, na.rm = TRUE),
    SERMS = sd(RMS, na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  )

ggplot(plot_block_summary, aes(x = Block, y = MeanRMS, fill = PerformanceGroup)) +
  geom_bar(stat = "identity", position = position_dodge(width = 0.8)) +
  geom_errorbar(aes(ymin = MeanRMS - SERMS, ymax = MeanRMS + SERMS),
                width = 0.2, position = position_dodge(0.8)) +
  facet_grid(phase ~ Axis) +
  labs(
    title = "Block-Level RMS by Group, Phase, and Axis",
    x = "Block", y = "Mean RMS"
  ) +
  theme_minimal(base_size = 14)

#Block avg sd

# --- Assign Top/Bottom Groups ---
top_subjects <- c(17, 7, 23, 16, 10, 14, 13, 2, 8)

tagged_data <- tagged_data %>%
  mutate(
    PerformanceGroup = ifelse(subject %in% top_subjects, "Top", "Bottom"),
    subject = factor(subject),
    Block = factor(Block),
    phase = factor(phase)
  )


# --- Compute SD per Block, Phase, and Subject ---
block_sd_summary <- tagged_data %>%
  group_by(subject, Block, phase, PerformanceGroup) %>%
  summarise(
    sd_x = sd(CoM.acc.x, na.rm = TRUE),
    sd_y = sd(CoM.acc.y, na.rm = TRUE),
    sd_z = sd(CoM.acc.z, na.rm = TRUE),
    .groups = "drop"
  ) %>%
  pivot_longer(cols = starts_with("sd_"), names_to = "Axis", values_to = "SD") %>%
  mutate(Axis = gsub("sd_", "", Axis))


# --- LMM: Does Performance Group Affect SD? ---
library(lmerTest)

run_group_block_sd_model <- function(axis) {
  lmer(SD ~ PerformanceGroup * Block * phase + (1 | subject),
       data = filter(block_sd_summary, Axis == axis))
}

model_x_sd <- run_group_block_sd_model("x")
model_y_sd <- run_group_block_sd_model("y")
model_z_sd <- run_group_block_sd_model("z")

anova(model_x_sd)
Type III Analysis of Variance Table with Satterthwaite's method
                              Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.0664  0.0664     1    16   2.7875   0.11445    
Block                         0.2658  0.0665     4   144   2.7895   0.02865 *  
phase                        11.7419 11.7419     1   144 492.8999 < 2.2e-16 ***
PerformanceGroup:Block        0.0635  0.0159     4   144   0.6666   0.61620    
PerformanceGroup:phase        0.1429  0.1429     1   144   5.9998   0.01551 *  
Block:phase                   1.0974  0.2743     4   144  11.5164 3.864e-08 ***
PerformanceGroup:Block:phase  0.0124  0.0031     4   144   0.1296   0.97141    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(model_y_sd)
Type III Analysis of Variance Table with Satterthwaite's method
                              Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.1165  0.1165     1    16   2.7656  0.115775    
Block                         0.3670  0.0918     4   144   2.1778  0.074397 .  
phase                        13.3371 13.3371     1   144 316.5745 < 2.2e-16 ***
PerformanceGroup:Block        0.0474  0.0119     4   144   0.2813  0.889703    
PerformanceGroup:phase        0.4638  0.4638     1   144  11.0084  0.001149 ** 
Block:phase                   1.2063  0.3016     4   144   7.1582 2.762e-05 ***
PerformanceGroup:Block:phase  0.0939  0.0235     4   144   0.5571  0.694137    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(model_z_sd)
Type III Analysis of Variance Table with Satterthwaite's method
                             Sum Sq Mean Sq NumDF DenDF  F value    Pr(>F)    
PerformanceGroup              0.246   0.246     1    16   2.7764  0.115116    
Block                         1.033   0.258     4   144   2.9113  0.023638 *  
phase                        36.347  36.347     1   144 409.6106 < 2.2e-16 ***
PerformanceGroup:Block        0.299   0.075     4   144   0.8433  0.499915    
PerformanceGroup:phase        0.716   0.716     1   144   8.0702  0.005153 ** 
Block:phase                   2.848   0.712     4   144   8.0237 7.216e-06 ***
PerformanceGroup:Block:phase  0.070   0.018     4   144   0.1981  0.939039    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# --- Plot Group Differences for SD by Axis, Phase, and Block ---
plot_block_sd <- block_sd_summary %>%
  group_by(PerformanceGroup, Block, phase, Axis) %>%
  summarise(
    MeanSD = mean(SD, na.rm = TRUE),
    SESD = sd(SD, na.rm = TRUE) / sqrt(n()),
    .groups = "drop"
  )

ggplot(plot_block_sd, aes(x = Block, y = MeanSD, fill = PerformanceGroup)) +
  geom_bar(stat = "identity", position = position_dodge(width = 0.8)) +
  geom_errorbar(aes(ymin = MeanSD - SESD, ymax = MeanSD + SESD),
                width = 0.2, position = position_dodge(0.8)) +
  facet_grid(phase ~ Axis) +
  labs(
    title = "Block-Level SD by Group, Phase, and Axis",
    x = "Block", y = "Mean SD"
  ) +
  theme_minimal(base_size = 14)