Arousal Mood Induction Protocol 2024

Physiological signals anlysis

Author

Álvaro Rivera-Rei

Published

2025-04-14, Monday

Code
cat('\014')     # clean terminal
Code
rm(list = ls()) # clean workspace
library(tidyverse)
library(afex)
library(emmeans)
# library(performance)
Code
xclude <- c('p13_HA') # male participant
my_dodge <- .3
theme_set(theme_minimal())

a_posteriori <- function(afex_aov, sig_level = .05) {
  factors  <- as.list(rownames(afex_aov$anova_table))
  for (j in 1:length(factors)) {
    if (grepl(':', factors[[j]])) {
      factors[[j]] <- unlist(strsplit(factors[[j]], ':'))
    }
  }
  p_values <- afex_aov$anova_table$`Pr(>F)`
  for (i in 1:length(p_values)) {
    if (p_values[i] <= sig_level) {
      cat(rep('_', 60), '\n', sep = '')
      print(emmeans(afex_aov, factors[[i]], contr = 'pairwise'))
    }
  }
}
Code
study_group <- c('p04_LA', 'p05_LA', 'p06_HA', 'p14_LA')
hrv_df <- read_csv('../data/hrv_hrf_hra_rsa_rrv_neurokit2.csv', col_types = cols()) |>
  filter(!(sbj %in% xclude)) |> 
  mutate(log10_HRV_RMSSD = log10(HRV_RMSSD),
         log10_RRV_RMSSD = log10(RRV_RMSSD),
         arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control'))|> 
  mutate_if(is.character, as.factor)
rhrv_df <- read_csv('../data/hrv_rhrv.csv', col_types = cols()) |>
  filter(!(sbj %in% xclude)) |> 
  mutate(log10_rMSSD = log10(rMSSD),
         arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
ans_df <- read_csv('../data/average_ans_indexes.csv', col_types = cols()) |>
  filter(!(sbj %in% xclude)) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
ccoh_df <- read_csv('../data/ccoh_ave.csv', col_types = cols()) |>
  filter(!(sbj %in% xclude)) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
hr_aperiodic_df <- read_csv('../data/hr_aperiodic_params.csv', col_types = cols()) |>
  mutate(sbj = str_sub(subj, end = -2)) |> 
  filter(!(sbj %in% xclude)) |> 
  mutate(block = paste0('block', substr(subj, nchar(subj), nchar(subj)))) |> 
  merge(hrv_df[c('sbj', 'block', 'arousal', 'starting')], by = c('sbj', 'block')) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
rsp_aperiodic_df <- read_csv('../data/rsp_aperiodic_params.csv', col_types = cols()) |>
  mutate(sbj = str_sub(subj, end = -2)) |> 
  filter(!(sbj %in% xclude)) |> 
  mutate(block = paste0('block', substr(subj, nchar(subj), nchar(subj)))) |> 
  merge(hrv_df[c('sbj', 'block', 'arousal', 'starting')], by = c('sbj', 'block')) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
hr_pow_peaks_df <- read_csv('../data/hr_power_peaks.csv', col_types = cols()) |>
  mutate(sbj = str_sub(subj, end = -2)) |> 
  filter(!(sbj %in% xclude)) |> 
  mutate(block = paste0('block', substr(subj, nchar(subj), nchar(subj)))) |> 
  merge(hrv_df[c('sbj', 'block', 'arousal', 'starting')], by = c('sbj', 'block')) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)
rsp_pow_peaks_df <- read_csv('../data/rsp_power_peaks.csv', col_types = cols()) |>
  mutate(sbj = str_sub(subj, end = -2)) |> 
  filter(!(sbj %in% xclude)) |> 
  mutate(block = paste0('block', substr(subj, nchar(subj), nchar(subj)))) |> 
  merge(hrv_df[c('sbj', 'block', 'arousal', 'starting')], by = c('sbj', 'block')) |> 
  mutate(arousal = recode(arousal, 'HA' = 'high', 'LA' = 'low'),
         group   = if_else(sbj %in% study_group, 'study', 'control')) |> 
  mutate_if(is.character, as.factor)

Summary

Code
ans_table <- xtabs(~ group + starting, data = unique(hrv_df[c('sbj', 'group', 'starting')]))
addmargins(ans_table, margin = c(1, 2))
         starting
group     HA LA Sum
  control  4  2   6
  study    1  3   4
  Sum      5  5  10
Code
summary(hrv_df)
      sbj     starting    block    arousal     heart_rate      HRV_MeanNN    
 p01_HA : 4   HA:20    block1:10   high:20   Min.   :53.36   Min.   : 649.7  
 p02_LA : 4   LA:20    block2:10   low :20   1st Qu.:72.34   1st Qu.: 717.7  
 p03_HA : 4            block3:10             Median :77.62   Median : 773.1  
 p04_LA : 4            block4:10             Mean   :76.31   Mean   : 801.6  
 p05_LA : 4                                  3rd Qu.:83.60   3rd Qu.: 829.4  
 p06_HA : 4                                  Max.   :92.36   Max.   :1124.4  
 (Other):16                                                                  
    HRV_SDNN       HRV_SDANN1       HRV_SDNNI1      HRV_RMSSD     
 Min.   :23.62   Min.   : 5.043   Min.   :23.21   Min.   : 13.52  
 1st Qu.:38.06   1st Qu.:10.461   1st Qu.:34.46   1st Qu.: 22.46  
 Median :61.41   Median :13.685   Median :59.04   Median : 34.97  
 Mean   :56.12   Mean   :17.634   Mean   :53.03   Mean   : 38.98  
 3rd Qu.:67.85   3rd Qu.:25.489   3rd Qu.:66.03   3rd Qu.: 46.47  
 Max.   :95.02   Max.   :42.214   Max.   :94.48   Max.   :105.41  
                                                                  
    HRV_SDSD         HRV_CVNN          HRV_CVSD        HRV_MedianNN   
 Min.   : 13.54   Min.   :0.03099   Min.   :0.01958   Min.   : 650.0  
 1st Qu.: 22.48   1st Qu.:0.05342   1st Qu.:0.03148   1st Qu.: 715.5  
 Median : 35.01   Median :0.06925   Median :0.04581   Median : 770.5  
 Mean   : 39.04   Mean   :0.06938   Mean   :0.04709   Mean   : 799.5  
 3rd Qu.: 46.54   3rd Qu.:0.08746   3rd Qu.:0.05382   3rd Qu.: 824.4  
 Max.   :105.56   Max.   :0.11158   Max.   :0.11776   Max.   :1129.5  
                                                                      
   HRV_MadNN        HRV_MCVNN         HRV_IQRNN       HRV_SDRMSSD    
 Min.   : 23.72   Min.   :0.03308   Min.   : 31.00   Min.   :0.9015  
 1st Qu.: 36.14   1st Qu.:0.04958   1st Qu.: 49.38   1st Qu.:1.2234  
 Median : 65.61   Median :0.06829   Median : 88.12   Median :1.4443  
 Mean   : 59.06   Mean   :0.07355   Mean   : 80.59   Mean   :1.5638  
 3rd Qu.: 77.47   3rd Qu.:0.09576   3rd Qu.:108.31   3rd Qu.:1.9651  
 Max.   :109.71   Max.   :0.12605   Max.   :160.00   Max.   :2.2278  
                                                                     
  HRV_Prc20NN      HRV_Prc80NN       HRV_pNN50        HRV_pNN20    
 Min.   : 625.0   Min.   : 673.0   Min.   : 0.000   Min.   :12.27  
 1st Qu.: 676.5   1st Qu.: 773.0   1st Qu.: 1.945   1st Qu.:38.82  
 Median : 731.2   Median : 820.0   Median :13.624   Median :57.99  
 Mean   : 752.8   Mean   : 851.3   Mean   :19.406   Mean   :52.86  
 3rd Qu.: 760.3   3rd Qu.: 907.5   3rd Qu.:30.008   3rd Qu.:70.68  
 Max.   :1064.0   Max.   :1195.0   Max.   :67.761   Max.   :86.87  
                                                                   
   HRV_MinNN       HRV_MaxNN         HRV_HTI          HRV_TINN     
 Min.   :523.0   Min.   : 738.0   Min.   : 6.871   Min.   : 54.69  
 1st Qu.:591.8   1st Qu.: 837.5   1st Qu.: 9.891   1st Qu.:132.81  
 Median :634.5   Median : 940.5   Median :14.614   Median :167.97  
 Mean   :655.4   Mean   : 950.9   Mean   :13.847   Mean   :175.00  
 3rd Qu.:683.5   3rd Qu.:1011.8   3rd Qu.:16.802   3rd Qu.:234.38  
 Max.   :868.0   Max.   :1321.0   Max.   :21.294   Max.   :320.31  
                                                                   
    HRV_VLF              HRV_LF             HRV_HF            HRV_VHF         
 Min.   :0.0005632   Min.   :0.004142   Min.   :0.001650   Min.   :4.116e-05  
 1st Qu.:0.0048864   1st Qu.:0.012272   1st Qu.:0.004969   1st Qu.:1.564e-04  
 Median :0.0099804   Median :0.017878   Median :0.011713   Median :3.234e-04  
 Mean   :0.0093022   Mean   :0.020077   Mean   :0.015619   Mean   :4.024e-04  
 3rd Qu.:0.0139517   3rd Qu.:0.025172   3rd Qu.:0.024310   3rd Qu.:5.483e-04  
 Max.   :0.0204093   Max.   :0.049360   Max.   :0.044648   Max.   :1.665e-03  
                                                                              
     HRV_TP           HRV_LFHF          HRV_LFn          HRV_HFn      
 Min.   :0.01502   Min.   : 0.1452   Min.   :0.1233   Min.   :0.0634  
 1st Qu.:0.03356   1st Qu.: 0.5590   1st Qu.:0.2815   1st Qu.:0.1552  
 Median :0.04211   Median : 1.6526   Median :0.4211   Median :0.2928  
 Mean   :0.04540   Mean   : 2.9930   Mean   :0.4710   Mean   :0.3135  
 3rd Qu.:0.05872   3rd Qu.: 4.1354   3rd Qu.:0.6115   3rd Qu.:0.4635  
 Max.   :0.08247   Max.   :13.6533   Max.   :0.8657   Max.   :0.8489  
                                                                      
    HRV_LnHF         HRV_SD1          HRV_SD2         HRV_SD1SD2    
 Min.   :-6.407   Min.   : 9.573   Min.   : 28.98   Min.   :0.2307  
 1st Qu.:-5.305   1st Qu.:15.899   1st Qu.: 51.55   1st Qu.:0.2635  
 Median :-4.447   Median :24.756   Median : 78.85   Median :0.3695  
 Mean   :-4.532   Mean   :27.602   Mean   : 74.02   Mean   :0.3667  
 3rd Qu.:-3.717   3rd Qu.:32.907   3rd Qu.: 91.05   3rd Qu.:0.4479  
 Max.   :-3.109   Max.   :74.645   Max.   :118.74   Max.   :0.6669  
                                                                    
     HRV_S          HRV_CSI         HRV_CVI      HRV_CSI_Modified
 Min.   : 1051   Min.   :1.499   Min.   :3.729   Min.   : 209.8  
 1st Qu.: 2256   1st Qu.:2.233   1st Qu.:4.060   1st Qu.: 623.4  
 Median : 6518   Median :2.706   Median :4.521   Median : 811.0  
 Mean   : 7323   Mean   :2.946   Mean   :4.429   Mean   : 858.2  
 3rd Qu.: 8795   3rd Qu.:3.796   3rd Qu.:4.651   3rd Qu.:1083.8  
 Max.   :26248   Max.   :4.334   Max.   :5.126   Max.   :1570.0  
                                                                 
    HRF_PIP          HRF_IALS         HRF_PSS          HRF_PAS        
 Min.   :0.2038   Min.   :0.1971   Min.   :0.1765   Min.   :0.000000  
 1st Qu.:0.3583   1st Qu.:0.3549   1st Qu.:0.4278   1st Qu.:0.007568  
 Median :0.4008   Median :0.4014   Median :0.5233   Median :0.015512  
 Mean   :0.3985   Mean   :0.3948   Mean   :0.5227   Mean   :0.035453  
 3rd Qu.:0.4502   3rd Qu.:0.4463   3rd Qu.:0.6747   3rd Qu.:0.037655  
 Max.   :0.6581   Max.   :0.6592   Max.   :0.9432   Max.   :0.175676  
                                                                      
     HRA_GI          HRA_SI          HRA_AI          HRA_PI     
 Min.   :49.17   Min.   :49.16   Min.   :49.16   Min.   :39.65  
 1st Qu.:49.61   1st Qu.:49.63   1st Qu.:49.64   1st Qu.:45.55  
 Median :49.91   Median :49.92   Median :49.89   Median :47.98  
 Mean   :49.92   Mean   :49.93   Mean   :49.92   Mean   :48.06  
 3rd Qu.:50.16   3rd Qu.:50.15   3rd Qu.:50.17   3rd Qu.:49.95  
 Max.   :50.71   Max.   :50.75   Max.   :50.73   Max.   :61.45  
                                                                
    HRA_C1d          HRA_C1a          HRA_SD1d         HRA_SD1a     
 Min.   :0.4012   Min.   :0.3613   Min.   : 6.451   Min.   : 6.638  
 1st Qu.:0.4483   1st Qu.:0.4876   1st Qu.:10.719   1st Qu.:12.156  
 Median :0.4826   Median :0.5174   Median :18.296   Median :16.766  
 Mean   :0.4875   Mean   :0.5125   Mean   :19.180   Mean   :19.788  
 3rd Qu.:0.5124   3rd Qu.:0.5517   3rd Qu.:21.793   3rd Qu.:25.450  
 Max.   :0.6387   Max.   :0.5988   Max.   :52.238   Max.   :53.321  
                                                                    
    HRA_C2d          HRA_C2a          HRA_SD2d        HRA_SD2a    
 Min.   :0.4056   Min.   :0.3762   Min.   :22.87   Min.   :17.80  
 1st Qu.:0.4725   1st Qu.:0.4644   1st Qu.:35.61   1st Qu.:36.55  
 Median :0.4978   Median :0.5022   Median :56.86   Median :53.78  
 Mean   :0.5075   Mean   :0.4925   Mean   :52.25   Mean   :52.28  
 3rd Qu.:0.5356   3rd Qu.:0.5275   3rd Qu.:63.55   3rd Qu.:67.03  
 Max.   :0.6238   Max.   :0.5944   Max.   :83.93   Max.   :84.00  
                                                                  
     HRA_Cd           HRA_Ca         HRA_SDNNd       HRA_SDNNa    
 Min.   :0.4183   Min.   :0.4198   Min.   :17.75   Min.   :15.27  
 1st Qu.:0.4718   1st Qu.:0.4730   1st Qu.:26.05   1st Qu.:27.71  
 Median :0.4967   Median :0.5033   Median :42.52   Median :41.79  
 Mean   :0.5013   Mean   :0.4987   Mean   :39.48   Mean   :39.79  
 3rd Qu.:0.5270   3rd Qu.:0.5282   3rd Qu.:47.41   3rd Qu.:49.95  
 Max.   :0.5802   Max.   :0.5817   Max.   :68.03   Max.   :66.50  
                                                                  
 HRV_DFA_alpha1   HRV_MFDFA_alpha1_Width HRV_MFDFA_alpha1_Peak
 Min.   :0.6120   Min.   :0.634          Min.   :0.820        
 1st Qu.:0.9498   1st Qu.:1.352          1st Qu.:1.073        
 Median :1.1976   Median :1.874          Median :1.387        
 Mean   :1.2164   Mean   :1.866          Mean   :1.401        
 3rd Qu.:1.4840   3rd Qu.:2.362          3rd Qu.:1.664        
 Max.   :1.7196   Max.   :3.538          Max.   :2.135        
                                                              
 HRV_MFDFA_alpha1_Mean HRV_MFDFA_alpha1_Max HRV_MFDFA_alpha1_Delta
 Min.   :1.166         Min.   :-3.4247      Min.   :-4.4032       
 1st Qu.:1.636         1st Qu.:-2.4354      1st Qu.:-3.0365       
 Median :2.058         Median :-1.2936      Median :-2.0737       
 Mean   :2.000         Mean   :-1.4954      Mean   :-2.1333       
 3rd Qu.:2.291         3rd Qu.:-0.4391      3rd Qu.:-1.1040       
 Max.   :3.009         Max.   : 0.5512      Max.   :-0.2557       
                                                                  
 HRV_MFDFA_alpha1_Asymmetry HRV_MFDFA_alpha1_Fluctuation
 Min.   :-0.427751          Min.   :0.0001604           
 1st Qu.:-0.266249          1st Qu.:0.0008625           
 Median :-0.170848          Median :0.0018421           
 Mean   :-0.186395          Mean   :0.0031072           
 3rd Qu.:-0.122207          3rd Qu.:0.0046781           
 Max.   :-0.007863          Max.   :0.0115272           
                                                        
 HRV_MFDFA_alpha1_Increment HRV_DFA_alpha2   HRV_MFDFA_alpha2_Width
 Min.   :0.02981            Min.   :0.2191   Min.   :0.07798       
 1st Qu.:0.13907            1st Qu.:0.5939   1st Qu.:0.33904       
 Median :0.25851            Median :0.8427   Median :0.48868       
 Mean   :0.33281            Mean   :0.7602   Mean   :0.53592       
 3rd Qu.:0.48019            3rd Qu.:0.9764   3rd Qu.:0.70801       
 Max.   :1.09117            Max.   :1.2028   Max.   :1.24970       
                                                                   
 HRV_MFDFA_alpha2_Peak HRV_MFDFA_alpha2_Mean HRV_MFDFA_alpha2_Max
 Min.   :0.2487        Min.   :0.2124        Min.   :-1.1453     
 1st Qu.:0.5022        1st Qu.:0.7044        1st Qu.: 0.2097     
 Median :0.7506        Median :0.8406        Median : 0.5350     
 Mean   :0.7576        Mean   :0.8224        Mean   : 0.4891     
 3rd Qu.:1.0047        3rd Qu.:0.9691        3rd Qu.: 1.0027     
 Max.   :1.1199        Max.   :1.2930        Max.   : 1.5751     
                                                                 
 HRV_MFDFA_alpha2_Delta HRV_MFDFA_alpha2_Asymmetry HRV_MFDFA_alpha2_Fluctuation
 Min.   :-1.8613        Min.   :-1.0000            Min.   :1.040e-06           
 1st Qu.:-0.5147        1st Qu.:-0.5767            1st Qu.:3.386e-05           
 Median :-0.1729        Median :-0.3569            Median :7.472e-05           
 Mean   :-0.2918        Mean   :-0.3992            Mean   :1.480e-04           
 3rd Qu.: 0.2000        3rd Qu.:-0.1242            3rd Qu.:2.038e-04           
 Max.   : 0.7492        Max.   : 0.0000            Max.   :6.746e-04           
                                                                               
 HRV_MFDFA_alpha2_Increment    HRV_ApEn        HRV_SampEn       HRV_ShanEn   
 Min.   :0.000633           Min.   :0.7589   Min.   :0.7803   Min.   :6.319  
 1st Qu.:0.007493           1st Qu.:1.0083   1st Qu.:1.2358   1st Qu.:6.882  
 Median :0.017048           Median :1.0932   Median :1.4043   Median :7.236  
 Mean   :0.022527           Mean   :1.0625   Mean   :1.3901   Mean   :7.116  
 3rd Qu.:0.033356           3rd Qu.:1.1398   3rd Qu.:1.5426   3rd Qu.:7.379  
 Max.   :0.079039           Max.   :1.2316   Max.   :2.0716   Max.   :7.603  
                                                                             
  HRV_FuzzyEn        HRV_MSEn        HRV_CMSEn       HRV_RCMSEn   
 Min.   :0.7513   Min.   :0.8365   Min.   :1.230   Min.   :1.753  
 1st Qu.:0.9671   1st Qu.:1.3322   1st Qu.:1.339   1st Qu.:1.988  
 Median :1.1443   Median :1.4288   Median :1.362   Median :2.081  
 Mean   :1.1027   Mean   :1.4077   Mean   :1.358   Mean   :2.076  
 3rd Qu.:1.2565   3rd Qu.:1.5248   3rd Qu.:1.387   3rd Qu.:2.187  
 Max.   :1.4632   Max.   :1.6822   Max.   :1.464   Max.   :2.320  
                                                                  
     HRV_CD         HRV_HFD         HRV_KFD         HRV_LZC      
 Min.   :1.347   Min.   :1.424   Min.   :2.413   Min.   :0.5218  
 1st Qu.:1.666   1st Qu.:1.626   1st Qu.:2.734   1st Qu.:0.7006  
 Median :1.744   Median :1.806   Median :2.967   Median :0.7837  
 Mean   :1.725   Mean   :1.744   Mean   :3.127   Mean   :0.7773  
 3rd Qu.:1.791   3rd Qu.:1.892   3rd Qu.:3.364   3rd Qu.:0.8572  
 Max.   :1.895   Max.   :2.041   Max.   :4.983   Max.   :0.9932  
                                                                 
  RSA_P2T_Mean    RSA_P2T_Mean_log   RSA_P2T_SD    RSA_P2T_NoRSA 
 Min.   : 25.33   Min.   :3.232    Min.   :12.94   Min.   : 0.0  
 1st Qu.: 45.69   1st Qu.:3.822    1st Qu.:30.43   1st Qu.: 0.0  
 Median : 65.85   Median :4.184    Median :41.35   Median : 0.0  
 Mean   : 86.85   Mean   :4.287    Mean   :41.58   Mean   : 1.1  
 3rd Qu.:131.45   3rd Qu.:4.879    3rd Qu.:51.70   3rd Qu.: 0.0  
 Max.   :219.22   Max.   :5.390    Max.   :81.39   Max.   :14.0  
                                                                 
 RSA_PorgesBohrer RSA_Gates_Mean  RSA_Gates_Mean_log  RSA_Gates_SD    
 Min.   :-6.583   Min.   :7.433   Min.   :2.006      Min.   :0.04312  
 1st Qu.:-5.813   1st Qu.:7.731   1st Qu.:2.045      1st Qu.:0.10268  
 Median :-5.051   Median :7.924   Median :2.070      Median :0.13116  
 Mean   :-5.202   Mean   :7.983   Mean   :2.076      Mean   :0.14402  
 3rd Qu.:-4.614   3rd Qu.:8.191   3rd Qu.:2.103      3rd Qu.:0.19296  
 Max.   :-2.963   Max.   :8.783   Max.   :2.173      Max.   :0.26885  
                                                                      
    rsp_rate        RRV_RMSSD        RRV_MeanBB       RRV_SDBB     
 Min.   : 5.965   Min.   : 558.7   Min.   : 2946   Min.   : 466.1  
 1st Qu.:12.078   1st Qu.: 968.7   1st Qu.: 3812   1st Qu.: 720.5  
 Median :14.614   Median :1302.3   Median : 4106   Median : 995.1  
 Mean   :13.721   Mean   :1501.0   Mean   : 4887   Mean   :1148.6  
 3rd Qu.:15.740   3rd Qu.:1687.6   3rd Qu.: 4972   3rd Qu.:1460.9  
 Max.   :20.366   Max.   :4168.8   Max.   :10059   Max.   :2535.2  
                                                                   
    RRV_SDSD         RRV_CVBB         RRV_CVSD       RRV_MedianBB 
 Min.   : 562.5   Min.   :0.1192   Min.   :0.1206   Min.   :2819  
 1st Qu.: 975.4   1st Qu.:0.1888   1st Qu.:0.2431   1st Qu.:3664  
 Median :1313.1   Median :0.2397   Median :0.3031   Median :3904  
 Mean   :1516.6   Mean   :0.2300   Mean   :0.2968   Mean   :4746  
 3rd Qu.:1701.3   3rd Qu.:0.2622   3rd Qu.:0.3585   3rd Qu.:4705  
 Max.   :4242.0   Max.   :0.3823   Max.   :0.4827   Max.   :9789  
                                                                  
   RRV_MadBB        RRV_MCVBB          RRV_VLF             RRV_LF        
 Min.   : 358.8   Min.   :0.08535   Min.   :0.004080   Min.   :0.001397  
 1st Qu.: 493.1   1st Qu.:0.12866   1st Qu.:0.008827   1st Qu.:0.008026  
 Median : 657.2   Median :0.18584   Median :0.012042   Median :0.011014  
 Mean   : 979.0   Mean   :0.18826   Mean   :0.011931   Mean   :0.014982  
 3rd Qu.:1035.6   3rd Qu.:0.22358   3rd Qu.:0.014926   3rd Qu.:0.021209  
 Max.   :3282.5   Max.   :0.41311   Max.   :0.020489   Max.   :0.044389  
                                                                         
     RRV_HF             RRV_LFHF           RRV_LFn          RRV_HFn         
 Min.   :2.241e-06   Min.   :   5.865   Min.   :0.1928   Min.   :9.865e-05  
 1st Qu.:1.054e-04   1st Qu.:  14.741   1st Qu.:0.3759   1st Qu.:5.716e-03  
 Median :3.693e-04   Median :  31.937   Median :0.5004   Median :1.753e-02  
 Mean   :8.108e-04   Mean   : 248.988   Mean   :0.4973   Mean   :2.324e-02  
 3rd Qu.:1.373e-03   3rd Qu.:  63.052   3rd Qu.:0.6092   3rd Qu.:3.324e-02  
 Max.   :4.004e-03   Max.   :3637.081   Max.   :0.8457   Max.   :1.032e-01  
                                                                            
    RRV_SD1          RRV_SD2         RRV_SD2SD1        RRV_ApEn      
 Min.   : 397.7   Min.   : 463.3   Min.   :0.5309   Min.   :0.09514  
 1st Qu.: 689.7   1st Qu.: 743.4   1st Qu.:1.0126   1st Qu.:0.47566  
 Median : 928.5   Median :1010.7   Median :1.1850   Median :0.56197  
 Mean   :1072.4   Mean   :1193.9   Mean   :1.1817   Mean   :0.53443  
 3rd Qu.:1203.0   3rd Qu.:1472.3   3rd Qu.:1.2901   3rd Qu.:0.66925  
 Max.   :2999.5   Max.   :3154.2   Max.   :1.8824   Max.   :0.84394  
                                                                     
   RRV_SampEn     RRV_DFA_alpha2   RRV_MFDFA_alpha2_Width RRV_MFDFA_alpha2_Peak
 Min.   :0.6931   Min.   :0.2261   Min.   :0.2969         Min.   :0.2914       
 1st Qu.:1.5519   1st Qu.:0.5014   1st Qu.:0.5044         1st Qu.:0.5963       
 Median :1.7533   Median :0.5776   Median :0.7488         Median :0.7027       
 Mean   :   Inf   Mean   :0.6157   Mean   :0.8157         Mean   :0.7654       
 3rd Qu.:2.1449   3rd Qu.:0.7789   3rd Qu.:1.0059         3rd Qu.:0.9821       
 Max.   :   Inf   Max.   :1.0220   Max.   :1.8727         Max.   :1.3448       
                  NA's   :14       NA's   :14             NA's   :14           
 RRV_MFDFA_alpha2_Mean RRV_MFDFA_alpha2_Max RRV_MFDFA_alpha2_Delta
 Min.   :0.2366        Min.   :-0.2278      Min.   :-0.70089      
 1st Qu.:0.5670        1st Qu.: 0.2128      1st Qu.:-0.17799      
 Median :0.7528        Median : 0.3472      Median : 0.12867      
 Mean   :0.7546        Mean   : 0.3660      Mean   : 0.04354      
 3rd Qu.:0.9189        3rd Qu.: 0.5596      3rd Qu.: 0.22658      
 Max.   :1.2787        Max.   : 0.7456      Max.   : 0.62625      
 NA's   :14            NA's   :14           NA's   :14            
 RRV_MFDFA_alpha2_Asymmetry RRV_MFDFA_alpha2_Fluctuation
 Min.   :-0.6719            Min.   :0.0000004           
 1st Qu.:-0.5869            1st Qu.:0.0000097           
 Median :-0.5282            Median :0.0000526           
 Mean   :-0.5119            Mean   :0.0002140           
 3rd Qu.:-0.4298            3rd Qu.:0.0002116           
 Max.   :-0.3385            Max.   :0.0025105           
 NA's   :14                 NA's   :14                  
 RRV_MFDFA_alpha2_Increment log10_HRV_RMSSD log10_RRV_RMSSD     group   
 Min.   :0.003212           Min.   :1.131   Min.   :2.747   control:24  
 1st Qu.:0.010450           1st Qu.:1.351   1st Qu.:2.986   study  :16  
 Median :0.027182           Median :1.544   Median :3.114               
 Mean   :0.048626           Mean   :1.536   Mean   :3.116               
 3rd Qu.:0.063279           3rd Qu.:1.667   3rd Qu.:3.226               
 Max.   :0.306067           Max.   :2.023   Max.   :3.620               
 NA's   :14                                                             

Time Domain Heart Rate Variability (HRV)

Heart Rate

Code
heart_rate_anova <- aov_ez('sbj',
                           'heart_rate', hrv_df,
                           within = c('arousal'), between = c('group', 'starting'))
heart_rate_afex_plot <-
  afex_plot(
    heart_rate_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(heart_rate_afex_plot))
Figure 1: heart_rate
Code
print(heart_rate_anova)
Anova Table (Type 3 tests)

Response: heart_rate
                  Effect   df    MSE        F   ges p.value
1                  group 1, 6 307.42     0.00 <.001    .957
2               starting 1, 6 307.42     0.12  .019    .742
3         group:starting 1, 6 307.42     0.02  .003    .897
4                arousal 1, 6   0.34   5.89 +  .001    .051
5          group:arousal 1, 6   0.34  13.67 *  .003    .010
6       starting:arousal 1, 6   0.34 21.83 **  .004    .003
7 group:starting:arousal 1, 6   0.34     1.15 <.001    .324
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(heart_rate_anova)
____________________________________________________________
$emmeans
 group   arousal emmean   SE df lower.CL upper.CL
 control high      76.9 5.44  6     63.6     90.3
 study   high      75.3 7.25  6     57.6     93.1
 control low       76.6 5.31  6     63.6     89.6
 study   low       77.2 7.07  6     59.9     94.5

Results are averaged over the levels of: starting 
Confidence level used: 0.95 

$contrasts
 contrast                   estimate    SE df t.ratio p.value
 control high - study high     1.613 9.060  6   0.178  0.9978
 control high - control low    0.379 0.358  6   1.059  0.7246
 control high - study low     -0.216 8.920  6  -0.024  1.0000
 study high - control low     -1.233 8.980  6  -0.137  0.9990
 study high - study low       -1.829 0.478  6  -3.827  0.0330
 control low - study low      -0.596 8.840  6  -0.067  0.9999

Results are averaged over the levels of: starting 
P value adjustment: tukey method for comparing a family of 4 estimates 

____________________________________________________________
$emmeans
 starting arousal emmean   SE df lower.CL upper.CL
 HA       high      77.0 7.02  6     59.8     94.2
 LA       high      75.3 5.73  6     61.3     89.3
 HA       low       79.1 6.85  6     62.3     95.9
 LA       low       74.6 5.59  6     60.9     88.3

Results are averaged over the levels of: group 
Confidence level used: 0.95 

$contrasts
 contrast          estimate    SE df t.ratio p.value
 HA high - LA high    1.690 9.060  6   0.187  0.9974
 HA high - HA low    -2.120 0.463  6  -4.582  0.0148
 HA high - LA low     2.361 8.970  6   0.263  0.9930
 LA high - HA low    -3.810 8.930  6  -0.427  0.9717
 LA high - LA low     0.671 0.378  6   1.775  0.3678
 HA low - LA low      4.481 8.840  6   0.507  0.9545

Results are averaged over the levels of: group 
P value adjustment: tukey method for comparing a family of 4 estimates 

HRV_SDNN

Code
sdnn_anova <- aov_ez('sbj',
                     'HRV_SDNN', hrv_df,
                     within = c('arousal'), between = c('group', 'starting'))
sdnn_afex_plot <-
  afex_plot(
    sdnn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sdnn_afex_plot))
