Setup & Data Preparation

Load & Reconstruct

metrics <- read_csv("/Users/rialeung/Desktop/KITE/Thesis/Spectral Analysis/files/metrics_full_filtered.csv")

# Reconstruct Condition3 if not present
if (!"Condition3" %in% colnames(metrics)) {
  metrics <- metrics %>%
    mutate(
      HearingAid = str_to_title(str_trim(as.character(HearingAid))),
      Condition3 = case_when(
        Group == "NHOA"                            ~ "NHOA",
        Group == "HLHA" & HearingAid == "Aided"   ~ "HL_Aided",
        Group == "HLHA" & HearingAid == "Unaided" ~ "HL_Unaided",
        TRUE ~ NA_character_
      )
    )
  cat("Condition3 reconstructed from Group + HearingAid.\n")
  print(table(metrics$Condition3, useNA = "always"))
}
## Condition3 reconstructed from Group + HearingAid.
## 
##   HL_Aided HL_Unaided       NHOA       <NA> 
##        428        415       1036          0

Factor Setup & Derived Metrics

metrics <- metrics %>%
  mutate(
    Condition3 = factor(Condition3,
                        levels = c("NHOA", "HL_Aided", "HL_Unaided"),
                        labels = c("NHOA", "HL Aided", "HL Unaided")),
    Posture = factor(Posture,
                     levels = c("Testing", "Sitting", "Standing_Firm", "Standing_Compliant",
                                "Firm", "Compliant"),
                     labels = c("Testing", "Sitting", "Firm", "Compliant",
                                "Firm", "Compliant")),
    Eyes      = factor(Eyes,      levels = c("Open", "Closed")),
    Listening = factor(Listening, levels = c("None", "LowEffort", "HighEffort")),
    Acoustic  = factor(Acoustic,  levels = c("None", "WhiteNoise", "SpatialSounds")),
    StudyID   = factor(StudyID),
    Session   = factor(Session)
  ) %>%
  mutate(
    HF_LF_ratio  = (mean_BP_05_1 + mean_BP_1_5) / (mean_BP_0_01 + mean_BP_01_05),
    log_MPF      = log(mean_MPF      + 1),
    log_BP_0_01  = log(mean_BP_0_01  + 1e-6),
    log_BP_01_05 = log(mean_BP_01_05 + 1e-6),
    log_BP_05_1  = log(mean_BP_05_1  + 1e-6),
    log_BP_1_5   = log(mean_BP_1_5   + 1e-6),
    log_HF_LF    = log(HF_LF_ratio   + 1e-6),
    total_power  = mean_BP_0_01 + mean_BP_01_05 + mean_BP_05_1 + mean_BP_1_5
  )

Filter & Winsorize

metrics_clean <- metrics %>%
  filter(!is.na(Condition3), !is.na(Posture), !is.na(mean_MPF))

winsorize_sd <- function(x, n_sd = 3.5) {
  m <- mean(x, na.rm = TRUE)
  s <- sd(x,   na.rm = TRUE)
  pmax(pmin(x, m + n_sd * s), m - n_sd * s)
}

spectral_cols <- c("mean_MPF", "HF_LF_ratio", "log_MPF", "log_HF_LF",
                   "mean_BP_0_01", "mean_BP_01_05", "mean_BP_05_1", "mean_BP_1_5",
                   "log_BP_0_01",  "log_BP_01_05",  "log_BP_05_1",  "log_BP_1_5",
                   "total_power")

metrics_clean <- metrics_clean %>%
  mutate(across(all_of(spectral_cols), winsorize_sd))

cat("Winsorizing complete. HF_LF_ratio range:",
    round(range(metrics_clean$HF_LF_ratio, na.rm = TRUE), 3), "\n")
## Winsorizing complete. HF_LF_ratio range: 0.007 2.562

Condition Subsets

# A: Eyes Open, No Listening — single-task baseline
metrics_baseline <- metrics_clean %>%
  filter(Eyes == "Open", Listening == "None", Acoustic == "None")

# B: Eyes Open, High Listening — moderate dual-task demand
metrics_dualtask <- metrics_clean %>%
  filter(Eyes == "Open", Listening == "HighEffort", Acoustic == "None")

# C: Eyes Closed, Low Listening — where significant results concentrate
metrics_closedlow <- metrics_clean %>%
  filter(Eyes == "Closed", Listening == "LowEffort", Acoustic == "None")

# D: Eyes Closed, High Listening — where HF/LF trends live
metrics_closedhigh <- metrics_clean %>%
  filter(Eyes == "Closed", Listening == "HighEffort", Acoustic == "None")

# E: Eyes Closed, Low Listening — ALL acoustic conditions
metrics_closedlow_acoustic <- metrics_clean %>%
  filter(Eyes == "Closed", Listening == "LowEffort")

cat("Baseline (Eyes Open, No Listening) n =",        nrow(metrics_baseline), "\n")
## Baseline (Eyes Open, No Listening) n = 105
cat("Dual-task (Eyes Open, High Listening) n =",     nrow(metrics_dualtask), "\n")
## Dual-task (Eyes Open, High Listening) n = 106
cat("Closed/Low (Eyes Closed, Low Listening) n =",   nrow(metrics_closedlow), "\n")
## Closed/Low (Eyes Closed, Low Listening) n = 105
cat("Closed/High (Eyes Closed, High Listening) n =", nrow(metrics_closedhigh), "\n")
## Closed/High (Eyes Closed, High Listening) n = 104
cat("\nBaseline by Condition3 x Posture:\n")
## 
## Baseline by Condition3 x Posture:
print(table(metrics_baseline$Condition3, metrics_baseline$Posture))
##             
##              Testing Sitting Firm Compliant
##   NHOA             0       0   30        28
##   HL Aided         0       0   12        12
##   HL Unaided       0       0   12        11
cat("\nDual-task by Condition3 x Posture:\n")
## 
## Dual-task by Condition3 x Posture:
print(table(metrics_dualtask$Condition3, metrics_dualtask$Posture))
##             
##              Testing Sitting Firm Compliant
##   NHOA             0       0   30        28
##   HL Aided         0       0   12        12
##   HL Unaided       0       0   12        12
cat("\nClosed/Low by Condition3 x Posture:\n")
## 
## Closed/Low by Condition3 x Posture:
print(table(metrics_closedlow$Condition3, metrics_closedlow$Posture))
##             
##              Testing Sitting Firm Compliant
##   NHOA             0       0   30        28
##   HL Aided         0       0   12        12
##   HL Unaided       0       0   12        11
cat("\nClosed/High by Condition3 x Posture:\n")
## 
## Closed/High by Condition3 x Posture:
print(table(metrics_closedhigh$Condition3, metrics_closedhigh$Posture))
##             
##              Testing Sitting Firm Compliant
##   NHOA             0       0   29        28
##   HL Aided         0       0   12        12
##   HL Unaided       0       0   12        11

Descriptive Statistics

Eyes Open, No Listening

metrics_baseline %>%
  group_by(Condition3, Posture) %>%
  summarise(
    n          = n(),
    MPF_M      = round(mean(mean_MPF,      na.rm = TRUE), 3),
    MPF_SD     = round(sd(mean_MPF,        na.rm = TRUE), 3),
    HFLF_M     = round(mean(HF_LF_ratio,   na.rm = TRUE), 3),
    HFLF_SD    = round(sd(HF_LF_ratio,     na.rm = TRUE), 3),
    BP_0_01_M  = round(mean(mean_BP_0_01,  na.rm = TRUE), 4),
    BP_01_05_M = round(mean(mean_BP_01_05, na.rm = TRUE), 4),
    BP_05_1_M  = round(mean(mean_BP_05_1,  na.rm = TRUE), 4),
    BP_1_5_M   = round(mean(mean_BP_1_5,   na.rm = TRUE), 4),
    .groups = "drop"
  ) %>%
  knitr::kable(caption = "Descriptives: Eyes Open, No Listening")
Descriptives: Eyes Open, No Listening
Condition3 Posture n MPF_M MPF_SD HFLF_M HFLF_SD BP_0_01_M BP_01_05_M BP_05_1_M BP_1_5_M
NHOA Firm 30 0.440 0.171 0.585 0.647 9.6091 28.4757 10.4935 4.6370
NHOA Compliant 28 0.521 0.180 0.738 0.603 14.9230 64.2248 21.1936 10.5242
HL Aided Firm 12 0.464 0.178 0.594 0.551 4.9209 36.0015 10.9361 4.4949
HL Aided Compliant 12 0.553 0.166 0.578 0.385 10.6360 50.4897 14.5201 13.6329
HL Unaided Firm 12 0.345 0.120 0.255 0.175 27.0982 57.5537 5.8169 3.8436
HL Unaided Compliant 11 0.511 0.187 0.492 0.421 15.7799 81.3265 15.2481 14.0835

Eyes Open, High Listening

metrics_dualtask %>%
  group_by(Condition3, Posture) %>%
  summarise(
    n          = n(),
    MPF_M      = round(mean(mean_MPF,      na.rm = TRUE), 3),
    MPF_SD     = round(sd(mean_MPF,        na.rm = TRUE), 3),
    HFLF_M     = round(mean(HF_LF_ratio,   na.rm = TRUE), 3),
    HFLF_SD    = round(sd(HF_LF_ratio,     na.rm = TRUE), 3),
    BP_0_01_M  = round(mean(mean_BP_0_01,  na.rm = TRUE), 4),
    BP_01_05_M = round(mean(mean_BP_01_05, na.rm = TRUE), 4),
    BP_05_1_M  = round(mean(mean_BP_05_1,  na.rm = TRUE), 4),
    BP_1_5_M   = round(mean(mean_BP_1_5,   na.rm = TRUE), 4),
    .groups = "drop"
  ) %>%
  knitr::kable(caption = "Descriptives: Eyes Open, High Listening")
Descriptives: Eyes Open, High Listening
Condition3 Posture n MPF_M MPF_SD HFLF_M HFLF_SD BP_0_01_M BP_01_05_M BP_05_1_M BP_1_5_M
NHOA Firm 30 0.354 0.186 0.458 0.576 22.1290 28.4739 13.2204 5.1938
NHOA Compliant 28 0.433 0.110 0.450 0.420 18.7475 53.9719 21.5010 8.3772
HL Aided Firm 12 0.358 0.143 0.327 0.326 22.7910 52.7229 12.9971 4.4667
HL Aided Compliant 12 0.417 0.114 0.360 0.184 28.5981 74.7277 16.3830 11.2000
HL Unaided Firm 12 0.288 0.107 0.218 0.225 36.7832 81.8484 11.1586 5.3148
HL Unaided Compliant 12 0.385 0.199 0.324 0.344 42.7847 78.5050 19.7211 13.5979

LME Models

Log MPF

