1 Initialization

Need to install the relativeVariability package from source install.packages("relativeVariability_1.0.tar.gz", repos=NULL, type="source")

rm(list=ls())
library(relativeVariability)
library(rsurveyutils)
library(here)
library(tidyverse)
library(ggthemr)
# theme_set(theme_bw())
ggthemr("fresh")

library(lmerTest)
library(sjPlot)

library(aTSA)
library(tidylog)

2 Preprocessing

2.1 Read data

filepath <- here("data/proc/wave2/ESM_W2_WITH_MISSING_V1_no exclusions.csv")
df_raw <- read_csv(filepath) %>% 
  janitor::clean_names() 
## Warning: One or more parsing issues, call `problems()` on your data frame for details,
## e.g.:
##   dat <- vroom(...)
##   problems(dat)
names(df_raw)
##   [1] "x1"                                                     
##   [2] "connection_id"                                          
##   [3] "invitation_code"                                        
##   [4] "alias"                                                  
##   [5] "scheduled_beep_id"                                      
##   [6] "sent_beep_id"                                           
##   [7] "reminder_for_original_sent_beep_id"                     
##   [8] "question_list_name"                                     
##   [9] "time_stamp_scheduled"                                   
##  [10] "time_stamp_sent"                                        
##  [11] "time_stamp_start"                                       
##  [12] "time_stamp_stop"                                        
##  [13] "original_time_stamp_sent"                               
##  [14] "check_right_2"                                          
##  [15] "random_number_computation"                              
##  [16] "n_computation"                                          
##  [17] "panas_happy"                                            
##  [18] "randomizercode_1_computation"                           
##  [19] "panas_relaxed"                                          
##  [20] "randomizercode_2_computation"                           
##  [21] "panas_energetic"                                        
##  [22] "randomizercode_3_computation"                           
##  [23] "panas_sad"                                              
##  [24] "randomizercode_4_computation"                           
##  [25] "panas_angry"                                            
##  [26] "randomizercode_5_computation"                           
##  [27] "panas_anxious"                                          
##  [28] "randomizercode_6_computation"                           
##  [29] "panas_uncertain"                                        
##  [30] "randomizercode_7_computation"                           
##  [31] "panas_annoyed"                                          
##  [32] "randomizercode_8_computation"                           
##  [33] "panas_stressed"                                         
##  [34] "randomizercode_9_computation"                           
##  [35] "intense_emotion_multiple_choice_index"                  
##  [36] "intense_emotion_multiple_choice_string"                 
##  [37] "intense_emotion_multiple_choice_likert"                 
##  [38] "intense_emotion_intensity_slider_neutral_pos"           
##  [39] "randomizercode_10_computation"                          
##  [40] "emotionregulation_reappraisal"                          
##  [41] "randomizercode_11_computation"                          
##  [42] "emotionregulation_distraction"                          
##  [43] "randomizercode_12_computation"                          
##  [44] "emotionregulation_socialsupport"                        
##  [45] "randomizercode_13_computation"                          
##  [46] "emotionregulation_suppresion"                           
##  [47] "randomizercode_14_computation"                          
##  [48] "emotionregulation_rumination"                           
##  [49] "randomizercode_15_computation"                          
##  [50] "emotionregulation_selfcompassion1"                      
##  [51] "randomizercode_16_computation"                          
##  [52] "emotionregulation_selfcompassion2"                      
##  [53] "randomizercode_17_computation"                          
##  [54] "emotionregulation_engagement"                           
##  [55] "randomizercode_18_computation"                          
##  [56] "event_stressevaluation_choice"                          
##  [57] "event_stressevaluation"                                 
##  [58] "stressevaluation_event_multiple_choice_likert"          
##  [59] "randomizercode_19_computation"                          
##  [60] "event_stressevaluation_stress"                          
##  [61] "randomizercode_20_computation"                          
##  [62] "check_right_1"                                          
##  [63] "event_stressevaluation_control"                         
##  [64] "randomizercode_21_computation"                          
##  [65] "check_left_1"                                           
##  [66] "friend_interaction_yesno"                               
##  [67] "friend_positive_listened"                               
##  [68] "friend_positive_attention"                              
##  [69] "friend_negative_irritated"                              
##  [70] "friend_negative_argued"                                 
##  [71] "peer_exclusion_slider_neg_pos"                          
##  [72] "peer_acceptance_slider_neg_pos"                         
##  [73] "randomizercode_22_computation"                          
##  [74] "sleep_time_time"                                        
##  [75] "sleep_quality_slider_neg_pos"                           
##  [76] "check_right_4"                                          
##  [77] "sleep_awakening_time"                                   
##  [78] "intense_emotion_rating"                                 
##  [79] "randomizercode_23_computation"                          
##  [80] "panas_happy_1_slider_neg_pos"                           
##  [81] "friend_seen_last"                                       
##  [82] "friend_seen_last_time_multiple_choice_string"           
##  [83] "friend_seen_last_time_multiple_choice_likert"           
##  [84] "time_seen_friend_time"                                  
##  [85] "check_right_3"                                          
##  [86] "random_number_computation_1"                            
##  [87] "n_computation_1"                                        
##  [88] "check_left_3"                                           
##  [89] "label_r_oe_z_basic"                                     
##  [90] "check_right_5"                                          
##  [91] "check_left_5"                                           
##  [92] "emotionregulation_socialsupport_slider_neutral_pos_1"   
##  [93] "panas_sad_slider_neg_pos_1"                             
##  [94] "check_left_4"                                           
##  [95] "friend_interaction_yesno_1"                             
##  [96] "panas_sad_slider_neg_pos_2"                             
##  [97] "check_left_2"                                           
##  [98] "panas_happy_slider_neg_pos_1"                           
##  [99] "panas_happy_slider_neg_pos_2"                           
## [100] "panas_anxious_slider_neg_pos_1"                         
## [101] "panas_angry_slider_neg_pos_1"                           
## [102] "time_seen_friend_time_1"                                
## [103] "emotionregulation_selfcompassion_1_slider_neutral_pos_1"
## [104] "peer_acceptance_slider_neg_pos_1"                       
## [105] "emotionregulation_reappraisal_slider_neutral_pos_1"     
## [106] "panas_annoyed_slider_neg_pos_1"                         
## [107] "emotionregulation_distraction_slider_neutral_pos_1"     
## [108] "friend_interaction_yesno_2"                             
## [109] "panas_relaxed_slider_neg_pos_1"                         
## [110] "panas_relaxed_slider_neg_pos_2"                         
## [111] "panas_uncertain_slider_neg_pos_1"                       
## [112] "panas_uncertain_slider_neg_pos_2"                       
## [113] "emotionregulation_selfcompassion_2_slider_neutral_pos_1"
## [114] "friend_negative2_slider_neg_pos_1"                      
## [115] "panas_energetic_slider_neg_pos_1"                       
## [116] "emotionregulation_rumination_slider_neutral_pos_1"      
## [117] "friend_negative2_slider_neg_pos_2"                      
## [118] "intensity_neg_emotions_slider_neg_pos_1"                
## [119] "intensity_neg_emotions_slider_neg_pos_2"                
## [120] "intensity_neg_emotions_slider_neg_pos_3"                
## [121] "friend_seen_last_time_multiple_choice_index_1"          
## [122] "friend_seen_last_time_multiple_choice_string_1"         
## [123] "friend_seen_last_time_multiple_choice_likert_1"         
## [124] "emotionregulation_rumination_slider_neutral_pos_2"      
## [125] "emotionregulation_suppresion_slider_neutral_pos_1"      
## [126] "emotionregulation_distraction_slider_neutral_pos_2"     
## [127] "emotionregulation_distraction_slider_neutral_pos_3"     
## [128] "emotionregulation_distraction_slider_neutral_pos_4"     
## [129] "emotionregulation_distraction_slider_neutral_pos_5"     
## [130] "panas_stressed_slider_neg_pos_1"                        
## [131] "wave_text"                                              
## [132] "wave"                                                   
## [133] "temporal"                                               
## [134] "time_stamp_scheduled_transformed"                       
## [135] "time_stamp_sent_transformed"                            
## [136] "time_stamp_start_transformed"                           
## [137] "time_stamp_stop_transformed"                            
## [138] "temp"                                                   
## [139] "received_beeps"                                         
## [140] "completed_beeps"                                        
## [141] "check_right"                                            
## [142] "check_left"                                             
## [143] "check_correct"                                          
## [144] "n_correct"                                              
## [145] "n_incorrect"                                            
## [146] "start_stop_difference_seconds"                          
## [147] "start_stop_difference_seconds_average"                  
## [148] "completed_enough"                                       
## [149] "day"                                                    
## [150] "weekend"                                                
## [151] "day_sequence"                                           
## [152] "day_sequence_completed"                                 
## [153] "time_stamp_diff_sent_start"                             
## [154] "time_stamp_survey_duration"                             
## [155] "marker"                                                 
## [156] "relative_compliance"                                    
## [157] "beeps"                                                  
## [158] "beeps_sequence_completed"                               
## [159] "beeps_sequence"                                         
## [160] "panas_positivescale_beep"                               
## [161] "panas_negativescale_beep"                               
## [162] "myna_pa"                                                
## [163] "myna_na"                                                
## [164] "panas_positivescale_day"                                
## [165] "panas_negativescale_day"                                
## [166] "emotionregulation_selfcompassion"                       
## [167] "was_er_used"                                            
## [168] "betw_strat_mean"                                        
## [169] "betw_strat_sd"                                          
## [170] "betw_strat_sd_index"                                    
## [171] "betw_strat_rel_sd"                                      
## [172] "friend_positive_interaction"                            
## [173] "friend_negative_interaction"                            
## [174] "id"                                                     
## [175] "sex"                                                    
## [176] "birth_year"                                             
## [177] "birth_month"                                            
## [178] "ethnicity"                                              
## [179] "education_mother"                                       
## [180] "education_father"                                       
## [181] "birth"                                                  
## [182] "wave_2"                                                 
## [183] "olw_v_gl_w2"                                            
## [184] "olw_v_form_1_w2"                                        
## [185] "olw_v_form_2_w2"                                        
## [186] "olw_v_form_3_w2"                                        
## [187] "olw_v_form_4_w2"                                        
## [188] "olw_v_form_5_w2"                                        
## [189] "olw_v_form_6_w2"                                        
## [190] "olw_v_form_7_w2"                                        
## [191] "olw_v_form_8_w2"                                        
## [192] "olw_v_form_9_w2"                                        
## [193] "olw_v_form_10_w2"                                       
## [194] "olw_v_form_10_text_w2"                                  
## [195] "olw_b_gl_w2"                                            
## [196] "nri_supp_1_w2"                                          
## [197] "nri_supp_2_w2"                                          
## [198] "nri_supp_3_w2"                                          
## [199] "nri_crit_1_w2"                                          
## [200] "nri_crit_2_w2"                                          
## [201] "nri_crit_3_w2"                                          
## [202] "nri_conf_1_w2"                                          
## [203] "nri_inti_1_w2"                                          
## [204] "nri_conf_2_w2"                                          
## [205] "nri_inti_2_w2"                                          
## [206] "nri_conf_3_w2"                                          
## [207] "nri_inti_3_w2"                                          
## [208] "ccsq_peer_1_w2"                                         
## [209] "ccsq_peer_2_w2"                                         
## [210] "ccsq_peer_3_w2"                                         
## [211] "ccsq_peer_4_w2"                                         
## [212] "ccsq_peer_5_w2"                                         
## [213] "ccsq_peer_6_w2"                                         
## [214] "ccsq_peer_7_w2"                                         
## [215] "ccsq_peer_8_w2"                                         
## [216] "scared_1_w2"                                            
## [217] "scared_2_w2"                                            
## [218] "scared_3_w2"                                            
## [219] "scared_4_w2"                                            
## [220] "scared_5_w2"                                            
## [221] "scared_6_w2"                                            
## [222] "scared_7_w2"                                            
## [223] "scared_8_w2"                                            
## [224] "scared_9_w2"                                            
## [225] "scared_10_w2"                                           
## [226] "scared_11_w2"                                           
## [227] "scared_12_w2"                                           
## [228] "scared_13_w2"                                           
## [229] "smfq_1_w2"                                              
## [230] "smfq_2_w2"                                              
## [231] "smfq_3_w2"                                              
## [232] "smfq_4_w2"                                              
## [233] "smfq_5_w2"                                              
## [234] "smfq_6_w2"                                              
## [235] "smfq_7_w2"                                              
## [236] "smfq_8_w2"                                              
## [237] "smfq_9_w2"                                              
## [238] "smfq_10_w2"                                             
## [239] "smfq_11_w2"                                             
## [240] "smfq_12_w2"                                             
## [241] "smfq_13_w2"                                             
## [242] "rsq_12_w2"                                              
## [243] "rsq_13_w2"                                              
## [244] "rsq_16_w2"                                              
## [245] "scared_scale_w2"                                        
## [246] "smfq_scale_w2"                                          
## [247] "smfq_scale_omit_w2"                                     
## [248] "ccsq_scale_w2"                                          
## [249] "nri_conf_scale_w2"                                      
## [250] "nri_supp_scale_w2"                                      
## [251] "nri_crit_scale_w2"                                      
## [252] "nri_inti_scale_w2"                                      
## [253] "rsq_scale_w2"                                           
## [254] "experiment_start_date"                                  
## [255] "week"                                                   
## [256] "day_sequence_study"                                     
## [257] "beep_sequence_study"                                    
## [258] "myrow"                                                  
## [259] "panas_negativescale_beep_new"                           
## [260] "myna_na_new"                                            
## [261] "panas_negativescale_day_new"                            
## [262] "panas_negativescale_week_new"                           
## [263] "panas_negativescale_general_new"