Figure 2: HRV_SDNN
Code
print(sdnn_anova)
Anova Table (Type 3 tests)

Response: HRV_SDNN
                  Effect   df     MSE    F   ges p.value
1                  group 1, 6 1181.21 0.08  .013    .789
2               starting 1, 6 1181.21 0.29  .046    .608
3         group:starting 1, 6 1181.21 0.00 <.001    .978
4                arousal 1, 6   18.74 0.07 <.001    .800
5          group:arousal 1, 6   18.74 0.80  .002    .406
6       starting:arousal 1, 6   18.74 0.96  .002    .365
7 group:starting:arousal 1, 6   18.74 2.36  .006    .175
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sdnn_anova)

HRV_CVNN

Code
cvnn_anova <- aov_ez('sbj',
                     'HRV_CVNN', hrv_df,
                     within = c('arousal'), between = c('group', 'starting'))
cvnn_afex_plot <-
  afex_plot(
    cvnn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(cvnn_afex_plot))
Figure 3: HRV_CVNN
Code
print(cvnn_anova)
Anova Table (Type 3 tests)

Response: HRV_CVNN
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.00   0.17  .028    .692
2               starting 1, 6 0.00   0.22  .035    .653
3         group:starting 1, 6 0.00   0.03  .006    .858
4                arousal 1, 6 0.00   0.00 <.001    .998
5          group:arousal 1, 6 0.00   0.56  .002    .481
6       starting:arousal 1, 6 0.00   0.46  .001    .524
7 group:starting:arousal 1, 6 0.00 4.18 +  .011    .087
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(cvnn_anova)