res_mpf <- run_lme("log_MPF", "Log MPF", metrics_clean)
## 
## 
## === LME: Log MPF ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                             Sum Sq Mean Sq NumDF  DenDF
## Condition3                                 0.01478 0.00739     2   60.6
## Posture                                    1.65354 1.65354     1 1850.0
## Eyes                                       0.21406 0.21406     1 1847.8
## Listening                                  0.74459 0.37230     2 1847.2
## Acoustic                                   0.00052 0.00026     2 1847.2
## Condition3:Posture                         0.08944 0.04472     2 1850.6
## Condition3:Eyes                            0.04742 0.02371     2 1848.0
## Posture:Eyes                               0.04684 0.04684     1 1847.8
## Condition3:Listening                       0.04627 0.01157     4 1847.2
## Posture:Listening                          0.03203 0.01601     2 1847.2
## Eyes:Listening                             0.06552 0.03276     2 1847.2
## Condition3:Acoustic                        0.03488 0.00872     4 1847.2
## Posture:Acoustic                           0.01528 0.00764     2 1847.2
## Eyes:Acoustic                              0.00813 0.00407     2 1847.2
## Listening:Acoustic                         0.04494 0.01124     4 1847.2
## Condition3:Posture:Eyes                    0.08524 0.04262     2 1848.0
## Condition3:Posture:Listening               0.01143 0.00286     4 1847.2
## Condition3:Eyes:Listening                  0.02576 0.00644     4 1847.2
## Posture:Eyes:Listening                     0.00776 0.00388     2 1847.2
## Condition3:Posture:Acoustic                0.03292 0.00823     4 1847.2
## Condition3:Eyes:Acoustic                   0.02349 0.00587     4 1847.2
## Posture:Eyes:Acoustic                      0.01413 0.00706     2 1847.2
## Condition3:Listening:Acoustic              0.01516 0.00189     8 1847.2
## Posture:Listening:Acoustic                 0.02583 0.00646     4 1847.2
## Eyes:Listening:Acoustic                    0.11258 0.02815     4 1847.2
## Condition3:Posture:Eyes:Listening          0.01827 0.00457     4 1847.2
## Condition3:Posture:Eyes:Acoustic           0.00714 0.00179     4 1847.2
## Condition3:Posture:Listening:Acoustic      0.08439 0.01055     8 1847.2
## Condition3:Eyes:Listening:Acoustic         0.07516 0.00939     8 1847.2
## Posture:Eyes:Listening:Acoustic            0.01059 0.00265     4 1847.2
## Condition3:Posture:Eyes:Listening:Acoustic 0.07583 0.00948     8 1847.2
##                                             F value    Pr(>F)    
## Condition3                                   0.9721  0.384098    
## Posture                                    217.5435 < 2.2e-16 ***
## Eyes                                        28.1617  1.25e-07 ***
## Listening                                   48.9800 < 2.2e-16 ***
## Acoustic                                     0.0339  0.966645    
## Condition3:Posture                           5.8838  0.002837 ** 
## Condition3:Eyes                              3.1194  0.044418 *  
## Posture:Eyes                                 6.1624  0.013137 *  
## Condition3:Listening                         1.5217  0.193240    
## Posture:Listening                            2.1067  0.121928    
## Eyes:Listening                               4.3098  0.013572 *  
## Condition3:Acoustic                          1.1472  0.332529    
## Posture:Acoustic                             1.0054  0.366115    
## Eyes:Acoustic                                0.5349  0.585790    
## Listening:Acoustic                           1.4782  0.206227    
## Condition3:Posture:Eyes                      5.6069  0.003735 ** 
## Condition3:Posture:Listening                 0.3758  0.826029    
## Condition3:Eyes:Listening                    0.8473  0.495106    
## Posture:Eyes:Listening                       0.5107  0.600132    
## Condition3:Posture:Acoustic                  1.0827  0.363405    
## Condition3:Eyes:Acoustic                     0.7726  0.542943    
## Posture:Eyes:Acoustic                        0.9292  0.395067    
## Condition3:Listening:Acoustic                0.2493  0.981118    
## Posture:Listening:Acoustic                   0.8496  0.493667    
## Eyes:Listening:Acoustic                      3.7029  0.005224 ** 
## Condition3:Posture:Eyes:Listening            0.6009  0.662040    
## Condition3:Posture:Eyes:Acoustic             0.2349  0.918774    
## Condition3:Posture:Listening:Acoustic        1.3879  0.196775    
## Condition3:Eyes:Listening:Acoustic           1.2360  0.273725    
## Posture:Eyes:Listening:Acoustic              0.3482  0.845401    
## Condition3:Posture:Eyes:Listening:Acoustic   1.2470  0.267476    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log HF/LF Ratio

res_hflf <- run_lme("log_HF_LF", "Log HF/LF Ratio", metrics_clean)
## 
## 
## === LME: Log HF/LF Ratio ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                            Sum Sq Mean Sq NumDF   DenDF F value
## Condition3                                  1.455   0.728     2   60.62  1.2917
## Posture                                    42.895  42.895     1 1850.26 76.1406
## Eyes                                        6.212   6.212     1 1847.87 11.0257
## Listening                                  14.095   7.047     2 1847.24 12.5093
## Acoustic                                    0.051   0.026     2 1847.28  0.0455
## Condition3:Posture                          4.369   2.185     2 1850.86  3.8776
## Condition3:Eyes                             3.449   1.725     2 1848.06  3.0611
## Posture:Eyes                                1.142   1.142     1 1847.87  2.0263
## Condition3:Listening                        1.887   0.472     4 1847.25  0.8373
## Posture:Listening                           0.957   0.479     2 1847.24  0.8495
## Eyes:Listening                              2.363   1.181     2 1847.24  2.0971
## Condition3:Acoustic                         3.116   0.779     4 1847.28  1.3827
## Posture:Acoustic                            1.018   0.509     2 1847.28  0.9037
## Eyes:Acoustic                               0.203   0.101     2 1847.25  0.1799
## Listening:Acoustic                          3.142   0.786     4 1847.25  1.3945
## Condition3:Posture:Eyes                     6.320   3.160     2 1848.06  5.6093
## Condition3:Posture:Listening                0.584   0.146     4 1847.25  0.2592
## Condition3:Eyes:Listening                   2.366   0.592     4 1847.25  1.0500
## Posture:Eyes:Listening                      0.518   0.259     2 1847.24  0.4596
## Condition3:Posture:Acoustic                 1.290   0.323     4 1847.28  0.5725
## Condition3:Eyes:Acoustic                    1.684   0.421     4 1847.25  0.7475
## Posture:Eyes:Acoustic                       1.278   0.639     2 1847.25  1.1339
## Condition3:Listening:Acoustic               2.000   0.250     8 1847.25  0.4438
## Posture:Listening:Acoustic                  1.247   0.312     4 1847.25  0.5536
## Eyes:Listening:Acoustic                     8.042   2.011     4 1847.25  3.5689
## Condition3:Posture:Eyes:Listening           2.487   0.622     4 1847.25  1.1038
## Condition3:Posture:Eyes:Acoustic            0.445   0.111     4 1847.25  0.1976
## Condition3:Posture:Listening:Acoustic       5.310   0.664     8 1847.25  1.1783
## Condition3:Eyes:Listening:Acoustic          4.390   0.549     8 1847.25  0.9740
## Posture:Eyes:Listening:Acoustic             0.288   0.072     4 1847.25  0.1277
## Condition3:Posture:Eyes:Listening:Acoustic  4.920   0.615     8 1847.25  1.0916
##                                               Pr(>F)    
## Condition3                                  0.282260    
## Posture                                    < 2.2e-16 ***
## Eyes                                        0.000916 ***
## Listening                                  4.015e-06 ***
## Acoustic                                    0.955539    
## Condition3:Posture                          0.020868 *  
## Condition3:Eyes                             0.047073 *  
## Posture:Eyes                                0.154770    
## Condition3:Listening                        0.501390    
## Posture:Listening                           0.427781    
## Eyes:Listening                              0.123108    
## Condition3:Acoustic                         0.237494    
## Posture:Acoustic                            0.405260    
## Eyes:Acoustic                               0.835405    
## Listening:Acoustic                          0.233420    
## Condition3:Posture:Eyes                     0.003726 ** 
## Condition3:Posture:Listening                0.904130    
## Condition3:Eyes:Listening                   0.379916    
## Posture:Eyes:Listening                      0.631628    
## Condition3:Posture:Acoustic                 0.682609    
## Condition3:Eyes:Acoustic                    0.559646    
## Posture:Eyes:Acoustic                       0.322013    
## Condition3:Listening:Acoustic               0.895088    
## Posture:Listening:Acoustic                  0.696423    
## Eyes:Listening:Acoustic                     0.006601 ** 
## Condition3:Posture:Eyes:Listening           0.353082    
## Condition3:Posture:Eyes:Acoustic            0.939680    
## Condition3:Posture:Listening:Acoustic       0.308320    
## Condition3:Eyes:Listening:Acoustic          0.454408    
## Posture:Eyes:Listening:Acoustic             0.972409    
## Condition3:Posture:Eyes:Listening:Acoustic  0.365896    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log BP 0–0.1 Hz

res_bp001 <- run_lme("log_BP_0_01", "Log BP 0-0.1 Hz", metrics_clean)
## 
## 
## === LME: Log BP 0-0.1 Hz ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                            Sum Sq Mean Sq NumDF   DenDF
## Condition3                                  18.42   9.209     2   59.17
## Posture                                    141.32 141.321     1 1852.37
## Eyes                                         4.28   4.281     1 1847.94
## Listening                                  433.39 216.694     2 1846.99
## Acoustic                                     1.34   0.669     2 1847.06
## Condition3:Posture                           4.65   2.325     2 1853.27
## Condition3:Eyes                              7.20   3.598     2 1848.23
## Posture:Eyes                                12.79  12.786     1 1847.94
## Condition3:Listening                        18.81   4.702     4 1847.00
## Posture:Listening                           19.74   9.870     2 1846.99
## Eyes:Listening                              12.38   6.190     2 1846.99
## Condition3:Acoustic                          6.68   1.671     4 1847.06
## Posture:Acoustic                             1.98   0.991     2 1847.06
## Eyes:Acoustic                                0.22   0.108     2 1847.01
## Listening:Acoustic                           2.52   0.631     4 1846.99
## Condition3:Posture:Eyes                      5.59   2.795     2 1848.23
## Condition3:Posture:Listening                11.07   2.768     4 1847.00
## Condition3:Eyes:Listening                    6.92   1.730     4 1847.00
## Posture:Eyes:Listening                       5.12   2.560     2 1846.99
## Condition3:Posture:Acoustic                  6.35   1.587     4 1847.06
## Condition3:Eyes:Acoustic                     4.76   1.191     4 1847.01
## Posture:Eyes:Acoustic                        3.85   1.925     2 1847.01
## Condition3:Listening:Acoustic               14.60   1.825     8 1847.00
## Posture:Listening:Acoustic                   1.71   0.427     4 1846.99
## Eyes:Listening:Acoustic                      4.90   1.224     4 1846.99
## Condition3:Posture:Eyes:Listening            2.95   0.737     4 1847.00
## Condition3:Posture:Eyes:Acoustic             3.96   0.991     4 1847.01
## Condition3:Posture:Listening:Acoustic        7.13   0.891     8 1847.00
## Condition3:Eyes:Listening:Acoustic           8.59   1.074     8 1847.00
## Posture:Eyes:Listening:Acoustic              2.41   0.601     4 1846.99
## Condition3:Posture:Eyes:Listening:Acoustic   7.81   0.976     8 1847.00
##                                             F value    Pr(>F)    
## Condition3                                   6.2634  0.003409 ** 
## Posture                                     96.1140 < 2.2e-16 ***
## Eyes                                         2.9113  0.088128 .  
## Listening                                  147.3760 < 2.2e-16 ***
## Acoustic                                     0.4551  0.634444    
## Condition3:Posture                           1.5810  0.206047    
## Condition3:Eyes                              2.4473  0.086807 .  
## Posture:Eyes                                 8.6959  0.003229 ** 
## Condition3:Listening                         3.1978  0.012542 *  
## Posture:Listening                            6.7130  0.001245 ** 
## Eyes:Listening                               4.2097  0.014994 *  
## Condition3:Acoustic                          1.1366  0.337461    
## Posture:Acoustic                             0.6743  0.509630    
## Eyes:Acoustic                                0.0735  0.929166    
## Listening:Acoustic                           0.4290  0.787751    
## Condition3:Posture:Eyes                      1.9006  0.149772    
## Condition3:Posture:Listening                 1.8827  0.110852    
## Condition3:Eyes:Listening                    1.1768  0.319083    
## Posture:Eyes:Listening                       1.7412  0.175606    
## Condition3:Posture:Acoustic                  1.0796  0.364971    
## Condition3:Eyes:Acoustic                     0.8097  0.518861    
## Posture:Eyes:Acoustic                        1.3094  0.270228    
## Condition3:Listening:Acoustic                1.2411  0.270807    
## Posture:Listening:Acoustic                   0.2903  0.884410    
## Eyes:Listening:Acoustic                      0.8327  0.504230    
## Condition3:Posture:Eyes:Listening            0.5015  0.734678    
## Condition3:Posture:Eyes:Acoustic             0.6739  0.610043    
## Condition3:Posture:Listening:Acoustic        0.6060  0.773543    
## Condition3:Eyes:Listening:Acoustic           0.7304  0.664790    
## Posture:Eyes:Listening:Acoustic              0.4090  0.802250    
## Condition3:Posture:Eyes:Listening:Acoustic   0.6639  0.723742    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log BP 0.1–0.5 Hz