2.2 Process data

df_emos <- df_raw %>% 
  select(id, time_stamp_sent, matches("panas.*scale.*beep"), -matches("new")) %>% 
  # TODO: what is panas scale new
  rename(
    panas_neg = panas_negativescale_beep,
    panas_pos = panas_positivescale_beep
  )

df_er <- df_raw %>% 
  select(id, time_stamp_sent, matches("emotionregulation_[a-z]+$")) %>% 
  rename_all(~str_replace(., "emotionregulation_", "er_"))

df_indiff <- df_raw %>% 
  select(id, sex, birth_year, birth_month, ethnicity, 
         matches("scared.*scale"), matches("smfq.*scale"),
         # matches("panas"),
         -matches("omit")) %>% 
  rename_all(~str_remove(., "_scale_w2")) %>% 
  distinct() %>%
  left_join(
    df_emos %>% 
      filter(!is.na(panas_neg) & !is.na(panas_pos)) %>% 
      group_by(id) %>% 
      summarize(
        panas_neg = mean(panas_neg, na.rm=T),
        panas_pos = mean(panas_pos, na.rm=T),
        n_beeps = n()
      )
  ) %>% 
  mutate_at(vars(scared, smfq, panas_neg, panas_pos), list(z=scale)) 
# confirm 1 row per person
df_indiff %>% 
  count(id) %>% 
  arrange(desc(n))