log10_HRV_RMSSD

Code
rmssd_anova <- aov_ez('sbj',
                      'log10_HRV_RMSSD', hrv_df,
                      within = c('arousal'), between = c('group', 'starting'))
rmssd_afex_plot <-
  afex_plot(
    rmssd_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rmssd_afex_plot))
Figure 4: log10_HRV_RMSSD
Code
print(rmssd_anova)
Anova Table (Type 3 tests)

Response: log10_HRV_RMSSD
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.15 0.00 <.001    .965
2               starting 1, 6 0.15 0.02  .004    .886
3         group:starting 1, 6 0.15 0.07  .011    .803
4                arousal 1, 6 0.00 0.20 <.001    .672
5          group:arousal 1, 6 0.00 0.69  .001    .439
6       starting:arousal 1, 6 0.00 2.84  .005    .143
7 group:starting:arousal 1, 6 0.00 0.09 <.001    .770
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rmssd_anova)
# check_autocorrelation(rmssd_anova)
# check_heteroscedasticity(rmssd_anova)
# plot(check_collinearity(rmssd_anova))
# normy <- check_normality(rmssd_anova)
# plot(normy, type = 'density')
# plot(normy, type = 'qq')

HRV_IQRNN

Code
iqrnn_anova <- aov_ez('sbj',
                      'HRV_IQRNN', hrv_df,
                      within = c('arousal'), between = c('group', 'starting'))
iqrnn_afex_plot <-
  afex_plot(
    iqrnn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(iqrnn_afex_plot))
Figure 5: HRV_IQRNN
Code
print(iqrnn_anova)
Anova Table (Type 3 tests)

Response: HRV_IQRNN
                  Effect   df     MSE    F  ges p.value
1                  group 1, 6 2924.57 0.47 .071    .518
2               starting 1, 6 2924.57 0.41 .062    .545
3         group:starting 1, 6 2924.57 0.04 .006    .852
4                arousal 1, 6  101.22 0.41 .002    .545
5          group:arousal 1, 6  101.22 1.08 .006    .339
6       starting:arousal 1, 6  101.22 2.40 .013    .172
7 group:starting:arousal 1, 6  101.22 0.74 .004    .422
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(iqrnn_anova)

HRV_HTI

Code
hti_anova <- aov_ez('sbj',
                    'HRV_HTI', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
hti_afex_plot <-
  afex_plot(
    hti_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hti_afex_plot))
Figure 6: HRV_HTI
Code
print(hti_anova)
Anova Table (Type 3 tests)

Response: HRV_HTI
                  Effect   df   MSE         F  ges p.value
1                  group 1, 6 46.12      0.11 .018    .750
2               starting 1, 6 46.12      0.34 .053    .581
3         group:starting 1, 6 46.12      0.12 .019    .745
4                arousal 1, 6  0.13  26.21 ** .012    .002
5          group:arousal 1, 6  0.13 88.10 *** .040   <.001
6       starting:arousal 1, 6  0.13 51.86 *** .024   <.001
7 group:starting:arousal 1, 6  0.13 66.53 *** .031   <.001
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hti_anova)
____________________________________________________________
$emmeans
 arousal emmean   SE df lower.CL upper.CL
 high      14.4 1.71  6    10.27     18.6
 low       13.5 1.76  6     9.18     17.8

Results are averaged over the levels of: group, starting 
Confidence level used: 0.95 