res_bp015 <- run_lme("log_BP_01_05", "Log BP 0.1-0.5 Hz", metrics_clean)
## 
## 
## === LME: Log BP 0.1-0.5 Hz ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                            Sum Sq Mean Sq NumDF  DenDF  F value
## Condition3                                   7.95    3.98     2   60.6   6.4014
## Posture                                    331.36  331.36     1 1849.5 533.5371
## Eyes                                         1.36    1.36     1 1847.6   2.1856
## Listening                                    0.05    0.03     2 1847.1   0.0416
## Acoustic                                     0.12    0.06     2 1847.1   0.0966
## Condition3:Posture                           2.38    1.19     2 1850.0   1.9156
## Condition3:Eyes                              6.46    3.23     2 1847.8   5.2025
## Posture:Eyes                                23.68   23.68     1 1847.6  38.1246
## Condition3:Listening                         0.97    0.24     4 1847.1   0.3898
## Posture:Listening                            2.67    1.34     2 1847.1   2.1497
## Eyes:Listening                               0.05    0.03     2 1847.1   0.0426
## Condition3:Acoustic                          3.24    0.81     4 1847.1   1.3042
## Posture:Acoustic                             0.43    0.21     2 1847.1   0.3422
## Eyes:Acoustic                                1.81    0.90     2 1847.1   1.4547
## Listening:Acoustic                           0.40    0.10     4 1847.1   0.1606
## Condition3:Posture:Eyes                      0.48    0.24     2 1847.8   0.3874
## Condition3:Posture:Listening                 1.16    0.29     4 1847.1   0.4683
## Condition3:Eyes:Listening                    2.46    0.62     4 1847.1   0.9904
## Posture:Eyes:Listening                       0.76    0.38     2 1847.1   0.6105
## Condition3:Posture:Acoustic                  5.02    1.25     4 1847.1   2.0200
## Condition3:Eyes:Acoustic                     1.82    0.46     4 1847.1   0.7336
## Posture:Eyes:Acoustic                        2.12    1.06     2 1847.1   1.7044
## Condition3:Listening:Acoustic                2.58    0.32     8 1847.1   0.5201
## Posture:Listening:Acoustic                   0.41    0.10     4 1847.1   0.1652
## Eyes:Listening:Acoustic                      1.81    0.45     4 1847.1   0.7287
## Condition3:Posture:Eyes:Listening            1.26    0.32     4 1847.1   0.5092
## Condition3:Posture:Eyes:Acoustic             3.93    0.98     4 1847.1   1.5827
## Condition3:Posture:Listening:Acoustic        6.73    0.84     8 1847.1   1.3544
## Condition3:Eyes:Listening:Acoustic           2.52    0.31     8 1847.1   0.5065
## Posture:Eyes:Listening:Acoustic              0.63    0.16     4 1847.1   0.2548
## Condition3:Posture:Eyes:Listening:Acoustic   2.76    0.35     8 1847.1   0.5555
##                                               Pr(>F)    
## Condition3                                  0.003005 ** 
## Posture                                    < 2.2e-16 ***
## Eyes                                        0.139474    
## Listening                                   0.959226    
## Acoustic                                    0.907883    
## Condition3:Posture                          0.147546    
## Condition3:Eyes                             0.005584 ** 
## Posture:Eyes                               8.139e-10 ***
## Condition3:Listening                        0.816051    
## Posture:Listening                           0.116805    
## Eyes:Listening                              0.958324    
## Condition3:Acoustic                         0.266195    
## Posture:Acoustic                            0.710235    
## Eyes:Acoustic                               0.233741    
## Listening:Acoustic                          0.958231    
## Condition3:Posture:Eyes                     0.678888    
## Condition3:Posture:Listening                0.759032    
## Condition3:Eyes:Listening                   0.411539    
## Posture:Eyes:Listening                      0.543209    
## Condition3:Posture:Acoustic                 0.089166 .  
## Condition3:Eyes:Acoustic                    0.569002    
## Posture:Eyes:Acoustic                       0.182170    
## Condition3:Listening:Acoustic               0.842106    
## Posture:Listening:Acoustic                  0.956032    
## Eyes:Listening:Acoustic                     0.572295    
## Condition3:Posture:Eyes:Listening           0.728998    
## Condition3:Posture:Eyes:Acoustic            0.176277    
## Condition3:Posture:Listening:Acoustic       0.212044    
## Condition3:Eyes:Listening:Acoustic          0.852230    
## Posture:Eyes:Listening:Acoustic             0.906828    
## Condition3:Posture:Eyes:Listening:Acoustic  0.814824    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log BP 0.5–1 Hz

res_bp051 <- run_lme("log_BP_05_1", "Log BP 0.5-1 Hz", metrics_clean)
## 
## 
## === LME: Log BP 0.5-1 Hz ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                            Sum Sq Mean Sq NumDF   DenDF
## Condition3                                   5.29    2.65     2   60.69
## Posture                                    377.65  377.65     1 1849.25
## Eyes                                         1.33    1.33     1 1847.59
## Listening                                    1.82    0.91     2 1847.13
## Acoustic                                     0.36    0.18     2 1847.15
## Condition3:Posture                           0.49    0.24     2 1849.70
## Condition3:Eyes                             13.24    6.62     2 1847.73
## Posture:Eyes                                30.21   30.21     1 1847.59
## Condition3:Listening                         1.50    0.37     4 1847.13
## Posture:Listening                            3.01    1.50     2 1847.13
## Eyes:Listening                               0.81    0.40     2 1847.13
## Condition3:Acoustic                          1.18    0.29     4 1847.15
## Posture:Acoustic                             0.90    0.45     2 1847.15
## Eyes:Acoustic                                0.72    0.36     2 1847.13
## Listening:Acoustic                           2.97    0.74     4 1847.13
## Condition3:Posture:Eyes                      2.55    1.28     2 1847.73
## Condition3:Posture:Listening                 0.18    0.04     4 1847.13
## Condition3:Eyes:Listening                    2.88    0.72     4 1847.13
## Posture:Eyes:Listening                       1.56    0.78     2 1847.13
## Condition3:Posture:Acoustic                  6.11    1.53     4 1847.15
## Condition3:Eyes:Acoustic                     1.79    0.45     4 1847.13
## Posture:Eyes:Acoustic                        1.86    0.93     2 1847.13
## Condition3:Listening:Acoustic                6.02    0.75     8 1847.13
## Posture:Listening:Acoustic                   1.53    0.38     4 1847.13
## Eyes:Listening:Acoustic                      2.76    0.69     4 1847.13
## Condition3:Posture:Eyes:Listening            2.14    0.53     4 1847.13
## Condition3:Posture:Eyes:Acoustic             5.11    1.28     4 1847.13
## Condition3:Posture:Listening:Acoustic        3.66    0.46     8 1847.13
## Condition3:Eyes:Listening:Acoustic           4.03    0.50     8 1847.13
## Posture:Eyes:Listening:Acoustic              0.64    0.16     4 1847.13
## Condition3:Posture:Eyes:Listening:Acoustic   5.02    0.63     8 1847.13
##                                             F value    Pr(>F)    
## Condition3                                   3.7889   0.02814 *  
## Posture                                    540.4704 < 2.2e-16 ***
## Eyes                                         1.9043   0.16777    
## Listening                                    1.3056   0.27126    
## Acoustic                                     0.2576   0.77295    
## Condition3:Posture                           0.3490   0.70547    
## Condition3:Eyes                              9.4771 8.037e-05 ***
## Posture:Eyes                                43.2349 6.299e-11 ***
## Condition3:Listening                         0.5359   0.70938    
## Posture:Listening                            2.1534   0.11638    
## Eyes:Listening                               0.5779   0.56117    
## Condition3:Acoustic                          0.4218   0.79298    
## Posture:Acoustic                             0.6469   0.52379    
## Eyes:Acoustic                                0.5136   0.59845    
## Listening:Acoustic                           1.0642   0.37268    
## Condition3:Posture:Eyes                      1.8273   0.16113    
## Condition3:Posture:Listening                 0.0628   0.99275    
## Condition3:Eyes:Listening                    1.0308   0.38988    
## Posture:Eyes:Listening                       1.1149   0.32816    
## Condition3:Posture:Acoustic                  2.1870   0.06816 .  
## Condition3:Eyes:Acoustic                     0.6388   0.63488    
## Posture:Eyes:Acoustic                        1.3284   0.26516    
## Condition3:Listening:Acoustic                1.0769   0.37636    
## Posture:Listening:Acoustic                   0.5481   0.70041    
## Eyes:Listening:Acoustic                      0.9871   0.41329    
## Condition3:Posture:Eyes:Listening            0.7653   0.54776    
## Condition3:Posture:Eyes:Acoustic             1.8268   0.12101    
## Condition3:Posture:Listening:Acoustic        0.6541   0.73229    
## Condition3:Eyes:Listening:Acoustic           0.7209   0.67323    
## Posture:Eyes:Listening:Acoustic              0.2292   0.92209    
## Condition3:Posture:Eyes:Listening:Acoustic   0.8981   0.51709    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Log BP 1–5 Hz

res_bp15 <- run_lme("log_BP_1_5", "Log BP 1-5 Hz", metrics_clean)
## 
## 
## === LME: Log BP 1-5 Hz ===
## 
## --- Fixed Effects (Type III ANOVA) ---
## Type III Analysis of Variance Table with Satterthwaite's method
##                                            Sum Sq Mean Sq NumDF   DenDF
## Condition3                                   5.16    2.58     2   61.05
## Posture                                    751.98  751.98     1 1849.03
## Eyes                                        29.75   29.75     1 1847.65
## Listening                                    2.37    1.18     2 1847.26
## Acoustic                                     0.01    0.01     2 1847.27
## Condition3:Posture                           0.76    0.38     2 1849.42
## Condition3:Eyes                             12.17    6.08     2 1847.77
## Posture:Eyes                                33.98   33.98     1 1847.65
## Condition3:Listening                         0.44    0.11     4 1847.26
## Posture:Listening                            0.84    0.42     2 1847.26
## Eyes:Listening                               1.11    0.56     2 1847.26
## Condition3:Acoustic                          2.42    0.61     4 1847.27
## Posture:Acoustic                             2.50    1.25     2 1847.27
## Eyes:Acoustic                                1.16    0.58     2 1847.26
## Listening:Acoustic                           1.86    0.46     4 1847.26
## Condition3:Posture:Eyes                      2.01    1.01     2 1847.77
## Condition3:Posture:Listening                 1.20    0.30     4 1847.26
## Condition3:Eyes:Listening                    2.83    0.71     4 1847.26
## Posture:Eyes:Listening                       1.56    0.78     2 1847.26
## Condition3:Posture:Acoustic                  3.21    0.80     4 1847.27
## Condition3:Eyes:Acoustic                     2.82    0.71     4 1847.26
## Posture:Eyes:Acoustic                        1.18    0.59     2 1847.26
## Condition3:Listening:Acoustic                2.87    0.36     8 1847.26
## Posture:Listening:Acoustic                   2.08    0.52     4 1847.26
## Eyes:Listening:Acoustic                      1.14    0.28     4 1847.26
## Condition3:Posture:Eyes:Listening            2.70    0.67     4 1847.26
## Condition3:Posture:Eyes:Acoustic             2.63    0.66     4 1847.26
## Condition3:Posture:Listening:Acoustic        2.59    0.32     8 1847.26
## Condition3:Eyes:Listening:Acoustic           2.35    0.29     8 1847.26
## Posture:Eyes:Listening:Acoustic              0.79    0.20     4 1847.26
## Condition3:Posture:Eyes:Listening:Acoustic   3.35    0.42     8 1847.26
##                                              F value    Pr(>F)    
## Condition3                                    4.5328   0.01461 *  
## Posture                                    1320.8013 < 2.2e-16 ***
## Eyes                                         52.2548 7.103e-13 ***
## Listening                                     2.0776   0.12552    
## Acoustic                                      0.0127   0.98739    
## Condition3:Posture                            0.6660   0.51388    
## Condition3:Eyes                              10.6846 2.434e-05 ***
## Posture:Eyes                                 59.6746 1.822e-14 ***
## Condition3:Listening                          0.1912   0.94308    
## Posture:Listening                             0.7404   0.47707    
## Eyes:Listening                                0.9765   0.37684    
## Condition3:Acoustic                           1.0639   0.37284    
## Posture:Acoustic                              2.1935   0.11181    
## Eyes:Acoustic                                 1.0191   0.36112    
## Listening:Acoustic                            0.8155   0.51516    
## Condition3:Posture:Eyes                       1.7658   0.17134    
## Condition3:Posture:Listening                  0.5258   0.71681    
## Condition3:Eyes:Listening                     1.2442   0.29009    
## Posture:Eyes:Listening                        1.3726   0.25371    
## Condition3:Posture:Acoustic                   1.4107   0.22793    
## Condition3:Eyes:Acoustic                      1.2389   0.29232    
## Posture:Eyes:Acoustic                         1.0394   0.35386    
## Condition3:Listening:Acoustic                 0.6310   0.75229    
## Posture:Listening:Acoustic                    0.9131   0.45534    
## Eyes:Listening:Acoustic                       0.4990   0.73651    
## Condition3:Posture:Eyes:Listening             1.1834   0.31611    
## Condition3:Posture:Eyes:Acoustic              1.1531   0.32979    
## Condition3:Posture:Listening:Acoustic         0.5679   0.80492    
## Condition3:Eyes:Listening:Acoustic            0.5151   0.84589    
## Posture:Eyes:Listening:Acoustic               0.3490   0.84484    
## Condition3:Posture:Eyes:Listening:Acoustic    0.7357   0.66004    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results Tables