## # A tibble: 265 × 2
##    id        n
##    <chr> <int>
##  1 10015     1
##  2 10016     1
##  3 10017     1
##  4 10018     1
##  5 10020     1
##  6 10021     1
##  7 10022     1
##  8 10026     1
##  9 10027     1
## 10 10028     1
## # ℹ 255 more rows

2.3 Calculate metrics

2.3.1 Mean ER

df_mean_er_strat <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating) %>% 
  group_by(id, strat) %>%
  summarize(
    mean_er = mean(rating)
  ) %>%
  ungroup
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
## group_by: 2 grouping variables (id, strat)
## summarize: now 1,855 rows and 3 columns, one group variable remaining (id)
## ungroup: no grouping variables remain
df_mean_er <- df_mean_er_strat %>% 
  group_by(id) %>% 
  summarize(
    mean_er = mean(mean_er)
  ) %>% 
  ungroup
## group_by: one grouping variable (id)
## summarize: now 265 rows and 2 columns, ungrouped
## ungroup: no grouping variables remain

2.3.2 Relative within SD

d <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating)
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
min(d$rating)
## [1] 1
max(d$rating)
## [1] 7
d %>% 
  group_by(id, strat) %>% 
  summarize(
    n = n()
  ) %>%
  # arrange(desc(n))
  arrange(n)