$contrasts
 contrast   estimate    SE df t.ratio p.value
 high - low    0.947 0.185  6   5.120  0.0022

Results are averaged over the levels of: group, starting 

____________________________________________________________
$emmeans
 group   arousal emmean   SE df lower.CL upper.CL
 control high      14.2 2.05  6     9.14     19.2
 study   high      14.7 2.73  6     8.05     21.4
 control low       14.9 2.12  6     9.76     20.1
 study   low       12.0 2.82  6     5.14     19.0

Results are averaged over the levels of: starting 
Confidence level used: 0.95 

$contrasts
 contrast                   estimate    SE df t.ratio p.value
 control high - study high    -0.580 3.410  6  -0.170  0.9981
 control high - control low   -0.789 0.222  6  -3.555  0.0449
 control high - study low      2.102 3.490  6   0.603  0.9275
 study high - control low     -0.209 3.450  6  -0.060  0.9999
 study high - study low        2.682 0.296  6   9.066  0.0004
 control low - study low       2.891 3.530  6   0.820  0.8436

Results are averaged over the levels of: starting 
P value adjustment: tukey method for comparing a family of 4 estimates 

____________________________________________________________
$emmeans
 starting arousal emmean   SE df lower.CL upper.CL
 HA       high      14.1 2.64  6     7.63     20.6
 LA       high      14.8 2.16  6     9.50     20.1
 HA       low       11.8 2.73  6     5.13     18.5
 LA       low       15.2 2.23  6     9.71     20.6

Results are averaged over the levels of: group 
Confidence level used: 0.95 

$contrasts
 contrast          estimate    SE df t.ratio p.value
 HA high - LA high   -0.688 3.410  6  -0.202  0.9968
 HA high - HA low     2.278 0.286  6   7.954  0.0009
 HA high - LA low    -1.073 3.460  6  -0.310  0.9886
 LA high - HA low     2.967 3.480  6   0.852  0.8287
 LA high - LA low    -0.385 0.234  6  -1.646  0.4232
 HA low - LA low     -3.351 3.530  6  -0.950  0.7809

Results are averaged over the levels of: group 
P value adjustment: tukey method for comparing a family of 4 estimates 

____________________________________________________________
$emmeans
 group   starting arousal emmean   SE df lower.CL upper.CL
 control HA       high      12.5 2.36  6     6.68     18.2
 study   HA       high      15.7 4.73  6     4.16     27.3
 control LA       high      15.8 3.34  6     7.66     24.0
 study   LA       high      13.7 2.73  6     7.05     20.4
 control HA       low       13.4 2.44  6     7.45     19.4
 study   HA       low       10.2 4.89  6    -1.75     22.2
 control LA       low       16.5 3.46  6     8.00     24.9
 study   LA       low       13.9 2.82  6     6.98     20.8

Confidence level used: 0.95 

$contrasts
 contrast                          estimate    SE df t.ratio p.value
 control HA high - study HA high     -3.271 5.290  6  -0.619  0.9969
 control HA high - control LA high   -3.379 4.100  6  -0.825  0.9841
 control HA high - study LA high     -1.269 3.610  6  -0.351  0.9999
 control HA high - control HA low    -0.965 0.256  6  -3.768  0.0888
 control HA high - study HA low       2.251 5.430  6   0.415  0.9997
 control HA high - control LA low    -3.991 4.190  6  -0.953  0.9667
 control HA high - study LA low      -1.426 3.680  6  -0.387  0.9998
 study HA high - control LA high     -0.108 5.790  6  -0.019  1.0000
 study HA high - study LA high        2.002 5.460  6   0.367  0.9999
 study HA high - control HA low       2.305 5.320  6   0.433  0.9997
 study HA high - study HA low         5.522 0.512  6  10.776  0.0005
 study HA high - control LA low      -0.720 5.860  6  -0.123  1.0000
 study HA high - study LA low         1.845 5.510  6   0.335  0.9999
 control LA high - study LA high      2.110 4.320  6   0.489  0.9993
 control LA high - control HA low     2.413 4.140  6   0.583  0.9978
 control LA high - study HA low       5.630 5.920  6   0.951  0.9671
 control LA high - control LA low    -0.612 0.362  6  -1.690  0.6961
 control LA high - study LA low       1.953 4.380  6   0.446  0.9996
 study LA high - control HA low       0.303 3.660  6   0.083  1.0000
 study LA high - study HA low         3.520 5.600  6   0.629  0.9966
 study LA high - control LA low      -2.723 4.400  6  -0.618  0.9969
 study LA high - study LA low        -0.158 0.296  6  -0.532  0.9987
 control HA low - study HA low        3.217 5.460  6   0.589  0.9977
 control HA low - control LA low     -3.026 4.230  6  -0.715  0.9927
 control HA low - study LA low       -0.461 3.730  6  -0.123  1.0000
 study HA low - control LA low       -6.242 5.990  6  -1.043  0.9490
 study HA low - study LA low         -3.677 5.640  6  -0.652  0.9957
 control LA low - study LA low        2.565 4.460  6   0.575  0.9980

P value adjustment: tukey method for comparing a family of 8 estimates 

Autonomic Nervous System Indexes (Candia-Rivera et al, 2023; Valenza et al, 2018)

CSI_ave

3 middle minutes in each block to avoid block transitions

Code
CSI_ave_anova <- aov_ez('sbj',
                        'CSI_ave', ans_df,
                        within = c('arousal'), between = c('group', 'starting'))
CSI_ave_afex_plot <-
  afex_plot(
    CSI_ave_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(CSI_ave_afex_plot))
Figure 7: CSI_ave
Code
print(CSI_ave_anova)
Anova Table (Type 3 tests)

Response: CSI_ave
                  Effect   df  MSE        F   ges p.value
1                  group 1, 6 0.10     0.02  .003    .901
2               starting 1, 6 0.10     0.31  .049    .599
3         group:starting 1, 6 0.10     0.07  .011    .806
4                arousal 1, 6 0.00     2.67 <.001    .153
5          group:arousal 1, 6 0.00 14.53 **  .001    .009
6       starting:arousal 1, 6 0.00 26.59 **  .002    .002
7 group:starting:arousal 1, 6 0.00     0.07 <.001    .794
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(CSI_ave_anova)
____________________________________________________________
$emmeans
 group   arousal emmean     SE df lower.CL upper.CL
 control high      2.20 0.0973  6     1.96     2.44
 study   high      2.21 0.1300  6     1.89     2.52
 control low       2.19 0.0989  6     1.95     2.43
 study   low       2.23 0.1320  6     1.90     2.55

Results are averaged over the levels of: starting 
Confidence level used: 0.95 

$contrasts
 contrast                   estimate      SE df t.ratio p.value
 control high - study high  -0.00665 0.16200  6  -0.041  1.0000
 control high - control low  0.00838 0.00462  6   1.815  0.3518
 control high - study low   -0.02760 0.16400  6  -0.168  0.9981
 study high - control low    0.01503 0.16300  6   0.092  0.9997
 study high - study low     -0.02095 0.00615  6  -3.404  0.0535
 control low - study low    -0.03598 0.16500  6  -0.218  0.9959

Results are averaged over the levels of: starting 
P value adjustment: tukey method for comparing a family of 4 estimates 

____________________________________________________________
$emmeans
 starting arousal emmean    SE df lower.CL upper.CL
 HA       high      2.15 0.126  6     1.84     2.46
 LA       high      2.26 0.103  6     2.01     2.51
 HA       low       2.17 0.128  6     1.86     2.49
 LA       low       2.24 0.104  6     1.99     2.50

Results are averaged over the levels of: group 
Confidence level used: 0.95 

$contrasts
 contrast          estimate      SE df t.ratio p.value
 HA high - LA high  -0.1105 0.16200  6  -0.681  0.9005
 HA high - HA low   -0.0261 0.00596  6  -4.383  0.0181
 HA high - LA low   -0.0970 0.16300  6  -0.594  0.9303
 LA high - HA low    0.0844 0.16400  6   0.515  0.9523
 LA high - LA low    0.0135 0.00487  6   2.785  0.1114
 HA low - LA low    -0.0709 0.16500  6  -0.430  0.9711

Results are averaged over the levels of: group 
P value adjustment: tukey method for comparing a family of 4 estimates 

CPI_ave

3 middle minutes in each block to avoid block transitions

Code
CPI_ave_anova <- aov_ez('sbj',
                        'CPI_ave', ans_df,
                        within = c('arousal'), between = c('group', 'starting'))
CPI_ave_afex_plot <-
  afex_plot(
    CPI_ave_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(CPI_ave_afex_plot))
Figure 8: CPI_ave
Code
print(CPI_ave_anova)
Anova Table (Type 3 tests)

Response: CPI_ave
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.27 0.00 <.001    .996
2               starting 1, 6 0.27 0.08  .014    .782
3         group:starting 1, 6 0.27 0.03  .005    .862
4                arousal 1, 6 0.00 0.52 <.001    .500
5          group:arousal 1, 6 0.00 0.47 <.001    .519
6       starting:arousal 1, 6 0.00 3.49  .005    .111
7 group:starting:arousal 1, 6 0.00 0.08 <.001    .781
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(CPI_ave_anova)

SAI_ave

3 middle minutes in each block to avoid block transitions

Code
SAI_ave_anova <- aov_ez('sbj',
                        'SAI_ave', ans_df,
                        within = c('arousal'), between = c('group', 'starting'))
SAI_ave_afex_plot <-
  afex_plot(
    SAI_ave_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(SAI_ave_afex_plot))
Figure 9: SAI_ave
Code
print(SAI_ave_anova)
Anova Table (Type 3 tests)

Response: SAI_ave
                  Effect   df     MSE       F   ges p.value
1                  group 1, 6 1065.29    0.00 <.001    .976
2               starting 1, 6 1065.29    0.00 <.001    .953
3         group:starting 1, 6 1065.29    0.01  .001    .938
4                arousal 1, 6    2.40    2.28 <.001    .182
5          group:arousal 1, 6    2.40    0.80 <.001    .407
6       starting:arousal 1, 6    2.40 11.09 *  .004    .016
7 group:starting:arousal 1, 6    2.40    1.27 <.001    .302
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(SAI_ave_anova)
____________________________________________________________
$emmeans
 starting arousal emmean   SE df lower.CL upper.CL
 HA       high      56.3 13.1  6     24.2     88.3
 LA       high      59.9 10.7  6     33.7     86.1
 HA       low       60.1 12.7  6     29.0     91.2
 LA       low       58.5 10.4  6     33.1     83.9

Results are averaged over the levels of: group 
Confidence level used: 0.95 

$contrasts
 contrast          estimate    SE df t.ratio p.value
 HA high - LA high   -3.663 16.90  6  -0.216  0.9960
 HA high - HA low    -3.830  1.23  6  -3.125  0.0742
 HA high - LA low    -2.223 16.70  6  -0.133  0.9991
 LA high - HA low    -0.167 16.60  6  -0.010  1.0000
 LA high - LA low     1.440  1.00  6   1.439  0.5226
 HA low - LA low      1.607 16.40  6   0.098  0.9996

Results are averaged over the levels of: group 
P value adjustment: tukey method for comparing a family of 4 estimates 

PAI_ave

3 middle minutes in each block to avoid block transitions

Code
PAI_ave_anova <- aov_ez('sbj',
                        'PAI_ave', ans_df,
                        within = c('arousal'), between = c('group', 'starting'))
PAI_ave_afex_plot <-
  afex_plot(
    PAI_ave_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(PAI_ave_afex_plot))
Figure 10: PAI_ave
Code
print(PAI_ave_anova)
Anova Table (Type 3 tests)

Response: PAI_ave
                  Effect   df    MSE    F   ges p.value
1                  group 1, 6 488.20 0.01  .001    .935
2               starting 1, 6 488.20 0.10  .016    .762
3         group:starting 1, 6 488.20 0.35  .053    .577
4                arousal 1, 6  18.84 0.20  .001    .669
5          group:arousal 1, 6  18.84 0.02 <.001    .898
6       starting:arousal 1, 6  18.84 0.07 <.001    .797
7 group:starting:arousal 1, 6  18.84 0.03 <.001    .879
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(PAI_ave_anova)

Frequency Domain HRV

HRV_LFn