ANOVA Summary

all_anova %>%
  knitr::kable(caption = "Type III ANOVA — All Models")
Type III ANOVA — All Models
Model Term df_num df_den F_val p_val sig
Log MPF Condition3 2 60.60138 0.972 0.3841 ns
Log MPF Posture 1 1850.04993 217.543 0.0000 ***
Log MPF Eyes 1 1847.79694 28.162 0.0000 ***
Log MPF Listening 2 1847.20531 48.980 0.0000 ***
Log MPF Acoustic 2 1847.23371 0.034 0.9666 ns
Log MPF Condition3:Posture 2 1850.62004 5.884 0.0028 **
Log MPF Condition3:Eyes 2 1847.98579 3.119 0.0444 *
Log MPF Posture:Eyes 1 1847.79695 6.162 0.0131 *
Log MPF Condition3:Listening 4 1847.20842 1.522 0.1932 ns
Log MPF Posture:Listening 2 1847.20531 2.107 0.1219 ns
Log MPF Eyes:Listening 2 1847.20531 4.310 0.0136 *
Log MPF Condition3:Acoustic 4 1847.23618 1.147 0.3325 ns
Log MPF Posture:Acoustic 2 1847.23371 1.005 0.3661 ns
Log MPF Eyes:Acoustic 2 1847.21207 0.535 0.5858 ns
Log MPF Listening:Acoustic 4 1847.20578 1.478 0.2062 ns
Log MPF Condition3:Posture:Eyes 2 1847.98579 5.607 0.0037 **
Log MPF Condition3:Posture:Listening 4 1847.20842 0.376 0.8260 ns
Log MPF Condition3:Eyes:Listening 4 1847.20842 0.847 0.4951 ns
Log MPF Posture:Eyes:Listening 2 1847.20532 0.511 0.6001 ns
Log MPF Condition3:Posture:Acoustic 4 1847.23618 1.083 0.3634 ns
Log MPF Condition3:Eyes:Acoustic 4 1847.21370 0.773 0.5429 ns
Log MPF Posture:Eyes:Acoustic 2 1847.21207 0.929 0.3951 ns
Log MPF Condition3:Listening:Acoustic 8 1847.20832 0.249 0.9811 ns
Log MPF Posture:Listening:Acoustic 4 1847.20578 0.850 0.4937 ns
Log MPF Eyes:Listening:Acoustic 4 1847.20578 3.703 0.0052 **
Log MPF Condition3:Posture:Eyes:Listening 4 1847.20842 0.601 0.6620 ns
Log MPF Condition3:Posture:Eyes:Acoustic 4 1847.21370 0.235 0.9188 ns
Log MPF Condition3:Posture:Listening:Acoustic 8 1847.20832 1.388 0.1968 ns
Log MPF Condition3:Eyes:Listening:Acoustic 8 1847.20832 1.236 0.2737 ns
Log MPF Posture:Eyes:Listening:Acoustic 4 1847.20578 0.348 0.8454 ns
Log MPF Condition3:Posture:Eyes:Listening:Acoustic 8 1847.20832 1.247 0.2675 ns
Log HF/LF Ratio Condition3 2 60.61555 1.292 0.2823 ns
Log HF/LF Ratio Posture 1 1850.26076 76.141 0.0000 ***
Log HF/LF Ratio Eyes 1 1847.86548 11.026 0.0009 ***
Log HF/LF Ratio Listening 2 1847.24474 12.509 0.0000 ***
Log HF/LF Ratio Acoustic 2 1847.27528 0.045 0.9555 ns
Log HF/LF Ratio Condition3:Posture 2 1850.85796 3.878 0.0209 *
Log HF/LF Ratio Condition3:Eyes 2 1848.06328 3.061 0.0471 *
Log HF/LF Ratio Posture:Eyes 1 1847.86548 2.026 0.1548 ns
Log HF/LF Ratio Condition3:Listening 4 1847.24800 0.837 0.5014 ns
Log HF/LF Ratio Posture:Listening 2 1847.24474 0.850 0.4278 ns
Log HF/LF Ratio Eyes:Listening 2 1847.24474 2.097 0.1231 ns
Log HF/LF Ratio Condition3:Acoustic 4 1847.27787 1.383 0.2375 ns
Log HF/LF Ratio Posture:Acoustic 2 1847.27529 0.904 0.4053 ns
Log HF/LF Ratio Eyes:Acoustic 2 1847.25201 0.180 0.8354 ns
Log HF/LF Ratio Listening:Acoustic 4 1847.24524 1.395 0.2334 ns
Log HF/LF Ratio Condition3:Posture:Eyes 2 1848.06328 5.609 0.0037 **
Log HF/LF Ratio Condition3:Posture:Listening 4 1847.24800 0.259 0.9041 ns
Log HF/LF Ratio Condition3:Eyes:Listening 4 1847.24800 1.050 0.3799 ns
Log HF/LF Ratio Posture:Eyes:Listening 2 1847.24474 0.460 0.6316 ns
Log HF/LF Ratio Condition3:Posture:Acoustic 4 1847.27787 0.573 0.6826 ns
Log HF/LF Ratio Condition3:Eyes:Acoustic 4 1847.25369 0.747 0.5596 ns
Log HF/LF Ratio Posture:Eyes:Acoustic 2 1847.25201 1.134 0.3220 ns
Log HF/LF Ratio Condition3:Listening:Acoustic 8 1847.24790 0.444 0.8951 ns
Log HF/LF Ratio Posture:Listening:Acoustic 4 1847.24524 0.554 0.6964 ns
Log HF/LF Ratio Eyes:Listening:Acoustic 4 1847.24524 3.569 0.0066 **
Log HF/LF Ratio Condition3:Posture:Eyes:Listening 4 1847.24800 1.104 0.3531 ns
Log HF/LF Ratio Condition3:Posture:Eyes:Acoustic 4 1847.25369 0.198 0.9397 ns
Log HF/LF Ratio Condition3:Posture:Listening:Acoustic 8 1847.24790 1.178 0.3083 ns
Log HF/LF Ratio Condition3:Eyes:Listening:Acoustic 8 1847.24790 0.974 0.4544 ns
Log HF/LF Ratio Posture:Eyes:Listening:Acoustic 4 1847.24524 0.128 0.9724 ns
Log HF/LF Ratio Condition3:Posture:Eyes:Listening:Acoustic 8 1847.24790 1.092 0.3659 ns
Log BP 0-0.1 Hz Condition3 2 59.17465 6.263 0.0034 **
Log BP 0-0.1 Hz Posture 1 1852.37415 96.114 0.0000 ***
Log BP 0-0.1 Hz Eyes 1 1847.93860 2.911 0.0881 †
Log BP 0-0.1 Hz Listening 2 1846.99342 147.376 0.0000 ***
Log BP 0-0.1 Hz Acoustic 2 1847.06031 0.455 0.6344 ns
Log BP 0-0.1 Hz Condition3:Posture 2 1853.27040 1.581 0.2060 ns
Log BP 0-0.1 Hz Condition3:Eyes 2 1848.23426 2.447 0.0868 †
Log BP 0-0.1 Hz Posture:Eyes 1 1847.93860 8.696 0.0032 **
Log BP 0-0.1 Hz Condition3:Listening 4 1846.99839 3.198 0.0125 *
Log BP 0-0.1 Hz Posture:Listening 2 1846.99342 6.713 0.0012 **
Log BP 0-0.1 Hz Eyes:Listening 2 1846.99342 4.210 0.0150 *
Log BP 0-0.1 Hz Condition3:Acoustic 4 1847.06373 1.137 0.3375 ns
Log BP 0-0.1 Hz Posture:Acoustic 2 1847.06031 0.674 0.5096 ns
Log BP 0-0.1 Hz Eyes:Acoustic 2 1847.00927 0.073 0.9292 ns
Log BP 0-0.1 Hz Listening:Acoustic 4 1846.99447 0.429 0.7878 ns
Log BP 0-0.1 Hz Condition3:Posture:Eyes 2 1848.23426 1.901 0.1498 ns
Log BP 0-0.1 Hz Condition3:Posture:Listening 4 1846.99839 1.883 0.1109 ns
Log BP 0-0.1 Hz Condition3:Eyes:Listening 4 1846.99839 1.177 0.3191 ns
Log BP 0-0.1 Hz Posture:Eyes:Listening 2 1846.99342 1.741 0.1756 ns
Log BP 0-0.1 Hz Condition3:Posture:Acoustic 4 1847.06373 1.080 0.3650 ns
Log BP 0-0.1 Hz Condition3:Eyes:Acoustic 4 1847.01083 0.810 0.5189 ns
Log BP 0-0.1 Hz Posture:Eyes:Acoustic 2 1847.00927 1.309 0.2702 ns
Log BP 0-0.1 Hz Condition3:Listening:Acoustic 8 1846.99814 1.241 0.2708 ns
Log BP 0-0.1 Hz Posture:Listening:Acoustic 4 1846.99447 0.290 0.8844 ns
Log BP 0-0.1 Hz Eyes:Listening:Acoustic 4 1846.99447 0.833 0.5042 ns
Log BP 0-0.1 Hz Condition3:Posture:Eyes:Listening 4 1846.99839 0.501 0.7347 ns
Log BP 0-0.1 Hz Condition3:Posture:Eyes:Acoustic 4 1847.01083 0.674 0.6100 ns
Log BP 0-0.1 Hz Condition3:Posture:Listening:Acoustic 8 1846.99814 0.606 0.7735 ns
Log BP 0-0.1 Hz Condition3:Eyes:Listening:Acoustic 8 1846.99814 0.730 0.6648 ns
Log BP 0-0.1 Hz Posture:Eyes:Listening:Acoustic 4 1846.99447 0.409 0.8022 ns
Log BP 0-0.1 Hz Condition3:Posture:Eyes:Listening:Acoustic 8 1846.99814 0.664 0.7237 ns
Log BP 0.1-0.5 Hz Condition3 2 60.59771 6.401 0.0030 **
Log BP 0.1-0.5 Hz Posture 1 1849.46563 533.537 0.0000 ***
Log BP 0.1-0.5 Hz Eyes 1 1847.61851 2.186 0.1395 ns
Log BP 0.1-0.5 Hz Listening 2 1847.11529 0.042 0.9592 ns
Log BP 0.1-0.5 Hz Acoustic 2 1847.13783 0.097 0.9079 ns
Log BP 0.1-0.5 Hz Condition3:Posture 2 1849.95292 1.916 0.1475 ns
Log BP 0.1-0.5 Hz Condition3:Eyes 2 1847.77993 5.202 0.0056 **
Log BP 0.1-0.5 Hz Posture:Eyes 1 1847.61851 38.125 0.0000 ***
Log BP 0.1-0.5 Hz Condition3:Listening 4 1847.11794 0.390 0.8161 ns
Log BP 0.1-0.5 Hz Posture:Listening 2 1847.11530 2.150 0.1168 ns
Log BP 0.1-0.5 Hz Eyes:Listening 2 1847.11530 0.043 0.9583 ns
Log BP 0.1-0.5 Hz Condition3:Acoustic 4 1847.13997 1.304 0.2662 ns
Log BP 0.1-0.5 Hz Posture:Acoustic 2 1847.13783 0.342 0.7102 ns
Log BP 0.1-0.5 Hz Eyes:Acoustic 2 1847.12067 1.455 0.2337 ns
Log BP 0.1-0.5 Hz Listening:Acoustic 4 1847.11567 0.161 0.9582 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Eyes 2 1847.77993 0.387 0.6789 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Listening 4 1847.11794 0.468 0.7590 ns
Log BP 0.1-0.5 Hz Condition3:Eyes:Listening 4 1847.11794 0.990 0.4115 ns
Log BP 0.1-0.5 Hz Posture:Eyes:Listening 2 1847.11530 0.610 0.5432 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Acoustic 4 1847.13997 2.020 0.0892 †
Log BP 0.1-0.5 Hz Condition3:Eyes:Acoustic 4 1847.12213 0.734 0.5690 ns
Log BP 0.1-0.5 Hz Posture:Eyes:Acoustic 2 1847.12067 1.704 0.1822 ns
Log BP 0.1-0.5 Hz Condition3:Listening:Acoustic 8 1847.11786 0.520 0.8421 ns
Log BP 0.1-0.5 Hz Posture:Listening:Acoustic 4 1847.11567 0.165 0.9560 ns
Log BP 0.1-0.5 Hz Eyes:Listening:Acoustic 4 1847.11567 0.729 0.5723 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Eyes:Listening 4 1847.11794 0.509 0.7290 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Eyes:Acoustic 4 1847.12213 1.583 0.1763 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Listening:Acoustic 8 1847.11786 1.354 0.2120 ns
Log BP 0.1-0.5 Hz Condition3:Eyes:Listening:Acoustic 8 1847.11786 0.506 0.8522 ns
Log BP 0.1-0.5 Hz Posture:Eyes:Listening:Acoustic 4 1847.11567 0.255 0.9068 ns
Log BP 0.1-0.5 Hz Condition3:Posture:Eyes:Listening:Acoustic 8 1847.11786 0.555 0.8148 ns
Log BP 0.5-1 Hz Condition3 2 60.69187 3.789 0.0281 *
Log BP 0.5-1 Hz Posture 1 1849.24933 540.470 0.0000 ***
Log BP 0.5-1 Hz Eyes 1 1847.58648 1.904 0.1678 ns
Log BP 0.5-1 Hz Listening 2 1847.12613 1.306 0.2713 ns
Log BP 0.5-1 Hz Acoustic 2 1847.14612 0.258 0.7730 ns
Log BP 0.5-1 Hz Condition3:Posture 2 1849.69616 0.349 0.7055 ns
Log BP 0.5-1 Hz Condition3:Eyes 2 1847.73450 9.477 0.0001 ***
Log BP 0.5-1 Hz Posture:Eyes 1 1847.58648 43.235 0.0000 ***
Log BP 0.5-1 Hz Condition3:Listening 4 1847.12854 0.536 0.7094 ns
Log BP 0.5-1 Hz Posture:Listening 2 1847.12613 2.153 0.1164 ns
Log BP 0.5-1 Hz Eyes:Listening 2 1847.12613 0.578 0.5612 ns
Log BP 0.5-1 Hz Condition3:Acoustic 4 1847.14810 0.422 0.7930 ns
Log BP 0.5-1 Hz Posture:Acoustic 2 1847.14612 0.647 0.5238 ns
Log BP 0.5-1 Hz Eyes:Acoustic 2 1847.13089 0.514 0.5984 ns
Log BP 0.5-1 Hz Listening:Acoustic 4 1847.12646 1.064 0.3727 ns
Log BP 0.5-1 Hz Condition3:Posture:Eyes 2 1847.73450 1.827 0.1611 ns
Log BP 0.5-1 Hz Condition3:Posture:Listening 4 1847.12854 0.063 0.9927 ns
Log BP 0.5-1 Hz Condition3:Eyes:Listening 4 1847.12854 1.031 0.3899 ns
Log BP 0.5-1 Hz Posture:Eyes:Listening 2 1847.12613 1.115 0.3282 ns
Log BP 0.5-1 Hz Condition3:Posture:Acoustic 4 1847.14810 2.187 0.0682 †
Log BP 0.5-1 Hz Condition3:Eyes:Acoustic 4 1847.13226 0.639 0.6349 ns
Log BP 0.5-1 Hz Posture:Eyes:Acoustic 2 1847.13089 1.328 0.2652 ns
Log BP 0.5-1 Hz Condition3:Listening:Acoustic 8 1847.12847 1.077 0.3764 ns
Log BP 0.5-1 Hz Posture:Listening:Acoustic 4 1847.12646 0.548 0.7004 ns
Log BP 0.5-1 Hz Eyes:Listening:Acoustic 4 1847.12646 0.987 0.4133 ns
Log BP 0.5-1 Hz Condition3:Posture:Eyes:Listening 4 1847.12854 0.765 0.5478 ns
Log BP 0.5-1 Hz Condition3:Posture:Eyes:Acoustic 4 1847.13227 1.827 0.1210 ns
Log BP 0.5-1 Hz Condition3:Posture:Listening:Acoustic 8 1847.12848 0.654 0.7323 ns
Log BP 0.5-1 Hz Condition3:Eyes:Listening:Acoustic 8 1847.12848 0.721 0.6732 ns
Log BP 0.5-1 Hz Posture:Eyes:Listening:Acoustic 4 1847.12646 0.229 0.9221 ns
Log BP 0.5-1 Hz Condition3:Posture:Eyes:Listening:Acoustic 8 1847.12848 0.898 0.5171 ns
Log BP 1-5 Hz Condition3 2 61.04872 4.533 0.0146 *
Log BP 1-5 Hz Posture 1 1849.03369 1320.801 0.0000 ***
Log BP 1-5 Hz Eyes 1 1847.64802 52.255 0.0000 ***
Log BP 1-5 Hz Listening 2 1847.25532 2.078 0.1255 ns
Log BP 1-5 Hz Acoustic 2 1847.27163 0.013 0.9874 ns
Log BP 1-5 Hz Condition3:Posture 2 1849.41624 0.666 0.5139 ns
Log BP 1-5 Hz Condition3:Eyes 2 1847.77474 10.685 0.0000 ***
Log BP 1-5 Hz Posture:Eyes 1 1847.64802 59.675 0.0000 ***
Log BP 1-5 Hz Condition3:Listening 4 1847.25738 0.191 0.9431 ns
Log BP 1-5 Hz Posture:Listening 2 1847.25532 0.740 0.4771 ns
Log BP 1-5 Hz Eyes:Listening 2 1847.25532 0.976 0.3768 ns
Log BP 1-5 Hz Condition3:Acoustic 4 1847.27333 1.064 0.3728 ns
Log BP 1-5 Hz Posture:Acoustic 2 1847.27163 2.194 0.1118 ns
Log BP 1-5 Hz Eyes:Acoustic 2 1847.25921 1.019 0.3611 ns
Log BP 1-5 Hz Listening:Acoustic 4 1847.25559 0.815 0.5152 ns
Log BP 1-5 Hz Condition3:Posture:Eyes 2 1847.77474 1.766 0.1713 ns
Log BP 1-5 Hz Condition3:Posture:Listening 4 1847.25738 0.526 0.7168 ns
Log BP 1-5 Hz Condition3:Eyes:Listening 4 1847.25738 1.244 0.2901 ns
Log BP 1-5 Hz Posture:Eyes:Listening 2 1847.25532 1.373 0.2537 ns
Log BP 1-5 Hz Condition3:Posture:Acoustic 4 1847.27333 1.411 0.2279 ns
Log BP 1-5 Hz Condition3:Eyes:Acoustic 4 1847.26041 1.239 0.2923 ns
Log BP 1-5 Hz Posture:Eyes:Acoustic 2 1847.25921 1.039 0.3539 ns
Log BP 1-5 Hz Condition3:Listening:Acoustic 8 1847.25732 0.631 0.7523 ns
Log BP 1-5 Hz Posture:Listening:Acoustic 4 1847.25559 0.913 0.4553 ns
Log BP 1-5 Hz Eyes:Listening:Acoustic 4 1847.25559 0.499 0.7365 ns
Log BP 1-5 Hz Condition3:Posture:Eyes:Listening 4 1847.25738 1.183 0.3161 ns
Log BP 1-5 Hz Condition3:Posture:Eyes:Acoustic 4 1847.26041 1.153 0.3298 ns
Log BP 1-5 Hz Condition3:Posture:Listening:Acoustic 8 1847.25732 0.568 0.8049 ns
Log BP 1-5 Hz Condition3:Eyes:Listening:Acoustic 8 1847.25732 0.515 0.8459 ns
Log BP 1-5 Hz Posture:Eyes:Listening:Acoustic 4 1847.25559 0.349 0.8448 ns
Log BP 1-5 Hz Condition3:Posture:Eyes:Listening:Acoustic 8 1847.25732 0.736 0.6600 ns