## group_by: 2 grouping variables (id, strat)
## summarize: now 1,855 rows and 3 columns, one group variable remaining (id)
## # A tibble: 1,855 × 3
## # Groups:   id [265]
##    id    strat                 n
##    <chr> <chr>             <int>
##  1 1029  er_distraction        1
##  2 1029  er_engagement         1
##  3 1029  er_reappraisal        1
##  4 1029  er_rumination         1
##  5 1029  er_selfcompassion     1
##  6 1029  er_socialsupport      1
##  7 1029  er_suppresion         1
##  8 8048  er_distraction        1
##  9 8048  er_engagement         1
## 10 8048  er_reappraisal        1
## # ℹ 1,845 more rows
df_rwsd <- d %>% 
  group_by(id, strat) %>% 
  mutate(n = n()) %>% 
  filter(n > 1) %>% 
  filter(mean(rating) < 7) %>%
  filter(mean(rating) > 1) %>%
  summarize(
    rwsd = relativeSD(rating, 1, 7),
    n = n()
  ) %>% 
  summarize(
    rwsd = mean(rwsd),
    n = mean(n)
  ) %>% 
  ungroup
## group_by: 2 grouping variables (id, strat)
## mutate (grouped): new variable 'n' (integer) with 64 unique values and 0% NA
## filter (grouped): removed 14 rows (<1%), 88,096 rows remaining (removed 14 groups, 1,841 groups remaining)
## filter (grouped): no rows removed
## filter (grouped): removed 9,004 rows (10%), 79,092 rows remaining (removed 188 groups, 1,653 groups remaining)
## summarize: now 1,653 rows and 4 columns, one group variable remaining (id)
## summarize: now 254 rows and 3 columns, ungrouped
## ungroup: no grouping variables remain
hist(df_rwsd$rwsd)

Technically, the arithmetic mean is not the correct way to aggregate standard deviations (i.e. SDs of each strategy per person). One should do a pooled standard deviation, but it’s complicated because we’re using the relative SD measure…

2.3.3 Relative between SD

d <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating)
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
min(d$rating)
## [1] 1
max(d$rating)
## [1] 7
d %>% 
  group_by(id, time_stamp_sent) %>% 
  summarize(
    n = n()
  ) %>%
  # arrange(desc(n))
  arrange(n)
## group_by: 2 grouping variables (id, time_stamp_sent)
## summarize: now 12,590 rows and 3 columns, one group variable remaining (id)
## # A tibble: 12,590 × 3
## # Groups:   id [265]
##    id    time_stamp_sent     n
##    <chr>           <dbl> <int>
##  1 7034       1652955304     4
##  2 11187      1653992106     5
##  3 11143      1653569405     6
##  4 11143      1653768014     6
##  5 11143      1653854414     6
##  6 11143      1653940813     6
##  7 11143      1654027212     6
##  8 11143      1654157103     6
##  9 11143      1654449309     6
## 10 11170      1653768014     6
## # ℹ 12,580 more rows
df_rbsd <- d %>% 
  group_by(id, time_stamp_sent) %>% 
  mutate(n = n()) %>% 
  filter(n > 1) %>% 
  filter(mean(rating) > 1) %>%
  filter(mean(rating) < 7) %>%
  summarize(
    rbsd = relativeSD(rating, 1, 7),
    n = n()
  ) %>% 
  summarize(
    rbsd = mean(rbsd),
    n = mean(n)
  )
## group_by: 2 grouping variables (id, time_stamp_sent)
## mutate (grouped): new variable 'n' (integer) with 4 unique values and 0% NA
## filter (grouped): no rows removed
## filter (grouped): removed 38,736 rows (44%), 49,374 rows remaining (removed 5,536 groups, 7,054 groups remaining)
## filter (grouped): removed 637 rows (1%), 48,737 rows remaining (removed 91 groups, 6,963 groups remaining)
## summarize: now 6,963 rows and 4 columns, one group variable remaining (id)
## summarize: now 256 rows and 3 columns, ungrouped
hist(df_rbsd$rbsd)

2.3.4 Relative within RMSSD

d <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating)
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
min(d$rating)
## [1] 1
max(d$rating)
## [1] 7
d %>% 
  group_by(id, strat) %>% 
  summarize(
    n = n()
  ) %>%
  # arrange(desc(n))
  arrange(n)
## group_by: 2 grouping variables (id, strat)
## summarize: now 1,855 rows and 3 columns, one group variable remaining (id)
## # A tibble: 1,855 × 3
## # Groups:   id [265]
##    id    strat                 n
##    <chr> <chr>             <int>
##  1 1029  er_distraction        1
##  2 1029  er_engagement         1
##  3 1029  er_reappraisal        1
##  4 1029  er_rumination         1
##  5 1029  er_selfcompassion     1
##  6 1029  er_socialsupport      1
##  7 1029  er_suppresion         1
##  8 8048  er_distraction        1
##  9 8048  er_engagement         1
## 10 8048  er_reappraisal        1
## # ℹ 1,845 more rows
df_rwrmssd <- d %>% 
  group_by(id, strat) %>% 
  mutate(n = n()) %>% 
  filter(n > 1) %>% 
  filter(mean(rating) < 7) %>%
  filter(mean(rating) > 1) %>%
  summarize(
    rwrmssd = relativeRMSSD(rating, 1, 7),
    n = n()
  ) %>% 
  summarize(
    rwrmssd = mean(rwrmssd),
    n = mean(n)
  ) %>% 
  ungroup