Code
lfn_anova <- aov_ez('sbj',
                    'HRV_LFn', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
lfn_afex_plot <-
  afex_plot(
    lfn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(lfn_afex_plot))
Figure 11: HRV_LFn
Code
print(lfn_anova)
Anova Table (Type 3 tests)

Response: HRV_LFn
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.13 0.01  .002    .926
2               starting 1, 6 0.13 0.48  .072    .514
3         group:starting 1, 6 0.13 0.02  .003    .902
4                arousal 1, 6 0.00 0.01 <.001    .933
5          group:arousal 1, 6 0.00 0.34  .002    .579
6       starting:arousal 1, 6 0.00 0.78  .004    .411
7 group:starting:arousal 1, 6 0.00 0.04 <.001    .856
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(lfn_anova)

HRV_HFn

Code
hfn_anova <- aov_ez('sbj',
                    'HRV_HFn', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
hfn_afex_plot <-
  afex_plot(
    hfn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hfn_afex_plot))
Figure 12: HRV_HFn
Code
print(hfn_anova)
Anova Table (Type 3 tests)

Response: HRV_HFn
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.09   0.03  .005    .872
2               starting 1, 6 0.09   0.57  .085    .478
3         group:starting 1, 6 0.09   0.08  .013    .788
4                arousal 1, 6 0.00   0.02 <.001    .895
5          group:arousal 1, 6 0.00   0.26  .001    .629
6       starting:arousal 1, 6 0.00   3.49  .014    .111
7 group:starting:arousal 1, 6 0.00 4.17 +  .016    .087
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hfn_anova)

HRV_lnLF_lnHF

Code
hrv_df$HRV_lnLF_lnHF <- log(hrv_df$HRV_LFn) - log(hrv_df$HRV_HFn)
lfhf_anova <- aov_ez('sbj',
                     'HRV_lnLF_lnHF', hrv_df,
                     within = c('arousal'), between = c('group', 'starting'))
lfhf_afex_plot <-
  afex_plot(
    lfhf_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(lfhf_afex_plot))
Figure 13: HRV_lnLF_lnHF
Code
print(lfhf_anova)
Anova Table (Type 3 tests)

Response: HRV_lnLF_lnHF
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 3.51 0.00 <.001    .950
2               starting 1, 6 3.51 0.64  .095    .455
3         group:starting 1, 6 3.51 0.00 <.001    .962
4                arousal 1, 6 0.05 0.10 <.001    .757
5          group:arousal 1, 6 0.05 0.09 <.001    .769
6       starting:arousal 1, 6 0.05 3.14  .007    .127
7 group:starting:arousal 1, 6 0.05 2.74  .006    .149
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(lfhf_anova)

HR to HRV Ratio

Code
hrv_df$hr_to_hrv <- hrv_df$heart_rate / hrv_df$HRV_LFn
hr_to_hrv_anova <- aov_ez('sbj',
                          'hr_to_hrv', hrv_df,
                          within = c('arousal'), between = c('group', 'starting'))
hr_to_hrv_afex_plot <-
  afex_plot(
    hr_to_hrv_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hr_to_hrv_afex_plot))
Figure 14: hr_to_hrv
Code
print(hr_to_hrv_anova)
Anova Table (Type 3 tests)

Response: hr_to_hrv
                  Effect   df      MSE    F   ges p.value
1                  group 1, 6 25379.78 0.28  .043    .617
2               starting 1, 6 25379.78 0.60  .089    .467
3         group:starting 1, 6 25379.78 0.01  .002    .922
4                arousal 1, 6   728.41 0.68  .003    .440
5          group:arousal 1, 6   728.41 0.07 <.001    .804
6       starting:arousal 1, 6   728.41 0.01 <.001    .935
7 group:starting:arousal 1, 6   728.41 1.06  .005    .343
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hr_to_hrv_anova)

HR Periodic Components, greater peak

HR Frequency

Code
hr_frequency_anova <- aov_ez('sbj',
                             'frequency', hr_pow_peaks_df[hr_pow_peaks_df$peak_size == 1, ],
                             within = c('arousal'), between = c('group', 'starting'))
hr_frequency_afex_plot <-
  afex_plot(
    hr_frequency_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hr_frequency_afex_plot))
Figure 15: hr_frequency
Code
print(hr_frequency_anova)
Anova Table (Type 3 tests)

Response: frequency
                  Effect   df  MSE    F  ges p.value
1                  group 1, 6 0.01 3.54 .346    .109
2               starting 1, 6 0.01 0.28 .040    .614
3         group:starting 1, 6 0.01 1.35 .167    .290
4                arousal 1, 6 0.00 0.37 .006    .566
5          group:arousal 1, 6 0.00 1.03 .018    .349
6       starting:arousal 1, 6 0.00 0.49 .008    .508
7 group:starting:arousal 1, 6 0.00 0.43 .007    .536
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hr_frequency_anova)

HR Power

Code
hr_power_anova <- aov_ez('sbj',
                         'power', hr_pow_peaks_df[hr_pow_peaks_df$peak_size == 1, ],
                         within = c('arousal'), between = c('group', 'starting'))
hr_power_afex_plot <-
  afex_plot(
    hr_power_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hr_power_afex_plot))
Figure 16: hr_power
Code
print(hr_power_anova)
Anova Table (Type 3 tests)

Response: power
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.05 1.55  .155    .260
2               starting 1, 6 0.05 0.83  .090    .396
3         group:starting 1, 6 0.05 0.89  .095    .383
4                arousal 1, 6 0.02 0.05  .002    .829
5          group:arousal 1, 6 0.02 0.31  .015    .595
6       starting:arousal 1, 6 0.02 0.01 <.001    .932
7 group:starting:arousal 1, 6 0.02 0.89  .041    .381
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hr_power_anova)

HR Aperiodic Components

HR Exponent

Code
hr_exponent_anova <- aov_ez('sbj',
                            'exponent', hr_aperiodic_df,
                            within = c('arousal'), between = c('group', 'starting'))
hr_exponent_afex_plot <-
  afex_plot(
    hr_exponent_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hr_exponent_afex_plot))
Figure 17: hr_exponent
Code
print(hr_exponent_anova)
Anova Table (Type 3 tests)

Response: exponent
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 1.62 0.55  .079    .486
2               starting 1, 6 1.62 0.78  .108    .412
3         group:starting 1, 6 1.62 0.15  .023    .708
4                arousal 1, 6 0.11 0.02 <.001    .896
5          group:arousal 1, 6 0.11 0.00 <.001    .983
6       starting:arousal 1, 6 0.11 1.27  .013    .303
7 group:starting:arousal 1, 6 0.11 2.20  .022    .189
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hr_exponent_anova)

HR Knee

Code
if('knee' %in% colnames(hr_aperiodic_df)) {
  hr_knee_anova <- aov_ez('sbj',
                          'knee', hr_aperiodic_df,
                          within = c('arousal'), between = c('group', 'starting'))
  hr_knee_afex_plot <-
    afex_plot(
      hr_knee_anova,
      x     = 'arousal',
      trace = 'starting',
      error = 'within',
      error_arg = list(width = .15),
      dodge     = my_dodge,
      data_arg  = list(
        position = 
          position_jitterdodge(
            jitter.width  = .1, 
            dodge.width   = my_dodge
          )),
      mapping   = c('color'),
      point_arg = list(size = 4)
    )
  suppressWarnings(print(hr_knee_afex_plot))
} else {
  print('Fitted with fixed mode, no knee parameter included.')
}
Figure 18: hr_knee
Code
if('knee' %in% colnames(hr_aperiodic_df)) {
  print(hr_knee_anova)
  a_posteriori(hr_knee_anova)
} else {
  print('Fitted with fixed mode, no knee parameter included.')
}
Anova Table (Type 3 tests)

Response: knee
                  Effect   df  MSE       F  ges p.value
1                  group 1, 6 0.00    0.14 .022    .722
2               starting 1, 6 0.00    2.14 .260    .194
3         group:starting 1, 6 0.00    0.09 .014    .779
4                arousal 1, 6 0.00    2.12 .006    .196
5          group:arousal 1, 6 0.00 11.63 * .030    .014
6       starting:arousal 1, 6 0.00    2.94 .008    .137
7 group:starting:arousal 1, 6 0.00  6.87 * .018    .040
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
____________________________________________________________
$emmeans
 group   arousal   emmean       SE df  lower.CL upper.CL
 control high    0.000605 0.000257  6 -2.46e-05  0.00123
 study   high    0.000579 0.000343  6 -2.60e-04  0.00142
 control low     0.000501 0.000243  6 -9.42e-05  0.00110
 study   low     0.000836 0.000325  6  4.17e-05  0.00163

Results are averaged over the levels of: starting 
Confidence level used: 0.95 

$contrasts
 contrast                    estimate       SE df t.ratio p.value
 control high - study high   2.56e-05 4.29e-04  6   0.060  0.9999
 control high - control low  1.03e-04 6.34e-05  6   1.630  0.4304
 control high - study low   -2.31e-04 4.14e-04  6  -0.558  0.9409
 study high - control low    7.76e-05 4.21e-04  6   0.185  0.9975
 study high - study low     -2.57e-04 8.45e-05  6  -3.041  0.0819
 control low - study low    -3.34e-04 4.06e-04  6  -0.824  0.8414

Results are averaged over the levels of: starting 
P value adjustment: tukey method for comparing a family of 4 estimates 

____________________________________________________________
$emmeans
 group   starting arousal   emmean       SE df  lower.CL upper.CL
 control HA       high    0.000871 0.000297  6  1.44e-04  0.00160
 study   HA       high    0.000828 0.000594  6 -6.25e-04  0.00228
 control LA       high    0.000339 0.000420  6 -6.89e-04  0.00137
 study   LA       high    0.000330 0.000343  6 -5.09e-04  0.00117
 control HA       low     0.000719 0.000281  6  3.16e-05  0.00141
 study   HA       low     0.001314 0.000562  6 -6.18e-05  0.00269
 control LA       low     0.000283 0.000398  6 -6.89e-04  0.00126
 study   LA       low     0.000358 0.000325  6 -4.36e-04  0.00115

Confidence level used: 0.95 

$contrasts
 contrast                           estimate       SE df t.ratio p.value
 control HA high - study HA high    4.24e-05 6.64e-04  6   0.064  1.0000
 control HA high - control LA high  5.32e-04 5.14e-04  6   1.034  0.9510
 control HA high - study LA high    5.41e-04 4.54e-04  6   1.192  0.9086
 control HA high - control HA low   1.51e-04 7.32e-05  6   2.066  0.5137
 control HA high - study HA low    -4.43e-04 6.36e-04  6  -0.697  0.9937
 control HA high - control LA low   5.87e-04 4.96e-04  6   1.183  0.9113
 control HA high - study LA low     5.13e-04 4.40e-04  6   1.165  0.9168
 study HA high - control LA high    4.89e-04 7.27e-04  6   0.673  0.9949
 study HA high - study LA high      4.98e-04 6.86e-04  6   0.727  0.9921
 study HA high - control HA low     1.09e-04 6.57e-04  6   0.165  1.0000
 study HA high - study HA low      -4.86e-04 1.46e-04  6  -3.320  0.1426
 study HA high - control LA low     5.45e-04 7.15e-04  6   0.762  0.9896
 study HA high - study LA low       4.70e-04 6.77e-04  6   0.695  0.9938
 control LA high - study LA high    8.91e-06 5.42e-04  6   0.016  1.0000
 control LA high - control HA low  -3.81e-04 5.05e-04  6  -0.753  0.9903
 control LA high - study HA low    -9.75e-04 7.02e-04  6  -1.389  0.8355
 control LA high - control LA low   5.54e-05 1.03e-04  6   0.535  0.9987
 control LA high - study LA low    -1.91e-05 5.31e-04  6  -0.036  1.0000
 study LA high - control HA low    -3.90e-04 4.43e-04  6  -0.878  0.9779
 study LA high - study HA low      -9.84e-04 6.59e-04  6  -1.494  0.7896
 study LA high - control LA low     4.65e-05 5.25e-04  6   0.088  1.0000
 study LA high - study LA low      -2.80e-05 8.45e-05  6  -0.332  0.9999
 control HA low - study HA low     -5.94e-04 6.29e-04  6  -0.946  0.9680
 control HA low - control LA low    4.36e-04 4.87e-04  6   0.895  0.9756
 control HA low - study LA low      3.62e-04 4.29e-04  6   0.842  0.9823
 study HA low - control LA low      1.03e-03 6.89e-04  6   1.496  0.7886
 study HA low - study LA low        9.56e-04 6.49e-04  6   1.472  0.7994
 control LA low - study LA low     -7.45e-05 5.13e-04  6  -0.145  1.0000

P value adjustment: tukey method for comparing a family of 8 estimates 