Contrasts Summary

all_contrasts %>%
  filter(Condition %in% cond_order) %>%
  knitr::kable(caption = "Pairwise Contrasts — All Models x All Conditions")
Pairwise Contrasts — All Models x All Conditions
Model Condition Posture contrast estimate SE df t.ratio p.value sig
Log MPF Eyes Open, No Listening Firm NHOA - HL Aided -0.0197 0.0372 286.3 -0.531 0.8564 ns
Log MPF Eyes Open, No Listening Firm NHOA - HL Unaided 0.0623 0.0372 286.3 1.674 0.2168 ns
Log MPF Eyes Open, No Listening Firm HL Aided - HL Unaided 0.0820 0.0367 1959.5 2.237 0.0654 †
Log MPF Eyes Open, No Listening Compliant NHOA - HL Aided -0.0260 0.0375 294.0 -0.694 0.7671 ns
Log MPF Eyes Open, No Listening Compliant NHOA - HL Unaided 0.0066 0.0383 317.7 0.172 0.9838 ns
Log MPF Eyes Open, No Listening Compliant HL Aided - HL Unaided 0.0326 0.0375 1959.6 0.869 0.6597 ns
Log MPF Eyes Open, High Listening Firm NHOA - HL Aided -0.0092 0.0372 286.3 -0.247 0.9669 ns
Log MPF Eyes Open, High Listening Firm NHOA - HL Unaided 0.0422 0.0372 286.3 1.135 0.4933 ns
Log MPF Eyes Open, High Listening Firm HL Aided - HL Unaided 0.0514 0.0367 1959.5 1.402 0.3400 ns
Log MPF Eyes Open, High Listening Compliant NHOA - HL Aided 0.0077 0.0375 294.0 0.205 0.9771 ns
Log MPF Eyes Open, High Listening Compliant NHOA - HL Unaided 0.0365 0.0375 294.0 0.974 0.5938 ns
Log MPF Eyes Open, High Listening Compliant HL Aided - HL Unaided 0.0288 0.0367 1959.5 0.786 0.7114 ns
Log MPF Eyes Closed, High Listening Firm NHOA - HL Aided 0.0158 0.0373 290.0 0.423 0.9063 ns
Log MPF Eyes Closed, High Listening Firm NHOA - HL Unaided 0.0296 0.0373 290.0 0.794 0.7071 ns
Log MPF Eyes Closed, High Listening Firm HL Aided - HL Unaided 0.0139 0.0367 1959.5 0.378 0.9242 ns
Log MPF Eyes Closed, High Listening Compliant NHOA - HL Aided 0.0448 0.0375 294.0 1.195 0.4572 ns
Log MPF Eyes Closed, High Listening Compliant NHOA - HL Unaided -0.0145 0.0383 317.7 -0.379 0.9238 ns
Log MPF Eyes Closed, High Listening Compliant HL Aided - HL Unaided -0.0593 0.0375 1959.6 -1.582 0.2538 ns
Log MPF Eyes Closed, Low Listening Firm NHOA - HL Aided 0.0164 0.0372 286.3 0.441 0.8983 ns
Log MPF Eyes Closed, Low Listening Firm NHOA - HL Unaided 0.0901 0.0372 286.3 2.423 0.0422 *
Log MPF Eyes Closed, Low Listening Firm HL Aided - HL Unaided 0.0737 0.0367 1959.5 2.010 0.1099 ns
Log MPF Eyes Closed, Low Listening Compliant NHOA - HL Aided -0.0130 0.0375 294.0 -0.348 0.9356 ns
Log MPF Eyes Closed, Low Listening Compliant NHOA - HL Unaided 0.0030 0.0383 317.7 0.078 0.9966 ns
Log MPF Eyes Closed, Low Listening Compliant HL Aided - HL Unaided 0.0160 0.0375 1959.6 0.427 0.9042 ns
Log HF/LF Ratio Eyes Open, No Listening Firm NHOA - HL Aided -0.1935 0.3164 312.5 -0.612 0.8139 ns
Log HF/LF Ratio Eyes Open, No Listening Firm NHOA - HL Unaided 0.5804 0.3164 312.5 1.834 0.1602 ns
Log HF/LF Ratio Eyes Open, No Listening Firm HL Aided - HL Unaided 0.7739 0.3156 1959.5 2.452 0.0380 *
Log HF/LF Ratio Eyes Open, No Listening Compliant NHOA - HL Aided 0.0794 0.3190 320.9 0.249 0.9664 ns
Log HF/LF Ratio Eyes Open, No Listening Compliant NHOA - HL Unaided 0.4768 0.3261 346.9 1.462 0.3105 ns
Log HF/LF Ratio Eyes Open, No Listening Compliant HL Aided - HL Unaided 0.3974 0.3228 1959.6 1.231 0.4349 ns
Log HF/LF Ratio Eyes Open, High Listening Firm NHOA - HL Aided 0.1969 0.3164 312.5 0.622 0.8081 ns
Log HF/LF Ratio Eyes Open, High Listening Firm NHOA - HL Unaided 0.6700 0.3164 312.5 2.117 0.0880 †
Log HF/LF Ratio Eyes Open, High Listening Firm HL Aided - HL Unaided 0.4731 0.3156 1959.5 1.499 0.2915 ns
Log HF/LF Ratio Eyes Open, High Listening Compliant NHOA - HL Aided 0.1259 0.3190 320.9 0.395 0.9177 ns
Log HF/LF Ratio Eyes Open, High Listening Compliant NHOA - HL Unaided 0.4902 0.3190 320.9 1.537 0.2751 ns
Log HF/LF Ratio Eyes Open, High Listening Compliant HL Aided - HL Unaided 0.3643 0.3156 1959.5 1.154 0.4809 ns
Log HF/LF Ratio Eyes Closed, High Listening Firm NHOA - HL Aided 0.1853 0.3177 316.5 0.583 0.8292 ns
Log HF/LF Ratio Eyes Closed, High Listening Firm NHOA - HL Unaided 0.4092 0.3177 316.5 1.288 0.4030 ns
Log HF/LF Ratio Eyes Closed, High Listening Firm HL Aided - HL Unaided 0.2239 0.3156 1959.5 0.709 0.7580 ns
Log HF/LF Ratio Eyes Closed, High Listening Compliant NHOA - HL Aided 0.4107 0.3190 320.9 1.288 0.4032 ns
Log HF/LF Ratio Eyes Closed, High Listening Compliant NHOA - HL Unaided 0.0244 0.3261 346.9 0.075 0.9969 ns
Log HF/LF Ratio Eyes Closed, High Listening Compliant HL Aided - HL Unaided -0.3863 0.3228 1959.6 -1.197 0.4554 ns
Log HF/LF Ratio Eyes Closed, Low Listening Firm NHOA - HL Aided 0.1160 0.3164 312.5 0.367 0.9286 ns
Log HF/LF Ratio Eyes Closed, Low Listening Firm NHOA - HL Unaided 0.7308 0.3164 312.5 2.309 0.0560 †
Log HF/LF Ratio Eyes Closed, Low Listening Firm HL Aided - HL Unaided 0.6148 0.3156 1959.5 1.948 0.1257 ns
Log HF/LF Ratio Eyes Closed, Low Listening Compliant NHOA - HL Aided 0.1027 0.3190 320.9 0.322 0.9444 ns
Log HF/LF Ratio Eyes Closed, Low Listening Compliant NHOA - HL Unaided -0.0028 0.3261 346.9 -0.009 1.0000 ns
Log HF/LF Ratio Eyes Closed, Low Listening Compliant HL Aided - HL Unaided -0.1056 0.3228 1959.6 -0.327 0.9428 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Firm NHOA - HL Aided -0.1765 0.4664 769.3 -0.378 0.9241 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Firm NHOA - HL Unaided -0.9083 0.4664 769.3 -1.947 0.1262 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Firm HL Aided - HL Unaided -0.7318 0.5099 1959.5 -1.435 0.3229 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Compliant NHOA - HL Aided 0.0995 0.4708 785.4 0.211 0.9757 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Compliant NHOA - HL Unaided 0.0930 0.4834 841.3 0.192 0.9798 ns
Log BP 0-0.1 Hz Eyes Open, No Listening Compliant HL Aided - HL Unaided -0.0065 0.5215 1959.8 -0.013 0.9999 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Firm NHOA - HL Aided -0.0049 0.4664 769.3 -0.010 0.9999 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Firm NHOA - HL Unaided -0.7513 0.4664 769.3 -1.611 0.2416 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Firm HL Aided - HL Unaided -0.7464 0.5099 1959.5 -1.464 0.3086 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Compliant NHOA - HL Aided -0.0498 0.4708 785.4 -0.106 0.9938 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Compliant NHOA - HL Unaided -0.7339 0.4708 785.4 -1.559 0.2643 ns
Log BP 0-0.1 Hz Eyes Open, High Listening Compliant HL Aided - HL Unaided -0.6841 0.5099 1959.5 -1.342 0.3722 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Firm NHOA - HL Aided -0.2743 0.4686 776.6 -0.585 0.8280 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Firm NHOA - HL Unaided -0.2349 0.4686 776.6 -0.501 0.8707 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Firm HL Aided - HL Unaided 0.0394 0.5099 1959.5 0.077 0.9967 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Compliant NHOA - HL Aided -0.3556 0.4708 785.4 -0.755 0.7304 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Compliant NHOA - HL Unaided 0.2939 0.4834 841.3 0.608 0.8158 ns
Log BP 0-0.1 Hz Eyes Closed, High Listening Compliant HL Aided - HL Unaided 0.6495 0.5215 1959.8 1.245 0.4266 ns
Log BP 0-0.1 Hz Eyes Closed, Low Listening Firm NHOA - HL Aided 0.0678 0.4664 769.3 0.145 0.9884 ns
Log BP 0-0.1 Hz Eyes Closed, Low Listening Firm NHOA - HL Unaided -1.2420 0.4664 769.3 -2.663 0.0216 *
Log BP 0-0.1 Hz Eyes Closed, Low Listening Firm HL Aided - HL Unaided -1.3098 0.5099 1959.5 -2.569 0.0277 *
Log BP 0-0.1 Hz Eyes Closed, Low Listening Compliant NHOA - HL Aided 1.1031 0.4708 785.4 2.343 0.0506 †
Log BP 0-0.1 Hz Eyes Closed, Low Listening Compliant NHOA - HL Unaided 0.3296 0.4834 841.3 0.682 0.7741 ns
Log BP 0-0.1 Hz Eyes Closed, Low Listening Compliant HL Aided - HL Unaided -0.7735 0.5215 1959.8 -1.483 0.2992 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Firm NHOA - HL Aided -0.4012 0.3503 218.8 -1.145 0.4873 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Firm NHOA - HL Unaided -0.4187 0.3503 218.8 -1.195 0.4573 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Firm HL Aided - HL Unaided -0.0175 0.3314 1959.5 -0.053 0.9985 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Compliant NHOA - HL Aided -0.0979 0.3529 224.6 -0.277 0.9585 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Compliant NHOA - HL Unaided -0.3165 0.3600 241.8 -0.879 0.6539 ns
Log BP 0.1-0.5 Hz Eyes Open, No Listening Compliant HL Aided - HL Unaided -0.2186 0.3390 1959.6 -0.645 0.7952 ns
Log BP 0.1-0.5 Hz Eyes Open, High Listening Firm NHOA - HL Aided -0.2765 0.3503 218.8 -0.789 0.7100 ns
Log BP 0.1-0.5 Hz Eyes Open, High Listening Firm NHOA - HL Unaided -1.0853 0.3503 218.8 -3.098 0.0062 **
Log BP 0.1-0.5 Hz Eyes Open, High Listening Firm HL Aided - HL Unaided -0.8088 0.3314 1959.5 -2.441 0.0391 *
Log BP 0.1-0.5 Hz Eyes Open, High Listening Compliant NHOA - HL Aided 0.1697 0.3529 224.6 0.481 0.8804 ns
Log BP 0.1-0.5 Hz Eyes Open, High Listening Compliant NHOA - HL Unaided -0.3694 0.3529 224.6 -1.047 0.5481 ns
Log BP 0.1-0.5 Hz Eyes Open, High Listening Compliant HL Aided - HL Unaided -0.5391 0.3314 1959.5 -1.627 0.2345 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Firm NHOA - HL Aided -0.0291 0.3516 221.6 -0.083 0.9962 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Firm NHOA - HL Unaided -0.0536 0.3516 221.6 -0.152 0.9873 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Firm HL Aided - HL Unaided -0.0245 0.3314 1959.5 -0.074 0.9970 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Compliant NHOA - HL Aided 0.1261 0.3529 224.6 0.357 0.9321 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Compliant NHOA - HL Unaided 0.1977 0.3600 241.8 0.549 0.8470 ns
Log BP 0.1-0.5 Hz Eyes Closed, High Listening Compliant HL Aided - HL Unaided 0.0716 0.3390 1959.6 0.211 0.9757 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Firm NHOA - HL Aided 0.0411 0.3503 218.8 0.117 0.9924 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Firm NHOA - HL Unaided -0.5222 0.3503 218.8 -1.491 0.2974 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Firm HL Aided - HL Unaided -0.5633 0.3314 1959.5 -1.700 0.2054 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Compliant NHOA - HL Aided 0.1800 0.3529 224.6 0.510 0.8664 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Compliant NHOA - HL Unaided 0.0404 0.3600 241.8 0.112 0.9931 ns
Log BP 0.1-0.5 Hz Eyes Closed, Low Listening Compliant HL Aided - HL Unaided -0.1396 0.3390 1959.6 -0.412 0.9107 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Firm NHOA - HL Aided -0.6697 0.3804 191.9 -1.761 0.1858 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Firm NHOA - HL Unaided -0.1085 0.3804 191.9 -0.285 0.9562 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Firm HL Aided - HL Unaided 0.5613 0.3515 1959.5 1.597 0.2472 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Compliant NHOA - HL Aided 0.2327 0.3830 196.8 0.608 0.8161 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Compliant NHOA - HL Unaided 0.3989 0.3904 211.4 1.022 0.5641 ns
Log BP 0.5-1 Hz Eyes Open, No Listening Compliant HL Aided - HL Unaided 0.1661 0.3595 1959.5 0.462 0.8890 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Firm NHOA - HL Aided 0.1777 0.3804 191.9 0.467 0.8868 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Firm NHOA - HL Unaided -0.2575 0.3804 191.9 -0.677 0.7773 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Firm HL Aided - HL Unaided -0.4352 0.3515 1959.5 -1.238 0.4308 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Compliant NHOA - HL Aided 0.2632 0.3830 196.8 0.687 0.7712 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Compliant NHOA - HL Unaided 0.0638 0.3830 196.8 0.166 0.9848 ns
Log BP 0.5-1 Hz Eyes Open, High Listening Compliant HL Aided - HL Unaided -0.1995 0.3515 1959.5 -0.568 0.8374 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Firm NHOA - HL Aided 0.2001 0.3817 194.3 0.524 0.8596 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Firm NHOA - HL Unaided 0.4054 0.3817 194.3 1.062 0.5389 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Firm HL Aided - HL Unaided 0.2053 0.3515 1959.5 0.584 0.8287 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Compliant NHOA - HL Aided 0.2646 0.3830 196.8 0.691 0.7691 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Compliant NHOA - HL Unaided 0.3280 0.3904 211.4 0.840 0.6785 ns
Log BP 0.5-1 Hz Eyes Closed, High Listening Compliant HL Aided - HL Unaided 0.0634 0.3595 1959.5 0.176 0.9830 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Firm NHOA - HL Aided 0.2286 0.3804 191.9 0.601 0.8197 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Firm NHOA - HL Unaided -0.0461 0.3804 191.9 -0.121 0.9919 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Firm HL Aided - HL Unaided -0.2747 0.3515 1959.5 -0.782 0.7144 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Compliant NHOA - HL Aided 0.5010 0.3830 196.8 1.308 0.3924 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Compliant NHOA - HL Unaided 0.0065 0.3904 211.4 0.017 0.9998 ns
Log BP 0.5-1 Hz Eyes Closed, Low Listening Compliant HL Aided - HL Unaided -0.4945 0.3595 1959.5 -1.376 0.3540 ns
Log BP 1-5 Hz Eyes Open, No Listening Firm NHOA - HL Aided -0.1746 0.3585 155.7 -0.487 0.8775 ns
Log BP 1-5 Hz Eyes Open, No Listening Firm NHOA - HL Unaided 0.0560 0.3585 155.7 0.156 0.9866 ns
Log BP 1-5 Hz Eyes Open, No Listening Firm HL Aided - HL Unaided 0.2307 0.3173 1959.5 0.727 0.7475 ns
Log BP 1-5 Hz Eyes Open, No Listening Compliant NHOA - HL Aided -0.2354 0.3608 159.4 -0.652 0.7913 ns
Log BP 1-5 Hz Eyes Open, No Listening Compliant NHOA - HL Unaided -0.0503 0.3672 170.5 -0.137 0.9897 ns
Log BP 1-5 Hz Eyes Open, No Listening Compliant HL Aided - HL Unaided 0.1850 0.3245 1959.5 0.570 0.8360 ns
Log BP 1-5 Hz Eyes Open, High Listening Firm NHOA - HL Aided -0.0519 0.3585 155.7 -0.145 0.9885 ns
Log BP 1-5 Hz Eyes Open, High Listening Firm NHOA - HL Unaided -0.4544 0.3585 155.7 -1.267 0.4158 ns
Log BP 1-5 Hz Eyes Open, High Listening Firm HL Aided - HL Unaided -0.4024 0.3173 1959.5 -1.268 0.4133 ns
Log BP 1-5 Hz Eyes Open, High Listening Compliant NHOA - HL Aided -0.0223 0.3608 159.4 -0.062 0.9979 ns
Log BP 1-5 Hz Eyes Open, High Listening Compliant NHOA - HL Unaided -0.2817 0.3608 159.4 -0.781 0.7154 ns
Log BP 1-5 Hz Eyes Open, High Listening Compliant HL Aided - HL Unaided -0.2594 0.3173 1959.5 -0.817 0.6923 ns
Log BP 1-5 Hz Eyes Closed, High Listening Firm NHOA - HL Aided 0.1130 0.3596 157.5 0.314 0.9471 ns
Log BP 1-5 Hz Eyes Closed, High Listening Firm NHOA - HL Unaided 0.3958 0.3596 157.5 1.101 0.5151 ns
Log BP 1-5 Hz Eyes Closed, High Listening Firm HL Aided - HL Unaided 0.2829 0.3173 1959.5 0.891 0.6457 ns
Log BP 1-5 Hz Eyes Closed, High Listening Compliant NHOA - HL Aided 0.3530 0.3608 159.4 0.978 0.5915 ns
Log BP 1-5 Hz Eyes Closed, High Listening Compliant NHOA - HL Unaided 0.1542 0.3672 170.5 0.420 0.9075 ns
Log BP 1-5 Hz Eyes Closed, High Listening Compliant HL Aided - HL Unaided -0.1989 0.3245 1959.5 -0.613 0.8132 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Firm NHOA - HL Aided 0.0716 0.3585 155.7 0.200 0.9783 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Firm NHOA - HL Unaided 0.0823 0.3585 155.7 0.230 0.9714 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Firm HL Aided - HL Unaided 0.0107 0.3173 1959.5 0.034 0.9994 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Compliant NHOA - HL Aided 0.3740 0.3608 159.4 1.037 0.5549 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Compliant NHOA - HL Unaided 0.1070 0.3672 170.5 0.291 0.9543 ns
Log BP 1-5 Hz Eyes Closed, Low Listening Compliant HL Aided - HL Unaided -0.2670 0.3245 1959.5 -0.823 0.6890 ns