## group_by: 2 grouping variables (id, strat)
## mutate (grouped): new variable 'n' (integer) with 64 unique values and 0% NA
## filter (grouped): removed 14 rows (<1%), 88,096 rows remaining (removed 14 groups, 1,841 groups remaining)
## filter (grouped): no rows removed
## filter (grouped): removed 9,004 rows (10%), 79,092 rows remaining (removed 188 groups, 1,653 groups remaining)
## summarize: now 1,653 rows and 4 columns, one group variable remaining (id)
## summarize: now 254 rows and 3 columns, ungrouped
## ungroup: no grouping variables remain
hist(df_rwrmssd$rwrmssd)

2.3.5 Bray-Curtis

d <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  group_by(id, strat) %>% 
  arrange(time_stamp_sent) %>% 
  mutate(
    rating_abs_diff = abs(rating - lag(rating)),
    rating_sum = rating + lag(rating),
  ) %>%
  ungroup %>% 
  drop_na(rating_abs_diff)
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## group_by: 2 grouping variables (id, strat)
## mutate (grouped): new variable 'rating_abs_diff' (double) with 14 unique values and 46% NA
##                   new variable 'rating_sum' (double) with 26 unique values and 46% NA
## ungroup: no grouping variables remain
## drop_na: removed 58,907 rows (46%), 69,956 rows remaining
# momentary level (state)
df_bc_st <- d %>% 
  group_by(id, time_stamp_sent) %>%
  summarize(
    bc = sum(rating_abs_diff, na.rm=T)/sum(rating_sum, na.rm=T)
  )
## group_by: 2 grouping variables (id, time_stamp_sent)
## summarize: now 9,999 rows and 3 columns, one group variable remaining (id)
hist(df_bc_st$bc)

# individual level (trait)


# df_bc_tr <- df_bc_st %>% 
#   group_by(id) %>%
#   summarize(
#     bc = mean(bc, na.rm=T),
#     n = n()
#   )
# 
# hist(df_bc_tr$bc)


df_bc_tr <- d %>%
  group_by(id) %>%
  summarize(
    bc = sum(rating_abs_diff, na.rm=T)/sum(rating_sum, na.rm=T),
    n = n()
  ) 
## group_by: one grouping variable (id)
## summarize: now 257 rows and 3 columns, ungrouped
hist(df_bc_tr$bc)

# checking for a relationship between number of observations and bc
df_bc_tr %>% 
  ggplot(aes(x = n, y = bc)) +
  geom_smooth(se=F, size=.4, color="red") + 
  geom_smooth(method="lm") + 
  geom_point()
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

2.3.6 Wentropy

# momentary (state)
df_wentropy_st <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating) %>% 
  group_by(id, time_stamp_sent) %>% 
  mutate(
    pr = rating/7,
    ln_pr = log(pr),
    pr_ln_pr = pr*ln_pr
    ) %>%
  summarize(
    wentropy = -sum(pr_ln_pr)
  ) %>% 
  ungroup
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
## group_by: 2 grouping variables (id, time_stamp_sent)
## mutate (grouped): new variable 'pr' (double) with 13 unique values and 0% NA
##                   new variable 'ln_pr' (double) with 13 unique values and 0% NA
##                   new variable 'pr_ln_pr' (double) with 13 unique values and 0% NA
## summarize: now 12,590 rows and 3 columns, one group variable remaining (id)
## ungroup: no grouping variables remain
hist(df_wentropy_st$wentropy)

# individual (trait)
df_wentropy_tr <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating) %>% 
  group_by(id, strat) %>% 
  summarize(
    pr = sum(rating)/(7*n()),
    ln_pr = log(pr),
    pr_ln_pr = pr*ln_pr
    ) %>%
  summarize(
    wentropy = -sum(pr_ln_pr)
  ) %>% 
  ungroup
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
## group_by: 2 grouping variables (id, strat)
## summarize: now 1,855 rows and 5 columns, one group variable remaining (id)
## summarize: now 265 rows and 2 columns, ungrouped
## ungroup: no grouping variables remain
hist(df_wentropy_tr$wentropy)

2.3.7 Entropy

# momentary (state)
df_entropy_st <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating) %>% 
  group_by(id, time_stamp_sent) %>% 
  mutate(
    pr = rating/sum(rating),
    ln_pr = log(pr),
    pr_ln_pr = pr*ln_pr
    ) %>%
  summarize(
    entropy = -sum(pr_ln_pr)
  ) %>% 
  ungroup
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
## group_by: 2 grouping variables (id, time_stamp_sent)
## mutate (grouped): new variable 'pr' (double) with 452 unique values and 0% NA
##                   new variable 'ln_pr' (double) with 452 unique values and 0% NA
##                   new variable 'pr_ln_pr' (double) with 451 unique values and 0% NA
## summarize: now 12,590 rows and 3 columns, one group variable remaining (id)
## ungroup: no grouping variables remain
hist(df_entropy_st$entropy, 50)