HR Offset

Code
hr_offset_anova <- aov_ez('sbj',
                          'offset', hr_aperiodic_df,
                          within = c('arousal'), between = c('group', 'starting'))
hr_offset_afex_plot <-
  afex_plot(
    hr_offset_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(hr_offset_afex_plot))
Figure 19: ohr_ffset
Code
print(hr_offset_anova)
Anova Table (Type 3 tests)

Response: offset
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.47 0.88  .123    .385
2               starting 1, 6 0.47 0.82  .115    .400
3         group:starting 1, 6 0.47 0.00 <.001    .953
4                arousal 1, 6 0.02 0.13 <.001    .728
5          group:arousal 1, 6 0.02 0.19  .001    .682
6       starting:arousal 1, 6 0.02 0.06 <.001    .821
7 group:starting:arousal 1, 6 0.02 2.98  .021    .135
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(hr_offset_anova)

Poincaré Plot HRV

HRV_SD2

Code
sd2_anova <- aov_ez('sbj',
                    'HRV_SD2', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
sd2_afex_plot <-
  afex_plot(
    sd2_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sd2_afex_plot))
Figure 20: HRV_SD2
Code
print(sd2_anova)
Anova Table (Type 3 tests)

Response: HRV_SD2
                  Effect   df     MSE      F   ges p.value
1                  group 1, 6 1879.15   0.08  .014    .781
2               starting 1, 6 1879.15   0.39  .061    .553
3         group:starting 1, 6 1879.15   0.00 <.001    .990
4                arousal 1, 6   24.37   0.02 <.001    .893
5          group:arousal 1, 6   24.37   1.18  .003    .319
6       starting:arousal 1, 6   24.37   0.71  .002    .431
7 group:starting:arousal 1, 6   24.37 4.67 +  .010    .074
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sd2_anova)

HRV_SD1SD2

Code
sd1sd2_anova <- aov_ez('sbj',
                       'HRV_SD1SD2', hrv_df,
                       within = c('arousal'), between = c('group', 'starting'))
sd1sd2_afex_plot <-
  afex_plot(
    sd1sd2_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sd1sd2_afex_plot))
Figure 21: HRV_SD1SD2
Code
print(sd1sd2_anova)
Anova Table (Type 3 tests)

Response: HRV_SD1SD2
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.03   0.00 <.001    .987
2               starting 1, 6 0.03   0.40  .062    .548
3         group:starting 1, 6 0.03   0.03  .004    .874
4                arousal 1, 6 0.00   0.34  .002    .583
5          group:arousal 1, 6 0.00   0.30  .001    .604
6       starting:arousal 1, 6 0.00   3.05  .014    .131
7 group:starting:arousal 1, 6 0.00 6.39 *  .028    .045
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sd1sd2_anova)
____________________________________________________________
$emmeans
 group   starting arousal emmean     SE df lower.CL upper.CL
 control HA       high     0.427 0.0618  6    0.276    0.578
 study   HA       high     0.399 0.1240  6    0.096    0.701
 control LA       high     0.327 0.0875  6    0.113    0.541
 study   LA       high     0.342 0.0714  6    0.168    0.517
 control HA       low      0.351 0.0560  6    0.214    0.488
 study   HA       low      0.409 0.1120  6    0.135    0.683
 control LA       low      0.371 0.0792  6    0.177    0.565
 study   LA       low      0.331 0.0647  6    0.173    0.489

Confidence level used: 0.95 

$contrasts
 contrast                          estimate     SE df t.ratio p.value
 control HA high - study HA high    0.02818 0.1380  6   0.204  1.0000
 control HA high - control LA high  0.09988 0.1070  6   0.932  0.9701
 control HA high - study LA high    0.08440 0.0945  6   0.893  0.9759
 control HA high - control HA low   0.07623 0.0196  6   3.898  0.0776
 control HA high - study HA low     0.01759 0.1280  6   0.137  1.0000
 control HA high - control LA low   0.05548 0.1010  6   0.552  0.9984
 control HA high - study LA low     0.09589 0.0895  6   1.071  0.9423
 study HA high - control LA high    0.07171 0.1510  6   0.473  0.9994
 study HA high - study LA high      0.05623 0.1430  6   0.394  0.9998
 study HA high - control HA low     0.04805 0.1360  6   0.354  0.9999
 study HA high - study HA low      -0.01059 0.0391  6  -0.271  1.0000
 study HA high - control LA low     0.02731 0.1470  6   0.186  1.0000
 study HA high - study LA low       0.06772 0.1400  6   0.485  0.9993
 control LA high - study LA high   -0.01548 0.1130  6  -0.137  1.0000
 control LA high - control HA low  -0.02366 0.1040  6  -0.228  1.0000
 control LA high - study HA low    -0.08230 0.1420  6  -0.579  0.9979
 control LA high - control LA low  -0.04440 0.0277  6  -1.605  0.7373
 control LA high - study LA low    -0.00399 0.1090  6  -0.037  1.0000
 study LA high - control HA low    -0.00818 0.0908  6  -0.090  1.0000
 study LA high - study HA low      -0.06682 0.1330  6  -0.503  0.9991
 study LA high - control LA low    -0.02892 0.1070  6  -0.271  1.0000
 study LA high - study LA low       0.01149 0.0226  6   0.509  0.9991
 control HA low - study HA low     -0.05864 0.1250  6  -0.468  0.9994
 control HA low - control LA low   -0.02075 0.0970  6  -0.214  1.0000
 control HA low - study LA low      0.01966 0.0856  6   0.230  1.0000
 study HA low - control LA low      0.03789 0.1370  6   0.276  1.0000
 study HA low - study LA low        0.07830 0.1290  6   0.605  0.9973
 control LA low - study LA low      0.04041 0.1020  6   0.395  0.9998

P value adjustment: tukey method for comparing a family of 8 estimates 

Heart Rate Fragmentation (HRF)

Percentage of inflection points of the RR intervals series (PIP)

Code
pip_anova <- aov_ez('sbj',
                    'HRF_PIP', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
pip_afex_plot <-
  afex_plot(
    pip_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(pip_afex_plot))
Figure 22: HRF_PIP
Code
print(pip_anova)
Anova Table (Type 3 tests)

Response: HRF_PIP
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.02   1.61  .210    .252
2               starting 1, 6 0.02   0.11  .018    .753
3         group:starting 1, 6 0.02   0.97  .138    .363
4                arousal 1, 6 0.00   0.26 <.001    .631
5          group:arousal 1, 6 0.00   0.29 <.001    .612
6       starting:arousal 1, 6 0.00 4.99 +  .008    .067
7 group:starting:arousal 1, 6 0.00   1.08  .002    .339
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(pip_anova)

Inverse of the average length of the acceleration/deceleration segments (IALS)

Code
ials_anova <- aov_ez('sbj',
                     'HRF_IALS', hrv_df,
                     within = c('arousal'), between = c('group', 'starting'))
ials_afex_plot <-
  afex_plot(
    ials_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(ials_afex_plot))
Figure 23: HRF_IALS
Code
print(ials_anova)
Anova Table (Type 3 tests)

Response: HRF_IALS
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.02   1.61  .210    .252
2               starting 1, 6 0.02   0.10  .017    .760
3         group:starting 1, 6 0.02   0.91  .131    .377
4                arousal 1, 6 0.00   0.11 <.001    .753
5          group:arousal 1, 6 0.00   0.33 <.001    .588
6       starting:arousal 1, 6 0.00 4.57 +  .007    .076
7 group:starting:arousal 1, 6 0.00   0.85  .001    .392
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(ials_anova)

Percentage of short segments (PSS)

Code
pss_anova <- aov_ez('sbj',
                    'HRF_PSS', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
pss_afex_plot <-
  afex_plot(
    pss_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(pss_afex_plot))
Figure 24: HRF_PSS
Code
print(pss_anova)
Anova Table (Type 3 tests)

Response: HRF_PSS
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.09 1.10  .153    .335
2               starting 1, 6 0.09 0.05  .008    .836
3         group:starting 1, 6 0.09 0.67  .100    .443
4                arousal 1, 6 0.00 0.16 <.001    .707
5          group:arousal 1, 6 0.00 0.86  .002    .388
6       starting:arousal 1, 6 0.00 0.17 <.001    .697
7 group:starting:arousal 1, 6 0.00 1.42  .003    .278
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(pss_anova)

Percentage of NN intervals in alternation segments (PAS)

Code
pas_anova <- aov_ez('sbj',
                    'HRF_PAS', hrv_df,
                    within = c('arousal'), between = c('group', 'starting'))
pas_afex_plot <-
  afex_plot(
    pas_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(pas_afex_plot))
Figure 25: HRF_PAS
Code
print(pas_anova)
Anova Table (Type 3 tests)

Response: HRF_PAS
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.00 0.51  .075    .503
2               starting 1, 6 0.00 0.02  .004    .884
3         group:starting 1, 6 0.00 0.76  .109    .416
4                arousal 1, 6 0.00 0.25  .002    .632
5          group:arousal 1, 6 0.00 0.14 <.001    .723
6       starting:arousal 1, 6 0.00 0.10 <.001    .761
7 group:starting:arousal 1, 6 0.00 0.61  .004    .466
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(pas_anova)

Heart Rate Asymmetry (HRA)

Guzik’s Index (GI)

Code
gi_anova <- aov_ez('sbj',
                   'HRA_GI', hrv_df,
                   within = c('arousal'), between = c('group', 'starting'))
gi_afex_plot <-
  afex_plot(
    gi_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(gi_afex_plot))
Figure 26: HRA_GI
Code
print(gi_anova)
Anova Table (Type 3 tests)

Response: HRA_GI
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.02   0.17  .008    .692
2               starting 1, 6 0.02   1.50  .065    .267
3         group:starting 1, 6 0.02   3.12  .126    .128
4                arousal 1, 6 0.06   2.67  .243    .154
5          group:arousal 1, 6 0.06   0.08  .009    .792
6       starting:arousal 1, 6 0.06 4.45 +  .349    .079
7 group:starting:arousal 1, 6 0.06   0.00 <.001    .963
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(gi_anova)

Slope Index (SI)

Code
si_anova <- aov_ez('sbj',
                   'HRA_SI', hrv_df,
                   within = c('arousal'), between = c('group', 'starting'))
si_afex_plot <-
  afex_plot(
    si_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(si_afex_plot))
Figure 27: HRA_SI
Code
print(si_anova)
Anova Table (Type 3 tests)

Response: HRA_SI
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.03   0.11  .006    .749
2               starting 1, 6 0.03   1.42  .070    .279
3         group:starting 1, 6 0.03   2.61  .121    .157
4                arousal 1, 6 0.06   2.64  .231    .155
5          group:arousal 1, 6 0.06   0.14  .016    .722
6       starting:arousal 1, 6 0.06 4.62 +  .345    .075
7 group:starting:arousal 1, 6 0.06   0.01 <.001    .941
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(si_anova)

Area Index (AI)

Code
ai_anova <- aov_ez('sbj',
                   'HRA_AI', hrv_df,
                   within = c('arousal'), between = c('group', 'starting'))
ai_afex_plot <-
  afex_plot(
    ai_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(ai_afex_plot))
Figure 28: HRA_AI
Code
print(ai_anova)
Anova Table (Type 3 tests)

Response: HRA_AI
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.02   0.28  .011    .618
2               starting 1, 6 0.02   1.58  .058    .256
3         group:starting 1, 6 0.02 3.88 +  .133    .096
4                arousal 1, 6 0.06   2.70  .256    .151
5          group:arousal 1, 6 0.06   0.03  .004    .866
6       starting:arousal 1, 6 0.06 4.32 +  .355    .083
7 group:starting:arousal 1, 6 0.06   0.00 <.001    .987
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(ai_anova)

Porta’s Index (PI)

Code
pi_anova <- aov_ez('sbj',
                   'HRA_PI', hrv_df,
                   within = c('arousal'), between = c('group', 'starting'))
pi_afex_plot <-
  afex_plot(
    pi_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(pi_afex_plot))
Figure 29: HRA_PI
Code
print(pi_anova)
Anova Table (Type 3 tests)

Response: HRA_PI
                  Effect   df   MSE    F   ges p.value
1                  group 1, 6 69.50 0.01 <.001    .943
2               starting 1, 6 69.50 0.58  .086    .475
3         group:starting 1, 6 69.50 0.09  .014    .778
4                arousal 1, 6  1.63 2.09  .008    .198
5          group:arousal 1, 6  1.63 1.51  .006    .265
6       starting:arousal 1, 6  1.63 0.06 <.001    .809
7 group:starting:arousal 1, 6  1.63 2.12  .008    .195
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(pi_anova)

Total variance of contributions of decelerations (SDNNd)

Code
sdnnd_anova <- aov_ez('sbj',
                      'HRA_SDNNd', hrv_df,
                      within = c('arousal'), between = c('group', 'starting'))
sdnnd_afex_plot <-
  afex_plot(
    sdnnd_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sdnnd_afex_plot))
Figure 30: HRA_SDNNd
Code
print(sdnnd_anova)
Anova Table (Type 3 tests)

Response: HRA_SDNNd
                  Effect   df    MSE    F   ges p.value
1                  group 1, 6 561.41 0.06  .009    .817
2               starting 1, 6 561.41 0.29  .046    .607
3         group:starting 1, 6 561.41 0.00 <.001    .969
4                arousal 1, 6  12.55 0.30  .001    .606
5          group:arousal 1, 6  12.55 0.30  .001    .602
6       starting:arousal 1, 6  12.55 1.11  .004    .332
7 group:starting:arousal 1, 6  12.55 1.50  .005    .267
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sdnnd_anova)