Save Word Tables

doc <- read_docx() %>%
  body_add_par(
    "Spectral Analysis Results — Mohanathas et al. (2024) Secondary Analysis",
    style = "heading 1") %>%
  body_add_par(
    "Each outcome has two table formats: (A) Long — one row per contrast; (B) Wide — conditions as columns. Yellow = p < .05, Orange = p < .10.",
    style = "Normal")

for (i in seq_len(nrow(model_meta))) {
  m_label <- model_meta$Model[i]
  t_n     <- model_meta$tbl_n[i]
  t_label <- model_meta$label[i]

  ct <- all_contrasts %>%
    filter(Model == m_label) %>%
    mutate(Condition = factor(Condition, levels = cond_order))

  long_tbl <- ct %>%
    mutate(Condition = cond_short[as.character(Condition)],
           contrast  = as.character(contrast)) %>%
    select(Condition, Posture, Contrast = contrast,
           b = estimate, SE, t = t.ratio, p = p.value, ` ` = sig) %>%
    arrange(Condition, Posture, Contrast)

  ft_long <- flextable(long_tbl) %>%
    set_caption(paste0("Table ", t_n, "A. ", t_label, " — Pairwise Contrasts (Long)")) %>%
    merge_v(j = c("Condition", "Posture")) %>%
    valign(j = c("Condition", "Posture"), valign = "top") %>%
    style_ft()

  wide_tbl <- ct %>%
    mutate(
      cond_short = cond_short[as.character(Condition)],
      cell       = paste0(round(estimate, 3), "\n",
                          "t=", round(t.ratio, 2), ", p=", round(p.value, 3), " ", sig)
    ) %>%
    select(Posture, contrast, cond_short, cell) %>%
    mutate(contrast = as.character(contrast)) %>%
    pivot_wider(names_from = cond_short, values_from = cell) %>%
    arrange(Posture, contrast) %>%
    rename(Contrast = contrast)

  for (cn in cond_short) {
    if (!cn %in% names(wide_tbl)) wide_tbl[[cn]] <- NA_character_
  }
  wide_tbl <- wide_tbl %>%
    select(Posture, Contrast, all_of(unname(cond_short)))

  ft_wide <- flextable(wide_tbl) %>%
    set_caption(paste0("Table ", t_n, "B. ", t_label, " — Pairwise Contrasts (Wide)")) %>%
    set_header_labels(`Open / None`   = "Open / None\n(Baseline)",
                      `Open / High`   = "Open / High\n(Moderate)",
                      `Closed / High` = "Closed / High\n(Hard)",
                      `Closed / Low`  = "Closed / Low\n(Easy)") %>%
    merge_v(j = "Posture") %>%
    valign(j = "Posture", valign = "top") %>%
    style_ft_wide() %>%
    bold(j = 1:2, part = "body")

  doc <- doc %>%
    body_add_break() %>%
    body_add_par(paste0("Outcome ", t_n, ": ", t_label), style = "heading 2") %>%
    body_add_par(
      "Contrasts: NHOA vs HL Aided, NHOA vs HL Unaided, HL Aided vs HL Unaided. b = log-scale estimate.",
      style = "Normal") %>%
    body_add_par(" ", style = "Normal") %>%
    body_add_par(paste0("Table ", t_n, "A — Long Format"), style = "heading 3") %>%
    body_add_flextable(ft_long) %>%
    body_add_par(" ", style = "Normal") %>%
    body_add_par(paste0("Table ", t_n, "B — Wide Format"), style = "heading 3") %>%
    body_add_flextable(ft_wide)
}