# individual (trait)
df_entropy_tr <- df_er %>% 
  pivot_longer(cols=starts_with("er_"), 
               names_to="strat", 
               values_to="rating") %>% 
  drop_na(rating) %>% 
  group_by(id, strat) %>% 
  summarize(
    sum_strategy_rating = sum(rating),
    ) %>%
  mutate(
    pr = sum_strategy_rating/sum(sum_strategy_rating),
    ln_pr = log(pr),
    pr_ln_pr = pr*ln_pr
    ) %>%
  summarize(
    entropy = -sum(pr_ln_pr)
  ) %>% 
  ungroup
## pivot_longer: reorganized (er_reappraisal, er_distraction, er_socialsupport, er_suppresion, er_rumination, …) into (strat, rating) [was 18409x9, now 128863x4]
## drop_na: removed 40,753 rows (32%), 88,110 rows remaining
## group_by: 2 grouping variables (id, strat)
## summarize: now 1,855 rows and 3 columns, one group variable remaining (id)
## mutate (grouped): new variable 'pr' (double) with 1,415 unique values and 0% NA
##                   new variable 'ln_pr' (double) with 1,415 unique values and 0% NA
##                   new variable 'pr_ln_pr' (double) with 1,415 unique values and 0% NA
## summarize: now 265 rows and 2 columns, ungrouped
## ungroup: no grouping variables remain
hist(df_entropy_tr$entropy, breaks=30)

3 Trait

3.1 Cor between metrics

d <- df_rwsd %>% 
  select(-n) %>% 
  full_join(df_rbsd %>% select(-n), by="id") %>%
  full_join(df_rwrmssd %>% select(-n), by="id") %>%
  full_join(df_bc_tr %>% select(-n), by="id") %>%
  full_join(df_wentropy_tr, by="id") %>%
  full_join(df_entropy_tr, by="id") %>% 
  full_join(df_mean_er, by="id") %>%
  select(-id)
## select: dropped one variable (n)
## select: dropped one variable (n)
## full_join: added one column (rbsd)
##            > rows only in x                         0
##            > rows only in df_rbsd %>% select(-n)    2
##            > matched rows                         254
##            >                                     =====
##            > rows total                           256
## select: dropped one variable (n)
## full_join: added one column (rwrmssd)
##            > rows only in x                            2
##            > rows only in df_rwrmssd %>% select(-n)    0
##            > matched rows                            254
##            >                                        =====
##            > rows total                              256
## select: dropped one variable (n)
## full_join: added one column (bc)
##            > rows only in x                          7
##            > rows only in df_bc_tr %>% select(-n)    8
##            > matched rows                          249
##            >                                      =====
##            > rows total                            264
## full_join: added one column (wentropy)
##            > rows only in x                 0
##            > rows only in df_wentropy_tr    1
##            > matched rows                 264
##            >                             =====
##            > rows total                   265
## full_join: added one column (entropy)
##            > rows only in x                0
##            > rows only in df_entropy_tr    0
##            > matched rows                265
##            >                            =====
##            > rows total                  265
## full_join: added one column (mean_er)
##            > rows only in x             0
##            > rows only in df_mean_er    0
##            > matched rows             265
##            >                         =====
##            > rows total               265
## select: dropped one variable (id)
corrplot::corrplot(cor(d, use="pairwise.complete.obs"))

cor(d, use="pairwise.complete.obs")
##                 rwsd        rbsd      rwrmssd           bc    wentropy
## rwsd      1.00000000  0.70223069  0.911538061 -0.028013737 -0.09405299
## rbsd      0.70223069  1.00000000  0.647137143 -0.031475373 -0.23977250
## rwrmssd   0.91153806  0.64713714  1.000000000 -0.138209853 -0.14656079
## bc       -0.02801374 -0.03147537 -0.138209853  1.000000000  0.57881635
## wentropy -0.09405299 -0.23977250 -0.146560790  0.578816354  1.00000000
## entropy  -0.07516132 -0.32195712 -0.009524656 -0.007960902  0.17287186
## mean_er  -0.53758175 -0.26931454 -0.646611160  0.212521644 -0.30937610
##               entropy    mean_er
## rwsd     -0.075161321 -0.5375818
## rbsd     -0.321957120 -0.2693145
## rwrmssd  -0.009524656 -0.6466112
## bc       -0.007960902  0.2125216
## wentropy  0.172871862 -0.3093761
## entropy   1.000000000 -0.1292289
## mean_er  -0.129228899  1.0000000

3.2 Relative within SD

df_rwsd_outcomes <- df_rwsd %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 11)
## > matched rows 254
## > =====
## > rows total 254

3.2.1 Depression