Total variance of contributions of accelerations (SDNNa)

Code
sdnna_anova <- aov_ez('sbj',
                      'HRA_SDNNa', hrv_df,
                      within = c('arousal'), between = c('group', 'starting'))
sdnna_afex_plot <-
  afex_plot(
    sdnnd_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sdnna_afex_plot))
Figure 31: HRA_SDNNa
Code
print(sdnna_anova)
Anova Table (Type 3 tests)

Response: HRA_SDNNa
                  Effect   df    MSE    F   ges p.value
1                  group 1, 6 632.55 0.09  .015    .770
2               starting 1, 6 632.55 0.28  .044    .615
3         group:starting 1, 6 632.55 0.00 <.001    .983
4                arousal 1, 6   7.52 0.01 <.001    .919
5          group:arousal 1, 6   7.52 1.47  .003    .271
6       starting:arousal 1, 6   7.52 0.66  .001    .448
7 group:starting:arousal 1, 6   7.52 3.20  .006    .124
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sdnna_anova)

Indices of Complexity

HRV_SampEn

Code
sampen_anova <- aov_ez('sbj',
                       'HRV_SampEn', hrv_df,
                       within = c('arousal'), between = c('group', 'starting'))
sampen_afex_plot <-
  afex_plot(
    sampen_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(sampen_afex_plot))
Figure 32: HRV_SampEn
Code
print(sampen_anova)
Anova Table (Type 3 tests)

Response: HRV_SampEn
                  Effect   df  MSE    F  ges p.value
1                  group 1, 6 0.15 3.63 .360    .106
2               starting 1, 6 0.15 0.49 .071    .509
3         group:starting 1, 6 0.15 0.27 .041    .619
4                arousal 1, 6 0.01 0.95 .011    .367
5          group:arousal 1, 6 0.01 0.10 .001    .760
6       starting:arousal 1, 6 0.01 0.50 .006    .506
7 group:starting:arousal 1, 6 0.01 0.23 .003    .652
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(sampen_anova)

HRV_ShanEn

Code
shanen_anova <- aov_ez('sbj',
                       'HRV_ShanEn', hrv_df,
                       within = c('arousal'), between = c('group', 'starting'))
shanen_afex_plot <-
  afex_plot(
    shanen_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(shanen_afex_plot))
Figure 33: HRV_ShanEn
Code
print(shanen_anova)
Anova Table (Type 3 tests)

Response: HRV_ShanEn
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.35   0.00 <.001    .951
2               starting 1, 6 0.35   0.47  .071    .519
3         group:starting 1, 6 0.35   0.21  .033    .663
4                arousal 1, 6 0.01   0.06 <.001    .818
5          group:arousal 1, 6 0.01   3.36  .011    .116
6       starting:arousal 1, 6 0.01   1.43  .005    .277
7 group:starting:arousal 1, 6 0.01 6.65 *  .021    .042
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(shanen_anova)
____________________________________________________________
$emmeans
 group   starting arousal emmean    SE df lower.CL upper.CL
 control HA       high      6.91 0.226  6     6.36     7.47
 study   HA       high      7.22 0.451  6     6.12     8.33
 control LA       high      7.32 0.319  6     6.54     8.10
 study   LA       high      7.13 0.260  6     6.49     7.77
 control HA       low       7.04 0.198  6     6.56     7.53
 study   HA       low       6.97 0.396  6     6.00     7.94
 control LA       low       7.33 0.280  6     6.64     8.02
 study   LA       low       7.20 0.229  6     6.64     7.76

Confidence level used: 0.95 

$contrasts
 contrast                          estimate     SE df t.ratio p.value
 control HA high - study HA high    -0.3089 0.5040  6  -0.613  0.9970
 control HA high - control LA high  -0.4058 0.3910  6  -1.039  0.9498
 control HA high - study LA high    -0.2154 0.3440  6  -0.625  0.9967
 control HA high - control HA low   -0.1277 0.0595  6  -2.147  0.4769
 control HA high - study HA low     -0.0580 0.4560  6  -0.127  1.0000
 control HA high - control LA low   -0.4149 0.3600  6  -1.154  0.9202
 control HA high - study LA low     -0.2883 0.3210  6  -0.898  0.9753
 study HA high - control LA high    -0.0969 0.5520  6  -0.175  1.0000
 study HA high - study LA high       0.0935 0.5210  6   0.180  1.0000
 study HA high - control HA low      0.1813 0.4930  6   0.368  0.9999
 study HA high - study HA low        0.2510 0.1190  6   2.110  0.4933
 study HA high - control LA low     -0.1060 0.5310  6  -0.200  1.0000
 study HA high - study LA low        0.0206 0.5060  6   0.041  1.0000
 control LA high - study LA high     0.1904 0.4120  6   0.462  0.9995
 control LA high - control HA low    0.2782 0.3750  6   0.741  0.9911
 control LA high - study HA low      0.3479 0.5090  6   0.684  0.9944
 control LA high - control LA low   -0.0091 0.0841  6  -0.108  1.0000
 control LA high - study LA low      0.1175 0.3920  6   0.299  1.0000
 study LA high - control HA low      0.0877 0.3270  6   0.268  1.0000
 study LA high - study HA low        0.1575 0.4740  6   0.332  0.9999
 study LA high - control LA low     -0.1995 0.3820  6  -0.522  0.9989
 study LA high - study LA low       -0.0729 0.0687  6  -1.062  0.9446
 control HA low - study HA low       0.0697 0.4430  6   0.157  1.0000
 control HA low - control LA low    -0.2873 0.3430  6  -0.837  0.9828
 control HA low - study LA low      -0.1607 0.3030  6  -0.531  0.9988
 study HA low - control LA low      -0.3570 0.4850  6  -0.736  0.9915
 study HA low - study LA low        -0.2304 0.4570  6  -0.504  0.9991
 control LA low - study LA low       0.1266 0.3620  6   0.350  0.9999

P value adjustment: tukey method for comparing a family of 8 estimates 

Respiratory Rate Variability (RRV)

Respiratory Rate

Code
hrv_df$rsp_rate <- 60000 / hrv_df$RRV_MeanBB
rsp_rate_anova <- aov_ez('sbj',
                         'rsp_rate', hrv_df,
                         within = c('arousal'), between = c('group', 'starting'))
rsp_rate_afex_plot <-
  afex_plot(
    rsp_rate_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsp_rate_afex_plot))
Figure 34: rsp_rate
Code
print(rsp_rate_anova)
Anova Table (Type 3 tests)

Response: rsp_rate
                  Effect   df   MSE      F   ges p.value
1                  group 1, 6 18.83 4.16 +  .402    .087
2               starting 1, 6 18.83   0.17  .026    .697
3         group:starting 1, 6 18.83   2.46  .284    .168
4                arousal 1, 6  0.60   0.00 <.001    .995
5          group:arousal 1, 6  0.60   0.56  .003    .483
6       starting:arousal 1, 6  0.60   0.13 <.001    .728
7 group:starting:arousal 1, 6  0.60   0.11 <.001    .751
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsp_rate_anova)

log10_RRV_RMSSD

Code
rrmssd_anova <- aov_ez('sbj',
                       'log10_RRV_RMSSD', hrv_df,
                       within = c('arousal'), between = c('group', 'starting'))
rrmssd_afex_plot <-
  afex_plot(
    rrmssd_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rrmssd_afex_plot))
Figure 35: log10_RRV_RMSSD
Code
print(rrmssd_anova)
Anova Table (Type 3 tests)

Response: log10_RRV_RMSSD
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.08 0.85  .115    .391
2               starting 1, 6 0.08 1.54  .190    .262
3         group:starting 1, 6 0.08 1.25  .161    .306
4                arousal 1, 6 0.01 0.00 <.001    .950
5          group:arousal 1, 6 0.01 0.08  .001    .792
6       starting:arousal 1, 6 0.01 0.81  .011    .403
7 group:starting:arousal 1, 6 0.01 0.68  .009    .443
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rrmssd_anova)

RRV_SD2

Code
rrv_sd2_anova <- aov_ez('sbj',
                        'RRV_SD2', hrv_df,
                        within = c('arousal'), between = c('group', 'starting'))
rrv_sd2_afex_plot <-
  afex_plot(
    rrv_sd2_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rrv_sd2_afex_plot))
Figure 36: RRV_SD2
Code
print(rrv_sd2_anova)
Anova Table (Type 3 tests)

Response: RRV_SD2
                  Effect   df       MSE    F   ges p.value
1                  group 1, 6 872621.74 0.52  .073    .499
2               starting 1, 6 872621.74 0.03  .004    .872
3         group:starting 1, 6 872621.74 0.11  .017    .750
4                arousal 1, 6  81190.91 0.16  .002    .702
5          group:arousal 1, 6  81190.91 0.01 <.001    .925
6       starting:arousal 1, 6  81190.91 1.40  .019    .282
7 group:starting:arousal 1, 6  81190.91 0.97  .014    .363
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rrv_sd2_anova)

RRV_SD2SD1

Code
RRV_SD2SD1_anova <- aov_ez('sbj',
                        'RRV_SD2SD1', hrv_df,
                        within = c('arousal'), between = c('group', 'starting'))
RRV_SD2SD1_afex_plot <-
  afex_plot(
    RRV_SD2SD1_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(RRV_SD2SD1_afex_plot))
Figure 37: RRV_SD2SD1
Code
print(RRV_SD2SD1_anova)
Anova Table (Type 3 tests)

Response: RRV_SD2SD1
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.07   0.21  .022    .660
2               starting 1, 6 0.07 4.79 +  .333    .071
3         group:starting 1, 6 0.07   1.54  .138    .261
4                arousal 1, 6 0.04   0.09  .006    .774
5          group:arousal 1, 6 0.04   0.01 <.001    .928
6       starting:arousal 1, 6 0.04   0.00 <.001    .967
7 group:starting:arousal 1, 6 0.04   0.05  .003    .836
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(RRV_SD2SD1_anova)

RRV_ApEn

Code
RRV_ApEn_anova <- aov_ez('sbj',
                        'RRV_ApEn', hrv_df,
                        within = c('arousal'), between = c('group', 'starting'))
RRV_ApEn_afex_plot <-
  afex_plot(
    RRV_ApEn_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(RRV_ApEn_afex_plot))
Figure 38: RRV_ApEn
Code
print(RRV_ApEn_anova)
Anova Table (Type 3 tests)

Response: RRV_ApEn
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 0.05 4.31 +  .408    .083
2               starting 1, 6 0.05   1.62  .206    .250
3         group:starting 1, 6 0.05   0.58  .084    .476
4                arousal 1, 6 0.00   0.10 <.001    .760
5          group:arousal 1, 6 0.00   0.01 <.001    .934
6       starting:arousal 1, 6 0.00   1.01  .007    .353
7 group:starting:arousal 1, 6 0.00   0.00 <.001    .961
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(RRV_ApEn_anova)

RSP Periodic Components, greater peak

RSP Frequency

Code
rsp_frequency_anova <- aov_ez('sbj',
                              'frequency', rsp_pow_peaks_df[rsp_pow_peaks_df$peak_size == 1, ],
                              within = c('arousal'), between = c('group', 'starting'))
rsp_frequency_afex_plot <-
  afex_plot(
    rsp_frequency_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsp_frequency_afex_plot))