print(doc, target = file.path(out_dir, "spectral_results_tables.docx"))
cat("Word tables saved to:", out_dir, "\n")
## Word tables saved to: /Users/rialeung/Desktop/KITE/Thesis/Spectral Analysis/Files/Plots

Plot Helpers

Colour Palette & Theme

The cond_colours palette and base_theme are defined in the hidden setup chunk above and shared across all plot sections below.

  • NHOA = #2C7BB6 (blue)
  • HL Aided = #ABD9E9 (light blue)
  • HL Unaided = #D7191C (red)

All helper functions (make_violin, make_linePlot, make_bands, and their _acoustic variants) are also defined there and reused across conditions.


Condition A: Eyes Open, No Listening

Single-task baseline — no dual-task interference.

MPF Violin

p_mpf_A <- make_violin(metrics_baseline, "mean_MPF", "MPF (Hz)",
  title    = "Mean Power Frequency (MPF) | Eyes Open, No Listening",
  subtitle = "Higher MPF indicates a shift toward higher-frequency postural control (compensatory rigidity)")
print(p_mpf_A)

HF/LF Violin

p_hflf_A <- make_violin(metrics_baseline, "HF_LF_ratio", "HF/LF Ratio",
  title    = "HF/LF Power Ratio | Eyes Open, No Listening",
  subtitle = "(0.5-5 Hz)/(0-0.5 Hz) — higher values indicate stiffer, higher-frequency control")
print(p_hflf_A)

Band Power

p_bands_A <- make_bands(metrics_baseline,
  title    = "CoP Spectral Band Power | Eyes Open, No Listening",
  subtitle = "Compensatory rigidity predicts warm colours (high-freq) up and cool colours (low-freq) down in HL Unaided vs. NHOA")
print(p_bands_A)

MPF Line

p_mpf_line_A <- make_linePlot(metrics_baseline, "mean_MPF", "Mean MPF (Hz)",
  title    = "MPF Across Postural Conditions by Group | Eyes Open, No Listening",
  subtitle = "HL Unaided rising earlier = lower demand threshold for rigidity engagement. Error bars = +/- SE")
print(p_mpf_line_A)

HF/LF Line

p_hflf_line_A <- make_linePlot(metrics_baseline, "HF_LF_ratio", "HF/LF Power Ratio",
  title    = "HF/LF Ratio Across Postural Conditions by Group | Eyes Open, No Listening",
  subtitle = "Steeper rise in HL Unaided = earlier/stronger rigidity engagement. Error bars = +/- SE")
print(p_hflf_line_A)

Combined

combined_A <- (p_mpf_line_A | p_hflf_line_A) / p_bands_A +
  plot_annotation(
    title    = "Spectral Rigidity — Eyes Open, No Listening (Single-Task Baseline)",
    subtitle = "NHOA = Normal Hearing Older Adults | HL Aided/Unaided = Hearing Loss group",
    theme    = theme(plot.title    = element_text(face = "bold", size = 14),
                     plot.subtitle = element_text(size = 10, colour = "grey40"))
  )
print(combined_A)


Condition B: Eyes Open, High Listening

Moderate dual-task demand — peak rigidity expected.

MPF Violin

p_mpf_B <- make_violin(metrics_dualtask, "mean_MPF", "MPF (Hz)",
  title    = "Mean Power Frequency (MPF) | Eyes Open, High Listening",
  subtitle = "Higher MPF indicates a shift toward higher-frequency postural control (compensatory rigidity)")
print(p_mpf_B)

HF/LF Violin

p_hflf_B <- make_violin(metrics_dualtask, "HF_LF_ratio", "HF/LF Ratio",
  title    = "HF/LF Power Ratio | Eyes Open, High Listening",
  subtitle = "(0.5-5 Hz)/(0-0.5 Hz) — higher values indicate stiffer, higher-frequency control")
print(p_hflf_B)

Band Power

p_bands_B <- make_bands(metrics_dualtask,
  title    = "CoP Spectral Band Power | Eyes Open, High Listening",
  subtitle = "Compensatory rigidity predicts warm colours (high-freq) up and cool colours (low-freq) down in HL Unaided vs. NHOA")
print(p_bands_B)