fit <- lm(smfq ~ rwsd, data=df_rwsd_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 1.65 1.45 – 1.86 <0.001
rwsd -0.29 -0.56 – -0.02 0.036
Observations 246
R2 / R2 adjusted 0.018 / 0.014
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.2.2 Anxiety

fit <- lm(scared ~ rwsd, data=df_rwsd_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 2.19 1.99 – 2.40 <0.001
rwsd -0.36 -0.63 – -0.08 0.012
Observations 245
R2 / R2 adjusted 0.026 / 0.022
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.2.3 Neg

fit <- lm(panas_neg ~ rwsd, data=df_rwsd_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 2.79 2.43 – 3.16 <0.001
rwsd -1.35 -1.84 – -0.86 <0.001
Observations 254
R2 / R2 adjusted 0.105 / 0.101
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.2.4 Pos

fit <- lm(panas_pos ~ rwsd, data=df_rwsd_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 4.02 3.47 – 4.57 <0.001
rwsd 1.54 0.81 – 2.27 <0.001
Observations 254
R2 / R2 adjusted 0.064 / 0.060
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.3 Relative between SD

df_rbsd_outcomes <- df_rbsd %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 9)
## > matched rows 256
## > =====
## > rows total 256

3.3.1 Depression

fit <- lm(smfq ~ rbsd, data=df_rbsd_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 1.55 1.39 – 1.70 <0.001
rbsd -0.16 -0.38 – 0.06 0.159
Observations 248
R2 / R2 adjusted 0.008 / 0.004
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.3.2 Anxiety

fit <- lm(scared ~ rbsd, data=df_rbsd_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 2.03 1.87 – 2.19 <0.001
rbsd -0.14 -0.37 – 0.08 0.212
Observations 247
R2 / R2 adjusted 0.006 / 0.002
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.3.3 Neg

fit <- lm(panas_neg ~ rbsd, data=df_rbsd_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 2.22 1.93 – 2.51 <0.001
rbsd -0.61 -1.02 – -0.19 0.004
Observations 256
R2 / R2 adjusted 0.032 / 0.028
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.3.4 Pos

fit <- lm(panas_pos ~ rbsd, data=df_rbsd_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 4.61 4.18 – 5.03 <0.001
rbsd 0.80 0.20 – 1.41 0.009
Observations 256
R2 / R2 adjusted 0.026 / 0.022
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.4 Relative within RMSSD

df_rwrmssd_outcomes <- df_rwrmssd %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 11)
## > matched rows 254
## > =====
## > rows total 254

3.4.1 Depression

fit <- lm(smfq ~ rwrmssd, data=df_rwrmssd_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 1.65 1.49 – 1.81 <0.001
rwrmssd -0.34 -0.60 – -0.08 0.009
Observations 246
R2 / R2 adjusted 0.027 / 0.023
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.4.2 Anxiety

fit <- lm(scared ~ rwrmssd, data=df_rwrmssd_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 2.21 2.04 – 2.37 <0.001
rwrmssd -0.45 -0.71 – -0.19 0.001
Observations 245
R2 / R2 adjusted 0.047 / 0.043
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.4.3 Neg

fit <- lm(panas_neg ~ rwrmssd, data=df_rwrmssd_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 2.73 2.44 – 3.01 <0.001
rwrmssd -1.52 -1.97 – -1.07 <0.001
Observations 254
R2 / R2 adjusted 0.150 / 0.147
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.4.4 Pos

fit <- lm(panas_pos ~ rwrmssd, data=df_rwrmssd_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 4.29 3.86 – 4.73 <0.001
rwrmssd 1.40 0.71 – 2.10 <0.001
Observations 254
R2 / R2 adjusted 0.060 / 0.056
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.5 Bray curtis

df_bc_tr_outcomes <- df_bc_tr %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 8)
## > matched rows 257
## > =====
## > rows total 257

3.5.1 Depression

fit <- lm(smfq ~ bc, data=df_bc_tr_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 1.35 1.25 – 1.45 <0.001
bc 0.57 0.04 – 1.09 0.033
Observations 249
R2 / R2 adjusted 0.018 / 0.014
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.5.2 Anxiety

fit <- lm(scared ~ bc, data=df_bc_tr_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 1.76 1.66 – 1.87 <0.001
bc 1.00 0.47 – 1.53 <0.001
Observations 249
R2 / R2 adjusted 0.053 / 0.050
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.5.3 Neg

fit <- lm(panas_neg ~ bc, data=df_bc_tr_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 1.36 1.17 – 1.54 <0.001
bc 2.76 1.82 – 3.69 <0.001
Observations 257
R2 / R2 adjusted 0.117 / 0.113
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.5.4 Pos

fit <- lm(panas_pos ~ bc, data=df_bc_tr_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 5.69 5.42 – 5.97 <0.001
bc -3.28 -4.69 – -1.87 <0.001
Observations 257
R2 / R2 adjusted 0.076 / 0.073
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.6 Wentropy

df_wentropy_tr_outcomes <- df_wentropy_tr %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 0)
## > matched rows 265
## > =====
## > rows total 265

3.6.1 Depression

fit <- lm(smfq ~ wentropy, data=df_wentropy_tr_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 1.22 0.85 – 1.59 <0.001
wentropy 0.10 -0.07 – 0.27 0.248
Observations 257
R2 / R2 adjusted 0.005 / 0.001
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.6.2 Anxiety

fit <- lm(scared ~ wentropy, data=df_wentropy_tr_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 1.63 1.25 – 2.01 <0.001
wentropy 0.14 -0.04 – 0.31 0.134
Observations 256
R2 / R2 adjusted 0.009 / 0.005
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.6.3 Neg

fit <- lm(panas_neg ~ wentropy, data=df_wentropy_tr_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 0.75 0.06 – 1.43 0.033
wentropy 0.49 0.18 – 0.81 0.002
Observations 265
R2 / R2 adjusted 0.035 / 0.031
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.6.4 Pos

fit <- lm(panas_pos ~ wentropy, data=df_wentropy_tr_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 7.28 6.29 – 8.27 <0.001
wentropy -0.99 -1.45 – -0.53 <0.001
Observations 265
R2 / R2 adjusted 0.064 / 0.060
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.7 Entropy

df_entropy_tr_outcomes <- df_entropy_tr %>% 
  left_join(df_indiff) 
## Joining with `by = join_by(id)`
## left_join: added 13 columns (sex, birth_year, birth_month, ethnicity, scared,
## …)
## > rows only in x 0
## > rows only in df_indiff ( 0)
## > matched rows 265
## > =====
## > rows total 265

3.7.1 Depression

fit <- lm(smfq ~ entropy, data=df_entropy_tr_outcomes)
tab_model(fit)
  smfq
Predictors Estimates CI p
(Intercept) 4.21 2.32 – 6.11 <0.001
entropy -1.45 -2.43 – -0.46 0.004
Observations 257
R2 / R2 adjusted 0.032 / 0.028
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.7.2 Anxiety

fit <- lm(scared ~ entropy, data=df_entropy_tr_outcomes)
tab_model(fit)
  scared
Predictors Estimates CI p
(Intercept) 3.91 1.92 – 5.91 <0.001
entropy -1.04 -2.08 – -0.00 0.050
Observations 256
R2 / R2 adjusted 0.015 / 0.011
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.7.3 Neg

fit <- lm(panas_neg ~ entropy, data=df_entropy_tr_outcomes)
tab_model(fit)
  panas neg
Predictors Estimates CI p
(Intercept) 3.95 0.32 – 7.58 0.033
entropy -1.12 -3.01 – 0.77 0.244
Observations 265
R2 / R2 adjusted 0.005 / 0.001
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

3.7.4 Pos

fit <- lm(panas_pos ~ entropy, data=df_entropy_tr_outcomes)
tab_model(fit)
  panas pos
Predictors Estimates CI p
(Intercept) 3.44 -1.92 – 8.80 0.208
entropy 0.90 -1.89 – 3.69 0.524
Observations 265
R2 / R2 adjusted 0.002 / -0.002
plot_model(fit, type="slope")
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'

Some issues I’m noticing: - not capturing uncertainty around SD estimates in models - not aggregating SDs correctly

4 Session Info

sessionInfo()
## R version 4.4.0 (2024-04-24)
## Platform: aarch64-apple-darwin20
## Running under: macOS 15.1
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0
## 
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: America/Los_Angeles
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] tidylog_1.1.0           aTSA_3.1.2.1            sjPlot_2.8.16          
##  [4] lmerTest_3.1-3          lme4_1.1-35.3           Matrix_1.7-0           
##  [7] ggthemr_1.1.0           lubridate_1.9.3         forcats_1.0.0          
## [10] stringr_1.5.1           dplyr_1.1.4             purrr_1.0.2            
## [13] readr_2.1.5             tidyr_1.3.1             tibble_3.2.1           
## [16] ggplot2_3.5.1           tidyverse_2.0.0         here_1.0.1             
## [19] rsurveyutils_0.1.0      relativeVariability_1.0
## 
## loaded via a namespace (and not attached):
##  [1] sjlabelled_1.2.0    tidyselect_1.2.1    farver_2.1.2       
##  [4] fastmap_1.2.0       janitor_2.2.0       bayestestR_0.13.2  
##  [7] sjstats_0.19.0      digest_0.6.35       timechange_0.3.0   
## [10] estimability_1.5.1  lifecycle_1.0.4     magrittr_2.0.3     
## [13] compiler_4.4.0      rlang_1.1.4         sass_0.4.9         
## [16] tools_4.4.0         utf8_1.2.4          yaml_2.3.9         
## [19] corrplot_0.95       knitr_1.47          labeling_0.4.3     
## [22] bit_4.0.5           RColorBrewer_1.1-3  withr_3.0.0        
## [25] numDeriv_2016.8-1.1 grid_4.4.0          datawizard_0.10.0  
## [28] fansi_1.0.6         xtable_1.8-4        colorspace_2.1-0   
## [31] emmeans_1.10.3      scales_1.3.0        MASS_7.3-60.2      
## [34] insight_0.20.0      cli_3.6.3           mvtnorm_1.2-5      
## [37] rmarkdown_2.27      crayon_1.5.3        generics_0.1.3     
## [40] rstudioapi_0.16.0   performance_0.11.0  tzdb_0.4.0         
## [43] parameters_0.21.7   minqa_1.2.7         cachem_1.1.0       
## [46] splines_4.4.0       parallel_4.4.0      effectsize_0.8.8   
## [49] vctrs_0.6.5         boot_1.3-30         jsonlite_1.8.8     
## [52] hms_1.1.3           bit64_4.0.5         jquerylib_0.1.4    
## [55] glue_1.7.0          nloptr_2.0.3        stringi_1.8.4      
## [58] gtable_0.3.5        ggeffects_1.6.0     munsell_0.5.1      
## [61] pillar_1.9.0        clisymbols_1.2.0    htmltools_0.5.8.1  
## [64] R6_2.5.1            rprojroot_2.0.4     vroom_1.6.5        
## [67] evaluate_0.23       lattice_0.22-6      highr_0.11         
## [70] snakecase_0.11.1    bslib_0.7.0         Rcpp_1.0.12        
## [73] coda_0.19-4.1       nlme_3.1-164        mgcv_1.9-1         
## [76] xfun_0.44           sjmisc_2.8.10       pkgconfig_2.0.3