Figure 39: rsp_frequency
Code
print(rsp_frequency_anova)
Anova Table (Type 3 tests)

Response: frequency
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.01 2.11  .258    .197
2               starting 1, 6 0.01 0.51  .077    .503
3         group:starting 1, 6 0.01 0.67  .100    .444
4                arousal 1, 6 0.00 0.06 <.001    .816
5          group:arousal 1, 6 0.00 0.53 <.001    .495
6       starting:arousal 1, 6 0.00 1.10  .002    .335
7 group:starting:arousal 1, 6 0.00 2.55  .004    .161
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsp_frequency_anova)

RSP Power

Code
rsp_power_anova <- aov_ez('sbj',
                          'power', rsp_pow_peaks_df[rsp_pow_peaks_df$peak_size == 1, ],
                          within = c('arousal'), between = c('group', 'starting'))
rsp_power_afex_plot <-
  afex_plot(
    rsp_power_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsp_power_afex_plot))
Figure 40: rsp_power
Code
print(rsp_power_anova)
Anova Table (Type 3 tests)

Response: power
                  Effect   df  MSE      F  ges p.value
1                  group 1, 6 0.11 4.03 + .337    .091
2               starting 1, 6 0.11   0.34 .042    .579
3         group:starting 1, 6 0.11   0.02 .002    .905
4                arousal 1, 6 0.04   0.42 .017    .540
5          group:arousal 1, 6 0.04   2.12 .080    .195
6       starting:arousal 1, 6 0.04   0.08 .003    .788
7 group:starting:arousal 1, 6 0.04 4.58 + .157    .076
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsp_power_anova)

RSP Aperiodic Components

RSP Exponent

Code
rsp_exponent_anova <- aov_ez('sbj',
                             'exponent', rsp_aperiodic_df,
                             within = c('arousal'), between = c('group', 'starting'))
rsp_exponent_afex_plot <-
  afex_plot(
    rsp_exponent_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsp_exponent_afex_plot))
Figure 41: rsp_exponent
Code
print(rsp_exponent_anova)
Anova Table (Type 3 tests)

Response: exponent
                  Effect   df  MSE      F   ges p.value
1                  group 1, 6 6.40   1.68  .126    .242
2               starting 1, 6 6.40   0.10  .009    .762
3         group:starting 1, 6 6.40 4.75 +  .288    .072
4                arousal 1, 6 6.09   1.72  .123    .237
5          group:arousal 1, 6 6.09   0.00 <.001    .997
6       starting:arousal 1, 6 6.09   0.00 <.001    .954
7 group:starting:arousal 1, 6 6.09   1.80  .127    .228
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsp_exponent_anova)

RSP Knee

Code
if('knee' %in% colnames(rsp_aperiodic_df)) {
  rsp_knee_anova <- aov_ez('sbj',
                           'knee', rsp_aperiodic_df,
                           within = c('arousal'), between = c('group', 'starting'))
  rsp_knee_afex_plot <-
    afex_plot(
      rsp_knee_anova,
      x     = 'arousal',
      trace = 'starting',
      error = 'within',
      error_arg = list(width = .15),
      dodge     = my_dodge,
      data_arg  = list(
        position = 
          position_jitterdodge(
            jitter.width  = .1, 
            dodge.width   = my_dodge
          )),
      mapping   = c('color'),
      point_arg = list(size = 4)
    )
  suppressWarnings(print(rsp_knee_afex_plot))
} else {
  print('Fitted with fixed mode, no knee parameter included.')
}
Figure 42: rsp_knee
Code
if('knee' %in% colnames(rsp_aperiodic_df)) {
  print(rsp_knee_anova)
  a_posteriori(rsp_knee_anova)
} else {
  print('Fitted with fixed mode, no knee parameter included.')
}
Anova Table (Type 3 tests)

Response: knee
                  Effect   df     MSE      F  ges p.value
1                  group 1, 6 4979.29   1.29 .131    .299
2               starting 1, 6 4979.29   0.17 .020    .690
3         group:starting 1, 6 4979.29   0.10 .012    .762
4                arousal 1, 6 2124.13 6.99 * .258    .038
5          group:arousal 1, 6 2124.13   2.05 .093    .202
6       starting:arousal 1, 6 2124.13   0.11 .005    .752
7 group:starting:arousal 1, 6 2124.13   1.04 .049    .348
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
____________________________________________________________
$emmeans
 arousal emmean    SE df lower.CL upper.CL
 high      6.27  7.53  6   -12.16     24.7
 low      68.44 29.50  6    -3.65    140.5

Results are averaged over the levels of: group, starting 
Confidence level used: 0.95 

$contrasts
 contrast   estimate   SE df t.ratio p.value
 high - low    -62.2 23.5  6  -2.644  0.0384

Results are averaged over the levels of: group, starting 

RSP Offset

Code
rsp_offset_anova <- aov_ez('sbj',
                           'offset', rsp_aperiodic_df,
                           within = c('arousal'), between = c('group', 'starting'))
rsp_offset_afex_plot <-
  afex_plot(
    rsp_offset_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsp_offset_afex_plot))
Figure 43: orsp_ffset
Code
print(rsp_offset_anova)
Anova Table (Type 3 tests)

Response: offset
                  Effect   df  MSE      F  ges p.value
1                  group 1, 6 2.63   1.00 .091    .355
2               starting 1, 6 2.63   0.07 .007    .797
3         group:starting 1, 6 2.63 6.59 * .396    .042
4                arousal 1, 6 1.78   2.16 .127    .192
5          group:arousal 1, 6 1.78   0.15 .010    .707
6       starting:arousal 1, 6 1.78   0.02 .001    .887
7 group:starting:arousal 1, 6 1.78   1.20 .075    .315
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsp_offset_anova)
____________________________________________________________
$emmeans
 group   starting emmean    SE df lower.CL upper.CL
 control HA       -1.333 0.573  6    -2.74   0.0697
 study   HA       -2.629 1.150  6    -5.44   0.1764
 control LA       -3.236 0.811  6    -5.22  -1.2517
 study   LA       -0.283 0.662  6    -1.90   1.3370

Results are averaged over the levels of: arousal 
Confidence level used: 0.95 

$contrasts
 contrast                estimate    SE df t.ratio p.value
 control HA - study HA      1.296 1.280  6   1.011  0.7497
 control HA - control LA    1.902 0.993  6   1.916  0.3140
 control HA - study LA     -1.050 0.876  6  -1.199  0.6491
 study HA - control LA      0.606 1.400  6   0.432  0.9708
 study HA - study LA       -2.346 1.320  6  -1.772  0.3690
 control LA - study LA     -2.953 1.050  6  -2.821  0.1067

Results are averaged over the levels of: arousal 
P value adjustment: tukey method for comparing a family of 4 estimates 

Respiratory Sinus Arrhythmia (RSA)

RSA_P2T_Mean

Code
rsa_p2t_anova <- aov_ez('sbj',
                        'RSA_P2T_Mean_log', hrv_df,
                        within = c('arousal'), between = c('group', 'starting'))
rsa_p2t_afex_plot <-
  afex_plot(
    rsa_p2t_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsa_p2t_afex_plot))
Figure 44: RSA_P2T_Mean
Code
print(rsa_p2t_anova)
Anova Table (Type 3 tests)

Response: RSA_P2T_Mean_log
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.78 1.04  .145    .347
2               starting 1, 6 0.78 0.02  .004    .881
3         group:starting 1, 6 0.78 1.35  .181    .290
4                arousal 1, 6 0.01 0.00 <.001    .987
5          group:arousal 1, 6 0.01 0.48  .001    .515
6       starting:arousal 1, 6 0.01 1.70  .005    .240
7 group:starting:arousal 1, 6 0.01 0.15 <.001    .711
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsa_p2t_anova)

RSA_PorgesBohrer

Code
rsa_pogboh_anova <- aov_ez('sbj',
                           'RSA_PorgesBohrer', hrv_df,
                           within = c('arousal'), between = c('group', 'starting'))
rsa_pogboh_afex_plot <-
  afex_plot(
    rsa_pogboh_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsa_pogboh_afex_plot))
Figure 45: RSA_PorgesBohrer
Code
print(rsa_pogboh_anova)
Anova Table (Type 3 tests)

Response: RSA_PorgesBohrer
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 1.75 0.11  .018    .748
2               starting 1, 6 1.75 0.12  .019    .744
3         group:starting 1, 6 1.75 1.01  .140    .353
4                arousal 1, 6 0.06 0.14 <.001    .720
5          group:arousal 1, 6 0.06 0.02 <.001    .900
6       starting:arousal 1, 6 0.06 0.84  .004    .394
7 group:starting:arousal 1, 6 0.06 0.00 <.001    .991
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsa_pogboh_anova)

RSA_Gates_Mean

Code
rsa_gates_anova <- aov_ez('sbj',
                          'RSA_Gates_Mean_log', hrv_df,
                          within = c('arousal'), between = c('group', 'starting'))
rsa_gates_afex_plot <-
  afex_plot(
    rsa_gates_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(rsa_gates_afex_plot))
Figure 46: RSA_Gates_Mean
Code
print(rsa_gates_anova)
Anova Table (Type 3 tests)

Response: RSA_Gates_Mean_log
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.01 0.05  .009    .823
2               starting 1, 6 0.01 0.09  .014    .777
3         group:starting 1, 6 0.01 0.00 <.001    .982
4                arousal 1, 6 0.00 0.89  .002    .382
5          group:arousal 1, 6 0.00 0.64  .001    .455
6       starting:arousal 1, 6 0.00 3.51  .007    .110
7 group:starting:arousal 1, 6 0.00 0.16 <.001    .705
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(rsa_gates_anova)

RSP-HR Continuous Coherence, average

ccoh_ave_lfhf

Frequency range .04 - .4 Hz

3 middle minutes in each block to avoid block transitions

Code
ccoh_ave_lfhf_anova <- aov_ez('sbj',
                         'ccoh_ave_lfhf', ccoh_df,
                         within = c('arousal'), between = c('group', 'starting'))
ccoh_ave_lfhf_afex_plot <-
  afex_plot(
    ccoh_ave_lfhf_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(ccoh_ave_lfhf_afex_plot))
Figure 47: ccoh_ave_lfhf
Code
print(ccoh_ave_lfhf_anova)
Anova Table (Type 3 tests)

Response: ccoh_ave_lfhf
                  Effect   df  MSE    F   ges p.value
1                  group 1, 6 0.01 0.20  .026    .674
2               starting 1, 6 0.01 0.28  .037    .614
3         group:starting 1, 6 0.01 0.64  .080    .456
4                arousal 1, 6 0.00 0.02 <.001    .888
5          group:arousal 1, 6 0.00 0.93  .028    .372
6       starting:arousal 1, 6 0.00 2.79  .079    .146
7 group:starting:arousal 1, 6 0.00 0.04  .001    .855
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(ccoh_ave_lfhf_anova)

ccoh_ave_rsp

Frequency band of .15 Hz around subject modal respiratory frequency

3 middle minutes in each block to avoid block transitions

Code
ccoh_ave_rsp_anova <- aov_ez('sbj',
                         'ccoh_ave_rsp', ccoh_df,
                         within = c('arousal'), between = c('group', 'starting'))
ccoh_ave_rsp_afex_plot <-
  afex_plot(
    ccoh_ave_rsp_anova,
    x     = 'starting',
    trace = 'arousal',
    panel = 'group',
    error = 'within',
    error_arg = list(width = .15),
    dodge     = my_dodge,
    data_arg  = list(
      position = 
        position_jitterdodge(
          jitter.width  = .1, 
          dodge.width   = my_dodge
        )),
    mapping   = c('color'),
    point_arg = list(size = 4)
  )
suppressWarnings(print(ccoh_ave_rsp_afex_plot))
Figure 48: ccoh_ave_rsp
Code
print(ccoh_ave_rsp_anova)
Anova Table (Type 3 tests)

Response: ccoh_ave_rsp
                  Effect   df  MSE      F  ges p.value
1                  group 1, 6 0.01   0.48 .063    .516
2               starting 1, 6 0.01   0.31 .042    .597
3         group:starting 1, 6 0.01   0.35 .046    .578
4                arousal 1, 6 0.00   0.78 .020    .411
5          group:arousal 1, 6 0.00   3.67 .090    .104
6       starting:arousal 1, 6 0.00 3.83 + .093    .098
7 group:starting:arousal 1, 6 0.00   0.92 .024    .375
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '+' 0.1 ' ' 1
Code
a_posteriori(ccoh_ave_rsp_anova)