MPF Line

p_mpf_line_B <- make_linePlot(metrics_dualtask, "mean_MPF", "Mean MPF (Hz)",
  title    = "MPF Across Postural Conditions by Group | Eyes Open, High Listening",
  subtitle = "HL Unaided rising earlier = lower demand threshold for rigidity engagement. Error bars = +/- SE")
print(p_mpf_line_B)

HF/LF Line

p_hflf_line_B <- make_linePlot(metrics_dualtask, "HF_LF_ratio", "HF/LF Power Ratio",
  title    = "HF/LF Ratio Across Postural Conditions by Group | Eyes Open, High Listening",
  subtitle = "Steeper rise in HL Unaided = earlier/stronger rigidity engagement. Error bars = +/- SE")
print(p_hflf_line_B)

Combined

combined_B <- (p_mpf_line_B | p_hflf_line_B) / p_bands_B +
  plot_annotation(
    title    = "Spectral Rigidity — Eyes Open, High Listening (Moderate Dual-Task Demand)",
    subtitle = "NHOA = Normal Hearing Older Adults | HL Aided/Unaided = Hearing Loss group",
    theme    = theme(plot.title    = element_text(face = "bold", size = 14),
                     plot.subtitle = element_text(size = 10, colour = "grey40"))
  )
print(combined_B)


Condition C: Eyes Closed, Low Listening

Where significant results concentrate.

MPF Violin

p_mpf_C <- make_violin(metrics_closedlow, "mean_MPF", "MPF (Hz)",
  title    = "Mean Power Frequency (MPF) | Eyes Closed, Low Listening",
  subtitle = "Higher MPF = compensatory rigidity. NHOA > HL Unaided significant on Firm (p = .042)")
print(p_mpf_C)

HF/LF Violin

p_hflf_C <- make_violin(metrics_closedlow, "HF_LF_ratio", "HF/LF Ratio",
  title    = "HF/LF Power Ratio | Eyes Closed, Low Listening",
  subtitle = "(0.5-5 Hz)/(0-0.5 Hz) — NHOA > HL Unaided significant on Firm (p = .048)")
print(p_hflf_C)

Band Power

p_bands_C <- make_bands(metrics_closedlow,
  title    = "CoP Spectral Band Power | Eyes Closed, Low Listening",
  subtitle = "HL Unaided > others in low-freq bands on Firm (0-0.1 Hz: p = .009; 0.1-0.5 Hz: p = .043)")
print(p_bands_C)

MPF Line

p_mpf_line_C <- make_linePlot(metrics_closedlow, "mean_MPF", "Mean MPF (Hz)",
  title    = "MPF Across Postural Conditions by Group | Eyes Closed, Low Listening",
  subtitle = "HL Unaided lower MPF than NHOA on Firm = reduced high-freq postural activity. Error bars = +/- SE")
print(p_mpf_line_C)

HF/LF Line

p_hflf_line_C <- make_linePlot(metrics_closedlow, "HF_LF_ratio", "HF/LF Power Ratio",
  title    = "HF/LF Ratio Across Postural Conditions by Group | Eyes Closed, Low Listening",
  subtitle = "HL Unaided lower HF/LF than NHOA on Firm = less high-frequency relative to low-frequency power. Error bars = +/- SE")
print(p_hflf_line_C)

Combined

combined_C <- (p_mpf_line_C | p_hflf_line_C) / p_bands_C +
  plot_annotation(
    title    = "Spectral Rigidity — Eyes Closed, Low Listening (Most Significant Condition)",
    subtitle = "NHOA = Normal Hearing Older Adults | HL Aided/Unaided = Hearing Loss group",
    theme    = theme(plot.title    = element_text(face = "bold", size = 14),
                     plot.subtitle = element_text(size = 10, colour = "grey40"))
  )
print(combined_C)


Condition D: Eyes Closed, High Listening

Dual-task + no vision — where HF/LF trends concentrate.

MPF Violin

p_mpf_D <- make_violin(metrics_closedhigh, "mean_MPF", "MPF (Hz)",
  title    = "Mean Power Frequency (MPF) | Eyes Closed, High Listening",
  subtitle = "Higher MPF = compensatory rigidity. NHOA > HL Unaided trend on Firm (p = .083)")
print(p_mpf_D)

HF/LF Violin

p_hflf_D <- make_violin(metrics_closedhigh, "HF_LF_ratio", "HF/LF Ratio",
  title    = "HF/LF Power Ratio | Eyes Closed, High Listening",
  subtitle = "(0.5-5 Hz)/(0-0.5 Hz) — NHOA > HL Unaided significant on Firm (p = .050)")
print(p_hflf_D)

Band Power

p_bands_D <- make_bands(metrics_closedhigh,
  title    = "CoP Spectral Band Power | Eyes Closed, High Listening",
  subtitle = "Compensatory rigidity predicts warm colours up and cool colours down in HL Unaided vs. NHOA")
print(p_bands_D)

MPF Line

p_mpf_line_D <- make_linePlot(metrics_closedhigh, "mean_MPF", "Mean MPF (Hz)",
  title    = "MPF Across Postural Conditions by Group | Eyes Closed, High Listening",
  subtitle = "HL Unaided lower MPF than NHOA on Firm = reduced high-freq postural activity. Error bars = +/- SE")
print(p_mpf_line_D)

HF/LF Line

p_hflf_line_D <- make_linePlot(metrics_closedhigh, "HF_LF_ratio", "HF/LF Power Ratio",
  title    = "HF/LF Ratio Across Postural Conditions by Group | Eyes Closed, High Listening",
  subtitle = "NHOA > HL Unaided on Firm (p = .050) = NHOA maintains higher-frequency postural control. Error bars = +/- SE")
print(p_hflf_line_D)

Combined

combined_D <- (p_mpf_line_D | p_hflf_line_D) / p_bands_D +
  plot_annotation(
    title    = "Spectral Rigidity — Eyes Closed, High Listening (Dual-Task + No Vision)",
    subtitle = "NHOA = Normal Hearing Older Adults | HL Aided/Unaided = Hearing Loss group",
    theme    = theme(plot.title    = element_text(face = "bold", size = 14),
                     plot.subtitle = element_text(size = 10, colour = "grey40"))
  )
print(combined_D)


Condition E: Acoustic Moderation

Eyes Closed, Low Listening — all acoustic conditions. Do spatial sounds or white noise moderate group differences?

MPF Violin

p_mpf_E <- make_violin_acoustic(metrics_closedlow_acoustic, "mean_MPF", "MPF (Hz)",
  title    = "MPF | Eyes Closed, Low Listening — By Acoustic Condition",
  subtitle = "Rows = Acoustic condition. If spatial sounds help HL Unaided: expect MPF to rise toward NHOA in SpatialSounds row")
print(p_mpf_E)

HF/LF Violin

p_hflf_E <- make_violin_acoustic(metrics_closedlow_acoustic, "HF_LF_ratio", "HF/LF Ratio",
  title    = "HF/LF Ratio | Eyes Closed, Low Listening — By Acoustic Condition",
  subtitle = "Spatial sounds providing auditory landmarks may increase HF/LF in HL Unaided relative to None/WhiteNoise")
print(p_hflf_E)

Band Power

p_bands_E <- make_bands_acoustic(metrics_closedlow_acoustic,
  title    = "Spectral Band Power | Eyes Closed, Low Listening — By Acoustic Condition",
  subtitle = "Does acoustic environment shift energy from low-freq to high-freq bands in HL Unaided?")
print(p_bands_E)

MPF Line

p_mpf_line_E <- make_linePlot_acoustic(metrics_closedlow_acoustic, "mean_MPF", "Mean MPF (Hz)",
  title    = "MPF Across Postures by Group — By Acoustic Condition | Eyes Closed, Low Listening",
  subtitle = "Facets = acoustic condition. Error bars = +/- SE")
print(p_mpf_line_E)

HF/LF Line

p_hflf_line_E <- make_linePlot_acoustic(metrics_closedlow_acoustic, "HF_LF_ratio", "HF/LF Power Ratio",
  title    = "HF/LF Ratio Across Postures by Group — By Acoustic Condition | Eyes Closed, Low Listening",
  subtitle = "Facets = acoustic condition. Error bars = +/- SE")
print(p_hflf_line_E)

Combined

combined_E <- (p_mpf_line_E | p_hflf_line_E) / p_bands_E +
  plot_annotation(
    title    = "Acoustic Moderation — Eyes Closed, Low Listening",
    subtitle = "None vs White Noise vs Spatial Sounds | NHOA = Normal Hearing | HL Aided/Unaided = Hearing Loss group",
    theme    = theme(plot.title    = element_text(face = "bold", size = 14),
                     plot.subtitle = element_text(size = 10, colour = "grey40"))
  )
print(combined_E)


Save All Plots

out_dir <- "/Users/rialeung/Desktop/KITE/Thesis/Spectral Analysis/Files/Plots"
dir.create(out_dir, showWarnings = FALSE, recursive = TRUE)

# Condition A
ggsave(file.path(out_dir, "A01_MPF_violin_baseline.png"),    p_mpf_A,       width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "A02_HFLF_violin_baseline.png"),   p_hflf_A,      width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "A03_BandPower_bar_baseline.png"), p_bands_A,     width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "A04_MPF_line_baseline.png"),      p_mpf_line_A,  width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "A05_HFLF_line_baseline.png"),     p_hflf_line_A, width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "A00_combined_baseline.png"),      combined_A,    width = 14, height = 10,  dpi = 300)

# Condition B
ggsave(file.path(out_dir, "B01_MPF_violin_dualtask.png"),    p_mpf_B,       width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "B02_HFLF_violin_dualtask.png"),   p_hflf_B,      width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "B03_BandPower_bar_dualtask.png"), p_bands_B,     width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "B04_MPF_line_dualtask.png"),      p_mpf_line_B,  width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "B05_HFLF_line_dualtask.png"),     p_hflf_line_B, width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "B00_combined_dualtask.png"),      combined_B,    width = 14, height = 10,  dpi = 300)

# Condition C
ggsave(file.path(out_dir, "C01_MPF_violin_closedlow.png"),    p_mpf_C,       width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "C02_HFLF_violin_closedlow.png"),   p_hflf_C,      width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "C03_BandPower_bar_closedlow.png"), p_bands_C,     width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "C04_MPF_line_closedlow.png"),      p_mpf_line_C,  width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "C05_HFLF_line_closedlow.png"),     p_hflf_line_C, width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "C00_combined_closedlow.png"),      combined_C,    width = 14, height = 10,  dpi = 300)

# Condition D
ggsave(file.path(out_dir, "D01_MPF_violin_closedhigh.png"),    p_mpf_D,       width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "D02_HFLF_violin_closedhigh.png"),   p_hflf_D,      width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "D03_BandPower_bar_closedhigh.png"), p_bands_D,     width = 12, height = 6.5, dpi = 300)
ggsave(file.path(out_dir, "D04_MPF_line_closedhigh.png"),      p_mpf_line_D,  width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "D05_HFLF_line_closedhigh.png"),     p_hflf_line_D, width = 8,  height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "D00_combined_closedhigh.png"),      combined_D,    width = 14, height = 10,  dpi = 300)

# Condition E
ggsave(file.path(out_dir, "E01_MPF_violin_acoustic.png"),    p_mpf_E,       width = 14, height = 10,  dpi = 300)
ggsave(file.path(out_dir, "E02_HFLF_violin_acoustic.png"),   p_hflf_E,      width = 14, height = 10,  dpi = 300)
ggsave(file.path(out_dir, "E03_BandPower_bar_acoustic.png"), p_bands_E,     width = 14, height = 10,  dpi = 300)
ggsave(file.path(out_dir, "E04_MPF_line_acoustic.png"),      p_mpf_line_E,  width = 12, height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "E05_HFLF_line_acoustic.png"),     p_hflf_line_E, width = 12, height = 5.5, dpi = 300)
ggsave(file.path(out_dir, "E00_combined_acoustic.png"),      combined_E,    width = 16, height = 12,  dpi = 300)

cat("All plots saved to:", out_dir, "\n")
## All plots saved to: /Users/rialeung/Desktop/KITE/Thesis/Spectral Analysis/Files/Plots
cat("Done! :)\n")
## Done! :)