Set-up

# load in packages 
library(tidyverse)
library(janitor)
library(psych)
library(haven) 
library(naniar) 
library(ggpubr) 
library(report) 
library(ggplot2)
library(reshape2)
library(lme4)
library(sjPlot)
library(parameters)
library(mediation)
library(lavaan)
library(lmerTest)
library(modEvA)
## Warning: package 'modEvA' was built under R version 4.4.1
library(rsconnect)
library(effectsize)
library(emmeans)
## Warning: package 'emmeans' was built under R version 4.4.1
library(performance)
library(tinytex)
library(latexpdf)
library(interactions)
library(lm.beta)
library(car)
library(apaTables)
library(sjPlot)
library(papaja)
library(broom.mixed)
# load in data
full_data <- read.csv("full_data_b_wide.csv")

Cleaning

# check exclusion criteria

# check minimum age
min(full_data$age_years)
## [1] 19
# check if all participants were either currently or previously pregnant 
full_data %>% 
  filter(t1_pregnant == "No" & t1_number_of_children == "None")
##    X              Prolific_ID     ID.x hitsNeg_1 hitsNeut_1 hitsPNeg_1
## 1 31 5d01006f8a840b00195c2159 11284603         3          2          4
##   hitsNeg_2 hitsNeut_2 hitsPNeg_2 hitsNeg_3 hitsNeut_3 hitsPNeg_3 missesNeg_1
## 1         1          3          3         1          2          0           2
##   missesNeut_1 missesPNeg_1 missesNeg_2 missesNeut_2 missesPNeg_2 missesNeg_3
## 1            3            1           4            2            2           4
##   missesNeut_3 missesPNeg_3 false_alarmsNeg_1 false_alarmsNeut_1
## 1            3            5                 4                  5
##   false_alarmsPNeg_1 false_alarmsNeg_2 false_alarmsNeut_2 false_alarmsPNeg_2
## 1                  4                 4                  2                  4
##   false_alarmsNeg_3 false_alarmsNeut_3 false_alarmsPNeg_3 correct_rejectNeg_1
## 1                 4                  5                  3                   7
##   correct_rejectNeut_1 correct_rejectPNeg_1 correct_rejectNeg_2
## 1                    6                    7                   8
##   correct_rejectNeut_2 correct_rejectPNeg_2 correct_rejectNeg_3
## 1                   10                    8                   9
##   correct_rejectNeut_3 correct_rejectPNeg_3 hit_rateNeg_1 hit_rateNeut_1
## 1                    8                   10           0.6            0.4
##   hit_ratePNeg_1 hit_rateNeg_2 hit_rateNeut_2 hit_ratePNeg_2 hit_rateNeg_3
## 1            0.8           0.2            0.6            0.6           0.2
##   hit_rateNeut_3 hit_ratePNeg_3 false_alarm_rateNeg_1 false_alarm_rateNeut_1
## 1            0.4          1e-05             0.3636364              0.4545455
##   false_alarm_ratePNeg_1 false_alarm_rateNeg_2 false_alarm_rateNeut_2
## 1              0.3636364             0.3333333              0.1666667
##   false_alarm_ratePNeg_2 false_alarm_rateNeg_3 false_alarm_rateNeut_3
## 1              0.3333333             0.3076923              0.3846154
##   false_alarm_ratePNeg_3 DprimeNeg_1 DprimeNeut_1 DprimePNeg_1 DprimeNeg_2
## 1              0.2307692   0.6021028   -0.1391618     1.190377  -0.4108939
##   DprimeNeut_2 DprimePNeg_2 DprimeNeg_3 DprimeNeut_3 DprimePNeg_3 RTNeg_1
## 1     1.220769    0.6840744   -0.339219   0.04003413    -3.528575 666.944
##   RTNeut_1 RTPNeg_1  RTNeg_2 RTNeut_2 RTPNeg_2  RTNeg_3 RTNeut_3 RTPNeg_3
## 1 666.5333  797.637 826.0923 795.8833 698.8444 619.4464 692.5571 608.4571
##   totaltrialsNeg_1 totaltrialsNeut_1 totaltrialsPNeg_1 totaltrialsNeg_2
## 1               16                16                16               17
##   totaltrialsNeut_2 totaltrialsPNeg_2 totaltrialsNeg_3 totaltrialsNeut_3
## 1                17                17               18                18
##   totaltrialsPNeg_3 totalcorrectNeg_1 totalcorrectNeut_1 totalcorrectPNeg_1
## 1                18                10                  8                 11
##   totalcorrectNeg_2 totalcorrectNeut_2 totalcorrectPNeg_2 totalcorrectNeg_3
## 1                 9                 13                 11                10
##   totalcorrectNeut_3 totalcorrectPNeg_3 percentcorrectNeg_1
## 1                 10                 10                62.5
##   percentcorrectNeut_1 percentcorrectPNeg_1 percentcorrectNeg_2
## 1                   50                68.75            52.94118
##   percentcorrectNeut_2 percentcorrectPNeg_2 percentcorrectNeg_3
## 1             76.47059             64.70588            55.55556
##   percentcorrectNeut_3 percentcorrectPNeg_3 study.x Task_randomiser    t1_date
## 1             55.55556             55.55556       A    PERI-NEG-NEU 2024-06-20
##   t1_phq_1 t1_phq_2 t1_phq_3 t1_phq_4 t1_phq_5 t1_phq_6 t1_phq_7 t1_phq_8
## 1        2        2        3        1        2        3        2        2
##   t1_gad_1 t1_gad_2 t1_gad_3 t1_gad_4 t1_gad_5 t1_gad_6 t1_gad_7 t1_cfq_1
## 1        1        1        1        1        1        1        1        7
##   t1_cfq_2 t1_cfq_3 t1_cfq_4 t1_cfq_5 t1_cfq_6 t1_cfq_7 t1_rtq_1 t1_rtq_2
## 1        7        7        7        7        7        7        5        5
##   t1_rtq_3 t1_rtq_4 t1_rtq_5 t1_rtq_6 t1_rtq_7 t1_rtq_8 t1_rtq_9 t1_rtq_10
## 1        5        5        5        5        5        5        5         5
##   t1_ocd_1 t1_ocd_2 t1_ocd_3 t1_ocd_4 t1_ocd_5 t1_ocd_6 t1_ocd_7 t1_ocd_8
## 1        2        3        2        4        4        4        4        4
##   t1_ocd_9 t1_ocd_10 t1_ocd_11 t1_ocd_12 t1_ocd_13 t1_ocd_14 t1_ocd_15
## 1        4         4         4         4         4         4         4
##   t1_ocd_16 t1_ocd_17 t1_ocd_18 t1_pnd_ocd1 t1_pnd_ocd2 t1_pnd_ocd3 t1_pnd_ocd4
## 1         4         4         4           1           1          NA           2
##   t1_thoughts_frequency t1_thoughts_interfere_functioning
## 1                     2                                 3
##   t1_thoughts_distress_level t1_mental_health_diagnosis t1_anxiety_diagnosis
## 1                          4                          1                    1
##   t1_bipolar_diagnosis t1_depression_diagnosis t1_eating_disorder_diagnosis
## 1                    0                       0                            0
##   t1_ocd_diagnosis t1_ptsd_diagnosis t1_schizophrenia_diagnosis
## 1                1                 0                          0
##   t1_prefer_not_to_say_diagnosis t1_other_diagnosis t1_other_type_diagnosis
## 1                              0                  0                    <NA>
##   t1_current_anxiety_disorder t1_current_bipolar_disorder
## 1                           1                           0
##   t1_current_depression_disorder t1_current_eating_disorder
## 1                              0                          0
##   t1_current_ocd_disorder t1_current_ptsd_disorder
## 1                       1                        0
##   t1_current_schizophrenia_disorder t1_no_current_disorder
## 1                                 0                      0
##   t1_current_disorder_prefer_not_to_say t1_other_current_disorder
## 1                                     0                         0
##   t1_other_current_type_disorder t1_neurodevelopmental_neurological_disorder
## 1                           <NA>                                           0
##   t1_adhd_disorder t1_autism_spectrum_disorder t1_asperger_syndrome_disorder
## 1               NA                          NA                            NA
##   t1_epilepsy t1_seizures t1_dyslexia_reading_disorder_
## 1          NA          NA                            NA
##   t1_dysgraphia_writing_disorder t1_dyscalculia_calculation_disorder
## 1                             NA                                  NA
##   t1_prefer_not_to_say t1_other_neuro_disorder t1_other_type_neuro_disorder
## 1                   NA                      NA                         <NA>
##   age_years gender_identity gender_identity_quant gender_identity_other
## 1        24          Female                     1                    NA
##   resident_country resident_country_quant ethnicity ethnicity_quant
## 1   United Kingdom                     11     White               6
##   ethnicity_other level_of_education level_of_education_quant  socioeconomics
## 1            <NA> University/college                        4 Fairly well off
##   socioeconomics_quant t1_pregnant t1_pregnant_quant t1_due_day t1_due_month
## 1                    3          No                 0         NA         <NA>
##   t1_due_month_quant t1_due_year t1_number_of_children t1_child_1_age
## 1                 NA          NA                  None             NA
##   t1_child_1_age_units t1_child_1_week_born t1_child_2_age t1_child_2_age_units
## 1                 <NA>                   NA             NA                 <NA>
##   t1_child_2_week_born t1_child_3_age t1_child_3_age_units t1_child_3_week_born
## 1                   NA             NA                 <NA>                   NA
##   t1_child_4_age t1_child_4_age_units t1_child_4_week_born t1_child_5_age
## 1             NA                 <NA>                   NA             NA
##   t1_child_5_age_units t1_child_5_week_born t1_child_6_age t1_child_6_age_units
## 1                 <NA>                   NA             NA                 <NA>
##   t1_child_6_week_born t1_birth_complications t1_birth_complications_quant
## 1                   NA                   <NA>                           NA
##   t1_birth_complications_type t1phqTotal t1gadTotal t1cfqTotal t1rtqTotal
## 1                        <NA>         17          7         49         50
##   t1ocdTotal t1intrusionsTotal t1_due_date t1_days_until_birth
## 1         67                 4        <NA>                  NA
##   t1_weeks_until_birth t1_gest_age_weeks t1_child_1_age_weeks
## 1                   NA                NA                   NA
##   t1_child_2_age_weeks t1_child_3_age_weeks t1_child_4_age_weeks
## 1                   NA                   NA                   NA
##   t1_child_5_age_weeks t1_child_6_age_weeks ID_t2 t2_date completed_t2
## 1                   NA                   NA    NA    <NA>         <NA>
##   t2_pregnancy_child_loss t2_pregnancy_child_loss_quant t2_phq_1 t2_phq_2
## 1                    <NA>                            NA       NA       NA
##   t2_phq_3 t2_phq_4 t2_phq_5 t2_phq_6 t2_phq_7 t2_phq_8 t2_gad_1 t2_gad_2
## 1       NA       NA       NA       NA       NA       NA       NA       NA
##   t2_gad_3 t2_gad_4 t2_gad_5 t2_gad_6 t2_gad_7 t2_cfq_1 t2_cfq_2 t2_cfq_3
## 1       NA       NA       NA       NA       NA       NA       NA       NA
##   t2_cfq_4 t2_cfq_5 t2_cfq_6 t2_cfq_7 t2_rtq_1 t2_rtq_2 t2_rtq_3 t2_rtq_4
## 1       NA       NA       NA       NA       NA       NA       NA       NA
##   t2_rtq_5 t2_rtq_6 t2_rtq_7 t2_rtq_8 t2_rtq_9 t2_rtq_10 t2_ocd_1 t2_ocd_2
## 1       NA       NA       NA       NA       NA        NA       NA       NA
##   t2_ocd_3 t2_ocd_4 t2_ocd_5 t2_ocd_6 t2_ocd_7 t2_ocd_8 t2_ocd_9 t2_ocd_10
## 1       NA       NA       NA       NA       NA       NA       NA        NA
##   t2_ocd_11 t2_ocd_12 t2_ocd_13 t2_ocd_14 t2_ocd_15 t2_ocd_16 t2_ocd_17
## 1        NA        NA        NA        NA        NA        NA        NA
##   t2_ocd_18 t2_pnd_ocd1 t2_pnd_ocd2 t2_pnd_ocd3 t2_pnd_ocd4
## 1        NA          NA          NA          NA          NA
##   t2_thoughts_frequency t2_thoughts_interfere_functioning
## 1                    NA                                NA
##   t2_thoughts_distress_level t2_new_mental_health_diagnosis_last_month
## 1                         NA                                        NA
##   t2_new_anxiety_diagnosis t2_new_bipolar_diagnosis t2_new_depression_diagnosis
## 1                       NA                       NA                          NA
##   t2_new_eating_disorder_diagnosis t2_new_ocd_diagnosis t2_new_ptsd_diagnosis
## 1                               NA                   NA                    NA
##   t2_new_schizophrenia_diagnosis t2_prefer_not_to_say_diagnosis
## 1                             NA                             NA
##   t2_new_other_diagnosis t2_new_other_type_diagnosis
## 1                     NA                        <NA>
##   t2_current_anxiety_disorder t2_current_bipolar_disorder
## 1                          NA                          NA
##   t2_current_depression_disorder t2_current_eating_disorder
## 1                             NA                         NA
##   t2_current_ocd_disorder t2_current_ptsd_disorder
## 1                      NA                       NA
##   t2_current_schizophrenia_disorder t2_current_disorder_prefer_not_to_say
## 1                                NA                                    NA
##   t2_other_current_disorder t2_other_current_type_disorder t2_pregnant
## 1                        NA                           <NA>        <NA>
##   t2_pregnant_quant t2_due_day t2_due_month t2_due_month_quant t2_due_year
## 1                NA         NA         <NA>                 NA          NA
##   t2_number_of_pregnancies birth_since_t1 birth_since_t1_quant
## 1                       NA           <NA>                   NA
##   birth_since_t1_child_1_age birth_since_t1_child_1_age_units
## 1                         NA                             <NA>
##   birth_since_t1_child_1_week_born birth_since_t1_child_2_age
## 1                               NA                         NA
##   birth_since_t1_child_2_age_units birth_since_t1_child_2_week_born
## 1                               NA                               NA
##   birth_since_t1_child_3_age birth_since_t1_child_3_age_units
## 1                         NA                               NA
##   birth_since_t1_child_3_week_born birth_since_t1_child_4_age
## 1                               NA                         NA
##   birth_since_t1_child_4_age_units birth_since_t1_child_4_week_born
## 1                               NA                               NA
##   t2_birth_complications t2_birth_complications_quant
## 1                   <NA>                           NA
##   t2_birth_complications_type t2_phq_total t2_gad_total t2_cfq_total
## 1                        <NA>           NA           NA           NA
##   t2_rtq_total t2_ocd_total t2_intrusions_total t2_due_date t2_days_until_birth
## 1           NA           NA                  NA        <NA>                  NA
##   t2_weeks_until_birth t2_gest_age_weeks
## 1                   NA                NA
  # exclude participant Prolific ID = 5d01006f8a840b00195c2159

# check if all pregnant participants had a gestational age > than 13 weeks 
full_data %>% 
  filter(t1_pregnant == "Yes" & t1_gest_age_weeks < 13)
##     X              Prolific_ID     ID.x hitsNeg_1 hitsNeut_1 hitsPNeg_1
## 1  57 5f262b3018c68e27aebdd170 11331455         4          1          1
## 2  76 606be651a89a7baf6141e8b9 11308857         1          1          3
## 3 101 631910aab5323b5658ca4a39 11308763         3          0          4
##   hitsNeg_2 hitsNeut_2 hitsPNeg_2 hitsNeg_3 hitsNeut_3 hitsPNeg_3 missesNeg_1
## 1         4          4          5         4          4          5           1
## 2         1          1          2         0          1          1           4
## 3         0          1          0         0          2          0           2
##   missesNeut_1 missesPNeg_1 missesNeg_2 missesNeut_2 missesPNeg_2 missesNeg_3
## 1            4            4           1            1            0           1
## 2            4            2           4            4            3           5
## 3            5            1           5            4            5           5
##   missesNeut_3 missesPNeg_3 false_alarmsNeg_1 false_alarmsNeut_1
## 1            1            0                 0                  6
## 2            4            4                 4                  4
## 3            3            5                 6                  9
##   false_alarmsPNeg_1 false_alarmsNeg_2 false_alarmsNeut_2 false_alarmsPNeg_2
## 1                  3                 2                  0                  0
## 2                  5                 6                  7                 10
## 3                  7                 0                  5                  2
##   false_alarmsNeg_3 false_alarmsNeut_3 false_alarmsPNeg_3 correct_rejectNeg_1
## 1                 3                  4                  1                  11
## 2                 6                  5                  7                   7
## 3                 0                  4                  0                   5
##   correct_rejectNeut_1 correct_rejectPNeg_1 correct_rejectNeg_2
## 1                    5                    8                  10
## 2                    7                    6                   6
## 3                    2                    4                  12
##   correct_rejectNeut_2 correct_rejectPNeg_2 correct_rejectNeg_3
## 1                   12                   12                  10
## 2                    5                    2                   7
## 3                    7                   10                  13
##   correct_rejectNeut_3 correct_rejectPNeg_3 hit_rateNeg_1 hit_rateNeut_1
## 1                    9                   12           0.8          2e-01
## 2                    8                    6           0.2          2e-01
## 3                    9                   13           0.6          1e-05
##   hit_ratePNeg_1 hit_rateNeg_2 hit_rateNeut_2 hit_ratePNeg_2 hit_rateNeg_3
## 1            0.2         8e-01            0.8        0.99999         8e-01
## 2            0.6         2e-01            0.2        0.40000         1e-05
## 3            0.8         1e-05            0.2        0.00001         1e-05
##   hit_rateNeut_3 hit_ratePNeg_3 false_alarm_rateNeg_1 false_alarm_rateNeut_1
## 1            0.8        0.99999             0.0000100              0.5454545
## 2            0.2        0.20000             0.3636364              0.3636364
## 3            0.4        0.00001             0.5454545              0.8181818
##   false_alarm_ratePNeg_1 false_alarm_rateNeg_2 false_alarm_rateNeut_2
## 1              0.2727273             0.1666667              0.0000100
## 2              0.4545455             0.5000000              0.5833333
## 3              0.6363636             0.0000100              0.4166667
##   false_alarm_ratePNeg_2 false_alarm_rateNeg_3 false_alarm_rateNeut_3
## 1              0.0000100             0.2307692              0.3076923
## 2              0.8333333             0.4615385              0.3846154
## 3              0.1666667             0.0000100              0.3076923
##   false_alarm_ratePNeg_3 DprimeNeg_1 DprimeNeut_1 DprimePNeg_1 DprimeNeg_2
## 1             0.07692308   5.1065120   -0.9558065   -0.2370359   1.8090428
## 2             0.53846154  -0.4928655   -0.4928655    0.3675324  -0.8416212
## 3             0.00001000   0.1391618   -5.1733487    0.4928655   0.0000000
##   DprimeNeut_2 DprimePNeg_2 DprimeNeg_3 DprimeNeut_3 DprimePNeg_3  RTNeg_1
## 1    5.1065120     8.529782    1.577937    1.3440235    5.6909677 728.7097
## 2   -1.0520496    -1.220769   -4.168332   -0.5482400   -0.9381798 700.6217
## 3   -0.6311928    -3.297469    0.000000    0.2490551    0.0000000 784.8667
##   RTNeut_1 RTPNeg_1  RTNeg_2 RTNeut_2 RTPNeg_2  RTNeg_3 RTNeut_3 RTPNeg_3
## 1 709.3636 731.3750 611.4839 623.4545 687.1176 564.6250 581.6129 674.8571
## 2 650.7917 820.3160 583.5042 610.5739 586.9286 501.8360 568.3630 502.3000
## 3 546.1765 858.4348 443.3034 616.0080 658.3963 469.7968 694.8724 389.4323
##   totaltrialsNeg_1 totaltrialsNeut_1 totaltrialsPNeg_1 totaltrialsNeg_2
## 1               16                16                16               17
## 2               16                16                16               17
## 3               16                16                16               17
##   totaltrialsNeut_2 totaltrialsPNeg_2 totaltrialsNeg_3 totaltrialsNeut_3
## 1                17                17               18                18
## 2                17                17               18                18
## 3                17                17               18                18
##   totaltrialsPNeg_3 totalcorrectNeg_1 totalcorrectNeut_1 totalcorrectPNeg_1
## 1                18                15                  6                  9
## 2                18                 8                  8                  9
## 3                18                 8                  2                  8
##   totalcorrectNeg_2 totalcorrectNeut_2 totalcorrectPNeg_2 totalcorrectNeg_3
## 1                14                 16                 17                14
## 2                 7                  6                  4                 7
## 3                12                  8                 10                13
##   totalcorrectNeut_3 totalcorrectPNeg_3 percentcorrectNeg_1
## 1                 13                 17               93.75
## 2                  9                  7               50.00
## 3                 11                 13               50.00
##   percentcorrectNeut_1 percentcorrectPNeg_1 percentcorrectNeg_2
## 1                 37.5                56.25            82.35294
## 2                 50.0                56.25            41.17647
## 3                 12.5                50.00            70.58824
##   percentcorrectNeut_2 percentcorrectPNeg_2 percentcorrectNeg_3
## 1             94.11765            100.00000            77.77778
## 2             35.29412             23.52941            38.88889
## 3             47.05882             58.82353            72.22222
##   percentcorrectNeut_3 percentcorrectPNeg_3 study.x Task_randomiser    t1_date
## 1             72.22222             94.44444       C    PERI-NEU-NEG 2024-06-28
## 2             50.00000             38.88889       A    NEG-PERI-NEU 2024-06-24
## 3             61.11111             72.22222       A    NEU-PERI-NEG 2024-06-24
##   t1_phq_1 t1_phq_2 t1_phq_3 t1_phq_4 t1_phq_5 t1_phq_6 t1_phq_7 t1_phq_8
## 1        1        1        0        2        0        0        0        0
## 2        2        2        1        0        0        0        0        0
## 3        1        1        1        1        0        1        1        0
##   t1_gad_1 t1_gad_2 t1_gad_3 t1_gad_4 t1_gad_5 t1_gad_6 t1_gad_7 t1_cfq_1
## 1        1        1        1        0        0        0        0        4
## 2        1        1        2        2        0        0        0        6
## 3        1        1        1        1        1        0        0        1
##   t1_cfq_2 t1_cfq_3 t1_cfq_4 t1_cfq_5 t1_cfq_6 t1_cfq_7 t1_rtq_1 t1_rtq_2
## 1        4        3        4        3        3        3        2        2
## 2        5        1        1        1        1        1        1        1
## 3        1        3        2        2        2        1        1        1
##   t1_rtq_3 t1_rtq_4 t1_rtq_5 t1_rtq_6 t1_rtq_7 t1_rtq_8 t1_rtq_9 t1_rtq_10
## 1        3        2        3        2        3        3        3         2
## 2        1        1        1        1        1        3        3         3
## 3        1        1        1        2        2        1        1         1
##   t1_ocd_1 t1_ocd_2 t1_ocd_3 t1_ocd_4 t1_ocd_5 t1_ocd_6 t1_ocd_7 t1_ocd_8
## 1        2        2        2        1        1        3        1        1
## 2        0        0        0        0        0        0        0        0
## 3        0        0        0        0        0        0        0        0
##   t1_ocd_9 t1_ocd_10 t1_ocd_11 t1_ocd_12 t1_ocd_13 t1_ocd_14 t1_ocd_15
## 1        1         0         1         1         2         0         2
## 2        0         0         0         0         0         0         4
## 3        0         0         0         0         1         1         0
##   t1_ocd_16 t1_ocd_17 t1_ocd_18 t1_pnd_ocd1 t1_pnd_ocd2 t1_pnd_ocd3 t1_pnd_ocd4
## 1         0         0         0           1           1           1           1
## 2         0         0         4           1           1           1           1
## 3         0         0         0           0           0           1           0
##   t1_thoughts_frequency t1_thoughts_interfere_functioning
## 1                     3                                 3
## 2                     1                                 1
## 3                     1                                 1
##   t1_thoughts_distress_level t1_mental_health_diagnosis t1_anxiety_diagnosis
## 1                          2                          0                   NA
## 2                          1                          0                   NA
## 3                          1                          0                   NA
##   t1_bipolar_diagnosis t1_depression_diagnosis t1_eating_disorder_diagnosis
## 1                   NA                      NA                           NA
## 2                   NA                      NA                           NA
## 3                   NA                      NA                           NA
##   t1_ocd_diagnosis t1_ptsd_diagnosis t1_schizophrenia_diagnosis
## 1               NA                NA                         NA
## 2               NA                NA                         NA
## 3               NA                NA                         NA
##   t1_prefer_not_to_say_diagnosis t1_other_diagnosis t1_other_type_diagnosis
## 1                             NA                 NA                    <NA>
## 2                             NA                 NA                    <NA>
## 3                             NA                 NA                    <NA>
##   t1_current_anxiety_disorder t1_current_bipolar_disorder
## 1                          NA                          NA
## 2                          NA                          NA
## 3                          NA                          NA
##   t1_current_depression_disorder t1_current_eating_disorder
## 1                             NA                         NA
## 2                             NA                         NA
## 3                             NA                         NA
##   t1_current_ocd_disorder t1_current_ptsd_disorder
## 1                      NA                       NA
## 2                      NA                       NA
## 3                      NA                       NA
##   t1_current_schizophrenia_disorder t1_no_current_disorder
## 1                                NA                     NA
## 2                                NA                     NA
## 3                                NA                     NA
##   t1_current_disorder_prefer_not_to_say t1_other_current_disorder
## 1                                    NA                        NA
## 2                                    NA                        NA
## 3                                    NA                        NA
##   t1_other_current_type_disorder t1_neurodevelopmental_neurological_disorder
## 1                           <NA>                                           0
## 2                           <NA>                                           0
## 3                           <NA>                                           0
##   t1_adhd_disorder t1_autism_spectrum_disorder t1_asperger_syndrome_disorder
## 1               NA                          NA                            NA
## 2               NA                          NA                            NA
## 3               NA                          NA                            NA
##   t1_epilepsy t1_seizures t1_dyslexia_reading_disorder_
## 1          NA          NA                            NA
## 2          NA          NA                            NA
## 3          NA          NA                            NA
##   t1_dysgraphia_writing_disorder t1_dyscalculia_calculation_disorder
## 1                             NA                                  NA
## 2                             NA                                  NA
## 3                             NA                                  NA
##   t1_prefer_not_to_say t1_other_neuro_disorder t1_other_type_neuro_disorder
## 1                   NA                      NA                         <NA>
## 2                   NA                      NA                         <NA>
## 3                   NA                      NA                         <NA>
##   age_years gender_identity gender_identity_quant gender_identity_other
## 1        28          Female                     1                    NA
## 2        28          Female                     1                    NA
## 3        35          Female                     1                    NA
##           resident_country resident_country_quant ethnicity ethnicity_quant
## 1           United Kingdom                     11     Mixed               5
## 2 United States of America                     12     Black               3
## 3 United States of America                     12     White               6
##   ethnicity_other level_of_education level_of_education_quant    socioeconomics
## 1            <NA> University/college                        4 Not very well off
## 2            <NA> University/college                        4 Not very well off
## 3            <NA> University/college                        4   Rather well off
##   socioeconomics_quant t1_pregnant t1_pregnant_quant t1_due_day t1_due_month
## 1                    2         Yes                 1          5      January
## 2                    2         Yes                 1         16     December
## 3                    4         Yes                 1          3     February
##   t1_due_month_quant t1_due_year t1_number_of_children t1_child_1_age
## 1                  1        2025                  None             NA
## 2                 12        2025                  None             NA
## 3                  2        2025                  None             NA
##   t1_child_1_age_units t1_child_1_week_born t1_child_2_age t1_child_2_age_units
## 1                 <NA>                   NA             NA                 <NA>
## 2                 <NA>                   NA             NA                 <NA>
## 3                 <NA>                   NA             NA                 <NA>
##   t1_child_2_week_born t1_child_3_age t1_child_3_age_units t1_child_3_week_born
## 1                   NA             NA                 <NA>                   NA
## 2                   NA             NA                 <NA>                   NA
## 3                   NA             NA                 <NA>                   NA
##   t1_child_4_age t1_child_4_age_units t1_child_4_week_born t1_child_5_age
## 1             NA                 <NA>                   NA             NA
## 2             NA                 <NA>                   NA             NA
## 3             NA                 <NA>                   NA             NA
##   t1_child_5_age_units t1_child_5_week_born t1_child_6_age t1_child_6_age_units
## 1                 <NA>                   NA             NA                 <NA>
## 2                 <NA>                   NA             NA                 <NA>
## 3                 <NA>                   NA             NA                 <NA>
##   t1_child_6_week_born t1_birth_complications t1_birth_complications_quant
## 1                   NA                   <NA>                           NA
## 2                   NA                   <NA>                           NA
## 3                   NA                   <NA>                           NA
##   t1_birth_complications_type t1phqTotal t1gadTotal t1cfqTotal t1rtqTotal
## 1                        <NA>          4          3         24         25
## 2                        <NA>          5          6         16         16
## 3                        <NA>          6          5         12         12
##   t1ocdTotal t1intrusionsTotal t1_due_date t1_days_until_birth
## 1         20                 4  2025-01-05                 191
## 2          8                 4  2025-12-16                 540
## 3          2                 1  2025-02-03                 224
##   t1_weeks_until_birth t1_gest_age_weeks t1_child_1_age_weeks
## 1             27.28571          12.71429                   NA
## 2             77.14286         -37.14286                   NA
## 3             32.00000           8.00000                   NA
##   t1_child_2_age_weeks t1_child_3_age_weeks t1_child_4_age_weeks
## 1                   NA                   NA                   NA
## 2                   NA                   NA                   NA
## 3                   NA                   NA                   NA
##   t1_child_5_age_weeks t1_child_6_age_weeks    ID_t2    t2_date completed_t2
## 1                   NA                   NA 11516554 2024-07-30     complete
## 2                   NA                   NA 11472949 2024-07-21     complete
## 3                   NA                   NA 11473575 2024-07-21     complete
##   t2_pregnancy_child_loss t2_pregnancy_child_loss_quant t2_phq_1 t2_phq_2
## 1                      No                             0        1        1
## 2                      No                             0        0        0
## 3                      No                             0        1        1
##   t2_phq_3 t2_phq_4 t2_phq_5 t2_phq_6 t2_phq_7 t2_phq_8 t2_gad_1 t2_gad_2
## 1        0        2        1        0        0        0        1        1
## 2        0        0        0        0        0        0        1        1
## 3        3        1        1        1        1        0        1        1
##   t2_gad_3 t2_gad_4 t2_gad_5 t2_gad_6 t2_gad_7 t2_cfq_1 t2_cfq_2 t2_cfq_3
## 1        2        1        1        1        1        4        4        5
## 2        1        1        1        3        2        3        3        3
## 3        1        2        2        1        0        4        4        5
##   t2_cfq_4 t2_cfq_5 t2_cfq_6 t2_cfq_7 t2_rtq_1 t2_rtq_2 t2_rtq_3 t2_rtq_4
## 1        4        4        4        4        3        3        2        3
## 2        3        3        2        2        1        1        1        1
## 3        4        3        5        5        2        3        2        3
##   t2_rtq_5 t2_rtq_6 t2_rtq_7 t2_rtq_8 t2_rtq_9 t2_rtq_10 t2_ocd_1 t2_ocd_2
## 1        4        3        3        3        2         2        2        1
## 2        2        2        1        1        1         1        0        2
## 3        2        3        2        2        2         2        1        1
##   t2_ocd_3 t2_ocd_4 t2_ocd_5 t2_ocd_6 t2_ocd_7 t2_ocd_8 t2_ocd_9 t2_ocd_10
## 1        1        1        0        2        1        1        1         1
## 2        0        0        0        3        0        0        0         0
## 3        2        1        0        2        2        1        2         0
##   t2_ocd_11 t2_ocd_12 t2_ocd_13 t2_ocd_14 t2_ocd_15 t2_ocd_16 t2_ocd_17
## 1         2         0         4         1         3         0         0
## 2         0         0         0         0         0         0         0
## 3         2         1         1         1         2         0         2
##   t2_ocd_18 t2_pnd_ocd1 t2_pnd_ocd2 t2_pnd_ocd3 t2_pnd_ocd4
## 1         1           0           1           0           1
## 2         0           2           1           1           2
## 3         2           0           0           2           0
##   t2_thoughts_frequency t2_thoughts_interfere_functioning
## 1                     3                                 2
## 2                     3                                 3
## 3                    NA                                 2
##   t2_thoughts_distress_level t2_new_mental_health_diagnosis_last_month
## 1                          2                                         0
## 2                          1                                         0
## 3                          3                                         0
##   t2_new_anxiety_diagnosis t2_new_bipolar_diagnosis t2_new_depression_diagnosis
## 1                       NA                       NA                          NA
## 2                       NA                       NA                          NA
## 3                       NA                       NA                          NA
##   t2_new_eating_disorder_diagnosis t2_new_ocd_diagnosis t2_new_ptsd_diagnosis
## 1                               NA                   NA                    NA
## 2                               NA                   NA                    NA
## 3                               NA                   NA                    NA
##   t2_new_schizophrenia_diagnosis t2_prefer_not_to_say_diagnosis
## 1                             NA                             NA
## 2                             NA                             NA
## 3                             NA                             NA
##   t2_new_other_diagnosis t2_new_other_type_diagnosis
## 1                     NA                            
## 2                     NA                            
## 3                     NA                            
##   t2_current_anxiety_disorder t2_current_bipolar_disorder
## 1                          NA                          NA
## 2                          NA                          NA
## 3                          NA                          NA
##   t2_current_depression_disorder t2_current_eating_disorder
## 1                             NA                         NA
## 2                             NA                         NA
## 3                             NA                         NA
##   t2_current_ocd_disorder t2_current_ptsd_disorder
## 1                      NA                       NA
## 2                      NA                       NA
## 3                      NA                       NA
##   t2_current_schizophrenia_disorder t2_current_disorder_prefer_not_to_say
## 1                                NA                                    NA
## 2                                NA                                    NA
## 3                                NA                                    NA
##   t2_other_current_disorder t2_other_current_type_disorder t2_pregnant
## 1                        NA                                        Yes
## 2                        NA                                        Yes
## 3                        NA                                        Yes
##   t2_pregnant_quant t2_due_day t2_due_month t2_due_month_quant t2_due_year
## 1                 1         20      January                  1        2025
## 2                 1         16     December                 12        2025
## 3                 1         15     February                  2        2025
##   t2_number_of_pregnancies birth_since_t1 birth_since_t1_quant
## 1                        1                                  NA
## 2                        1                                  NA
## 3                        1                                  NA
##   birth_since_t1_child_1_age birth_since_t1_child_1_age_units
## 1                         NA                                 
## 2                         NA                                 
## 3                         NA                                 
##   birth_since_t1_child_1_week_born birth_since_t1_child_2_age
## 1                               NA                         NA
## 2                               NA                         NA
## 3                               NA                         NA
##   birth_since_t1_child_2_age_units birth_since_t1_child_2_week_born
## 1                               NA                               NA
## 2                               NA                               NA
## 3                               NA                               NA
##   birth_since_t1_child_3_age birth_since_t1_child_3_age_units
## 1                         NA                               NA
## 2                         NA                               NA
## 3                         NA                               NA
##   birth_since_t1_child_3_week_born birth_since_t1_child_4_age
## 1                               NA                         NA
## 2                               NA                         NA
## 3                               NA                         NA
##   birth_since_t1_child_4_age_units birth_since_t1_child_4_week_born
## 1                               NA                               NA
## 2                               NA                               NA
## 3                               NA                               NA
##   t2_birth_complications t2_birth_complications_quant
## 1                                                  NA
## 2                                                  NA
## 3                                                  NA
##   t2_birth_complications_type t2_phq_total t2_gad_total t2_cfq_total
## 1                                        5            8           29
## 2                                        0           10           19
## 3                                        9            8           30
##   t2_rtq_total t2_ocd_total t2_intrusions_total t2_due_date t2_days_until_birth
## 1           28           22                   2  2025-01-20                 174
## 2           12            5                   6  2025-12-16                 513
## 3           23           23                   2  2025-02-15                 209
##   t2_weeks_until_birth t2_gest_age_weeks
## 1             24.85714          15.14286
## 2             73.28571         -33.28571
## 3             29.85714          10.14286
  # exclude participant Prolific ID = 5f262b3018c68e27aebdd170, 
  # 606be651a89a7baf6141e8b9, 631910aab5323b5658ca4a39
# check if non-pregnant participants' youngest child < 104.4 weeks (24 months)

child_weeks <- c("t1_child_1_age_weeks", "t1_child_2_age_weeks", 
                 "t1_child_3_age_weeks", 
                 "t1_child_4_age_weeks", "t1_child_5_age_weeks",
                "t1_child_6_age_weeks")

full_data %>% 
  filter(t1_pregnant == "No") %>% 
  dplyr::select(c(Prolific_ID, child_weeks)) %>% 
  pivot_longer(cols = child_weeks,
               names_to = "child", values_to = "weeks") %>% 
  na.omit() %>% 
  group_by(Prolific_ID) %>% 
  summarise(youngest_child_age = min(weeks),
            exclude = youngest_child_age > 104.4 | youngest_child_age < 0) %>% 
  filter(exclude == TRUE & youngest_child_age != Inf) 
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## ℹ Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(child_weeks)
## 
##   # Now:
##   data %>% select(all_of(child_weeks))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## # A tibble: 3 × 3
##   Prolific_ID              youngest_child_age exclude
##   <chr>                                 <dbl> <lgl>  
## 1 5f565a2b33c152071057bb04             -117.  TRUE   
## 2 650062cd6cef58594c7a5c78              126.  TRUE   
## 3 663259adf676257069e1a6e1              -52.1 TRUE
  # exclude participant Prolific ID == 650062cd6cef58594c7a5c78
  # assuming that age input by participant Prolific ID == 5f565a2b33c152071057bb04 
  # and 663259adf676257069e1a6e1 was a typo, exclude 
  # Prolific ID == 5f565a2b33c152071057bb04 and include 
  # Prolific ID == 663259adf676257069e1a6e1 
final_data <- full_data

# find row and column index of negative value of participant ID == 11308955
which(final_data == -52.14, arr.ind = TRUE)
##      row col
## [1,] 156 249
# change participant ID == 11308955 input value to positive, 
# assuming negative sign is a typo 
final_data[156,249] = -1 * final_data[156,249]

# check value change
final_data[156,249]
## [1] 52.14
# remove excluded participants and create final data frame 
final_data <- final_data %>%
  filter(Prolific_ID != "5d01006f8a840b00195c2159" & # not currently or 
                                                    #previously pregnant
         Prolific_ID != "5f262b3018c68e27aebdd170" & # gest age < 13 wks
         Prolific_ID != "606be651a89a7baf6141e8b9" & 
         Prolific_ID != "631910aab5323b5658ca4a39" & 
         Prolific_ID != "650062cd6cef58594c7a5c78" & # not preg. 
                                                  #& youngest child > 104.4 wks
         Prolific_ID != "5f565a2b33c152071057bb04") 
# calculate weeks since conception
final_data <- final_data %>% 
  rowwise() %>% 
  mutate(t1_post_child1 = sum(t1_child_1_age_weeks, t1_child_1_week_born),
         t1_post_child2 = sum(t1_child_2_age_weeks, t1_child_2_week_born),
         t1_post_child3 = sum(t1_child_3_age_weeks, t1_child_3_week_born),
         t1_post_child4 = sum(t1_child_4_age_weeks, t1_child_4_week_born),
         t1_post_child5 = sum(t1_child_5_age_weeks, t1_child_5_week_born),
         t1_post_child6 = sum(t1_child_6_age_weeks, t1_child_6_week_born)) %>% 
  mutate(min_postpartum = min(c(t1_post_child1, t1_post_child2, t1_post_child3, 
                                t1_post_child4, t1_post_child5, t1_post_child6), 
                              na.rm = TRUE),
         t1_gest_age_weeks_dup = t1_gest_age_weeks, 
         t1_wks_since_conception = case_when(is.na(t1_gest_age_weeks) == TRUE ~
                                                 min_postpartum, 
                                               .default = t1_gest_age_weeks)) %>% 
  ungroup()
## Warning: There were 26 warnings in `mutate()`.
## The first warning was:
## ℹ In argument: `min_postpartum = min(...)`.
## ℹ In row 12.
## Caused by warning in `min()`:
## ! no non-missing arguments to min; returning Inf
## ℹ Run `dplyr::last_dplyr_warnings()` to see the 25 remaining warnings.

Check distribution and outliers

Intrusions, distress and mental health

# check distributions of T1 Intrusions
ggplot(final_data, aes(t1intrusionsTotal)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 Intrusions Total Distribution", x= "T1 Intrusions Total Score (0-12: No this is Not True - this is True Most of the Time)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1intrusionsTotal)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 4.87 3.31      5    4.74 4.45   0  12    12 0.26    -0.98 0.21
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1intrusionsTotal)
mean_intrusions <- descriptives$mean  # Extract mean from describe output
sd_intrusions <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in intrusions total
z_scores <- (final_data$t1intrusionsTotal - mean_intrusions) / sd_intrusions

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1intrusionsTotal[abs(z_scores) > 3]

# Print outliers
outliers
## integer(0)
# check distributions of T1 Intrusions Distress 
ggplot(final_data, aes(t1_thoughts_distress_level)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 Intrusions Distress Total Distribution", x= "T1 Intrusions Distress Total Score (1-5: None to Near Constant Disabling Distress)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_bin()`).

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1_thoughts_distress_level)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 246 2.04 0.89      2       2 1.48   1   4     3  0.3    -0.94 0.06
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1_thoughts_distress_level)
mean_intrusionsdistress <- descriptives$mean  # Extract mean from describe output
sd_intrusionsdistress <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in intrustions distress total
z_scores <- (final_data$t1_thoughts_distress_level - mean_intrusionsdistress) / sd_intrusionsdistress

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1_thoughts_distress_level[abs(z_scores) > 3]

# Print outliers
outliers
## [1] NA
# check distributions of T1 PHQ Data
ggplot(final_data, aes(t1phqTotal)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 PHQ Total Distribution", x= "T1 PHQ Total Score, (0-24: Not at All to Every Day)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1phqTotal)
##    vars   n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 7.77 5.3      7    7.34 5.93   0  24    24 0.69    -0.15 0.34
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1phqTotal)
mean_phq <- descriptives$mean  # Extract mean from describe output
sd_phq <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in t1phqTotal
z_scores <- (final_data$t1phqTotal - mean_phq) / sd_phq

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1phqTotal[abs(z_scores) > 3]

# Print outliers
outliers
## [1] 24
# check distributions of T1 GAD Data
ggplot(final_data, aes(t1gadTotal)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 GAD Total Distribution", x= "T1 GAD Total Score (0-21: Not at All to Nearly Every Day)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1gadTotal)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 7.28 5.02      6    6.95 4.45   0  21    21 0.53    -0.55 0.32
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1gadTotal)
mean_gad <- descriptives$mean  # Extract mean from describe output
sd_gad <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in t1gadTotal
z_scores <- (final_data$t1gadTotal - mean_gad) / sd_gad

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1gadTotal[abs(z_scores) > 3]

# Print outliers
outliers
## integer(0)
# check distributions of T1 OCD Data
ggplot(final_data, aes(t1ocdTotal)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 OCD Total Distribution", x= "T1 OCD Total Score (0-72: Not At All to Extermely", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1ocdTotal)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 247 16.31 13.57     12   14.77 13.34   0  54    54 0.82    -0.31 0.86
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1ocdTotal)
mean_ocd <- descriptives$mean  # Extract mean from describe output
sd_ocd <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in t1ocdTotal
z_scores <- (final_data$t1ocdTotal - mean_ocd) / sd_ocd

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1ocdTotal[abs(z_scores) > 3]

# Print outliers
outliers
## integer(0)
# check distributions of T1 RNT Data
ggplot(final_data, aes(t1rtqTotal)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "T1 RTQ Total Distribution", x= "T1 RTQ Total Score (0-50: Not True at All to Very True)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$t1rtqTotal)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 247 26.33 10.56     27   25.99 13.34  10  50    40 0.19    -0.94 0.67
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$t1rtqTotal)
mean_rtq <- descriptives$mean  # Extract mean from describe output
sd_rtq <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in t1rtqTotal
z_scores <- (final_data$t1rtqTotal - mean_rtq) / sd_rtq

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$t1rtqTotal[abs(z_scores) > 3]

# Print outliers
outliers
## integer(0)

#Descriptives ### T1 Descriptives

### T1
describe(final_data$age_years)
##    vars   n  mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 32.13 5.05     32   32.09 5.93  19  45    26 0.05    -0.28 0.32
describe(final_data$t1_wks_since_conception)
##    vars   n  mean    sd median trimmed   mad   min    max  range skew kurtosis
## X1    1 247 63.16 31.22   65.1   62.42 39.97 13.57 145.28 131.71 0.11    -1.12
##      se
## X1 1.99
describe(final_data$t1phqTotal)
##    vars   n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 7.77 5.3      7    7.34 5.93   0  24    24 0.69    -0.15 0.34
describe(final_data$t1gadTotal)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 7.28 5.02      6    6.95 4.45   0  21    21 0.53    -0.55 0.32
describe(final_data$t1cfqTotal)
##    vars   n  mean    sd median trimmed   mad min max range  skew kurtosis   se
## X1    1 247 24.02 10.04     25   24.01 11.86   7  47    40 -0.02       -1 0.64
describe(final_data$t1rtqTotal)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 247 26.33 10.56     27   25.99 13.34  10  50    40 0.19    -0.94 0.67
describe(final_data$t1ocdTotal)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 247 16.31 13.57     12   14.77 13.34   0  54    54 0.82    -0.31 0.86
describe(final_data$t1intrusionsTotal)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 247 4.87 3.31      5    4.74 4.45   0  12    12 0.26    -0.98 0.21
describe(final_data$t1_thoughts_distress_level)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 246 2.04 0.89      2       2 1.48   1   4     3  0.3    -0.94 0.06
#Calculate levels of mental health
# gad 
final_data %>% 
  dplyr::select(t1gadTotal) %>% 
  mutate(scoring = case_when(t1gadTotal <= 4 ~ "minimal anxiety",
                             t1gadTotal <= 9 ~ "mild anxiety",
                             t1gadTotal <= 14 ~ "moderate anxiety",
                             t1gadTotal <= 21 ~ "severe anxiety")) %>% 
  tabyl(scoring)
##           scoring  n   percent
##      mild anxiety 77 0.3117409
##   minimal anxiety 90 0.3643725
##  moderate anxiety 55 0.2226721
##    severe anxiety 25 0.1012146
# phq 
final_data %>% 
dplyr::select(t1phqTotal) %>% 
  mutate(scoring = case_when(t1phqTotal <= 4 ~ "none/minimal depression",
                             t1phqTotal <= 9 ~ "mild depression",
                             t1phqTotal <= 14 ~ "moderate depression",
                             t1phqTotal <= 19 ~ "moderately severe depression",
                             t1phqTotal <= 27 ~ "severe depression")) %>% 
  tabyl(scoring)
##                       scoring  n    percent
##               mild depression 73 0.29554656
##           moderate depression 57 0.23076923
##  moderately severe depression 24 0.09716599
##       none/minimal depression 86 0.34817814
##             severe depression  7 0.02834008
# rtq
final_data %>% 
dplyr::select(t1rtqTotal) %>% 
  mutate(scoring = ifelse(t1rtqTotal < 32, "non-clinical", "clinical")) %>% 
  tabyl(scoring)
##       scoring   n   percent
##      clinical  77 0.3117409
##  non-clinical 170 0.6882591
# ocd 
final_data %>% 
  dplyr::select(t1ocdTotal) %>% 
  mutate(scoring = case_when(t1ocdTotal <= 15 ~ "mild",
                             t1ocdTotal <= 27 ~ "moderate",
                             t1ocdTotal <= 72 ~ "severe")) %>% 
  tabyl(scoring)
##   scoring   n   percent
##      mild 143 0.5789474
##  moderate  51 0.2064777
##    severe  53 0.2145749
tabyl(final_data$gender_identity)
##  final_data$gender_identity   n     percent
##                      Female 246 0.995951417
##                        Male   1 0.004048583
tabyl(final_data$ethnicity)
##  final_data$ethnicity   n     percent
##                 Asian  22 0.089068826
##                 Black  35 0.141700405
##              Hispanic   8 0.032388664
##                 Mixed  10 0.040485830
##     Prefer not to say   1 0.004048583
##                 White 167 0.676113360
##               __other   4 0.016194332
tabyl(final_data$resident_country)
##  final_data$resident_country   n     percent
##                    Australia  14 0.056680162
##                       Canada  20 0.080971660
##                      Germany   4 0.016194332
##                  Netherlands   8 0.032388664
##                  New Zealand   2 0.008097166
##                       Sweden   1 0.004048583
##               United Kingdom 125 0.506072874
##     United States of America  73 0.295546559
tabyl(final_data$level_of_education)
##     final_data$level_of_education   n   percent
##                       High School  36 0.1457490
##  Professional/vocational training  25 0.1012146
##                University/college 186 0.7530364
tabyl(final_data$socioeconomics)
##  final_data$socioeconomics   n     percent
##            Fairly well off 123 0.497975709
##        Not at all well off   9 0.036437247
##          Not very well off  64 0.259109312
##          Prefer not to say   2 0.008097166
##            Rather well off  45 0.182186235
##              Very well off   4 0.016194332
tabyl(final_data$t1_pregnant)
##  final_data$t1_pregnant   n   percent
##                      No 172 0.6963563
##                     Yes  75 0.3036437
tabyl(final_data$t1_number_of_children)
##  final_data$t1_number_of_children   n    percent
##                                 1 107 0.43319838
##                                 2  69 0.27935223
##                                 3  32 0.12955466
##                                 4   5 0.02024291
##                                 5   4 0.01619433
##                                 6   4 0.01619433
##                              None  26 0.10526316
tabyl(final_data$t1_birth_complications)
##  final_data$t1_birth_complications   n     percent valid_percent
##                                 No 118 0.477732794   0.533936652
##                  Prefer not to say   2 0.008097166   0.009049774
##                                Yes 101 0.408906883   0.457013575
##                               <NA>  26 0.105263158            NA
tabyl(final_data$t1_mental_health_diagnosis)
##  final_data$t1_mental_health_diagnosis   n   percent
##                                      0 165 0.6680162
##                                      1  82 0.3319838
tabyl(final_data$t1_anxiety_diagnosis)
##  final_data$t1_anxiety_diagnosis   n    percent valid_percent
##                                0  19 0.07692308     0.2317073
##                                1  63 0.25506073     0.7682927
##                               NA 165 0.66801619            NA
tabyl(final_data$t1_bipolar_diagnosis)
##  final_data$t1_bipolar_diagnosis   n    percent valid_percent
##                                0  77 0.31174089    0.93902439
##                                1   5 0.02024291    0.06097561
##                               NA 165 0.66801619            NA
tabyl(final_data$t1_depression_diagnosis)
##  final_data$t1_depression_diagnosis   n   percent valid_percent
##                                   0  25 0.1012146      0.304878
##                                   1  57 0.2307692      0.695122
##                                  NA 165 0.6680162            NA
tabyl(final_data$t1_eating_disorder_diagnosis)
##  final_data$t1_eating_disorder_diagnosis   n   percent valid_percent
##                                        0  70 0.2834008     0.8536585
##                                        1  12 0.0485830     0.1463415
##                                       NA 165 0.6680162            NA
tabyl(final_data$t1_ocd_diagnosis)
##  final_data$t1_ocd_diagnosis   n    percent valid_percent
##                            0  77 0.31174089    0.93902439
##                            1   5 0.02024291    0.06097561
##                           NA 165 0.66801619            NA
tabyl(final_data$t1_ptsd_diagnosis)
##  final_data$t1_ptsd_diagnosis   n    percent valid_percent
##                             0  68 0.27530364     0.8292683
##                             1  14 0.05668016     0.1707317
##                            NA 165 0.66801619            NA
tabyl(final_data$t1_schizophrenia_diagnosis)
##  final_data$t1_schizophrenia_diagnosis   n   percent valid_percent
##                                      0  82 0.3319838             1
##                                     NA 165 0.6680162            NA
tabyl(final_data$t1_prefer_not_to_say_diagnosis)
##  final_data$t1_prefer_not_to_say_diagnosis   n     percent valid_percent
##                                          0  81 0.327935223    0.98780488
##                                          1   1 0.004048583    0.01219512
##                                         NA 165 0.668016194            NA
tabyl(final_data$t1_other_diagnosis)
##  final_data$t1_other_diagnosis   n    percent valid_percent
##                              0  78 0.31578947    0.95121951
##                              1   4 0.01619433    0.04878049
##                             NA 165 0.66801619            NA
tabyl(final_data$t1_other_type_diagnosis)
##     final_data$t1_other_type_diagnosis   n     percent valid_percent
##                                    BPD   1 0.004048583          0.25
##        Borderline Personality Disorder   1 0.004048583          0.25
##  Borderline Personality Disorder, ADHD   1 0.004048583          0.25
##                                  grief   1 0.004048583          0.25
##                                   <NA> 243 0.983805668            NA
tabyl(final_data$t1_current_anxiety_disorder)
##  final_data$t1_current_anxiety_disorder   n   percent valid_percent
##                                       0  31 0.1255061     0.3780488
##                                       1  51 0.2064777     0.6219512
##                                      NA 165 0.6680162            NA
tabyl(final_data$t1_current_bipolar_disorder)
##  final_data$t1_current_bipolar_disorder   n    percent valid_percent
##                                       0  79 0.31983806    0.96341463
##                                       1   3 0.01214575    0.03658537
##                                      NA 165 0.66801619            NA
tabyl(final_data$t1_current_depression_disorder)
##  final_data$t1_current_depression_disorder   n   percent valid_percent
##                                          0  49 0.1983806      0.597561
##                                          1  33 0.1336032      0.402439
##                                         NA 165 0.6680162            NA
tabyl(final_data$t1_current_eating_disorder)
##  final_data$t1_current_eating_disorder   n    percent valid_percent
##                                      0  77 0.31174089    0.93902439
##                                      1   5 0.02024291    0.06097561
##                                     NA 165 0.66801619            NA
tabyl(final_data$t1_current_ocd_disorder)
##  final_data$t1_current_ocd_disorder   n   percent valid_percent
##                                   0  76 0.3076923    0.92682927
##                                   1   6 0.0242915    0.07317073
##                                  NA 165 0.6680162            NA
tabyl(final_data$t1_current_ptsd_disorder)
##  final_data$t1_current_ptsd_disorder   n    percent valid_percent
##                                    0  73 0.29554656     0.8902439
##                                    1   9 0.03643725     0.1097561
##                                   NA 165 0.66801619            NA
tabyl(final_data$t1_current_schizophrenia_disorder)
##  final_data$t1_current_schizophrenia_disorder   n   percent valid_percent
##                                             0  82 0.3319838             1
##                                            NA 165 0.6680162            NA
tabyl(final_data$t1_no_current_disorder)
##  final_data$t1_no_current_disorder   n    percent valid_percent
##                                  0  61 0.24696356     0.7439024
##                                  1  21 0.08502024     0.2560976
##                                 NA 165 0.66801619            NA
tabyl(final_data$t1_current_disorder_prefer_not_to_say)
##  final_data$t1_current_disorder_prefer_not_to_say   n   percent valid_percent
##                                                 0  82 0.3319838             1
##                                                NA 165 0.6680162            NA
tabyl(final_data$t1_other_current_disorder)
##  final_data$t1_other_current_disorder   n    percent valid_percent
##                                     0  78 0.31578947    0.95121951
##                                     1   4 0.01619433    0.04878049
##                                    NA 165 0.66801619            NA
tabyl(final_data$t1_other_current_type_disorder)
##  final_data$t1_other_current_type_disorder   n     percent valid_percent
##                                        BPD   1 0.004048583          0.25
##            Borderline Personality Disorder   1 0.004048583          0.25
##      Borderline Personality Disorder, ADHD   1 0.004048583          0.25
##                                      grief   1 0.004048583          0.25
##                                       <NA> 243 0.983805668            NA
tabyl(final_data$t1_neurodevelopmental_neurological_disorder)
##  final_data$t1_neurodevelopmental_neurological_disorder   n     percent
##                                                       0 228 0.923076923
##                                                       1  17 0.068825911
##                                                      NA   2 0.008097166
##  valid_percent
##     0.93061224
##     0.06938776
##             NA
tabyl(final_data$t1_adhd_disorder)
##  final_data$t1_adhd_disorder   n    percent valid_percent
##                            0   4 0.01619433     0.2352941
##                            1  13 0.05263158     0.7647059
##                           NA 230 0.93117409            NA
tabyl(final_data$t1_autism_spectrum_disorder)
##  final_data$t1_autism_spectrum_disorder   n    percent valid_percent
##                                       0  12 0.04858300     0.7058824
##                                       1   5 0.02024291     0.2941176
##                                      NA 230 0.93117409            NA
tabyl(final_data$t1_asperger_syndrome_disorder)
##  final_data$t1_asperger_syndrome_disorder   n    percent valid_percent
##                                         0  17 0.06882591             1
##                                        NA 230 0.93117409            NA
tabyl(final_data$t1_epilepsy)
##  final_data$t1_epilepsy   n    percent valid_percent
##                       0  17 0.06882591             1
##                      NA 230 0.93117409            NA
tabyl(final_data$t1_seizures)
##  final_data$t1_seizures   n    percent valid_percent
##                       0  17 0.06882591             1
##                      NA 230 0.93117409            NA
tabyl(final_data$t1_dyslexia_reading_disorder_)
##  final_data$t1_dyslexia_reading_disorder_   n     percent valid_percent
##                                         0  16 0.064777328    0.94117647
##                                         1   1 0.004048583    0.05882353
##                                        NA 230 0.931174089            NA
tabyl(final_data$t1_dysgraphia_writing_disorder)
##  final_data$t1_dysgraphia_writing_disorder   n    percent valid_percent
##                                          0  17 0.06882591             1
##                                         NA 230 0.93117409            NA
tabyl(final_data$t1_dyscalculia_calculation_disorder)
##  final_data$t1_dyscalculia_calculation_disorder   n     percent valid_percent
##                                               0  16 0.064777328    0.94117647
##                                               1   1 0.004048583    0.05882353
##                                              NA 230 0.931174089            NA
tabyl(final_data$t1_prefer_not_to_say)
##  final_data$t1_prefer_not_to_say   n    percent valid_percent
##                                0  17 0.06882591             1
##                               NA 230 0.93117409            NA
tabyl(final_data$t1_other_neuro_disorder)
##  final_data$t1_other_neuro_disorder   n     percent valid_percent
##                                   0  16 0.064777328    0.94117647
##                                   1   1 0.004048583    0.05882353
##                                  NA 230 0.931174089            NA
tabyl(final_data$t1_other_type_neuro_disorder)
##  final_data$t1_other_type_neuro_disorder   n     percent valid_percent
##                                Dispraxia   1 0.004048583             1
##                                     <NA> 246 0.995951417            NA

T2 Descriptives

t2_data <- final_data %>% 
  dplyr::select(c(Prolific_ID, completed_t2, starts_with(c("t2_", "birth_since")))) %>% 
  filter(completed_t2 != is.na(TRUE), 
         t2_pregnancy_child_loss != "Yes")
describe(t2_data$t2_phq_total)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 206 7.07 4.84      6    6.65 4.45   0  24    24 0.85     0.42 0.34
describe(t2_data$t2_gad_total)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 206 6.83 4.75      6    6.43 4.45   0  20    20 0.64    -0.23 0.33
describe(t2_data$t2_cfq_total)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis  se
## X1    1 206 23.27 10.05     24   23.08 10.38   7  49    42 0.08    -0.68 0.7
describe(t2_data$t2_rtq_total)
##    vars   n  mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 206 25.13 9.75     24   24.57 8.9  10  50    40 0.48    -0.42 0.68
describe(t2_data$t2_ocd_total)
##    vars   n  mean    sd median trimmed   mad min max range skew kurtosis   se
## X1    1 206 14.22 11.84     12   12.83 11.86   0  52    52 0.92     0.18 0.83
describe(t2_data$t2_intrusions_total)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 206 4.36 3.26      4    4.12 2.97   0  12    12 0.55    -0.47 0.23
describe(t2_data$t2_thoughts_distress_level)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 206    2 0.97      2    1.92 1.48   1   5     4 0.57    -0.47 0.07
#Calculate levels of mental health
# gad 
t2_data %>% 
  dplyr::select(t2_gad_total) %>% 
  mutate(scoring = case_when(t2_gad_total <= 4 ~ "minimal anxiety",
                             t2_gad_total <= 9 ~ "mild anxiety",
                             t2_gad_total <= 14 ~ "moderate anxiety",
                             t2_gad_total <= 21 ~ "severe anxiety")) %>% 
  tabyl(scoring)
##           scoring  n    percent
##      mild anxiety 67 0.32524272
##   minimal anxiety 80 0.38834951
##  moderate anxiety 42 0.20388350
##    severe anxiety 17 0.08252427
# phq 
t2_data %>% 
  dplyr::select(t2_phq_total) %>% 
  mutate(scoring = case_when(t2_phq_total <= 4 ~ "none/minimal depression",
                             t2_phq_total <= 9 ~ "mild depression",
                             t2_phq_total <= 14 ~ "moderate depression",
                             t2_phq_total <= 19 ~ "moderately severe depression",
                             t2_phq_total <= 27 ~ "severe depression")) %>% 
  tabyl(scoring)
##                       scoring  n    percent
##               mild depression 72 0.34951456
##           moderate depression 40 0.19417476
##  moderately severe depression 15 0.07281553
##       none/minimal depression 76 0.36893204
##             severe depression  3 0.01456311
# rtq
t2_data %>% 
dplyr::select(t2_rtq_total) %>% 
  mutate(scoring = ifelse(t2_rtq_total < 32, "non-clinical", "clinical")) %>% 
  tabyl(scoring)
##       scoring   n   percent
##      clinical  47 0.2281553
##  non-clinical 159 0.7718447
# ocd 
t2_data %>% 
 dplyr::select(t2_ocd_total) %>% 
  mutate(scoring = case_when(t2_ocd_total <= 15 ~ "mild",
                             t2_ocd_total <= 27 ~ "moderate",
                             t2_ocd_total <= 72 ~ "severe")) %>% 
  tabyl(scoring)
##   scoring   n   percent
##      mild 127 0.6165049
##  moderate  48 0.2330097
##    severe  31 0.1504854
tabyl(final_data$t2_pregnancy_child_loss)
##  final_data$t2_pregnancy_child_loss   n    percent valid_percent
##                                  No 206 0.83400810    0.94930876
##                                 Yes  11 0.04453441    0.05069124
##                                <NA>  30 0.12145749            NA
tabyl(final_data$completed_t2)
##  final_data$completed_t2   n    percent valid_percent
##                 complete 206 0.83400810    0.94930876
##                 rejected  11 0.04453441    0.05069124
##                     <NA>  30 0.12145749            NA
tabyl(t2_data$t2_pregnant)
##  t2_data$t2_pregnant   n   percent
##                   No 154 0.7475728
##                  Yes  52 0.2524272
tabyl(t2_data$t2_number_of_pregnancies)
##  t2_data$t2_number_of_pregnancies   n     percent valid_percent
##                                 1  19 0.092233010    0.36538462
##                                 2  15 0.072815534    0.28846154
##                                 3  13 0.063106796    0.25000000
##                                 4   1 0.004854369    0.01923077
##                                 5   2 0.009708738    0.03846154
##                                 7   1 0.004854369    0.01923077
##                                10   1 0.004854369    0.01923077
##                                NA 154 0.747572816            NA
tabyl(t2_data$birth_since_t1)
##  t2_data$birth_since_t1   n    percent
##                          52 0.25242718
##                      No 146 0.70873786
##                     Yes   8 0.03883495
tabyl(t2_data$t2_new_mental_health_diagnosis_last_month)
##  t2_data$t2_new_mental_health_diagnosis_last_month   n     percent
##                                                  0 202 0.980582524
##                                                  1   3 0.014563107
##                                                 NA   1 0.004854369
##  valid_percent
##     0.98536585
##     0.01463415
##             NA
tabyl(t2_data$t2_new_anxiety_diagnosis)
##  t2_data$t2_new_anxiety_diagnosis   n     percent valid_percent
##                                 0   2 0.009708738     0.6666667
##                                 1   1 0.004854369     0.3333333
##                                NA 203 0.985436893            NA
tabyl(t2_data$t2_new_bipolar_diagnosis)
##  t2_data$t2_new_bipolar_diagnosis   n     percent valid_percent
##                                 0   2 0.009708738     0.6666667
##                                 1   1 0.004854369     0.3333333
##                                NA 203 0.985436893            NA
tabyl(t2_data$t2_new_depression_diagnosis)
##  t2_data$t2_new_depression_diagnosis   n     percent valid_percent
##                                    0   2 0.009708738     0.6666667
##                                    1   1 0.004854369     0.3333333
##                                   NA 203 0.985436893            NA
tabyl(t2_data$t2_new_eating_disorder_diagnosis)
##  t2_data$t2_new_eating_disorder_diagnosis   n    percent valid_percent
##                                         0   3 0.01456311             1
##                                        NA 203 0.98543689            NA
tabyl(t2_data$t2_new_ocd_diagnosis)
##  t2_data$t2_new_ocd_diagnosis   n     percent valid_percent
##                             0   2 0.009708738     0.6666667
##                             1   1 0.004854369     0.3333333
##                            NA 203 0.985436893            NA
tabyl(t2_data$t2_new_other_diagnosis)
##  t2_data$t2_new_other_diagnosis   n     percent valid_percent
##                               0   2 0.009708738     0.6666667
##                               1   1 0.004854369     0.3333333
##                              NA 203 0.985436893            NA
tabyl(t2_data$t2_new_other_type_diagnosis)
##  t2_data$t2_new_other_type_diagnosis   n     percent
##                                      205 0.995145631
##                Postpartum depression   1 0.004854369
tabyl(t2_data$t2_current_anxiety_disorder)
##  t2_data$t2_current_anxiety_disorder   n    percent valid_percent
##                                    1   3 0.01456311             1
##                                   NA 203 0.98543689            NA
tabyl(t2_data$t2_current_bipolar_disorder)
##  t2_data$t2_current_bipolar_disorder   n     percent valid_percent
##                                    0   2 0.009708738     0.6666667
##                                    1   1 0.004854369     0.3333333
##                                   NA 203 0.985436893            NA
tabyl(t2_data$t2_current_depression_disorder)
##  t2_data$t2_current_depression_disorder   n    percent valid_percent
##                                       1   3 0.01456311             1
##                                      NA 203 0.98543689            NA
tabyl(t2_data$t2_current_eating_disorder)
##  t2_data$t2_current_eating_disorder   n     percent valid_percent
##                                   0   2 0.009708738     0.6666667
##                                   1   1 0.004854369     0.3333333
##                                  NA 203 0.985436893            NA
tabyl(t2_data$t2_current_ocd_disorder)
##  t2_data$t2_current_ocd_disorder   n     percent valid_percent
##                                0   1 0.004854369     0.3333333
##                                1   2 0.009708738     0.6666667
##                               NA 203 0.985436893            NA
tabyl(t2_data$t2_current_ptsd_disorder)
##  t2_data$t2_current_ptsd_disorder   n    percent valid_percent
##                                 1   3 0.01456311             1
##                                NA 203 0.98543689            NA
tabyl(t2_data$t2_current_schizophrenia_disorder)
##  t2_data$t2_current_schizophrenia_disorder   n    percent valid_percent
##                                          0   3 0.01456311             1
##                                         NA 203 0.98543689            NA
tabyl(t2_data$t2_current_disorder_prefer_not_to_say)
##  t2_data$t2_current_disorder_prefer_not_to_say   n    percent valid_percent
##                                              0   3 0.01456311             1
##                                             NA 203 0.98543689            NA
tabyl(t2_data$t2_other_current_disorder)
##  t2_data$t2_other_current_disorder   n     percent valid_percent
##                                  0   2 0.009708738     0.6666667
##                                  1   1 0.004854369     0.3333333
##                                 NA 203 0.985436893            NA
tabyl(t2_data$t2_other_current_type_disorder)
##  t2_data$t2_other_current_type_disorder   n     percent
##                                         205 0.995145631
##                                BPD, PPD   1 0.004854369

#Internal Consistency Checks for Measures

#T1
phq_items <- dplyr::select(final_data, starts_with("t1_phq_"))
gad_items <- dplyr::select(final_data, starts_with("t1_gad_"))
cfq_items <- dplyr::select(final_data, starts_with("t1_cfq_"))
rtq_items <- dplyr::select(final_data, starts_with("t1_rtq_"))
ocd_items <- dplyr::select(final_data, c(starts_with("t1_ocd_"), -t1_ocd_diagnosis))
pnd_items <- dplyr::select(final_data, starts_with("t1_pnd_ocd"))

omega(phq_items)
## Loading required namespace: GPArotation

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.84 
## G.6:                   0.84 
## Omega Hierarchical:    0.7 
## Omega H asymptotic:    0.8 
## Omega Total            0.88 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t1_phq_1 0.67  0.34             0.58 0.58 0.42 0.77 1.56
## t1_phq_2 0.73  0.50             0.79 0.79 0.21 0.68 1.77
## t1_phq_3 0.50              0.26 0.35 0.35 0.65 0.71 1.81
## t1_phq_4 0.46              0.65 0.63 0.63 0.37 0.34 1.82
## t1_phq_5 0.57        0.28  0.28 0.48 0.48 0.52 0.67 1.97
## t1_phq_6 0.67  0.32             0.57 0.57 0.43 0.78 1.55
## t1_phq_7 0.50        0.29       0.36 0.36 0.64 0.69 1.86
## t1_phq_8 0.54        0.43       0.48 0.48 0.52 0.60 1.95
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 2.75 0.50 0.37 0.60 2.39 
## 
## general/max  1.15   max/min =   6.39
## mean percent general =  0.66    with sd =  0.14 and cv of  0.21 
## Explained Common Variance of the general factor =  0.65 
## 
## The degrees of freedom are 7  and the fit is  0.03 
## The number of observations was  247  with Chi Square =  7.04  with prob <  0.42
## The root mean square of the residuals is  0.02 
## The df corrected root mean square of the residuals is  0.04
## RMSEA index =  0.002  and the 10 % confidence intervals are  0 0.079
## BIC =  -31.53
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 20  and the fit is  0.35 
## The number of observations was  247  with Chi Square =  83.98  with prob <  8.2e-10
## The root mean square of the residuals is  0.09 
## The df corrected root mean square of the residuals is  0.11 
## 
## RMSEA index =  0.114  and the 10 % confidence intervals are  0.089 0.14
## BIC =  -26.21 
## 
## Measures of factor score adequacy             
##                                                  g   F1*   F2*  F3*
## Correlation of scores with factors            0.85  0.58  0.56 0.72
## Multiple R square of scores with factors      0.73  0.34  0.32 0.53
## Minimum correlation of factor score estimates 0.46 -0.32 -0.36 0.05
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.88 0.84 0.57 0.68
## Omega general for total scores and subscales  0.70 0.64 0.39 0.43
## Omega group for total scores and subscales    0.11 0.20 0.19 0.26
omega(gad_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.88 
## G.6:                   0.87 
## Omega Hierarchical:    0.73 
## Omega H asymptotic:    0.8 
## Omega Total            0.92 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t1_gad_1 0.68  0.43             0.66 0.66 0.34 0.71 1.72
## t1_gad_2 0.72  0.51             0.78 0.78 0.22 0.67 1.82
## t1_gad_3 0.70  0.51             0.75 0.75 0.25 0.66 1.82
## t1_gad_4 0.61        0.35       0.53 0.53 0.47 0.70 1.82
## t1_gad_5 0.58        0.59       0.68 0.68 0.32 0.49 2.00
## t1_gad_6 0.54                   0.37 0.37 0.63 0.79 1.57
## t1_gad_7 0.70              0.71 1.00 1.00 0.00 0.49 2.00
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 2.96 0.76 0.51 0.53 3.48 
## 
## general/max  0.85   max/min =   6.77
## mean percent general =  0.64    with sd =  0.11 and cv of  0.18 
## Explained Common Variance of the general factor =  0.62 
## 
## The degrees of freedom are 3  and the fit is  0.02 
## The number of observations was  247  with Chi Square =  4.37  with prob <  0.22
## The root mean square of the residuals is  0.01 
## The df corrected root mean square of the residuals is  0.03
## RMSEA index =  0.043  and the 10 % confidence intervals are  0 0.123
## BIC =  -12.16
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 14  and the fit is  0.57 
## The number of observations was  247  with Chi Square =  139.14  with prob <  1.1e-22
## The root mean square of the residuals is  0.12 
## The df corrected root mean square of the residuals is  0.14 
## 
## RMSEA index =  0.19  and the 10 % confidence intervals are  0.163 0.22
## BIC =  62.01 
## 
## Measures of factor score adequacy             
##                                                  g   F1*  F2*  F3*
## Correlation of scores with factors            0.87  0.68 0.71 0.87
## Multiple R square of scores with factors      0.75  0.46 0.50 0.76
## Minimum correlation of factor score estimates 0.51 -0.08 0.00 0.52
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.92 0.89 0.73 1.00
## Omega general for total scores and subscales  0.73 0.61 0.51 0.49
## Omega group for total scores and subscales    0.14 0.29 0.22 0.51
omega(cfq_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.95 
## G.6:                   0.94 
## Omega Hierarchical:    0.9 
## Omega H asymptotic:    0.93 
## Omega Total            0.96 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t1_cfq_1 0.81        0.30       0.75 0.75 0.25 0.88 1.27
## t1_cfq_2 0.77        0.34       0.72 0.72 0.28 0.83 1.38
## t1_cfq_3 0.78              0.62 1.00 1.00 0.00 0.62 1.89
## t1_cfq_4 0.90                   0.86 0.86 0.14 0.94 1.14
## t1_cfq_5 0.82  0.32             0.77 0.77 0.23 0.86 1.31
## t1_cfq_6 0.88  0.25             0.83 0.83 0.17 0.92 1.17
## t1_cfq_7 0.83  0.21             0.74 0.74 0.26 0.93 1.16
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 4.81 0.25 0.23 0.40 4.66 
## 
## general/max  1.03   max/min =   20.57
## mean percent general =  0.85    with sd =  0.11 and cv of  0.13 
## Explained Common Variance of the general factor =  0.85 
## 
## The degrees of freedom are 3  and the fit is  0.01 
## The number of observations was  247  with Chi Square =  3.11  with prob <  0.38
## The root mean square of the residuals is  0.01 
## The df corrected root mean square of the residuals is  0.01
## RMSEA index =  0.011  and the 10 % confidence intervals are  0 0.109
## BIC =  -13.42
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 14  and the fit is  0.25 
## The number of observations was  247  with Chi Square =  60.87  with prob <  8.3e-08
## The root mean square of the residuals is  0.05 
## The df corrected root mean square of the residuals is  0.06 
## 
## RMSEA index =  0.116  and the 10 % confidence intervals are  0.088 0.147
## BIC =  -16.26 
## 
## Measures of factor score adequacy             
##                                                  g   F1*   F2*  F3*
## Correlation of scores with factors            0.95  0.51  0.56 0.91
## Multiple R square of scores with factors      0.90  0.26  0.32 0.83
## Minimum correlation of factor score estimates 0.81 -0.48 -0.36 0.67
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.96 0.94 0.85 1.00
## Omega general for total scores and subscales  0.90 0.87 0.73 0.62
## Omega group for total scores and subscales    0.05 0.07 0.12 0.38
omega(rtq_items)
## Warning in fa.stats(r = r, f = f, phi = phi, n.obs = n.obs, np.obs = np.obs, :
## The estimated weights for the factor scores are probably incorrect.  Try a
## different factor score estimation method.
## Warning in fac(r = r, nfactors = nfactors, n.obs = n.obs, rotate = rotate, : An
## ultra-Heywood case was detected.  Examine the results carefully
## Warning in cov2cor(t(w) %*% r %*% w): diag(V) had non-positive or NA entries;
## the non-finite result may be dubious

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.95 
## G.6:                   0.96 
## Omega Hierarchical:    0.85 
## Omega H asymptotic:    0.88 
## Omega Total            0.96 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##              g   F1* F2*   F3*   h2   h2   u2   p2  com
## t1_rtq_1  0.61  0.49           0.60 0.60 0.40 0.61 1.91
## t1_rtq_2  0.69  0.55           0.79 0.79 0.21 0.60 1.93
## t1_rtq_3  0.58  0.39           0.51 0.51 0.49 0.67 1.96
## t1_rtq_4  0.72  0.45           0.73 0.73 0.27 0.72 1.72
## t1_rtq_5  0.79            0.38 0.81 0.81 0.19 0.77 1.58
## t1_rtq_6  0.78  0.26      0.21 0.72 0.72 0.28 0.85 1.36
## t1_rtq_7  0.81  0.27           0.75 0.75 0.25 0.88 1.27
## t1_rtq_8  0.93                 0.85 0.85 0.15 1.02 1.02
## t1_rtq_9  0.93                 0.85 0.85 0.15 1.02 1.00
## t1_rtq_10 0.86                 0.75 0.75 0.25 0.97 1.09
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 6.07 1.09 0.00 0.27 5.53 
## 
## general/max  1.1   max/min =   Inf
## mean percent general =  0.81    with sd =  0.16 and cv of  0.2 
## Explained Common Variance of the general factor =  0.82 
## 
## The degrees of freedom are 18  and the fit is  0.2 
## The number of observations was  247  with Chi Square =  46.92  with prob <  0.00022
## The root mean square of the residuals is  0.02 
## The df corrected root mean square of the residuals is  0.03
## RMSEA index =  0.081  and the 10 % confidence intervals are  0.053 0.11
## BIC =  -52.24
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 35  and the fit is  1.17 
## The number of observations was  247  with Chi Square =  281.36  with prob <  3e-40
## The root mean square of the residuals is  0.11 
## The df corrected root mean square of the residuals is  0.12 
## 
## RMSEA index =  0.169  and the 10 % confidence intervals are  0.151 0.188
## BIC =  88.53 
## 
## Measures of factor score adequacy             
##                                                  g  F1* F2*  F3*
## Correlation of scores with factors            0.98 0.88   0 0.72
## Multiple R square of scores with factors      0.96 0.77   0 0.52
## Minimum correlation of factor score estimates 0.92 0.53  -1 0.04
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1* F2*  F3*
## Omega total for total scores and subscales    0.96 0.93  NA 0.93
## Omega general for total scores and subscales  0.85 0.74  NA 0.91
## Omega group for total scores and subscales    0.10 0.19  NA 0.03
omega(ocd_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.93 
## G.6:                   0.95 
## Omega Hierarchical:    0.72 
## Omega H asymptotic:    0.76 
## Omega Total            0.94 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##              g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t1_ocd_1  0.54  0.39             0.47 0.47 0.53 0.62 1.99
## t1_ocd_2  0.62  0.27  0.22       0.52 0.52 0.48 0.74 1.73
## t1_ocd_3  0.70              0.55 0.79 0.79 0.21 0.62 1.89
## t1_ocd_4  0.56        0.24       0.41 0.41 0.59 0.75 1.70
## t1_ocd_5  0.60        0.25       0.47 0.47 0.53 0.77 1.64
## t1_ocd_6  0.58  0.59             0.68 0.68 0.32 0.49 2.01
## t1_ocd_7  0.46  0.34             0.34 0.34 0.66 0.63 1.95
## t1_ocd_8  0.56        0.62       0.70 0.70 0.30 0.45 1.99
## t1_ocd_9  0.67              0.48 0.68 0.68 0.32 0.66 1.84
## t1_ocd_10 0.47        0.28       0.32 0.32 0.68 0.68 1.90
## t1_ocd_11 0.66        0.33       0.58 0.58 0.42 0.74 1.70
## t1_ocd_12 0.55  0.65             0.73 0.73 0.27 0.42 1.96
## t1_ocd_13 0.44  0.28             0.28 0.28 0.72 0.68 1.85
## t1_ocd_14 0.50        0.59       0.60 0.60 0.40 0.42 1.97
## t1_ocd_15 0.67              0.51 0.72 0.72 0.28 0.62 1.91
## t1_ocd_16 0.48  0.30             0.33 0.33 0.67 0.69 1.84
## t1_ocd_17 0.59        0.47       0.58 0.58 0.42 0.60 1.96
## t1_ocd_18 0.53  0.57             0.61 0.61 0.39 0.46 1.99
## 
## With Sums of squares  of:
##   g F1* F2* F3*  h2 
## 5.9 1.7 1.4 0.9 5.8 
## 
## general/max  1.01   max/min =   6.45
## mean percent general =  0.61    with sd =  0.12 and cv of  0.19 
## Explained Common Variance of the general factor =  0.6 
## 
## The degrees of freedom are 102  and the fit is  2.1 
## The number of observations was  247  with Chi Square =  497.34  with prob <  2.5e-53
## The root mean square of the residuals is  0.06 
## The df corrected root mean square of the residuals is  0.07
## RMSEA index =  0.125  and the 10 % confidence intervals are  0.115 0.137
## BIC =  -64.62
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 135  and the fit is  4.48 
## The number of observations was  247  with Chi Square =  1068.65  with prob <  5.7e-145
## The root mean square of the residuals is  0.14 
## The df corrected root mean square of the residuals is  0.15 
## 
## RMSEA index =  0.167  and the 10 % confidence intervals are  0.158 0.177
## BIC =  324.88 
## 
## Measures of factor score adequacy             
##                                                  g  F1*  F2*   F3*
## Correlation of scores with factors            0.86 0.80 0.78  0.70
## Multiple R square of scores with factors      0.75 0.64 0.61  0.49
## Minimum correlation of factor score estimates 0.49 0.29 0.23 -0.01
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.94 0.86 0.85 0.88
## Omega general for total scores and subscales  0.72 0.52 0.57 0.57
## Omega group for total scores and subscales    0.15 0.34 0.28 0.32
omega(pnd_items)
## Warning in GPFoblq(A, Tmat = Tmat, normalize = normalize, eps = eps, maxit =
## maxit, : convergence not obtained in GPFoblq. 1000 iterations used.

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.82 
## G.6:                   0.8 
## Omega Hierarchical:    0.5 
## Omega H asymptotic:    0.59 
## Omega Total            0.85 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##                g  F1*   F2*   F3*   h2   h2   u2   p2  com
## t1_pnd_ocd1 0.63 0.59             0.76 0.76 0.24 0.53 2.05
## t1_pnd_ocd2 0.65 0.57             0.76 0.76 0.24 0.55 2.05
## t1_pnd_ocd3 0.40 0.27  0.21       0.28 0.28 0.72 0.58 2.35
## t1_pnd_ocd4 0.59 0.45             0.60 0.60 0.40 0.59 2.12
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 1.34 0.95 0.07 0.04 1.59 
## 
## general/max  0.84   max/min =   37.01
## mean percent general =  0.56    with sd =  0.03 and cv of  0.05 
## Explained Common Variance of the general factor =  0.56 
## 
## The degrees of freedom are -3  and the fit is  0 
## The number of observations was  247  with Chi Square =  0  with prob <  NA
## The root mean square of the residuals is  0 
## The df corrected root mean square of the residuals is  NA
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 2  and the fit is  0.4 
## The number of observations was  247  with Chi Square =  98.1  with prob <  5e-22
## The root mean square of the residuals is  0.23 
## The df corrected root mean square of the residuals is  0.39 
## 
## RMSEA index =  0.441  and the 10 % confidence intervals are  0.37 0.519
## BIC =  87.08 
## 
## Measures of factor score adequacy             
##                                                  g   F1*   F2*   F3*
## Correlation of scores with factors            0.71  0.62  0.35  0.33
## Multiple R square of scores with factors      0.51  0.39  0.12  0.11
## Minimum correlation of factor score estimates 0.02 -0.22 -0.76 -0.78
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1* F2* F3*
## Omega total for total scores and subscales    0.85 0.84  NA  NA
## Omega general for total scores and subscales  0.50 0.50  NA  NA
## Omega group for total scores and subscales    0.34 0.34  NA  NA
# T2
t2_phq_items <- dplyr::select(final_data, c(starts_with("t2_phq_")), -t2_phq_total)
t2_gad_items <- dplyr::select(final_data, c(starts_with("t2_gad_")), -t2_gad_total)
t2_cfq_items <- dplyr::select(final_data, c(starts_with("t2_cfq_"), -t2_cfq_total))
t2_rtq_items <- dplyr::select(final_data, c(starts_with("t2_rtq_"), -t2_rtq_total))
t2_ocd_items <- dplyr::select(final_data, c(starts_with("t2_ocd_"), -t2_ocd_total))
t2_pnd_items <- dplyr::select(final_data, starts_with("t2_pnd_ocd"))

omega(t2_phq_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.84 
## G.6:                   0.84 
## Omega Hierarchical:    0.7 
## Omega H asymptotic:    0.79 
## Omega Total            0.88 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t2_phq_1 0.70  0.24             0.57 0.57 0.43 0.86 1.34
## t2_phq_2 0.79  0.36             0.76 0.76 0.24 0.83 1.40
## t2_phq_3 0.42        0.36  0.23 0.36 0.36 0.64 0.49 2.54
## t2_phq_4 0.47        0.49       0.47 0.47 0.53 0.46 2.09
## t2_phq_5 0.50        0.38       0.39 0.39 0.61 0.63 1.90
## t2_phq_6 0.63  0.20             0.46 0.46 0.54 0.86 1.33
## t2_phq_7 0.55        0.35       0.45 0.45 0.55 0.67 1.89
## t2_phq_8 0.54              0.84 1.00 1.00 0.00 0.29 1.70
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 2.75 0.23 0.69 0.80 2.82 
## 
## general/max  0.98   max/min =   12.33
## mean percent general =  0.64    with sd =  0.21 and cv of  0.33 
## Explained Common Variance of the general factor =  0.62 
## 
## The degrees of freedom are 7  and the fit is  0.05 
## The number of observations was  247  with Chi Square =  11.55  with prob <  0.12
## The root mean square of the residuals is  0.02 
## The df corrected root mean square of the residuals is  0.04
## RMSEA index =  0.051  and the 10 % confidence intervals are  0 0.102
## BIC =  -27.01
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 20  and the fit is  0.36 
## The number of observations was  247  with Chi Square =  87.03  with prob <  2.4e-10
## The root mean square of the residuals is  0.1 
## The df corrected root mean square of the residuals is  0.12 
## 
## RMSEA index =  0.116  and the 10 % confidence intervals are  0.092 0.142
## BIC =  -23.15 
## 
## Measures of factor score adequacy             
##                                                  g   F1*   F2*  F3*
## Correlation of scores with factors            0.88  0.43  0.68 0.95
## Multiple R square of scores with factors      0.77  0.19  0.46 0.90
## Minimum correlation of factor score estimates 0.54 -0.63 -0.08 0.81
## 
##  Total, General and Subset omega for each subset
##                                                  g F1*  F2*  F3*
## Omega total for total scores and subscales    0.88 0.8 0.72 1.00
## Omega general for total scores and subscales  0.70 0.7 0.43 0.29
## Omega group for total scores and subscales    0.13 0.1 0.29 0.71
omega(t2_gad_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.88 
## G.6:                   0.88 
## Omega Hierarchical:    0.76 
## Omega H asymptotic:    0.82 
## Omega Total            0.92 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*  F2*   F3*   h2   h2   u2   p2  com
## t2_gad_1 0.75  0.22       0.23 0.66 0.66 0.34 0.85 1.37
## t2_gad_2 0.84  0.28       0.20 0.83 0.83 0.17 0.86 1.34
## t2_gad_3 0.84  0.40            0.87 0.87 0.13 0.81 1.45
## t2_gad_4 0.63       0.30       0.51 0.51 0.49 0.77 1.60
## t2_gad_5 0.49       0.73       0.77 0.77 0.23 0.32 1.76
## t2_gad_6 0.47       0.36       0.37 0.37 0.63 0.61 1.98
## t2_gad_7 0.63             0.39 0.58 0.58 0.42 0.69 1.82
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 3.23 0.31 0.77 0.26 3.20 
## 
## general/max  1.01   max/min =   12.1
## mean percent general =  0.7    with sd =  0.19 and cv of  0.27 
## Explained Common Variance of the general factor =  0.7 
## 
## The degrees of freedom are 3  and the fit is  0.01 
## The number of observations was  247  with Chi Square =  1.73  with prob <  0.63
## The root mean square of the residuals is  0.01 
## The df corrected root mean square of the residuals is  0.02
## RMSEA index =  0  and the 10 % confidence intervals are  0 0.087
## BIC =  -14.8
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 14  and the fit is  0.4 
## The number of observations was  247  with Chi Square =  97.39  with prob <  1.5e-14
## The root mean square of the residuals is  0.1 
## The df corrected root mean square of the residuals is  0.12 
## 
## RMSEA index =  0.155  and the 10 % confidence intervals are  0.127 0.185
## BIC =  20.26 
## 
## Measures of factor score adequacy             
##                                                  g   F1*  F2*   F3*
## Correlation of scores with factors            0.90  0.48 0.82  0.60
## Multiple R square of scores with factors      0.82  0.23 0.67  0.36
## Minimum correlation of factor score estimates 0.64 -0.54 0.34 -0.28
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.92 0.91 0.76 0.73
## Omega general for total scores and subscales  0.76 0.78 0.43 0.60
## Omega group for total scores and subscales    0.10 0.13 0.33 0.13
omega(t2_cfq_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.95 
## G.6:                   0.95 
## Omega Hierarchical:    0.86 
## Omega H asymptotic:    0.89 
## Omega Total            0.96 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##             g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t2_cfq_1 0.93                   0.87 0.87 0.13 0.99 1.02
## t2_cfq_2 0.81  0.23             0.72 0.72 0.28 0.91 1.19
## t2_cfq_3 0.73  0.44             0.74 0.74 0.26 0.72 1.72
## t2_cfq_4 0.84  0.32             0.81 0.81 0.19 0.87 1.28
## t2_cfq_5 0.80        0.34       0.79 0.79 0.21 0.80 1.50
## t2_cfq_6 0.83  0.42             0.88 0.88 0.12 0.79 1.50
## t2_cfq_7 0.80  0.39             0.81 0.81 0.19 0.79 1.52
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 4.73 0.72 0.17 0.01 4.54 
## 
## general/max  1.04   max/min =   337.11
## mean percent general =  0.84    with sd =  0.09 and cv of  0.11 
## Explained Common Variance of the general factor =  0.84 
## 
## The degrees of freedom are 3  and the fit is  0 
## The number of observations was  247  with Chi Square =  0.22  with prob <  0.97
## The root mean square of the residuals is  0 
## The df corrected root mean square of the residuals is  0
## RMSEA index =  0  and the 10 % confidence intervals are  0 0
## BIC =  -16.31
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 14  and the fit is  0.68 
## The number of observations was  247  with Chi Square =  165.45  with prob <  5.7e-28
## The root mean square of the residuals is  0.1 
## The df corrected root mean square of the residuals is  0.12 
## 
## RMSEA index =  0.209  and the 10 % confidence intervals are  0.182 0.239
## BIC =  88.32 
## 
## Measures of factor score adequacy             
##                                                  g  F1*   F2*   F3*
## Correlation of scores with factors            0.96 0.74  0.63  0.17
## Multiple R square of scores with factors      0.91 0.54  0.40  0.03
## Minimum correlation of factor score estimates 0.82 0.09 -0.20 -0.95
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.96 0.95 0.75 0.87
## Omega general for total scores and subscales  0.86 0.79 0.64 0.86
## Omega group for total scores and subscales    0.09 0.16 0.12 0.01
omega(t2_rtq_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.95 
## G.6:                   0.95 
## Omega Hierarchical:    0.89 
## Omega H asymptotic:    0.92 
## Omega Total            0.96 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##              g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t2_rtq_1  0.67                   0.50 0.50 0.50 0.88 1.28
## t2_rtq_2  0.73        0.49       0.78 0.78 0.22 0.69 1.77
## t2_rtq_3  0.66                   0.46 0.46 0.54 0.94 1.13
## t2_rtq_4  0.77        0.33       0.72 0.72 0.28 0.83 1.39
## t2_rtq_5  0.82              0.47 0.89 0.89 0.11 0.75 1.60
## t2_rtq_6  0.77              0.26 0.67 0.67 0.33 0.88 1.27
## t2_rtq_7  0.82        0.24       0.75 0.75 0.25 0.89 1.26
## t2_rtq_8  0.85  0.26             0.80 0.80 0.20 0.90 1.22
## t2_rtq_9  0.88  0.23             0.84 0.84 0.16 0.93 1.15
## t2_rtq_10 0.81                   0.71 0.71 0.29 0.93 1.15
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 6.10 0.21 0.48 0.34 5.25 
## 
## general/max  1.16   max/min =   24.74
## mean percent general =  0.86    with sd =  0.08 and cv of  0.1 
## Explained Common Variance of the general factor =  0.86 
## 
## The degrees of freedom are 18  and the fit is  0.15 
## The number of observations was  247  with Chi Square =  35.12  with prob <  0.0091
## The root mean square of the residuals is  0.02 
## The df corrected root mean square of the residuals is  0.03
## RMSEA index =  0.062  and the 10 % confidence intervals are  0.03 0.093
## BIC =  -64.05
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 35  and the fit is  0.6 
## The number of observations was  247  with Chi Square =  144.02  with prob <  3.6e-15
## The root mean square of the residuals is  0.06 
## The df corrected root mean square of the residuals is  0.07 
## 
## RMSEA index =  0.112  and the 10 % confidence intervals are  0.094 0.132
## BIC =  -48.8 
## 
## Measures of factor score adequacy             
##                                                  g   F1*  F2*  F3*
## Correlation of scores with factors            0.95  0.43 0.74 0.73
## Multiple R square of scores with factors      0.90  0.19 0.55 0.53
## Minimum correlation of factor score estimates 0.81 -0.62 0.10 0.06
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.96 0.90 0.88 0.87
## Omega general for total scores and subscales  0.89 0.85 0.75 0.72
## Omega group for total scores and subscales    0.04 0.05 0.13 0.15
omega(t2_ocd_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.92 
## G.6:                   0.94 
## Omega Hierarchical:    0.7 
## Omega H asymptotic:    0.75 
## Omega Total            0.94 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##              g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t2_ocd_1  0.47  0.36             0.37 0.37 0.63 0.61 2.03
## t2_ocd_2  0.63  0.21  0.26       0.54 0.54 0.46 0.75 1.71
## t2_ocd_3  0.61              0.53 0.66 0.66 0.34 0.57 1.96
## t2_ocd_4  0.57              0.30 0.44 0.44 0.56 0.73 1.74
## t2_ocd_5  0.54        0.40       0.46 0.46 0.54 0.63 1.93
## t2_ocd_6  0.51  0.65             0.68 0.68 0.32 0.38 1.90
## t2_ocd_7  0.41  0.24             0.25 0.25 0.75 0.67 1.97
## t2_ocd_8  0.51        0.46       0.50 0.50 0.50 0.52 2.24
## t2_ocd_9  0.65              0.59 0.76 0.76 0.24 0.55 1.99
## t2_ocd_10 0.45  0.21             0.28 0.28 0.72 0.73 1.77
## t2_ocd_11 0.65        0.45       0.65 0.65 0.35 0.66 1.86
## t2_ocd_12 0.57  0.64             0.74 0.74 0.26 0.43 2.02
## t2_ocd_13 0.45  0.21             0.28 0.28 0.72 0.73 1.78
## t2_ocd_14 0.50        0.40       0.42 0.42 0.58 0.60 1.94
## t2_ocd_15 0.62              0.51 0.65 0.65 0.35 0.59 1.95
## t2_ocd_16 0.48                   0.31 0.31 0.69 0.75 1.70
## t2_ocd_17 0.58        0.61       0.71 0.71 0.29 0.48 2.02
## t2_ocd_18 0.55  0.57             0.64 0.64 0.36 0.47 2.08
## 
## With Sums of squares  of:
##   g F1* F2* F3*  h2 
## 5.4 1.6 1.2 1.1 5.4 
## 
## general/max  1   max/min =   4.74
## mean percent general =  0.6    with sd =  0.11 and cv of  0.19 
## Explained Common Variance of the general factor =  0.58 
## 
## The degrees of freedom are 102  and the fit is  1.66 
## The number of observations was  247  with Chi Square =  394.34  with prob <  5.7e-36
## The root mean square of the residuals is  0.06 
## The df corrected root mean square of the residuals is  0.07
## RMSEA index =  0.108  and the 10 % confidence intervals are  0.097 0.119
## BIC =  -167.62
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 135  and the fit is  3.96 
## The number of observations was  247  with Chi Square =  944.02  with prob <  1.8e-121
## The root mean square of the residuals is  0.13 
## The df corrected root mean square of the residuals is  0.14 
## 
## RMSEA index =  0.156  and the 10 % confidence intervals are  0.147 0.166
## BIC =  200.25 
## 
## Measures of factor score adequacy             
##                                                  g  F1*  F2*  F3*
## Correlation of scores with factors            0.85 0.82 0.75 0.74
## Multiple R square of scores with factors      0.72 0.67 0.56 0.54
## Minimum correlation of factor score estimates 0.44 0.33 0.11 0.09
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2*  F3*
## Omega total for total scores and subscales    0.94 0.81 0.86 0.87
## Omega general for total scores and subscales  0.70 0.50 0.55 0.53
## Omega group for total scores and subscales    0.15 0.31 0.31 0.33
omega(t2_pnd_items)

## Omega 
## Call: omegah(m = m, nfactors = nfactors, fm = fm, key = key, flip = flip, 
##     digits = digits, title = title, sl = sl, labels = labels, 
##     plot = plot, n.obs = n.obs, rotate = rotate, Phi = Phi, option = option, 
##     covar = covar)
## Alpha:                 0.83 
## G.6:                   0.81 
## Omega Hierarchical:    0.81 
## Omega H asymptotic:    0.94 
## Omega Total            0.87 
## 
## Schmid Leiman Factor loadings greater than  0.2 
##                g   F1*   F2*   F3*   h2   h2   u2   p2  com
## t2_pnd_ocd1 0.90  0.24             0.89 0.89 0.11 0.91 1.20
## t2_pnd_ocd2 0.77  0.23             0.68 0.68 0.32 0.88 1.27
## t2_pnd_ocd3 0.52        0.26 -0.20 0.37 0.37 0.63 0.72 1.79
## t2_pnd_ocd4 0.76        0.31       0.68 0.68 0.32 0.84 1.37
## 
## With Sums of squares  of:
##    g  F1*  F2*  F3*   h2 
## 2.25 0.11 0.16 0.10 1.85 
## 
## general/max  1.21   max/min =   19.34
## mean percent general =  0.84    with sd =  0.08 and cv of  0.1 
## Explained Common Variance of the general factor =  0.86 
## 
## The degrees of freedom are -3  and the fit is  0 
## The number of observations was  247  with Chi Square =  0  with prob <  NA
## The root mean square of the residuals is  0 
## The df corrected root mean square of the residuals is  NA
## 
## Compare this with the adequacy of just a general factor and no group factors
## The degrees of freedom for just the general factor are 2  and the fit is  0.04 
## The number of observations was  247  with Chi Square =  8.75  with prob <  0.013
## The root mean square of the residuals is  0.03 
## The df corrected root mean square of the residuals is  0.06 
## 
## RMSEA index =  0.117  and the 10 % confidence intervals are  0.046 0.201
## BIC =  -2.26 
## 
## Measures of factor score adequacy             
##                                                  g   F1*   F2*   F3*
## Correlation of scores with factors            0.93  0.35  0.47  0.48
## Multiple R square of scores with factors      0.87  0.13  0.22  0.23
## Minimum correlation of factor score estimates 0.73 -0.75 -0.56 -0.53
## 
##  Total, General and Subset omega for each subset
##                                                  g  F1*  F2* F3*
## Omega total for total scores and subscales    0.87 0.87 0.67  NA
## Omega general for total scores and subscales  0.81 0.81 0.56  NA
## Omega group for total scores and subscales    0.05 0.06 0.11  NA

Behavioural task

###Create cognitive and affective control variables

#Calculate and create average DPrime (accuracy) scores for each condition 
#across n-back loads

final_data$average_DPrime_negative_score <- rowMeans(final_data[, 
c("DprimeNeg_1", "DprimeNeg_2", "DprimeNeg_3")], na.rm = TRUE) #Dprime negative
final_data$average_DPrime_neutral_score <- rowMeans(final_data[,
c("DprimeNeut_1", "DprimeNeut_2", "DprimeNeut_3")], na.rm = TRUE) #Dprime neutral
final_data$average_DPrime_perineg_score <- rowMeans(final_data[,
c("DprimePNeg_1", "DprimePNeg_2", "DprimePNeg_3")], na.rm = TRUE) #Dprime peri-negative
#Calculate and create average Reaction Time (RT) correct trials scores for each 
#condition across n-back loads

final_data$average_RT_negative_score <- rowMeans(final_data[, c("RTNeg_1", 
                            "RTNeg_2", "RTNeg_3")], na.rm = TRUE) #RT negative
final_data$average_RT_neutral_score <- rowMeans(final_data[, c("RTNeut_1",
                            "RTNeut_2", "RTNeut_3")], na.rm = TRUE) #RT neutral
final_data$average_RT_perineg_score <- rowMeans(final_data[, c("RTPNeg_1",
                      "RTPNeg_2", "RTPNeg_3")], na.rm = TRUE) #RT peri-negative
final_data_test <- final_data

Check distribution and outliers of Dprime and Reaction Time

# check distributions of Neutral Dprime condition (average of Dprime Neutral tasks)
ggplot(final_data, aes(average_DPrime_neutral_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Neutral Dprime Distribution", x= "(Dprime - Accuracy)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_DPrime_neutral_score)
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 247 2.76 2.94   3.33    2.78 4.13 -3.48 8.53 12.01 -0.07     -1.2 0.19
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_DPrime_neutral_score)
mean_dp_neut <- descriptives$mean  # Extract mean from describe output
sd_dp_neut <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_DPrime_neutral_score - mean_dp_neut) / sd_dp_neut

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_DPrime_neutral_score[abs(z_scores) > 3]

# Print outliers
outliers
## numeric(0)
# check distributions of Negative Dprime condition (average of Dprime Negative tasks)
ggplot(final_data, aes(average_DPrime_negative_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Negative Dprime Distribution", x= "(Dprime - Accuracy)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_DPrime_negative_score)
##    vars   n mean   sd median trimmed mad   min  max range skew kurtosis  se
## X1    1 247 3.33 3.08   3.67    3.31 4.1 -2.79 8.53 11.32 0.02    -1.33 0.2
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_DPrime_negative_score)
mean_dp_neg <- descriptives$mean  # Extract mean from describe output
sd_dp_neg <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_DPrime_negative_score - mean_dp_neg) / sd_dp_neg

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_DPrime_negative_score[abs(z_scores) > 3]

# Print outliers
outliers
## numeric(0)
# check distributions of Peri-Negative Dprime condition (average of Dprime Peri-Negative tasks )
ggplot(final_data, aes(average_DPrime_perineg_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Peri-Negative Dprime Distribution", x= "(Dprime - Accuracy)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_DPrime_perineg_score)
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis  se
## X1    1 247 3.24 3.16   3.87    3.25 4.45 -3.56 8.53 12.09 -0.08    -1.36 0.2
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_DPrime_perineg_score)
mean_dp_pneg <- descriptives$mean  # Extract mean from describe output
sd_dp_pneg <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_DPrime_perineg_score - mean_dp_pneg) / sd_dp_pneg

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_DPrime_perineg_score[abs(z_scores) > 3]

# Print outliers
outliers
## numeric(0)
# check distributions of Neutral Reaction Time condition (average of Reaction Time for Neutral tasks)
ggplot(final_data, aes(average_RT_neutral_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Neutral Reaction Time Distribution", x= "(Reaction Time Correct Trials ms)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_RT_neutral_score)
##    vars   n   mean    sd median trimmed  mad    min    max range  skew kurtosis
## X1    1 247 728.64 85.66 731.01  729.79 76.3 476.37 939.67 463.3 -0.12     0.14
##      se
## X1 5.45
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_RT_neutral_score)
mean_rt_neut <- descriptives$mean  # Extract mean from describe output
sd_rt_neut <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_RT_neutral_score - mean_rt_neut) / sd_rt_neut

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_RT_neutral_score[abs(z_scores) > 3]

# Print outliers
outliers
## numeric(0)
# check distributions of Negative Reaction Time condition (average of Reaction Time for Negative tasks across loads)
ggplot(final_data, aes(average_RT_negative_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Negative Reaction Time Distribution", x= "(Reaction Time Correct Trials ms)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_RT_negative_score)
##    vars   n   mean    sd median trimmed   mad    min    max  range  skew
## X1    1 247 731.18 89.67 733.42  732.54 76.02 442.64 999.06 556.42 -0.14
##    kurtosis   se
## X1     0.48 5.71
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_RT_negative_score)
mean_rt_neg <- descriptives$mean  # Extract mean from describe output
sd_rt_neg <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_RT_negative_score - mean_rt_neg) / sd_rt_neg

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_RT_negative_score[abs(z_scores) > 3]

# Print outliers
outliers
## [1] 442.6396
# check distributions of Peri-Negative Reaction Time condition (average of Reaction Time for Peri-Negative tasks across loads)
ggplot(final_data, aes(average_RT_perineg_score)) +
  geom_histogram(color = "#000000", fill = "#0099F8") +
  labs (title = "Peri-Negative Reaction Time Distribution", x= "(Reaction Time Correct Trials ms)", y="Frequency")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

  theme_classic() +
  theme(plot.title = element_text(size = 18))  
## List of 136
##  $ line                            :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ lineend      : chr "butt"
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ rect                            :List of 5
##   ..$ fill         : chr "white"
##   ..$ colour       : chr "black"
##   ..$ linewidth    : num 0.5
##   ..$ linetype     : num 1
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ text                            :List of 11
##   ..$ family       : chr ""
##   ..$ face         : chr "plain"
##   ..$ colour       : chr "black"
##   ..$ size         : num 11
##   ..$ hjust        : num 0.5
##   ..$ vjust        : num 0.5
##   ..$ angle        : num 0
##   ..$ lineheight   : num 0.9
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ title                           : NULL
##  $ aspect.ratio                    : NULL
##  $ axis.title                      : NULL
##  $ axis.title.x                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.75points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.top                :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.75points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.x.bottom             : NULL
##  $ axis.title.y                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num 90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.75points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.title.y.left               : NULL
##  $ axis.title.y.right              :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : num -90
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.75points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text                       :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : chr "grey30"
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 1
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 2.2points 0points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.top                 :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : NULL
##   ..$ vjust        : num 0
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 2.2points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.x.bottom              : NULL
##  $ axis.text.y                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 1
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 0points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.y.left                : NULL
##  $ axis.text.y.right               :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 0points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.text.theta                 : NULL
##  $ axis.text.r                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0.5
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : 'margin' num [1:4] 0points 2.2points 0points 2.2points
##   .. ..- attr(*, "unit")= int 8
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ axis.ticks                      :List of 6
##   ..$ colour       : chr "grey20"
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.ticks.x                    : NULL
##  $ axis.ticks.x.top                : NULL
##  $ axis.ticks.x.bottom             : NULL
##  $ axis.ticks.y                    : NULL
##  $ axis.ticks.y.left               : NULL
##  $ axis.ticks.y.right              : NULL
##  $ axis.ticks.theta                : NULL
##  $ axis.ticks.r                    : NULL
##  $ axis.minor.ticks.x.top          : NULL
##  $ axis.minor.ticks.x.bottom       : NULL
##  $ axis.minor.ticks.y.left         : NULL
##  $ axis.minor.ticks.y.right        : NULL
##  $ axis.minor.ticks.theta          : NULL
##  $ axis.minor.ticks.r              : NULL
##  $ axis.ticks.length               : 'simpleUnit' num 2.75points
##   ..- attr(*, "unit")= int 8
##  $ axis.ticks.length.x             : NULL
##  $ axis.ticks.length.x.top         : NULL
##  $ axis.ticks.length.x.bottom      : NULL
##  $ axis.ticks.length.y             : NULL
##  $ axis.ticks.length.y.left        : NULL
##  $ axis.ticks.length.y.right       : NULL
##  $ axis.ticks.length.theta         : NULL
##  $ axis.ticks.length.r             : NULL
##  $ axis.minor.ticks.length         : 'rel' num 0.75
##  $ axis.minor.ticks.length.x       : NULL
##  $ axis.minor.ticks.length.x.top   : NULL
##  $ axis.minor.ticks.length.x.bottom: NULL
##  $ axis.minor.ticks.length.y       : NULL
##  $ axis.minor.ticks.length.y.left  : NULL
##  $ axis.minor.ticks.length.y.right : NULL
##  $ axis.minor.ticks.length.theta   : NULL
##  $ axis.minor.ticks.length.r       : NULL
##  $ axis.line                       :List of 6
##   ..$ colour       : chr "black"
##   ..$ linewidth    : 'rel' num 1
##   ..$ linetype     : NULL
##   ..$ lineend      : NULL
##   ..$ arrow        : logi FALSE
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_line" "element"
##  $ axis.line.x                     : NULL
##  $ axis.line.x.top                 : NULL
##  $ axis.line.x.bottom              : NULL
##  $ axis.line.y                     : NULL
##  $ axis.line.y.left                : NULL
##  $ axis.line.y.right               : NULL
##  $ axis.line.theta                 : NULL
##  $ axis.line.r                     : NULL
##  $ legend.background               :List of 5
##   ..$ fill         : NULL
##   ..$ colour       : logi NA
##   ..$ linewidth    : NULL
##   ..$ linetype     : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_rect" "element"
##  $ legend.margin                   : 'margin' num [1:4] 5.5points 5.5points 5.5points 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing                  : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##  $ legend.spacing.x                : NULL
##  $ legend.spacing.y                : NULL
##  $ legend.key                      : NULL
##  $ legend.key.size                 : 'simpleUnit' num 1.2lines
##   ..- attr(*, "unit")= int 3
##  $ legend.key.height               : NULL
##  $ legend.key.width                : NULL
##  $ legend.key.spacing              : 'simpleUnit' num 5.5points
##   ..- attr(*, "unit")= int 8
##  $ legend.key.spacing.x            : NULL
##  $ legend.key.spacing.y            : NULL
##  $ legend.frame                    : NULL
##  $ legend.ticks                    : NULL
##  $ legend.ticks.length             : 'rel' num 0.2
##  $ legend.axis.line                : NULL
##  $ legend.text                     :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : 'rel' num 0.8
##   ..$ hjust        : NULL
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.text.position            : NULL
##  $ legend.title                    :List of 11
##   ..$ family       : NULL
##   ..$ face         : NULL
##   ..$ colour       : NULL
##   ..$ size         : NULL
##   ..$ hjust        : num 0
##   ..$ vjust        : NULL
##   ..$ angle        : NULL
##   ..$ lineheight   : NULL
##   ..$ margin       : NULL
##   ..$ debug        : NULL
##   ..$ inherit.blank: logi TRUE
##   ..- attr(*, "class")= chr [1:2] "element_text" "element"
##  $ legend.title.position           : NULL
##  $ legend.position                 : chr "right"
##  $ legend.position.inside          : NULL
##  $ legend.direction                : NULL
##  $ legend.byrow                    : NULL
##  $ legend.justification            : chr "center"
##  $ legend.justification.top        : NULL
##  $ legend.justification.bottom     : NULL
##  $ legend.justification.left       : NULL
##  $ legend.justification.right      : NULL
##  $ legend.justification.inside     : NULL
##  $ legend.location                 : NULL
##  $ legend.box                      : NULL
##  $ legend.box.just                 : NULL
##  $ legend.box.margin               : 'margin' num [1:4] 0cm 0cm 0cm 0cm
##   ..- attr(*, "unit")= int 1
##  $ legend.box.background           : list()
##   ..- attr(*, "class")= chr [1:2] "element_blank" "element"
##  $ legend.box.spacing              : 'simpleUnit' num 11points
##   ..- attr(*, "unit")= int 8
##   [list output truncated]
##  - attr(*, "class")= chr [1:2] "theme" "gg"
##  - attr(*, "complete")= logi TRUE
##  - attr(*, "validate")= logi TRUE
# check descriptives 
describe(final_data$average_RT_perineg_score)
##    vars   n   mean    sd median trimmed   mad    min    max  range skew
## X1    1 247 738.22 93.11 730.84  738.01 93.55 470.06 997.06 527.01    0
##    kurtosis   se
## X1     0.04 5.92
# First, calculate the mean and standard deviation
descriptives <- describe(final_data$average_RT_perineg_score)
mean_rt_pneg <- descriptives$mean  # Extract mean from describe output
sd_rt_pneg <- descriptives$sd      # Extract standard deviation from describe output

# Calculate Z-scores for each data point in Dprime neutral 
z_scores <- (final_data$average_RT_perineg_score - mean_rt_pneg) / sd_rt_pneg

# Identify outliers based on a threshold, e.g., Z-scores greater than 3 or less than -3
outliers <- final_data$average_RT_perineg_score[abs(z_scores) > 3]

# Print outliers
outliers
## numeric(0)

#Create affective control indices

#Calculate and create affective difference scores 
final_data$ACdP_neg<-((final_data$average_DPrime_negative_score-final_data$average_DPrime_neutral_score)) #negative-neutral Dprime
final_data$ACdP_peri<-((final_data$average_DPrime_perineg_score-final_data$average_DPrime_neutral_score)) #perineg-neutral Dprime
final_data$ACdP_Nperi<-((final_data$average_DPrime_perineg_score-final_data$average_DPrime_negative_score)) #perineg-negative Dprime
final_data$ACRT_neg<-((final_data$average_RT_negative_score-final_data$average_RT_neutral_score)) #negative-neutral Reaction Time
final_data$ACRT_peri<-((final_data$average_RT_perineg_score-final_data$average_RT_neutral_score)) #perineg-negative Reaction Time
final_data$ACRT_Nperi<-((final_data$average_RT_perineg_score-final_data$average_RT_negative_score)) #perineg-negative Reaction Time
final_data_test2 <- final_data

Analyses

Associations between perinatal stage (wks since conception) and mental health

Y ~ X

# phq
ggplot(final_data, aes(t1_wks_since_conception, t1phqTotal)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "PHQ Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

t1_peri_phq <- lm(t1phqTotal ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_phq)
## 
## Call:
## lm(formula = t1phqTotal ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -8.4894 -4.2857 -0.8804  3.4306 15.3656 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              8.87438    0.75998  11.677   <2e-16 ***
## t1_wks_since_conception -0.01750    0.01079  -1.622    0.106    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.285 on 245 degrees of freedom
## Multiple R-squared:  0.01062,    Adjusted R-squared:  0.00658 
## F-statistic: 2.629 on 1 and 245 DF,  p-value: 0.1062
# gad
ggplot(final_data, aes(t1_wks_since_conception, t1gadTotal)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "GAD Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

t1_peri_gad <- lm(t1gadTotal ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_gad)
## 
## Call:
## lm(formula = t1gadTotal ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -7.886 -3.781 -1.018  3.341 13.266 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              8.05181    0.72061  11.174   <2e-16 ***
## t1_wks_since_conception -0.01223    0.01023  -1.195    0.233    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 5.011 on 245 degrees of freedom
## Multiple R-squared:  0.005798,   Adjusted R-squared:  0.00174 
## F-statistic: 1.429 on 1 and 245 DF,  p-value: 0.2331
# RNT
ggplot(final_data, aes(t1_wks_since_conception, t1rtqTotal)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "RNT Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  scale_y_continuous(n.breaks = 10, limits = c(0,55), expand = c(0,0)) + 
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

t1_peri_rtq <- lm(t1rtqTotal ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_rtq)
## 
## Call:
## lm(formula = t1rtqTotal ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -18.4354  -8.4729   0.2875   7.6391  26.8086 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             29.17633    1.50811  19.346   <2e-16 ***
## t1_wks_since_conception -0.04510    0.02141  -2.106   0.0362 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.49 on 245 degrees of freedom
## Multiple R-squared:  0.01778,    Adjusted R-squared:  0.01377 
## F-statistic: 4.436 on 1 and 245 DF,  p-value: 0.03621
standardized_model_t1_peri_rtq  <- standardize_parameters(t1_peri_rtq)
print(standardized_model_t1_peri_rtq)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |         95% CI
## -----------------------------------------------------
## (Intercept)             |   2.77e-17 | [-0.12,  0.12]
## t1 wks since conception |      -0.13 | [-0.26, -0.01]
# ocd
ggplot(final_data, aes(t1_wks_since_conception, t1ocdTotal)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "OCD Total Score") + 
  scale_x_continuous(n.breaks = 10) +
  scale_y_continuous(n.breaks = 10) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

t1_peri_ocd <- lm(t1ocdTotal ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_ocd)
## 
## Call:
## lm(formula = t1ocdTotal ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -18.581 -11.130  -3.373   8.453  36.977 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             19.70139    1.94093   10.15   <2e-16 ***
## t1_wks_since_conception -0.05374    0.02756   -1.95   0.0524 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.5 on 245 degrees of freedom
## Multiple R-squared:  0.01528,    Adjusted R-squared:  0.01126 
## F-statistic: 3.801 on 1 and 245 DF,  p-value: 0.05235
# intrusions 
ggplot(final_data, aes(t1_wks_since_conception, t1intrusionsTotal)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusions Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'

t1_peri_intrusions <- 
  lm(t1intrusionsTotal ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_intrusions)
## 
## Call:
## lm(formula = t1intrusionsTotal ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.3370 -2.9007 -0.2406  2.6933  7.5374 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              5.502444   0.474759  11.590   <2e-16 ***
## t1_wks_since_conception -0.010071   0.006741  -1.494    0.136    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.301 on 245 degrees of freedom
## Multiple R-squared:  0.009027,   Adjusted R-squared:  0.004982 
## F-statistic: 2.232 on 1 and 245 DF,  p-value: 0.1365
standardized_model_t1_peri_intrusions  <- standardize_parameters(t1_peri_intrusions)
print(standardized_model_t1_peri_intrusions)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |        95% CI
## ----------------------------------------------------
## (Intercept)             |   1.21e-16 | [-0.13, 0.13]
## t1 wks since conception |      -0.10 | [-0.22, 0.03]
# intrusion-related distress 
ggplot(final_data, aes(t1_wks_since_conception, t1_thoughts_distress_level)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusion Related Distress") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

t1_peri_thought_distress <-
  lm(t1_thoughts_distress_level ~ t1_wks_since_conception, data = final_data)
summary(t1_peri_thought_distress)
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.08841 -1.01892 -0.04904  0.92900  2.00368 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.1019419  0.1286523  16.338   <2e-16 ***
## t1_wks_since_conception -0.0009109  0.0018390  -0.495    0.621    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8878 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.001005,   Adjusted R-squared:  -0.00309 
## F-statistic: 0.2454 on 1 and 244 DF,  p-value: 0.6208
standardized_model_t1_peri_thought_distress  <- standardize_parameters(t1_peri_thought_distress)
print(standardized_model_t1_peri_thought_distress)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |        95% CI
## ----------------------------------------------------
## (Intercept)             |  -3.61e-16 | [-0.13, 0.13]
## t1 wks since conception |      -0.03 | [-0.16, 0.09]
# relevant graphs

# phq
phq_t1 <- ggplot(final_data, aes(t1_wks_since_conception, t1phqTotal)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Depression Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()

# gad
gad_t1 <-ggplot(final_data, aes(t1_wks_since_conception, t1gadTotal)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Anxiety Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()

# rtq 
rtq_t1 <-ggplot(final_data, aes(t1_wks_since_conception, t1rtqTotal)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Repetitive Negative Thinking Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  scale_y_continuous(n.breaks = 10, limits = c(0,55), expand = c(0,0)) + 
  theme_apa()

# ocd
ocd_t1 <-ggplot(final_data, aes(t1_wks_since_conception, t1ocdTotal)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Obsessive-Compulsive Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  scale_y_continuous(n.breaks = 15) +
  theme_apa()

# intrusions 
intr_t1 <- ggplot(final_data, aes(t1_wks_since_conception, t1intrusionsTotal)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusions Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()

# intrusion distress 
thought_dist_t1 <- ggplot(final_data, aes(t1_wks_since_conception, t1_thoughts_distress_level)) +
  geom_point() + 
  geom_smooth(method = "lm") + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusion Distress Level") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
### T2
# phq
ggplot(final_data, aes(t1_wks_since_conception, t2_phq_total)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Depression Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 30 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 30 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_phq <- lm(t2_phq_total ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_phq)
## 
## Call:
## lm(formula = t2_phq_total ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.7316 -3.7162 -0.7277  3.2814 17.2783 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              6.7367893  0.7813065   8.622 1.44e-15 ***
## t1_wks_since_conception -0.0003502  0.0109666  -0.032    0.975    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.973 on 215 degrees of freedom
##   (30 observations deleted due to missingness)
## Multiple R-squared:  4.744e-06,  Adjusted R-squared:  -0.004646 
## F-statistic: 0.00102 on 1 and 215 DF,  p-value: 0.9746
# gad
ggplot(final_data, aes(t1_wks_since_conception, t2_gad_total)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Anxiety Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 30 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 30 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_gad <- lm(t2_gad_total ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_gad)
## 
## Call:
## lm(formula = t2_gad_total ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -6.5722 -3.5495 -0.4904  3.4763 13.4772 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              6.597427   0.766871   8.603 1.64e-15 ***
## t1_wks_since_conception -0.001696   0.010764  -0.158    0.875    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.881 on 215 degrees of freedom
##   (30 observations deleted due to missingness)
## Multiple R-squared:  0.0001154,  Adjusted R-squared:  -0.004535 
## F-statistic: 0.02482 on 1 and 215 DF,  p-value: 0.875
# RNT
ggplot(final_data, aes(t1_wks_since_conception, t2_rtq_total)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "RNT Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 30 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 30 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_rtq <- lm(t2_rtq_total ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_rtq)
## 
## Call:
## lm(formula = t2_rtq_total ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -24.0781  -6.7998  -0.6409   6.2566  26.4601 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             24.145975   1.730004  13.957   <2e-16 ***
## t1_wks_since_conception -0.004567   0.024283  -0.188    0.851    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.01 on 215 degrees of freedom
##   (30 observations deleted due to missingness)
## Multiple R-squared:  0.0001645,  Adjusted R-squared:  -0.004486 
## F-statistic: 0.03537 on 1 and 215 DF,  p-value: 0.851
# ocd
ggplot(final_data, aes(t1_wks_since_conception, t2_ocd_total)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "OCD Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 30 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 30 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_ocd <- lm(t2_ocd_total ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_ocd)
## 
## Call:
## lm(formula = t2_ocd_total ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -14.220  -9.721  -2.942   7.387  38.564 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             14.43732    1.88102   7.675 5.71e-13 ***
## t1_wks_since_conception -0.01462    0.02640  -0.554     0.58    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.97 on 215 degrees of freedom
##   (30 observations deleted due to missingness)
## Multiple R-squared:  0.001425,   Adjusted R-squared:  -0.00322 
## F-statistic: 0.3068 on 1 and 215 DF,  p-value: 0.5802
# intrusions 
ggplot(final_data, aes(t1_wks_since_conception, t2_intrusions_total)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusions Total Score") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 30 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 30 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_intrusions <- 
  lm(t2_intrusions_total ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_intrusions)
## 
## Call:
## lm(formula = t2_intrusions_total ~ t1_wks_since_conception, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.2206 -3.0636 -0.1969  2.8147  7.9255 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             4.021560   0.522455   7.697 4.98e-13 ***
## t1_wks_since_conception 0.001816   0.007333   0.248    0.805    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.325 on 215 degrees of freedom
##   (30 observations deleted due to missingness)
## Multiple R-squared:  0.0002852,  Adjusted R-squared:  -0.004365 
## F-statistic: 0.06133 on 1 and 215 DF,  p-value: 0.8046
# intrusion distress 
ggplot(final_data, aes(t1_wks_since_conception, t2_thoughts_distress_level)) +
  geom_point() + 
  geom_smooth() + 
  labs(x = "Weeks Since Conception", 
       y = "Intrusion Distress Level") + 
  scale_x_continuous(n.breaks = 15) +
  theme_apa()
## `geom_smooth()` using method = 'loess' and formula = 'y ~ x'
## Warning: Removed 41 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 41 rows containing missing values or values outside the scale range
## (`geom_point()`).

t2_peri_thought_distress <-
  lm(t2_thoughts_distress_level ~ t1_wks_since_conception, data = final_data)
summary(t2_peri_thought_distress)
## 
## Call:
## lm(formula = t2_thoughts_distress_level ~ t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.16523 -0.94925 -0.01165  0.88349  2.92398 
## 
## Coefficients:
##                          Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              2.213720   0.158142  13.998   <2e-16 ***
## t1_wks_since_conception -0.003202   0.002196  -1.458    0.146    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9626 on 204 degrees of freedom
##   (41 observations deleted due to missingness)
## Multiple R-squared:  0.01032,    Adjusted R-squared:  0.005467 
## F-statistic: 2.127 on 1 and 204 DF,  p-value: 0.1463

Performance of task

#Rename variables for separation 
final_data_rename <- final_data %>%
  rename(intrusions_T1 = t1intrusionsTotal,
         intrusionsdistress_T1 = t1_thoughts_distress_level,
         rtq_T1 = t1rtqTotal,
         intrusions_T2 = t2_intrusions_total,
         intrusionsdistress_T2 = t2_thoughts_distress_level,
         rtq_T2 = t2_rtq_total
         )
#Select variables for pivot
final_data_select <- final_data_rename %>%
   dplyr::select (Prolific_ID, intrusions_T1, intrusionsdistress_T1, rtq_T1, intrusions_T2, intrusionsdistress_T2,rtq_T2, t1_wks_since_conception, average_DPrime_neutral_score, average_DPrime_negative_score, average_DPrime_perineg_score, average_RT_neutral_score, average_RT_negative_score, average_RT_perineg_score,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1,DprimeNeg_2,DprimeNeut_2,DprimePNeg_2,DprimeNeg_3, DprimeNeut_3, DprimePNeg_3,RTNeg_1,RTNeut_1,RTPNeg_1,RTNeg_2,RTNeut_2, RTPNeg_2,RTNeg_3,RTNeut_3,RTPNeg_3,percentcorrectNeg_1,percentcorrectNeut_1,percentcorrectPNeg_1,percentcorrectNeg_2,percentcorrectNeut_2,percentcorrectPNeg_2,percentcorrectNeg_3,percentcorrectNeut_3,percentcorrectPNeg_3,ACdP_neg,ACdP_peri, ACdP_Nperi,ACRT_neg,ACRT_peri,ACRT_Nperi)

Valence on each load - Dprime

#Load 1 Dprime
task_data_measures_dpL1 <- final_data_select %>% 
  dplyr::select(Prolific_ID,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1)
#Pivot to long 
dprimeL1 <- task_data_measures_dpL1 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
dprimeL1$Valence <- as.factor(dprimeL1$Valence)
dprimeL1$Valence <- relevel(dprimeL1$Valence, ref = "DprimeNeut_1")
model_dprimeL1 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = dprimeL1)
summary(model_dprimeL1)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: dprimeL1
## 
## REML criterion at convergence: 3927.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.0651 -0.4856  0.1461  0.4631  2.6043 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 11.987   3.462   
##  Residual                 6.184   2.487   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)           3.1094     0.2712 394.5891  11.464   <2e-16 ***
## ValenceDprimeNeg_1    0.6545     0.2238 492.0000   2.925   0.0036 ** 
## ValenceDprimePNeg_1   0.4187     0.2238 492.0000   1.871   0.0619 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VlDN_1
## VlncDprmN_1 -0.413       
## VlncDprPN_1 -0.413  0.500
standardized_model_dprimeL1 <- standardize_parameters(model_dprimeL1)
print(standardized_model_dprimeL1)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |      -0.08 | [-0.21, 0.04]
## Valence [DprimeNeg_1]  |       0.15 | [ 0.05, 0.26]
## Valence [DprimePNeg_1] |       0.10 | [ 0.00, 0.20]
anova(model_dprimeL1)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value Pr(>F)  
## Valence 54.287  27.144     2   492   4.389 0.0129 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Load 2 Dprime
task_data_measures_dpL2 <- final_data_select %>% 
  dplyr::select(Prolific_ID,DprimeNeg_2,DprimeNeut_2,DprimePNeg_2)
#Pivot to long 
dprimeL2 <- task_data_measures_dpL2 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
dprimeL2$Valence <- as.factor(dprimeL2$Valence)
dprimeL2$Valence <- relevel(dprimeL2$Valence, ref = "DprimeNeut_2")
model_dprimeL2 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = dprimeL2)
summary(model_dprimeL2)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: dprimeL2
## 
## REML criterion at convergence: 3675.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.66603 -0.44300  0.06092  0.50285  2.56681 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 10.989   3.315   
##  Residual                 3.955   1.989   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)           3.4357     0.2460 354.5517  13.968   <2e-16 ***
## ValenceDprimeNeg_2    0.2977     0.1789 492.0000   1.664   0.0968 .  
## ValenceDprimePNeg_2   0.1847     0.1789 492.0000   1.032   0.3026    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VlDN_2
## VlncDprmN_2 -0.364       
## VlncDprPN_2 -0.364  0.500
standardized_model_dprimeL2 <- standardize_parameters(model_dprimeL2)
print(standardized_model_dprimeL2)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |      -0.04 | [-0.17, 0.08]
## Valence [DprimeNeg_2]  |       0.08 | [-0.01, 0.17]
## Valence [DprimePNeg_2] |       0.05 | [-0.04, 0.14]
anova(model_dprimeL2)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## Valence  11.16  5.5798     2   492  1.4109 0.2449
#Load 3 Dprime
task_data_measures_dpL3 <- final_data_select %>% 
  dplyr::select(Prolific_ID,DprimeNeg_3,DprimeNeut_3,DprimePNeg_3)
#Pivot to long 
dprimeL3 <- task_data_measures_dpL3 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
dprimeL3$Valence <- as.factor(dprimeL3$Valence)
dprimeL3$Valence <- relevel(dprimeL3$Valence, ref = "DprimeNeut_3")
model_dprimeL3 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = dprimeL3)
summary(model_dprimeL3)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: dprimeL3
## 
## REML criterion at convergence: 3505.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4713 -0.5624 -0.1237  0.4987  2.6024 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.092    2.023   
##  Residual                4.194    2.048   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)           1.7482     0.1832 496.0778   9.545  < 2e-16 ***
## ValenceDprimeNeg_3    0.7473     0.1843 492.0000   4.055 5.83e-05 ***
## ValenceDprimePNeg_3   0.8240     0.1843 492.0000   4.471 9.67e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VlDN_3
## VlncDprmN_3 -0.503       
## VlncDprPN_3 -0.503  0.500
standardized_model_dprimeL3 <- standardize_parameters(model_dprimeL3)
print(standardized_model_dprimeL3)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |         95% CI
## ----------------------------------------------------
## (Intercept)            |      -0.18 | [-0.30, -0.06]
## Valence [DprimeNeg_3]  |       0.26 | [ 0.13,  0.38]
## Valence [DprimePNeg_3] |       0.28 | [ 0.16,  0.41]
anova(model_dprimeL3)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
## Valence 102.36   51.18     2   492  12.202 6.731e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Valence on each load - Reaction Time

#Load 1 Reaction Time
task_data_measures_rtL1 <- final_data_select %>% 
  dplyr::select(Prolific_ID,RTNeg_1,RTNeut_1,RTPNeg_1)
#Pivot to long 
rtL1 <- task_data_measures_rtL1 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
rtL1$Valence <- as.factor(rtL1$Valence)
rtL1$Valence <- relevel(rtL1$Valence, ref = "RTNeut_1")
model_rtL1 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = rtL1)
summary(model_rtL1)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: rtL1
## 
## REML criterion at convergence: 8677.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.2362 -0.5479 -0.0195  0.5344  3.4341 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4709     68.63   
##  Residual                4573     67.62   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                 Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)      740.131      6.130 487.182 120.734   <2e-16 ***
## ValenceRTNeg_1    13.725      6.085 492.000   2.256   0.0245 *  
## ValenceRTPNeg_1    9.253      6.085 492.000   1.521   0.1290    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VRTN_1
## ValncRTNg_1 -0.496       
## VlncRTPNg_1 -0.496  0.500
standardized_model_rtL1 <- standardize_parameters(model_rtL1)
print(standardized_model_rtL1)
## # Standardization method: refit
## 
## Parameter          | Std. Coef. |        95% CI
## -----------------------------------------------
## (Intercept)        |      -0.08 | [-0.20, 0.05]
## Valence [RTNeg_1]  |       0.14 | [ 0.02, 0.27]
## Valence [RTPNeg_1] |       0.10 | [-0.03, 0.22]
anova(model_rtL1)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## Valence  24206   12103     2   492  2.6467 0.07189 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Load 2 Reaction Time
task_data_measures_rtL2 <- final_data_select %>% 
  dplyr::select(Prolific_ID,RTNeg_2,RTNeut_2,RTPNeg_2)
#Pivot to long 
rtL2 <- task_data_measures_rtL2 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
rtL2$Valence <- as.factor(rtL2$Valence)
rtL2$Valence <- relevel(rtL2$Valence, ref = "RTNeut_2")
model_rtL2 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = rtL2)
summary(model_rtL2)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: rtL2
## 
## REML criterion at convergence: 8694.5
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.32648 -0.56870 -0.06428  0.46270  3.04830 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 8505     92.22   
##  Residual                3784     61.52   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                 Estimate Std. Error      df t value Pr(>|t|)    
## (Intercept)      741.481      7.054 376.932 105.118  < 2e-16 ***
## ValenceRTNeg_2    -1.554      5.536 492.000  -0.281 0.778996    
## ValenceRTPNeg_2   19.504      5.536 492.000   3.523 0.000466 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VRTN_2
## ValncRTNg_2 -0.392       
## VlncRTPNg_2 -0.392  0.500
standardized_model_rtL2 <- standardize_parameters(model_rtL2)
print(standardized_model_rtL2)
## # Standardization method: refit
## 
## Parameter          | Std. Coef. |        95% CI
## -----------------------------------------------
## (Intercept)        |      -0.05 | [-0.18, 0.07]
## Valence [RTNeg_2]  |      -0.01 | [-0.11, 0.08]
## Valence [RTPNeg_2] |       0.18 | [ 0.08, 0.27]
anova(model_rtL2)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
## Valence  68032   34016     2   492  8.9885 0.0001466 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_rtL2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter | Eta2 (partial) |       95% CI
## -----------------------------------------
## Valence   |           0.04 | [0.01, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
#Run pairwise valence on Load 2
model_rtL2pair <- lsmeans(model_rtL2, 
                                           pairwise~Valence, 
                                           adjust = "tukey") 
summary(model_rtL2pair)
## $lsmeans
##  Valence  lsmean   SE  df lower.CL upper.CL
##  RTNeut_2    741 7.05 377      728      755
##  RTNeg_2     740 7.05 377      726      754
##  RTPNeg_2    761 7.05 377      747      775
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast            estimate   SE  df t.ratio p.value
##  RTNeut_2 - RTNeg_2      1.55 5.54 492   0.281  0.9575
##  RTNeut_2 - RTPNeg_2   -19.50 5.54 492  -3.523  0.0014
##  RTNeg_2 - RTPNeg_2    -21.06 5.54 492  -3.804  0.0005
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 3 estimates
# Convert contrasts to a data frame to extract estimates
contrast_results <- as.data.frame(model_rtL2pair$contrasts)

# Extract the estimates for standardization
estimates <- contrast_results$estimate

# Standard deviation of the dependent variable (replace with the actual dependent variable)
# In your example, `dprime$Value` refers to your dependent variable (replace if needed)
sd_y <- sd(rtL2$Value)

# Standardize the estimates
standardized_estimates <- estimates / sd_y


# Create a summary table 
 summary_table <- data.frame(
            Contrast = contrast_results$contrast,
            Estimate = estimates,
            t_value = contrast_results$t.ratio,     # t-value
            p_value = contrast_results$p.value,     # p-value
            Standardized_Estimate = standardized_estimates
        )
# Print the summary table
print(summary_table)
##              Contrast  Estimate    t_value      p_value Standardized_Estimate
## 1  RTNeut_2 - RTNeg_2   1.55430  0.2807812 0.9574760037            0.01398712
## 2 RTNeut_2 - RTPNeg_2 -19.50437 -3.5234259 0.0013509311           -0.17551955
## 3  RTNeg_2 - RTPNeg_2 -21.05867 -3.8042072 0.0004695539           -0.18950668
#Load 3 Reaction Time
task_data_measures_rtL3 <- final_data_select %>% 
  dplyr::select(Prolific_ID,RTNeg_3,RTNeut_3,RTPNeg_3)
#Pivot to long 
rtL3 <- task_data_measures_rtL3 %>% 
  pivot_longer(
    cols = -Prolific_ID,
    names_to = "Valence", 
    values_to = "Value" 
  )
#Valence as factor and reference group to neutral
rtL3$Valence <- as.factor(rtL3$Valence)
rtL3$Valence <- relevel(rtL3$Valence, ref = "RTNeut_3")
model_rtL3 <- lmer(Value ~ Valence  + (1 | Prolific_ID), 
                                  data = rtL3)
summary(model_rtL3)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence + (1 | Prolific_ID)
##    Data: rtL3
## 
## REML criterion at convergence: 8602.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.90567 -0.52090 -0.00871  0.44566  3.02579 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 8277     90.98   
##  Residual                3210     56.66   
## Number of obs: 741, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                   Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)     704.301301   6.819568 362.043233 103.277   <2e-16 ***
## ValenceRTNeg_3   -4.545418   5.098140 492.000054  -0.892    0.373    
## ValenceRTPNeg_3   0.002429   5.098140 492.000054   0.000    1.000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VRTN_3
## ValncRTNg_3 -0.374       
## VlncRTPNg_3 -0.374  0.500
standardized_model_rtL3 <- standardize_parameters(model_rtL3)
print(standardized_model_rtL3)
## # Standardization method: refit
## 
## Parameter          | Std. Coef. |        95% CI
## -----------------------------------------------
## (Intercept)        |       0.01 | [-0.11, 0.14]
## Valence [RTNeg_3]  |      -0.04 | [-0.14, 0.05]
## Valence [RTPNeg_3] |   2.27e-05 | [-0.09, 0.09]
anova(model_rtL3)
## Type III Analysis of Variance Table with Satterthwaite's method
##         Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## Valence   3404    1702     2   492  0.5302 0.5888

#Valence * Load Interactions

###Dprime

#Select task variables 
task_data_measures <- final_data %>% 
  dplyr::select(Prolific_ID,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1,DprimeNeg_2,
                DprimeNeut_2,DprimePNeg_2,DprimeNeg_3, DprimeNeut_3, 
                DprimePNeg_3,RTNeg_1,RTNeut_1,RTPNeg_1,RTNeg_2,RTNeut_2,RTPNeg_2,
                RTNeg_3,RTNeut_3,RTPNeg_3,percentcorrectNeg_1,
                percentcorrectNeut_1,percentcorrectPNeg_1,percentcorrectNeg_2,
                percentcorrectNeut_2,percentcorrectPNeg_2,percentcorrectNeg_3,
                percentcorrectNeut_3,percentcorrectPNeg_3,t1rtqTotal,t1intrusionsTotal)
#Select dprime measures
dprime_select <- task_data_measures %>%
   dplyr::select("Prolific_ID", "DprimeNeg_1","DprimeNeut_1","DprimePNeg_1", 
                 "DprimeNeg_2", "DprimeNeut_2", "DprimePNeg_2", "DprimeNeg_3",
                 "DprimeNeut_3", "DprimePNeg_3","t1rtqTotal","t1intrusionsTotal")
#Pivot to long
dprime <- dprime_select %>% pivot_longer(
    cols = -c (Prolific_ID, t1rtqTotal,t1intrusionsTotal),
    names_to = c("Valence", "Load"), 
    names_sep = "_", values_to = "Value" 
)
#Change to factor variable
dprime$Valence <- factor(dprime$Valence)
#Change reference group to "Neutral"
dprime$Valence <- relevel(dprime$Valence, ref = "DprimeNeut")
#Run main effects and interactions of valence and load on Dprime 
model_dprime_interactions <- lmer(Value ~ Valence * Load  + (1 | Prolific_ID), 
                                  data = dprime)
summary(model_dprime_interactions)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence * Load + (1 | Prolific_ID)
##    Data: dprime
## 
## REML criterion at convergence: 10985.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.6826 -0.6057  0.0004  0.6792  3.0701 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 7.595    2.756   
##  Residual                6.205    2.491   
## Number of obs: 2223, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                           Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)                3.10942    0.23637  646.77995  13.155  < 2e-16 ***
## ValenceDprimeNeg           0.65455    0.22416 1968.00000   2.920  0.00354 ** 
## ValenceDprimePNeg          0.41868    0.22416 1968.00000   1.868  0.06194 .  
## Load2                      0.32625    0.22416 1968.00000   1.455  0.14570    
## Load3                     -1.36118    0.22416 1968.00000  -6.072 1.51e-09 ***
## ValenceDprimeNeg:Load2    -0.35680    0.31700 1968.00000  -1.126  0.26050    
## ValenceDprimePNeg:Load2   -0.23403    0.31700 1968.00000  -0.738  0.46044    
## ValenceDprimeNeg:Load3     0.09273    0.31700 1968.00000   0.293  0.76992    
## ValenceDprimePNeg:Load3    0.40529    0.31700 1968.00000   1.279  0.20122    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VlncDN VlnDPN Load2  Load3  VDN:L2 VDPN:L2 VDN:L3
## ValncDprmNg -0.474                                                  
## VlncDprmPNg -0.474  0.500                                           
## Load2       -0.474  0.500  0.500                                    
## Load3       -0.474  0.500  0.500  0.500                             
## VlncDprN:L2  0.335 -0.707 -0.354 -0.707 -0.354                      
## VlncDpPN:L2  0.335 -0.354 -0.707 -0.707 -0.354  0.500               
## VlncDprN:L3  0.335 -0.707 -0.354 -0.354 -0.707  0.500  0.250        
## VlncDpPN:L3  0.335 -0.354 -0.707 -0.354 -0.707  0.250  0.500   0.500
standardized_model_dprime_interactions <- standardize_parameters(model_dprime_interactions)
print(standardized_model_dprime_interactions)
## # Standardization method: refit
## 
## Parameter                       | Std. Coef. |         95% CI
## -------------------------------------------------------------
## (Intercept)                     |  -6.52e-04 | [-0.12,  0.12]
## Valence [DprimeNeg]             |       0.17 | [ 0.06,  0.29]
## Valence [DprimePNeg]            |       0.11 | [-0.01,  0.23]
## Load [2]                        |       0.09 | [-0.03,  0.20]
## Load [3]                        |      -0.36 | [-0.48, -0.24]
## Valence [DprimeNeg] × Load [2]  |      -0.09 | [-0.26,  0.07]
## Valence [DprimePNeg] × Load [2] |      -0.06 | [-0.23,  0.10]
## Valence [DprimeNeg] × Load [3]  |       0.02 | [-0.14,  0.19]
## Valence [DprimePNeg] × Load [3] |       0.11 | [-0.06,  0.27]
anova(model_dprime_interactions)
## Type III Analysis of Variance Table with Satterthwaite's method
##              Sum Sq Mean Sq NumDF DenDF F value    Pr(>F)    
## Valence      137.22   68.61     2  1968 11.0566 1.679e-05 ***
## Load         790.25  395.12     2  1968 63.6748 < 2.2e-16 ***
## Valence:Load  30.59    7.65     4  1968  1.2323     0.295    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_dprime_interactions)
## # Effect Size for ANOVA (Type III)
## 
## Parameter    | Eta2 (partial) |       95% CI
## --------------------------------------------
## Valence      |           0.01 | [0.00, 1.00]
## Load         |           0.06 | [0.04, 1.00]
## Valence:Load |       2.50e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
#Run posthoc pairwise valence and load on Dprime
posthoc_model_dp_interact <- lsmeans(model_dprime_interactions, 
                                     pairwise~Valence*Load, adjust = "tukey") 
summary(posthoc_model_dp_interact)
## $lsmeans
##  Valence    Load lsmean    SE  df lower.CL upper.CL
##  DprimeNeut 1      3.11 0.236 647     2.65     3.57
##  DprimeNeg  1      3.76 0.236 647     3.30     4.23
##  DprimePNeg 1      3.53 0.236 647     3.06     3.99
##  DprimeNeut 2      3.44 0.236 647     2.97     3.90
##  DprimeNeg  2      3.73 0.236 647     3.27     4.20
##  DprimePNeg 2      3.62 0.236 647     3.16     4.08
##  DprimeNeut 3      1.75 0.236 647     1.28     2.21
##  DprimeNeg  3      2.50 0.236 647     2.03     2.96
##  DprimePNeg 3      2.57 0.236 647     2.11     3.04
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                            estimate    SE   df t.ratio p.value
##  DprimeNeut Load1 - DprimeNeg Load1   -0.6545 0.224 1968  -2.920  0.0846
##  DprimeNeut Load1 - DprimePNeg Load1  -0.4187 0.224 1968  -1.868  0.6362
##  DprimeNeut Load1 - DprimeNeut Load2  -0.3262 0.224 1968  -1.455  0.8758
##  DprimeNeut Load1 - DprimeNeg Load2   -0.6240 0.224 1968  -2.784  0.1207
##  DprimeNeut Load1 - DprimePNeg Load2  -0.5109 0.224 1968  -2.279  0.3552
##  DprimeNeut Load1 - DprimeNeut Load3   1.3612 0.224 1968   6.072  <.0001
##  DprimeNeut Load1 - DprimeNeg Load3    0.6139 0.224 1968   2.739  0.1350
##  DprimeNeut Load1 - DprimePNeg Load3   0.5372 0.224 1968   2.397  0.2862
##  DprimeNeg Load1 - DprimePNeg Load1    0.2359 0.224 1968   1.052  0.9805
##  DprimeNeg Load1 - DprimeNeut Load2    0.3283 0.224 1968   1.465  0.8718
##  DprimeNeg Load1 - DprimeNeg Load2     0.0306 0.224 1968   0.136  1.0000
##  DprimeNeg Load1 - DprimePNeg Load2    0.1437 0.224 1968   0.641  0.9994
##  DprimeNeg Load1 - DprimeNeut Load3    2.0157 0.224 1968   8.993  <.0001
##  DprimeNeg Load1 - DprimeNeg Load3     1.2684 0.224 1968   5.659  <.0001
##  DprimeNeg Load1 - DprimePNeg Load3    1.1917 0.224 1968   5.317  <.0001
##  DprimePNeg Load1 - DprimeNeut Load2   0.0924 0.224 1968   0.412  1.0000
##  DprimePNeg Load1 - DprimeNeg Load2   -0.2053 0.224 1968  -0.916  0.9921
##  DprimePNeg Load1 - DprimePNeg Load2  -0.0922 0.224 1968  -0.411  1.0000
##  DprimePNeg Load1 - DprimeNeut Load3   1.7799 0.224 1968   7.940  <.0001
##  DprimePNeg Load1 - DprimeNeg Load3    1.0326 0.224 1968   4.607  0.0002
##  DprimePNeg Load1 - DprimePNeg Load3   0.9559 0.224 1968   4.264  0.0007
##  DprimeNeut Load2 - DprimeNeg Load2   -0.2977 0.224 1968  -1.328  0.9230
##  DprimeNeut Load2 - DprimePNeg Load2  -0.1847 0.224 1968  -0.824  0.9962
##  DprimeNeut Load2 - DprimeNeut Load3   1.6874 0.224 1968   7.528  <.0001
##  DprimeNeut Load2 - DprimeNeg Load3    0.9401 0.224 1968   4.194  0.0010
##  DprimeNeut Load2 - DprimePNeg Load3   0.8634 0.224 1968   3.852  0.0038
##  DprimeNeg Load2 - DprimePNeg Load2    0.1131 0.224 1968   0.505  0.9999
##  DprimeNeg Load2 - DprimeNeut Load3    1.9852 0.224 1968   8.856  <.0001
##  DprimeNeg Load2 - DprimeNeg Load3     1.2379 0.224 1968   5.522  <.0001
##  DprimeNeg Load2 - DprimePNeg Load3    1.1612 0.224 1968   5.180  <.0001
##  DprimePNeg Load2 - DprimeNeut Load3   1.8721 0.224 1968   8.352  <.0001
##  DprimePNeg Load2 - DprimeNeg Load3    1.1248 0.224 1968   5.018  <.0001
##  DprimePNeg Load2 - DprimePNeg Load3   1.0481 0.224 1968   4.676  0.0001
##  DprimeNeut Load3 - DprimeNeg Load3   -0.7473 0.224 1968  -3.334  0.0245
##  DprimeNeut Load3 - DprimePNeg Load3  -0.8240 0.224 1968  -3.676  0.0075
##  DprimeNeg Load3 - DprimePNeg Load3   -0.0767 0.224 1968  -0.342  1.0000
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 9 estimates
#Run posthoc pairwise valence on Dprime
posthoc_model_dp_interact_valence <- lsmeans(posthoc_model_dp_interact, 
                                             pairwise~Valence, adjust = "tukey")
## NOTE: Results may be misleading due to involvement in interactions
summary(posthoc_model_dp_interact_valence)
## $lsmeans
##  Valence    lsmean    SE  df lower.CL upper.CL
##  DprimeNeut   2.76 0.198 334     2.38     3.15
##  DprimeNeg    3.33 0.198 334     2.94     3.72
##  DprimePNeg   3.24 0.198 334     2.85     3.63
## 
## Results are averaged over the levels of: Load 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                estimate    SE   df t.ratio p.value
##  DprimeNeut - DprimeNeg   -0.5665 0.129 1968  -4.378  <.0001
##  DprimeNeut - DprimePNeg  -0.4758 0.129 1968  -3.676  0.0007
##  DprimeNeg - DprimePNeg    0.0908 0.129 1968   0.701  0.7628
## 
## Results are averaged over the levels of: Load 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 3 estimates
# Post-hoc pairwise comparisons for Valence & standardise coefficents
posthoc_model_dp_interact_valence <- lsmeans(posthoc_model_dp_interact, 
                                             pairwise ~ Valence, adjust = "tukey")
## NOTE: Results may be misleading due to involvement in interactions
# Convert contrasts to a data frame to extract estimates
contrast_results <- as.data.frame(posthoc_model_dp_interact_valence$contrasts)

# Extract the estimates for standardization
estimates <- contrast_results$estimate

# Standard deviation of the dependent variable (replace with the actual dependent variable)
# In your example, `dprime$Value` refers to your dependent variable (replace if needed)
sd_y <- sd(dprime$Value)

# Standardize the estimates
standardized_estimates <- estimates / sd_y


# Create a summary table 
 summary_table <- data.frame(
            Contrast = contrast_results$contrast,
            Estimate = estimates,
            t_value = contrast_results$t.ratio,     # t-value
            p_value = contrast_results$p.value,     # p-value
            Standardized_Estimate = standardized_estimates
        )
# Print the summary table
print(summary_table)
##                  Contrast    Estimate    t_value      p_value
## 1  DprimeNeut - DprimeNeg -0.56652467 -4.3775459 3.755999e-05
## 2 DprimeNeut - DprimePNeg -0.47577010 -3.6762838 7.105122e-04
## 3  DprimeNeg - DprimePNeg  0.09075456  0.7012621 7.627624e-01
##   Standardized_Estimate
## 1            -0.1504358
## 2            -0.1263367
## 3             0.0240991
#Run posthoc pairwise load on Dprime
posthoc_model_dp_interact_load <- lsmeans(posthoc_model_dp_interact, 
                                          pairwise~Load, adjust = "tukey")
## NOTE: Results may be misleading due to involvement in interactions
summary(posthoc_model_dp_interact_load)
## $lsmeans
##  Load lsmean    SE  df lower.CL upper.CL
##  1      3.47 0.198 334     3.08     3.86
##  2      3.60 0.198 334     3.21     3.99
##  3      2.27 0.198 334     1.88     2.66
## 
## Results are averaged over the levels of: Valence 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast      estimate    SE   df t.ratio p.value
##  Load1 - Load2   -0.129 0.129 1968  -0.999  0.5775
##  Load1 - Load3    1.195 0.129 1968   9.235  <.0001
##  Load2 - Load3    1.324 0.129 1968  10.234  <.0001
## 
## Results are averaged over the levels of: Valence 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 3 estimates
# Convert contrasts to a data frame to extract estimates
contrast_results <- as.data.frame(posthoc_model_dp_interact_load$contrasts)

# Extract the estimates for standardization
estimates <- contrast_results$estimate

# Standard deviation of the dependent variable (replace with the actual dependent variable)
# In your example, `dprime$Value` refers to your dependent variable (replace if needed)
sd_y <- sd(dprime$Value)

# Standardize the estimates
standardized_estimates <- estimates / sd_y


# Create a summary table 
 summary_table <- data.frame(
            Contrast = contrast_results$contrast,
            Estimate = estimates,
            t_value = contrast_results$t.ratio,     # t-value
            p_value = contrast_results$p.value,     # p-value
            Standardized_Estimate = standardized_estimates
        )
# Print the summary table
print(summary_table)
##        Contrast   Estimate   t_value      p_value Standardized_Estimate
## 1 Load1 - Load2 -0.1293033 -0.999129 5.774875e-01           -0.03433539
## 2 Load1 - Load3  1.1951689  9.235091 3.961564e-11            0.31736691
## 3 Load2 - Load3  1.3244723 10.234220 3.961309e-11            0.35170230
# Descriptive statistics for Dprime Value, grouped by Valence
describe.by(dprime$Value, group = dprime$Valence)
## Warning in describe.by(dprime$Value, group = dprime$Valence): describe.by is
## deprecated.  Please use the describeBy function
## 
##  Descriptive statistics by group 
## group: DprimeNeut
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 741 2.76 3.76   1.64    2.79 3.52 -4.94 8.53 13.47 0.23    -1.01 0.14
## ------------------------------------------------------------ 
## group: DprimeNeg
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 741 3.33 3.78   2.18    3.38 4.12 -5.65 8.53 14.18 0.13     -1.2 0.14
## ------------------------------------------------------------ 
## group: DprimePNeg
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 741 3.24 3.74   2.27    3.29 4.21 -4.94 8.53 13.47 0.08    -1.17 0.14
# Descriptive statistics for Dprime Value, grouped by Load
describeBy(dprime$Value, group = dprime$Load)
## 
##  Descriptive statistics by group 
## group: 1
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 741 3.47 4.27   3.92    3.69 6.54 -4.87 8.53  13.4 -0.08    -1.43 0.16
## ------------------------------------------------------------ 
## group: 2
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 741  3.6 3.86   4.01    3.71 6.01 -5.65 8.53 14.18 -0.03    -1.28 0.14
## ------------------------------------------------------------ 
## group: 3
##    vars   n mean  sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 741 2.27 2.9   1.68    2.11 2.43 -4.56 8.53 13.09 0.48    -0.08 0.11
# Descriptive statistics for Dprime Value, grouped by the interaction of Valence and Load
describeBy(dprime$Value, group = list(dprime$Valence, dprime$Load))
## 
##  Descriptive statistics by group 
## : DprimeNeut
## : 1
##    vars   n mean   sd median trimmed mad   min  max range  skew kurtosis   se
## X1    1 247 3.11 4.54   4.01    3.31 6.7 -4.38 8.53 12.91 -0.09    -1.48 0.29
## ------------------------------------------------------------ 
## : DprimeNeg
## : 1
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 247 3.76 4.08   3.92    3.92 6.33 -4.87 8.53  13.4 -0.05    -1.46 0.26
## ------------------------------------------------------------ 
## : DprimePNeg
## : 1
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 247 3.53 4.15   4.15    3.67 6.49 -4.87 8.53  13.4 -0.04    -1.48 0.26
## ------------------------------------------------------------ 
## : DprimeNeut
## : 2
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 247 3.44 3.86   2.22    3.55 4.27 -4.94 8.53 13.47 -0.01    -1.22 0.25
## ------------------------------------------------------------ 
## : DprimeNeg
## : 2
##    vars   n mean   sd median trimmed  mad   min  max range  skew kurtosis   se
## X1    1 247 3.73 4.04   3.83     3.9 6.29 -5.65 8.53 14.18 -0.08    -1.37 0.26
## ------------------------------------------------------------ 
## : DprimePNeg
## : 2
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 247 3.62 3.69   4.52    3.68 5.95 -4.94 8.53 13.47 0.01    -1.27 0.23
## ------------------------------------------------------------ 
## : DprimeNeut
## : 3
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 247 1.75 2.32   1.27    1.57 1.47 -3.53 8.53 12.06 0.85     1.05 0.15
## ------------------------------------------------------------ 
## : DprimeNeg
## : 3
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 247  2.5 2.97   1.68    2.31 2.43 -4.36 8.53 12.89 0.44    -0.26 0.19
## ------------------------------------------------------------ 
## : DprimePNeg
## : 3
##    vars   n mean   sd median trimmed  mad   min  max range skew kurtosis   se
## X1    1 247 2.57 3.26   1.86     2.5 3.57 -4.56 8.53 13.09 0.17    -0.57 0.21

Reaction Time - Valence * Load

#Select reaction time measures
rt_select <- task_data_measures %>%
   dplyr::select(Prolific_ID, RTNeg_1,RTNeut_1,RTPNeg_1, RTNeg_2, RTNeut_2, 
                 RTPNeg_2, RTNeg_3,RTNeut_3, RTPNeg_3)
#Pivot to long
rt <- rt_select %>% pivot_longer( cols = -Prolific_ID, 
                                  names_to = c("Valence", "Load"), 
                                  names_sep = "_", values_to = "Value" ) 
#Change to factor variable
rt$Valence <- factor(rt$Valence)
#Change reference group to "Neutral"
rt$Valence <- relevel(rt$Valence, ref = "RTNeut")
#Run main effects and interactions of valence and load on Reaction Time
model_rt_interactions <- lmer(Value ~ Valence * Load + (1 | Prolific_ID), 
                              data = rt)
summary(model_rt_interactions)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Value ~ Valence * Load + (1 | Prolific_ID)
##    Data: rt
## 
## REML criterion at convergence: 25676.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.5359 -0.5937 -0.0307  0.5470  5.2987 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6343     79.64   
##  Residual                4677     68.39   
## Number of obs: 2223, groups:  Prolific_ID, 247
## 
## Fixed effects:
##                     Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)          740.131      6.679  606.524 110.808  < 2e-16 ***
## ValenceRTNeg          13.725      6.154 1968.000   2.230   0.0258 *  
## ValenceRTPNeg          9.253      6.154 1968.000   1.504   0.1329    
## Load2                  1.351      6.154 1968.000   0.219   0.8263    
## Load3                -35.829      6.154 1968.000  -5.822 6.77e-09 ***
## ValenceRTNeg:Load2   -15.280      8.703 1968.000  -1.756   0.0793 .  
## ValenceRTPNeg:Load2   10.252      8.703 1968.000   1.178   0.2390    
## ValenceRTNeg:Load3   -18.271      8.703 1968.000  -2.099   0.0359 *  
## ValenceRTPNeg:Load3   -9.250      8.703 1968.000  -1.063   0.2880    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) VlnRTN VlRTPN Load2  Load3  VRTN:L2 VRTPN:L2 VRTN:L3
## ValenceRTNg -0.461                                                     
## ValencRTPNg -0.461  0.500                                              
## Load2       -0.461  0.500  0.500                                       
## Load3       -0.461  0.500  0.500  0.500                                
## VlncRTNg:L2  0.326 -0.707 -0.354 -0.707 -0.354                         
## VlncRTPN:L2  0.326 -0.354 -0.707 -0.707 -0.354  0.500                  
## VlncRTNg:L3  0.326 -0.707 -0.354 -0.354 -0.707  0.500   0.250          
## VlncRTPN:L3  0.326 -0.354 -0.707 -0.354 -0.707  0.250   0.500    0.500
standardized_model_rt_interactions <- standardize_parameters(model_rt_interactions)
print(standardized_model_rt_interactions)
## # Standardization method: refit
## 
## Parameter                   | Std. Coef. |         95% CI
## ---------------------------------------------------------
## (Intercept)                 |       0.07 | [-0.05,  0.19]
## Valence [RTNeg]             |       0.13 | [ 0.02,  0.24]
## Valence [RTPNeg]            |       0.09 | [-0.03,  0.20]
## Load [2]                    |       0.01 | [-0.10,  0.13]
## Load [3]                    |      -0.33 | [-0.45, -0.22]
## Valence [RTNeg] × Load [2]  |      -0.14 | [-0.30,  0.02]
## Valence [RTPNeg] × Load [2] |       0.10 | [-0.06,  0.26]
## Valence [RTNeg] × Load [3]  |      -0.17 | [-0.33, -0.01]
## Valence [RTPNeg] × Load [3] |      -0.09 | [-0.25,  0.07]
anova(model_rt_interactions)
## Type III Analysis of Variance Table with Satterthwaite's method
##              Sum Sq Mean Sq NumDF DenDF  F value  Pr(>F)    
## Valence       36553   18277     2  1968   3.9078 0.02024 *  
## Load         993309  496654     2  1968 106.1904 < 2e-16 ***
## Valence:Load  59089   14772     4  1968   3.1585 0.01341 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_rt_interactions)
## # Effect Size for ANOVA (Type III)
## 
## Parameter    | Eta2 (partial) |       95% CI
## --------------------------------------------
## Valence      |       3.96e-03 | [0.00, 1.00]
## Load         |           0.10 | [0.08, 1.00]
## Valence:Load |       6.38e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
#Run posthoc pairwise valence and load on Reaction Time
posthoc_model_rt_interact <- lsmeans(model_rt_interactions, 
                                     pairwise~Valence*Load, adjust = "tukey") 
summary(posthoc_model_rt_interact)
## $lsmeans
##  Valence Load lsmean   SE  df lower.CL upper.CL
##  RTNeut  1       740 6.68 607      727      753
##  RTNeg   1       754 6.68 607      741      767
##  RTPNeg  1       749 6.68 607      736      763
##  RTNeut  2       741 6.68 607      728      755
##  RTNeg   2       740 6.68 607      727      753
##  RTPNeg  2       761 6.68 607      748      774
##  RTNeut  3       704 6.68 607      691      717
##  RTNeg   3       700 6.68 607      687      713
##  RTPNeg  3       704 6.68 607      691      717
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                     estimate   SE   df t.ratio p.value
##  RTNeut Load1 - RTNeg Load1  -13.72522 6.15 1968  -2.230  0.3862
##  RTNeut Load1 - RTPNeg Load1  -9.25267 6.15 1968  -1.504  0.8542
##  RTNeut Load1 - RTNeut Load2  -1.35066 6.15 1968  -0.219  1.0000
##  RTNeut Load1 - RTNeg Load2    0.20364 6.15 1968   0.033  1.0000
##  RTNeut Load1 - RTPNeg Load2 -20.85503 6.15 1968  -3.389  0.0205
##  RTNeut Load1 - RTNeut Load3  35.82948 6.15 1968   5.822  <.0001
##  RTNeut Load1 - RTNeg Load3   40.37489 6.15 1968   6.561  <.0001
##  RTNeut Load1 - RTPNeg Load3  35.82705 6.15 1968   5.822  <.0001
##  RTNeg Load1 - RTPNeg Load1    4.47256 6.15 1968   0.727  0.9984
##  RTNeg Load1 - RTNeut Load2   12.37456 6.15 1968   2.011  0.5359
##  RTNeg Load1 - RTNeg Load2    13.92886 6.15 1968   2.263  0.3651
##  RTNeg Load1 - RTPNeg Load2   -7.12981 6.15 1968  -1.159  0.9648
##  RTNeg Load1 - RTNeut Load3   49.55470 6.15 1968   8.053  <.0001
##  RTNeg Load1 - RTNeg Load3    54.10012 6.15 1968   8.791  <.0001
##  RTNeg Load1 - RTPNeg Load3   49.55227 6.15 1968   8.052  <.0001
##  RTPNeg Load1 - RTNeut Load2   7.90201 6.15 1968   1.284  0.9361
##  RTPNeg Load1 - RTNeg Load2    9.45631 6.15 1968   1.537  0.8382
##  RTPNeg Load1 - RTPNeg Load2 -11.60236 6.15 1968  -1.885  0.6240
##  RTPNeg Load1 - RTNeut Load3  45.08214 6.15 1968   7.326  <.0001
##  RTPNeg Load1 - RTNeg Load3   49.62756 6.15 1968   8.064  <.0001
##  RTPNeg Load1 - RTPNeg Load3  45.07971 6.15 1968   7.325  <.0001
##  RTNeut Load2 - RTNeg Load2    1.55430 6.15 1968   0.253  1.0000
##  RTNeut Load2 - RTPNeg Load2 -19.50437 6.15 1968  -3.169  0.0412
##  RTNeut Load2 - RTNeut Load3  37.18013 6.15 1968   6.042  <.0001
##  RTNeut Load2 - RTNeg Load3   41.72555 6.15 1968   6.780  <.0001
##  RTNeut Load2 - RTPNeg Load3  37.17771 6.15 1968   6.041  <.0001
##  RTNeg Load2 - RTPNeg Load2  -21.05867 6.15 1968  -3.422  0.0183
##  RTNeg Load2 - RTNeut Load3   35.62583 6.15 1968   5.789  <.0001
##  RTNeg Load2 - RTNeg Load3    40.17125 6.15 1968   6.528  <.0001
##  RTNeg Load2 - RTPNeg Load3   35.62341 6.15 1968   5.789  <.0001
##  RTPNeg Load2 - RTNeut Load3  56.68451 6.15 1968   9.211  <.0001
##  RTPNeg Load2 - RTNeg Load3   61.22992 6.15 1968   9.950  <.0001
##  RTPNeg Load2 - RTPNeg Load3  56.68208 6.15 1968   9.211  <.0001
##  RTNeut Load3 - RTNeg Load3    4.54542 6.15 1968   0.739  0.9982
##  RTNeut Load3 - RTPNeg Load3  -0.00243 6.15 1968   0.000  1.0000
##  RTNeg Load3 - RTPNeg Load3   -4.54785 6.15 1968  -0.739  0.9982
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 9 estimates
#Run posthoc pairwise valence on Reaction Time
posthoc_model_rt_interact_valence <- lsmeans(posthoc_model_rt_interact, 
                                             pairwise~Valence, adjust = "tukey")
## NOTE: Results may be misleading due to involvement in interactions
summary(posthoc_model_rt_interact_valence )
## $lsmeans
##  Valence lsmean   SE  df lower.CL upper.CL
##  RTNeut     729 5.66 325      718      740
##  RTNeg      731 5.66 325      720      742
##  RTPNeg     738 5.66 325      727      749
## 
## Results are averaged over the levels of: Load 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast        estimate   SE   df t.ratio p.value
##  RTNeut - RTNeg     -2.54 3.55 1968  -0.715  0.7544
##  RTNeut - RTPNeg    -9.59 3.55 1968  -2.698  0.0193
##  RTNeg - RTPNeg     -7.04 3.55 1968  -1.983  0.1167
## 
## Results are averaged over the levels of: Load 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 3 estimates
#Run posthoc pairwise load on Reaction Time
posthoc_model_rt_interact_load <- lsmeans(posthoc_model_rt_interact, 
                                          pairwise~Load, adjust = "tukey")
## NOTE: Results may be misleading due to involvement in interactions
summary(posthoc_model_rt_interact_load)
## $lsmeans
##  Load lsmean   SE  df lower.CL upper.CL
##  1       748 5.66 325      737      759
##  2       747 5.66 325      736      759
##  3       703 5.66 325      692      714
## 
## Results are averaged over the levels of: Valence 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast      estimate   SE   df t.ratio p.value
##  Load1 - Load2    0.325 3.55 1968   0.092  0.9954
##  Load1 - Load3   45.003 3.55 1968  12.666  <.0001
##  Load2 - Load3   44.678 3.55 1968  12.575  <.0001
## 
## Results are averaged over the levels of: Valence 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 3 estimates
# Descriptive statistics for Reaction Time Value, grouped by Valence
describeBy(rt$Value, group = rt$Valence)
## 
##  Descriptive statistics by group 
## group: RTNeut
##    vars   n   mean     sd median trimmed   mad    min     max  range skew
## X1    1 741 728.64 101.81  728.5  728.29 93.48 372.12 1027.51 655.39    0
##    kurtosis   se
## X1     0.45 3.74
## ------------------------------------------------------------ 
## group: RTNeg
##    vars   n   mean     sd median trimmed   mad    min     max  range skew
## X1    1 741 731.18 108.17 729.97  731.89 99.22 378.76 1092.24 713.48 -0.1
##    kurtosis   se
## X1     0.56 3.97
## ------------------------------------------------------------ 
## group: RTPNeg
##    vars   n   mean     sd median trimmed    mad    min     max  range  skew
## X1    1 741 738.22 111.02 734.89  739.07 103.02 377.58 1110.53 732.95 -0.08
##    kurtosis   se
## X1      0.5 4.08
# Descriptive statistics for Reaction Time Value, grouped by Load
describeBy(rt$Value, group = rt$Load)
## 
##  Descriptive statistics by group 
## group: 1
##    vars   n   mean    sd median trimmed   mad    min     max  range skew
## X1    1 741 747.79 96.38 742.27  745.19 92.67 386.85 1062.33 675.47  0.2
##    kurtosis   se
## X1     0.36 3.54
## ------------------------------------------------------------ 
## group: 2
##    vars   n   mean     sd median trimmed    mad    min     max  range skew
## X1    1 741 747.46 111.12 744.01   746.9 101.26 382.68 1110.53 727.85 0.05
##    kurtosis   se
## X1     0.34 4.08
## ------------------------------------------------------------ 
## group: 3
##    vars   n   mean     sd median trimmed   mad    min    max  range skew
## X1    1 741 702.79 107.05 705.97  706.39 95.21 372.12 999.91 627.78 -0.3
##    kurtosis   se
## X1     0.36 3.93
# Descriptive statistics for Reaction Time Value, grouped by the interaction of Valence and Load
describeBy(rt$Value, group = list(rt$Valence, rt$Load))
## 
##  Descriptive statistics by group 
## : RTNeut
## : 1
##    vars   n   mean    sd median trimmed   mad    min     max  range skew
## X1    1 247 740.13 93.63 732.83  737.56 90.27 459.53 1009.98 550.45 0.28
##    kurtosis   se
## X1     0.26 5.96
## ------------------------------------------------------------ 
## : RTNeg
## : 1
##    vars   n   mean    sd median trimmed   mad    min     max range skew
## X1    1 247 753.86 98.01 752.54  751.83 89.51 386.85 1048.25 661.4 0.02
##    kurtosis   se
## X1      0.7 6.24
## ------------------------------------------------------------ 
## : RTPNeg
## : 1
##    vars   n   mean    sd median trimmed   mad    min     max  range skew
## X1    1 247 749.38 97.33 743.74  746.59 96.34 500.55 1062.33 561.78 0.28
##    kurtosis   se
## X1      0.1 6.19
## ------------------------------------------------------------ 
## : RTNeut
## : 2
##    vars   n   mean     sd median trimmed   mad    min     max  range skew
## X1    1 247 741.48 106.43  738.4  740.11 96.31 447.58 1027.51 579.94 0.11
##    kurtosis   se
## X1     0.03 6.77
## ------------------------------------------------------------ 
## : RTNeg
## : 2
##    vars   n   mean     sd median trimmed    mad    min     max  range  skew
## X1    1 247 739.93 110.56 739.66  739.86 101.96 382.68 1092.24 709.56 -0.03
##    kurtosis   se
## X1     0.49 7.03
## ------------------------------------------------------------ 
## : RTPNeg
## : 2
##    vars   n   mean    sd median trimmed    mad    min     max  range skew
## X1    1 247 760.99 115.4 761.48   761.2 102.95 420.37 1110.53 690.16 0.02
##    kurtosis   se
## X1     0.36 7.34
## ------------------------------------------------------------ 
## : RTNeut
## : 3
##    vars   n  mean     sd median trimmed   mad    min    max  range  skew
## X1    1 247 704.3 100.96 709.58  707.55 91.24 372.12 979.88 607.76 -0.33
##    kurtosis   se
## X1     0.52 6.42
## ------------------------------------------------------------ 
## : RTNeg
## : 3
##    vars   n   mean     sd median trimmed   mad    min    max  range  skew
## X1    1 247 699.76 108.54 697.02  702.21 90.42 378.76 999.91 621.15 -0.16
##    kurtosis   se
## X1     0.35 6.91
## ------------------------------------------------------------ 
## : RTPNeg
## : 3
##    vars   n  mean     sd median trimmed    mad    min    max  range  skew
## X1    1 247 704.3 111.75 710.41  709.23 100.36 377.58 977.39 599.81 -0.39
##    kurtosis   se
## X1     0.19 7.11

##H1T1 Cross-sectional Associations between affective control & intrusions/distress ###H1-T1 Intrusions

#Intrusions
model_intrusions_dp_neg <- lm(t1intrusionsTotal ~ 
                            ACdP_neg, data = final_data)
summary(model_intrusions_dp_neg) #Intrusions symptoms Dprime ACdP_neg
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_neg, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.0311 -2.8465  0.0681  2.5275  7.5453 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.8162     0.2212  21.770   <2e-16 ***
## ACdP_neg      0.0886     0.1186   0.747    0.456    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.313 on 245 degrees of freedom
## Multiple R-squared:  0.002272,   Adjusted R-squared:  -0.0018 
## F-statistic: 0.5579 on 1 and 245 DF,  p-value: 0.4558
standardized_model_intrusions_dp_neg <- standardize_parameters(model_intrusions_dp_neg)
print(standardized_model_intrusions_dp_neg)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.33e-16 | [-0.13, 0.13]
## ACdP neg    |       0.05 | [-0.08, 0.17]
anova(model_intrusions_dp_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_neg    1    6.12  6.1222  0.5579 0.4558
## Residuals 245 2688.47 10.9733
model_intrusions_dp_peri <- lm(t1intrusionsTotal ~ 
                            ACdP_peri, data = final_data)
summary(model_intrusions_dp_peri) #Intrusions symptoms Dprime ACdP_peri
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_peri, data = final_data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.349 -2.900  0.091  2.732  7.761 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   4.8037     0.2170  22.132   <2e-16 ***
## ACdP_peri     0.1317     0.1118   1.178     0.24    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.307 on 245 degrees of freedom
## Multiple R-squared:  0.005628,   Adjusted R-squared:  0.00157 
## F-statistic: 1.387 on 1 and 245 DF,  p-value: 0.2401
standardized_model_intrusions_dp_peri <- standardize_parameters(model_intrusions_dp_peri)
print(standardized_model_intrusions_dp_peri)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.25e-16 | [-0.13, 0.13]
## ACdP peri   |       0.08 | [-0.05, 0.20]
anova(model_intrusions_dp_peri)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_peri   1   15.17  15.166  1.3867 0.2401
## Residuals 245 2679.43  10.936
model_intrusions_dp_Nperi <- lm(t1intrusionsTotal ~ 
                            ACdP_Nperi, data = final_data)
summary(model_intrusions_dp_Nperi) #Intrusions symptoms Dprime ACdP_Nperi
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_Nperi, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.0212 -2.8838  0.0773  2.9190  7.2805 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.87198    0.21119  23.069   <2e-16 ***
## ACdP_Nperi   0.06152    0.12116   0.508    0.612    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.315 on 245 degrees of freedom
## Multiple R-squared:  0.001051,   Adjusted R-squared:  -0.003026 
## F-statistic: 0.2578 on 1 and 245 DF,  p-value: 0.6121
standardized_model_intrusions_dp_Nperi <- standardize_parameters(model_intrusions_dp_Nperi)
print(standardized_model_intrusions_dp_Nperi)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.34e-16 | [-0.13, 0.13]
## ACdP Nperi  |       0.03 | [-0.09, 0.16]
anova(model_intrusions_dp_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##             Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_Nperi   1    2.83  2.8328  0.2578 0.6121
## Residuals  245 2691.76 10.9868
model_intrusions_rt_neg <- lm(t1intrusionsTotal ~ ACRT_neg, data = final_data)
summary(model_intrusions_rt_neg) #Intrusions symptoms Reaction Time ACRT_neg
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_neg, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.5527 -2.7975  0.0154  2.6147  7.5540 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.882069   0.209943  23.254   <2e-16 ***
## ACRT_neg    -0.006166   0.003575  -1.725   0.0858 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.296 on 245 degrees of freedom
## Multiple R-squared:  0.012,  Adjusted R-squared:  0.007964 
## F-statistic: 2.975 on 1 and 245 DF,  p-value: 0.08583
standardized_model_intrusions_rt_neg <- standardize_parameters(model_intrusions_rt_neg)
print(standardized_model_intrusions_rt_neg)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.28e-16 | [-0.12, 0.12]
## ACRT neg    |      -0.11 | [-0.23, 0.02]
anova(model_intrusions_rt_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##            Df  Sum Sq Mean Sq F value  Pr(>F)  
## ACRT_neg    1   32.33  32.325  2.9748 0.08583 .
## Residuals 245 2662.27  10.866                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model_intrusions_rt_peri<- lm(t1intrusionsTotal ~ ACRT_peri, data = final_data)
summary(model_intrusions_rt_peri) #Intrusions symptoms Reaction Time ACRT_peri
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_peri, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.4898 -2.8295  0.1208  2.6272  7.4364 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  4.916046   0.212962  23.084   <2e-16 ***
## ACRT_peri   -0.005179   0.003608  -1.435    0.152    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.303 on 245 degrees of freedom
## Multiple R-squared:  0.00834,    Adjusted R-squared:  0.004292 
## F-statistic:  2.06 on 1 and 245 DF,  p-value: 0.1524
standardized_model_intrusions_rt_peri <- standardize_parameters(model_intrusions_rt_peri)
print(standardized_model_intrusions_rt_peri)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.25e-16 | [-0.13, 0.13]
## ACRT peri   |      -0.09 | [-0.22, 0.03]
anova(model_intrusions_rt_peri)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_peri   1   22.47  22.472  2.0604 0.1524
## Residuals 245 2672.12  10.907
model_intrusions_rt_Nperi<- lm(t1intrusionsTotal ~ ACRT_Nperi, data = final_data)
summary(model_intrusions_rt_Nperi) #Intrusions symptoms Reaction Time ACRT_Nperi
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_Nperi, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.9858 -2.8770  0.0741  3.0372  7.2552 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 4.859043   0.212467  22.870   <2e-16 ***
## ACRT_Nperi  0.001044   0.003564   0.293     0.77    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.316 on 245 degrees of freedom
## Multiple R-squared:  0.0003501,  Adjusted R-squared:  -0.00373 
## F-statistic: 0.08581 on 1 and 245 DF,  p-value: 0.7698
standardized_model_intrusions_rt_Nperi <- standardize_parameters(model_intrusions_rt_Nperi)
print(standardized_model_intrusions_rt_Nperi)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |   1.33e-16 | [-0.13, 0.13]
## ACRT Nperi  |       0.02 | [-0.11, 0.14]
anova(model_intrusions_rt_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##             Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_Nperi   1    0.94  0.9435  0.0858 0.7698
## Residuals  245 2693.65 10.9945
# final data T2
final_dataT2<-final_data
final_dataT2<-final_dataT2[which(final_dataT2$completed_t2=="complete"),]
#check mental health differences between T1 and T2
#gad
t_test_result_gad <- t.test(final_dataT2$t1gadTotal,final_dataT2$t2_gad_total, paired = TRUE)
print(t_test_result_gad)
## 
##  Paired t-test
## 
## data:  final_dataT2$t1gadTotal and final_dataT2$t2_gad_total
## t = 1.0678, df = 205, p-value = 0.2869
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.2424151  0.8152306
## sample estimates:
## mean difference 
##       0.2864078
#phq
t_test_result_phq<- t.test(final_dataT2$t1phqTotal, final_dataT2$t2_phq_total, paired = TRUE)
print(t_test_result_phq)
## 
##  Paired t-test
## 
## data:  final_dataT2$t1phqTotal and final_dataT2$t2_phq_total
## t = 1.6844, df = 205, p-value = 0.09364
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.07616456  0.96936844
## sample estimates:
## mean difference 
##       0.4466019
#ocd
t_test_result_ocd<- t.test(final_dataT2$t1ocdTotal, final_dataT2$t2_ocd_total, paired = TRUE)
print(t_test_result_ocd)
## 
##  Paired t-test
## 
## data:  final_dataT2$t1ocdTotal and final_dataT2$t2_ocd_total
## t = 1.8653, df = 205, p-value = 0.06356
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.0594611  2.1468397
## sample estimates:
## mean difference 
##        1.043689
#intrusions
t_test_result_intrusions<- t.test(final_dataT2$t1intrusionsTotal,final_dataT2$t2_intrusions_total, paired = TRUE)
print(t_test_result_intrusions)
## 
##  Paired t-test
## 
## data:  final_dataT2$t1intrusionsTotal and final_dataT2$t2_intrusions_total
## t = 1.9464, df = 205, p-value = 0.05298
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.005352203  0.830594922
## sample estimates:
## mean difference 
##       0.4126214
#intrusion distress 
t_test_result_intrusions_distress<- t.test(final_dataT2$t1_thoughts_distress_level,final_dataT2$t2_thoughts_distress_level, paired = TRUE)
print(t_test_result_intrusions_distress)
## 
##  Paired t-test
## 
## data:  final_dataT2$t1_thoughts_distress_level and final_dataT2$t2_thoughts_distress_level
## t = 1.0447, df = 205, p-value = 0.2974
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.05168435  0.16818921
## sample estimates:
## mean difference 
##      0.05825243

###H1-T1 Distress

#Intrusion distress
model_intrusions_distress_dp_neg <- lm(t1_thoughts_distress_level ~ 
                            ACdP_neg, data = final_data)
summary(model_intrusions_distress_dp_neg) #Intrusions symptoms Dprime ACdP_neg
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_neg, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.16092 -1.01210 -0.04284  0.92698  2.01306 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.02651    0.05931  34.165   <2e-16 ***
## ACdP_neg     0.03209    0.03174   1.011    0.313    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8864 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.004171,   Adjusted R-squared:  8.971e-05 
## F-statistic: 1.022 on 1 and 244 DF,  p-value: 0.3131
standardized_model_intrusions_distress_dp_neg<- standardize_parameters(model_intrusions_distress_dp_neg)
print(standardized_model_intrusions_distress_dp_neg)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.61e-16 | [-0.13, 0.13]
## ACdP neg    |       0.06 | [-0.06, 0.19]
anova(model_intrusions_distress_dp_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_neg    1   0.803 0.80295   1.022 0.3131
## Residuals 244 191.705 0.78568
model_intrusions_distress_dp_peri <- lm(t1_thoughts_distress_level ~ 
                            ACdP_peri, data = final_data)
summary(model_intrusions_distress_dp_peri) #Intrusions distress Dprime ACdP_peri
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_peri, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.22239 -0.98439 -0.03503  0.90357  2.04287 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.02550    0.05818  34.812   <2e-16 ***
## ACdP_peri    0.04046    0.02993   1.352    0.178    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8849 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.007435,   Adjusted R-squared:  0.003368 
## F-statistic: 1.828 on 1 and 244 DF,  p-value: 0.1776
standardized_model_intrusions_distress_dp_peri <- standardize_parameters(model_intrusions_distress_dp_peri)
print(standardized_model_intrusions_distress_dp_peri)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.65e-16 | [-0.13, 0.13]
## ACdP peri   |       0.09 | [-0.04, 0.21]
anova(model_intrusions_distress_dp_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_peri   1   1.431  1.4314  1.8278 0.1776
## Residuals 244 191.077  0.7831
model_intrusions_distress_dp_Nperi <- lm(t1_thoughts_distress_level ~ 
                            ACdP_Nperi, data = final_data)
summary(model_intrusions_distress_dp_Nperi) #Intrusions distress Dprime ACdP_Nperi
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_Nperi, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.11772 -1.02925 -0.04351  0.93877  1.98288 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.04600    0.05669  36.091   <2e-16 ***
## ACdP_Nperi   0.01383    0.03246   0.426     0.67    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8879 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.0007437,  Adjusted R-squared:  -0.003352 
## F-statistic: 0.1816 on 1 and 244 DF,  p-value: 0.6704
standardized_model_intrusions_distress_dp_Nperi <- standardize_parameters(model_intrusions_distress_dp_Nperi)
print(standardized_model_intrusions_distress_dp_Nperi)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.68e-16 | [-0.13, 0.13]
## ACdP Nperi  |       0.03 | [-0.10, 0.15]
anova(model_intrusions_distress_dp_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##             Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_Nperi   1   0.143 0.14318  0.1816 0.6704
## Residuals  244 192.365 0.78838
model_intrusions_distress_rt_neg<- lm(t1_thoughts_distress_level ~ ACRT_neg, data = final_data)
summary(model_intrusions_distress_rt_neg) #Intrusions distress Reaction Time ACRT_neg
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_neg, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.08141 -1.02832 -0.04458  0.94472  2.00274 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.0455465  0.0566796   36.09   <2e-16 ***
## ACRT_neg    -0.0003085  0.0009638   -0.32    0.749    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8881 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.0004196,  Adjusted R-squared:  -0.003677 
## F-statistic: 0.1024 on 1 and 244 DF,  p-value: 0.7492
standardized_model_intrusions_distress_rt_neg <- standardize_parameters(model_intrusions_distress_rt_neg)
print(standardized_model_intrusions_distress_rt_neg)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.65e-16 | [-0.13, 0.13]
## ACRT neg    |      -0.02 | [-0.15, 0.11]
anova(model_intrusions_distress_rt_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_neg    1   0.081 0.08078  0.1024 0.7492
## Residuals 244 192.427 0.78864
model_intrusions_distress_rt_peri<- lm(t1_thoughts_distress_level ~ ACRT_peri, data = final_data)
summary(model_intrusions_distress_rt_peri) #Intrusions distress Reaction Time ACRT_peri
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_peri, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.08482 -1.03117 -0.04535  0.94549  1.98423 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.0477059  0.0574071  35.670   <2e-16 ***
## ACRT_peri   -0.0003067  0.0009712  -0.316    0.752    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8881 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.0004084,  Adjusted R-squared:  -0.003688 
## F-statistic: 0.0997 on 1 and 244 DF,  p-value: 0.7525
standardized_model_intrusions_distress_rt_peri <- standardize_parameters(model_intrusions_distress_rt_peri)
print(standardized_model_intrusions_distress_rt_peri)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.67e-16 | [-0.13, 0.13]
## ACRT peri   |      -0.02 | [-0.15, 0.11]
anova(model_intrusions_distress_rt_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##            Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_peri   1   0.079 0.07863  0.0997 0.7525
## Residuals 244 192.430 0.78865
model_intrusions_distress_rt_Nperi<- lm(t1_thoughts_distress_level ~ ACRT_Nperi, data = final_data)
summary(model_intrusions_distress_rt_Nperi) #Intrusions distress Reaction Time
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_Nperi, data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.04569 -1.04445 -0.04475  0.95493  1.95643 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 2.045e+00  5.703e-02  35.852   <2e-16 ***
## ACRT_Nperi  6.315e-06  9.547e-04   0.007    0.995    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8882 on 244 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  1.794e-07,  Adjusted R-squared:  -0.004098 
## F-statistic: 4.376e-05 on 1 and 244 DF,  p-value: 0.9947
standardized_model_intrusions_distress_rt_Nperi <- standardize_parameters(model_intrusions_distress_rt_Nperi)
print(standardized_model_intrusions_distress_rt_Nperi)
## # Standardization method: refit
## 
## Parameter   | Std. Coef. |        95% CI
## ----------------------------------------
## (Intercept) |  -3.65e-16 | [-0.13, 0.13]
## ACRT Nperi  |   4.24e-04 | [-0.13, 0.13]
anova(model_intrusions_distress_rt_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##             Df Sum Sq Mean Sq F value Pr(>F)
## ACRT_Nperi   1   0.00 0.00003       0 0.9947
## Residuals  244 192.51 0.78897

###trialling

#Rename variables for separation 
final_data_rename <- final_data %>%
  rename(intrusions_T1 = t1intrusionsTotal,
         intrusionsdistress_T1 = t1_thoughts_distress_level,
         rtq_T1 = t1rtqTotal,
         intrusions_T2 = t2_intrusions_total,
         intrusionsdistress_T2 = t2_thoughts_distress_level,
         rtq_T2 = t2_rtq_total
         )
#Select variables for pivot
final_data_select <- final_data_rename %>%
   dplyr::select (Prolific_ID, intrusions_T1, intrusionsdistress_T1, rtq_T1, intrusions_T2, intrusionsdistress_T2,rtq_T2, t1_wks_since_conception, average_DPrime_neutral_score, average_DPrime_negative_score, average_DPrime_perineg_score, average_RT_neutral_score, average_RT_negative_score, average_RT_perineg_score,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1,DprimeNeg_2,DprimeNeut_2,DprimePNeg_2,DprimeNeg_3, DprimeNeut_3, DprimePNeg_3,RTNeg_1,RTNeut_1,RTPNeg_1,RTNeg_2,RTNeut_2, RTPNeg_2,RTNeg_3,RTNeut_3,RTPNeg_3,ACdP_neg,ACdP_peri,ACdP_Nperi,ACRT_neg,ACRT_peri,ACRT_Nperi)
final_data_select <- final_data_rename %>%
   dplyr::select (Prolific_ID, intrusions_T1, intrusionsdistress_T1, rtq_T1, intrusions_T2, intrusionsdistress_T2,rtq_T2, t1_wks_since_conception, average_DPrime_neutral_score, average_DPrime_negative_score, average_DPrime_perineg_score, average_RT_neutral_score, average_RT_negative_score, average_RT_perineg_score,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1,DprimeNeg_2,DprimeNeut_2,DprimePNeg_2,DprimeNeg_3, DprimeNeut_3, DprimePNeg_3,RTNeg_1,RTNeut_1,RTPNeg_1,RTNeg_2,RTNeut_2, RTPNeg_2,RTNeg_3,RTNeut_3,RTPNeg_3,ACdP_neg,ACdP_peri,ACdP_Nperi,ACRT_neg,ACRT_peri,ACRT_Nperi)
#Pivot to long
final_data_long <- final_data_select %>%
  pivot_longer(
    cols = c(intrusions_T1, intrusions_T2, intrusionsdistress_T1, intrusionsdistress_T2, rtq_T1, rtq_T2),
    names_to = c(".value", "time"), 
    names_sep = "_T"
  )
#Pivot to long
final_data_long <- final_data_select %>%
  pivot_longer(
    cols = c(intrusions_T1, intrusions_T2, intrusionsdistress_T1, intrusionsdistress_T2, rtq_T1, rtq_T2),
    names_to = c(".value", "time"), 
    names_sep = "_T"
  )
# Converting time to a factor
final_data_long$time <- as.factor(final_data_long$time)

H1 - T2 1-Month follow-up

#Rename variables for separation 
final_dataT2_rename <- final_dataT2 %>%
  rename(intrusions_T1 = t1intrusionsTotal,
         intrusionsdistress_T1 = t1_thoughts_distress_level,
         rtq_T1 = t1rtqTotal,
         intrusions_T2 = t2_intrusions_total,
         intrusionsdistress_T2 = t2_thoughts_distress_level,
         rtq_T2 = t2_rtq_total
         )
final_dataT2_select <- final_dataT2_rename %>%
   dplyr::select (Prolific_ID, intrusions_T1, intrusionsdistress_T1, rtq_T1, intrusions_T2, intrusionsdistress_T2,rtq_T2, t1_wks_since_conception, average_DPrime_neutral_score, average_DPrime_negative_score, average_DPrime_perineg_score, average_RT_neutral_score, average_RT_negative_score, average_RT_perineg_score,DprimeNeg_1,DprimeNeut_1,DprimePNeg_1,DprimeNeg_2,DprimeNeut_2,DprimePNeg_2,DprimeNeg_3, DprimeNeut_3, DprimePNeg_3,RTNeg_1,RTNeut_1,RTPNeg_1,RTNeg_2,RTNeut_2, RTPNeg_2,RTNeg_3,RTNeut_3,RTPNeg_3,ACdP_neg,ACdP_peri,ACdP_Nperi,ACRT_neg,ACRT_peri,ACRT_Nperi)
#Pivot to long
final_dataT2_long <- final_dataT2_select %>%
  pivot_longer(
    cols = c(intrusions_T1, intrusions_T2, intrusionsdistress_T1, intrusionsdistress_T2, rtq_T1, rtq_T2),
    names_to = c(".value", "time"), 
    names_sep = "_T"
  )
# Converting time to a factor
final_dataT2_long$time <- as.factor(final_dataT2_long$time)

###H1-T2 Intrusions

#Intrusions - Dprime
model_intrusions_dp_neg_t2 <- lmer(intrusions ~ time * ACdP_neg + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_neg_t2) #Intrusions symptoms Dprime ACdP_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACdP_neg + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2072
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7271 -0.4885 -0.1003  0.4775  3.0625 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.133    2.477   
##  Residual                4.650    2.156   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                 Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)      4.71039    0.24183 308.27461  19.478   <2e-16 ***
## time2           -0.39429    0.22459 204.00000  -1.756   0.0807 .  
## ACdP_neg         0.09956    0.12690 308.27461   0.785   0.4333    
## time2:ACdP_neg  -0.02970    0.11785 204.00000  -0.252   0.8013    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_n
## time2       -0.464              
## ACdP_neg    -0.324  0.150       
## tm2:ACdP_ng  0.150 -0.324 -0.464
standardized_model_intrusions_dp_neg_t2 <- standardize_parameters(model_intrusions_dp_neg_t2)
print(standardized_model_intrusions_dp_neg_t2)
## # Standardization method: refit
## 
## Parameter           | Std. Coef. |        95% CI
## ------------------------------------------------
## (Intercept)         |       0.06 | [-0.07, 0.20]
## time [2]            |      -0.13 | [-0.25, 0.00]
## ACdP neg            |       0.05 | [-0.08, 0.19]
## time [2] × ACdP neg |      -0.02 | [-0.14, 0.11]
anova(model_intrusions_dp_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## time          14.3327 14.3327     1   204  3.0821 0.08066 .
## ACdP_neg       2.6419  2.6419     1   204  0.5681 0.45188  
## time:ACdP_neg  0.2954  0.2954     1   204  0.0635 0.80125  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter     | Eta2 (partial) |       95% CI
## ---------------------------------------------
## time          |           0.01 | [0.00, 1.00]
## ACdP_neg      |       2.78e-03 | [0.00, 1.00]
## time:ACdP_neg |       3.11e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.571
##      Marginal R2: 0.006
model_intrusions_dp_peri_t2 <- lmer(intrusions ~ time * ACdP_peri + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_peri_t2) #Intrusions symptoms Dprime ACdP_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACdP_peri + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2070.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.78454 -0.48903 -0.09454  0.47979  3.09188 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.121    2.474   
##  Residual                4.628    2.151   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                 Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)       4.6749     0.2384 308.0975  19.607   <2e-16 ***
## time2            -0.3480     0.2213 204.0000  -1.573    0.117    
## ACdP_peri         0.1715     0.1208 308.0975   1.419    0.157    
## time2:ACdP_peri  -0.1143     0.1121 204.0000  -1.020    0.309    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_p
## time2       -0.464              
## ACdP_peri   -0.287  0.133       
## tm2:ACdP_pr  0.133 -0.287 -0.464
standardized_model_intrusions_dp_peri_t2 <- standardize_parameters(model_intrusions_dp_peri_t2)
print(standardized_model_intrusions_dp_peri_t2)
## # Standardization method: refit
## 
## Parameter            | Std. Coef. |        95% CI
## -------------------------------------------------
## (Intercept)          |       0.06 | [-0.07, 0.20]
## time [2]             |      -0.13 | [-0.25, 0.00]
## ACdP peri            |       0.10 | [-0.04, 0.24]
## time [2] × ACdP peri |      -0.07 | [-0.19, 0.06]
anova(model_intrusions_dp_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                 Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time           11.4467 11.4467     1   204  2.4733 0.1173
## ACdP_peri       5.2794  5.2794     1   204  1.1407 0.2868
## time:ACdP_peri  4.8120  4.8120     1   204  1.0397 0.3091
eta_squared(model_intrusions_dp_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## time           |           0.01 | [0.00, 1.00]
## ACdP_peri      |       5.56e-03 | [0.00, 1.00]
## time:ACdP_peri |       5.07e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.573
##      Marginal R2: 0.009
model_intrusions_dp_Nperi_t2 <- lmer(intrusions ~ time * ACdP_Nperi + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_Nperi_t2) #Intrusions symptoms Dprime ACdP_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACdP_Nperi + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2071.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.72882 -0.48046 -0.09531  0.46963  3.08238 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.158    2.482   
##  Residual                4.636    2.153   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                   Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)        4.77663    0.22901 307.81073  20.858   <2e-16 ***
## time2             -0.41778    0.21225 204.00000  -1.968   0.0504 .  
## ACdP_Nperi         0.09263    0.12953 307.81073   0.715   0.4751    
## time2:ACdP_Nperi  -0.09993    0.12005 204.00000  -0.832   0.4061    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_N
## time2       -0.463              
## ACdP_Nperi   0.029 -0.014       
## tm2:ACdP_Np -0.014  0.029 -0.463
standardized_model_intrusions_dp_Nperi_t2 <- standardize_parameters(model_intrusions_dp_Nperi_t2)
print(standardized_model_intrusions_dp_Nperi_t2)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |       0.06 | [-0.07, 0.20]
## time [2]              |      -0.13 | [-0.25, 0.00]
## ACdP Nperi            |       0.05 | [-0.09, 0.19]
## time [2] × ACdP Nperi |      -0.05 | [-0.18, 0.07]
anova(model_intrusions_dp_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                  Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## time            17.9626 17.9626     1   204  3.8746 0.05038 .
## ACdP_Nperi       0.6405  0.6405     1   204  0.1382 0.71051  
## time:ACdP_Nperi  3.2125  3.2125     1   204  0.6929 0.40614  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter       | Eta2 (partial) |       95% CI
## -----------------------------------------------
## time            |           0.02 | [0.00, 1.00]
## ACdP_Nperi      |       6.77e-04 | [0.00, 1.00]
## time:ACdP_Nperi |       3.39e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.573
##      Marginal R2: 0.005
#Intrusions - Reaction Time
model_intrusions_rt_neg_t2 <- lmer(intrusions ~ time * ACRT_neg + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_rt_neg_t2) #Intrusions symptoms Reaction Time ACRT_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACRT_neg + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2080.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.80627 -0.50119 -0.09415  0.49336  3.09832 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 5.914    2.432   
##  Residual                4.652    2.157   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                  Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)     4.801e+00  2.269e-01  3.107e+02  21.161   <2e-16 ***
## time2          -4.131e-01  2.129e-01  2.040e+02  -1.940   0.0537 .  
## ACRT_neg       -8.156e-03  3.746e-03  3.107e+02  -2.177   0.0302 *  
## time2:ACRT_neg  1.239e-04  3.515e-03  2.040e+02   0.035   0.9719    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_n
## time2       -0.469              
## ACRT_neg    -0.059  0.028       
## tm2:ACRT_ng  0.028 -0.059 -0.469
standardized_model_intrusions_rt_neg_t2 <- standardize_parameters(model_intrusions_rt_neg_t2)
print(standardized_model_intrusions_rt_neg_t2)
## # Standardization method: refit
## 
## Parameter           | Std. Coef. |         95% CI
## -------------------------------------------------
## (Intercept)         |       0.06 | [-0.07,  0.20]
## time [2]            |      -0.13 | [-0.25,  0.00]
## ACRT neg            |      -0.15 | [-0.29, -0.01]
## time [2] × ACRT neg |   2.29e-03 | [-0.13,  0.13]
anova(model_intrusions_rt_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## time          17.5130 17.5130     1   204  3.7648 0.05372 .
## ACRT_neg      27.8524 27.8524     1   204  5.9875 0.01525 *
## time:ACRT_neg  0.0058  0.0058     1   204  0.0012 0.97190  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_rt_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter     | Eta2 (partial) |       95% CI
## ---------------------------------------------
## time          |           0.02 | [0.00, 1.00]
## ACRT_neg      |           0.03 | [0.00, 1.00]
## time:ACRT_neg |       6.10e-06 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.571
##      Marginal R2: 0.026
model_intrusions_rt_peri_t2<- lmer(intrusions ~ time * ACRT_peri + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_rt_peri_t2) #Intrusions symptoms Reaction Time ACRT_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACRT_peri + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2084.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.8443 -0.4863 -0.1262  0.4601  3.1526 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.158    2.482   
##  Residual                4.607    2.146   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                   Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)       4.818740   0.231550 307.404637  20.811   <2e-16 ***
## time2            -0.460604   0.214218 204.000002  -2.150   0.0327 *  
## ACRT_peri        -0.004924   0.003867 307.404637  -1.273   0.2039    
## time2:ACRT_peri   0.005038   0.003578 204.000002   1.408   0.1606    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_p
## time2       -0.463              
## ACRT_peri   -0.159  0.074       
## tm2:ACRT_pr  0.074 -0.159 -0.463
standardized_model_intrusions_rt_peri_t2 <- standardize_parameters(model_intrusions_rt_peri_t2)
print(standardized_model_intrusions_rt_peri_t2)
## # Standardization method: refit
## 
## Parameter            | Std. Coef. |        95% CI
## -------------------------------------------------
## (Intercept)          |       0.06 | [-0.07, 0.20]
## time [2]             |      -0.13 | [-0.25, 0.00]
## ACRT peri            |      -0.09 | [-0.23, 0.05]
## time [2] × ACRT peri |       0.09 | [-0.04, 0.22]
anova(model_intrusions_rt_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                 Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## time           21.2992 21.2992     1   204  4.6232 0.03272 *
## ACRT_peri       2.2664  2.2664     1   204  0.4919 0.48386  
## time:ACRT_peri  9.1346  9.1346     1   204  1.9828 0.16062  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_rt_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## time           |           0.02 | [0.00, 1.00]
## ACRT_peri      |       2.41e-03 | [0.00, 1.00]
## time:ACRT_peri |       9.63e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.575
##      Marginal R2: 0.008
model_intrusions_rt_Nperi_t2 <- lmer(intrusions ~ time * ACRT_Nperi + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_rt_Nperi_t2) #Intrusions symptoms Reaction Time ACRT_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ time * ACRT_Nperi + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2081.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7037 -0.4987 -0.1001  0.4295  3.0613 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.049    2.459   
##  Residual                4.610    2.147   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                    Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)        4.750506   0.228605 308.608289  20.780   <2e-16 ***
## time2             -0.441636   0.212613 204.000000  -2.077    0.039 *  
## ACRT_Nperi         0.003583   0.003833 308.608289   0.935    0.351    
## time2:ACRT_Nperi   0.004871   0.003565 204.000000   1.366    0.173    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_N
## time2       -0.465              
## ACRT_Nperi  -0.100  0.046       
## tm2:ACRT_Np  0.046 -0.100 -0.465
standardized_model_intrusions_rt_Nperi_t2 <- standardize_parameters(model_intrusions_rt_Nperi_t2)
print(standardized_model_intrusions_rt_Nperi_t2)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |       0.06 | [-0.07, 0.20]
## time [2]              |      -0.13 | [-0.25, 0.00]
## ACRT Nperi            |       0.06 | [-0.07, 0.20]
## time [2] × ACRT Nperi |       0.09 | [-0.04, 0.22]
anova(model_intrusions_rt_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                  Sum Sq Mean Sq NumDF DenDF F value  Pr(>F)  
## time            19.8890 19.8890     1   204  4.3147 0.03904 *
## ACRT_Nperi      14.4967 14.4967     1   204  3.1449 0.07766 .
## time:ACRT_Nperi  8.6057  8.6057     1   204  1.8669 0.17333  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_rt_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter       | Eta2 (partial) |       95% CI
## -----------------------------------------------
## time            |           0.02 | [0.00, 1.00]
## ACRT_Nperi      |           0.02 | [0.00, 1.00]
## time:ACRT_Nperi |       9.07e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.575
##      Marginal R2: 0.018

H1-T2 Distress

#Intrusion distress -Dprime
model_intrusions_distress_dp_neg_t2 <- lmer(intrusionsdistress ~ time * ACdP_neg + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_neg_t2) #Intrusions symptoms Dprime ACdP_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACdP_neg + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1016.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.50800 -0.47251 -0.07393  0.49178  2.86521 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5397   0.7346  
##  Residual                0.3187   0.5646  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                 Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)      2.05087    0.06823 292.41513  30.058   <2e-16 ***
## time2           -0.08507    0.05880 204.00001  -1.447    0.149    
## ACdP_neg         0.01982    0.03580 292.41513   0.554    0.580    
## time2:ACdP_neg   0.04344    0.03085 204.00001   1.408    0.161    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_n
## time2       -0.431              
## ACdP_neg    -0.324  0.140       
## tm2:ACdP_ng  0.140 -0.324 -0.431
standardized_model_intrusions_distress_dp_neg_t2<- standardize_parameters(model_intrusions_distress_dp_neg_t2)
print(standardized_model_intrusions_distress_dp_neg_t2)
## # Standardization method: refit
## 
## Parameter           | Std. Coef. |        95% CI
## ------------------------------------------------
## (Intercept)         |       0.03 | [-0.11, 0.17]
## time [2]            |      -0.06 | [-0.18, 0.06]
## ACdP neg            |       0.04 | [-0.10, 0.18]
## time [2] × ACdP neg |       0.08 | [-0.03, 0.20]
anova(model_intrusions_distress_dp_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time          0.66713 0.66713     1   204  2.0931 0.1495
## ACdP_neg      0.52694 0.52694     1   204  1.6533 0.2000
## time:ACdP_neg 0.63181 0.63181     1   204  1.9823 0.1607
eta_squared(model_intrusions_distress_dp_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter     | Eta2 (partial) |       95% CI
## ---------------------------------------------
## time          |           0.01 | [0.00, 1.00]
## ACdP_neg      |       8.04e-03 | [0.00, 1.00]
## time:ACdP_neg |       9.62e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.632
##      Marginal R2: 0.009
model_intrusions_distress_dp_peri_t2 <- lmer(intrusionsdistress ~ time * ACdP_peri + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_peri_t2) #Intrusions symptoms Dprime ACdP_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACdP_peri + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1018.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.52712 -0.46811 -0.05872  0.46403  2.82564 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5364   0.7324  
##  Residual                0.3216   0.5671  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                  Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)       2.04031    0.06737 293.34724  30.287   <2e-16 ***
## time2            -0.06413    0.05833 204.00000  -1.099    0.273    
## ACdP_peri         0.04030    0.03413 293.34724   1.181    0.239    
## time2:ACdP_peri   0.01039    0.02955 204.00000   0.352    0.726    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_p
## time2       -0.433              
## ACdP_peri   -0.287  0.124       
## tm2:ACdP_pr  0.124 -0.287 -0.433
standardized_model_intrusions_distress_dp_peri_t2 <- standardize_parameters(model_intrusions_distress_dp_peri_t2)
print(standardized_model_intrusions_distress_dp_peri_t2)
## # Standardization method: refit
## 
## Parameter            | Std. Coef. |        95% CI
## -------------------------------------------------
## (Intercept)          |       0.03 | [-0.11, 0.17]
## time [2]             |      -0.06 | [-0.18, 0.06]
## ACdP peri            |       0.08 | [-0.05, 0.22]
## time [2] × ACdP peri |       0.02 | [-0.10, 0.14]
anova(model_intrusions_distress_dp_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                 Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time           0.38880 0.38880     1   204  1.2089 0.2729
## ACdP_peri      0.70302 0.70302     1   204  2.1859 0.1408
## time:ACdP_peri 0.03975 0.03975     1   204  0.1236 0.7255
eta_squared(model_intrusions_distress_dp_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## time           |       5.89e-03 | [0.00, 1.00]
## ACdP_peri      |           0.01 | [0.00, 1.00]
## time:ACdP_peri |       6.05e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.629
##      Marginal R2: 0.010
model_intrusions_distress_dp_Nperi_t2 <- lmer(intrusionsdistress ~ time * ACdP_Nperi + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_Nperi_t2) #Intrusions symptoms Dprime ACdP_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACdP_Nperi + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1019
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.56871 -0.46445 -0.04134  0.48083  2.93157 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5444   0.7379  
##  Residual                0.3201   0.5657  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                   Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)        2.06442    0.06481 292.13594  31.854   <2e-16 ***
## time2             -0.05997    0.05577 204.00001  -1.075    0.283    
## ACdP_Nperi         0.02549    0.03666 292.13594   0.695    0.487    
## time2:ACdP_Nperi  -0.03332    0.03154 204.00001  -1.056    0.292    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACdP_N
## time2       -0.430              
## ACdP_Nperi   0.029 -0.013       
## tm2:ACdP_Np -0.013  0.029 -0.430
standardized_model_intrusions_distress_dp_Nperi_t2 <- standardize_parameters(model_intrusions_distress_dp_Nperi_t2)
print(standardized_model_intrusions_distress_dp_Nperi_t2)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |       0.03 | [-0.11, 0.17]
## time [2]              |      -0.06 | [-0.18, 0.06]
## ACdP Nperi            |       0.05 | [-0.09, 0.19]
## time [2] × ACdP Nperi |      -0.06 | [-0.18, 0.05]
anova(model_intrusions_distress_dp_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                  Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time            0.37016 0.37016     1   204  1.1565 0.2835
## ACdP_Nperi      0.02279 0.02279     1   204  0.0712 0.7899
## time:ACdP_Nperi 0.35720 0.35720     1   204  1.1160 0.2920
eta_squared(model_intrusions_distress_dp_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter       | Eta2 (partial) |       95% CI
## -----------------------------------------------
## time            |       5.64e-03 | [0.00, 1.00]
## ACdP_Nperi      |       3.49e-04 | [0.00, 1.00]
## time:ACdP_Nperi |       5.44e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_Nperi_t2 )
## # R2 for Mixed Models
## 
##   Conditional R2: 0.631
##      Marginal R2: 0.002
#Intrusion distress - Reaction Time
model_intrusions_distress_rt_neg_t2<- lmer(intrusionsdistress ~ time * ACRT_neg + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_rt_neg_t2) #Intrusions symptoms Reaction Time ACRT_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACRT_neg + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1032.8
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.54088 -0.47904 -0.06403  0.45818  2.95496 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5423   0.7364  
##  Residual                0.3205   0.5661  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                  Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)     2.064e+00  6.483e-02  2.925e+02  31.844   <2e-16 ***
## time2          -5.518e-02  5.588e-02  2.040e+02  -0.988    0.324    
## ACRT_neg       -3.480e-04  1.070e-03  2.925e+02  -0.325    0.745    
## time2:ACRT_neg -8.597e-04  9.225e-04  2.040e+02  -0.932    0.352    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_n
## time2       -0.431              
## ACRT_neg    -0.059  0.025       
## tm2:ACRT_ng  0.025 -0.059 -0.431
standardized_model_intrusions_distress_rt_neg_t2 <- standardize_parameters(model_intrusions_distress_rt_neg_t2)
print(standardized_model_intrusions_distress_rt_neg_t2 )
## # Standardization method: refit
## 
## Parameter           | Std. Coef. |        95% CI
## ------------------------------------------------
## (Intercept)         |       0.03 | [-0.11, 0.17]
## time [2]            |      -0.06 | [-0.18, 0.06]
## ACRT neg            |      -0.02 | [-0.16, 0.11]
## time [2] × ACRT neg |      -0.06 | [-0.17, 0.06]
anova(model_intrusions_distress_rt_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time          0.31258 0.31258     1   204  0.9754 0.3245
## ACRT_neg      0.20790 0.20790     1   204  0.6488 0.4215
## time:ACRT_neg 0.27833 0.27833     1   204  0.8686 0.3525
eta_squared(model_intrusions_distress_rt_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter     | Eta2 (partial) |       95% CI
## ---------------------------------------------
## time          |       4.76e-03 | [0.00, 1.00]
## ACRT_neg      |       3.17e-03 | [0.00, 1.00]
## time:ACRT_neg |       4.24e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.630
##      Marginal R2: 0.004
model_intrusions_distress_rt_peri_t2<- lmer(intrusionsdistress ~ time * ACRT_peri + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_rt_peri_t2) #Intrusions symptoms Reaction Time ACRT_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACRT_peri + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1034
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.50197 -0.46473 -0.06301  0.44375  2.88532 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5432   0.7370  
##  Residual                0.3218   0.5673  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                   Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)      2.068e+00  6.564e-02  2.926e+02  31.501   <2e-16 ***
## time2           -5.915e-02  5.662e-02  2.040e+02  -1.045    0.297    
## ACRT_peri       -4.678e-04  1.096e-03  2.926e+02  -0.427    0.670    
## time2:ACRT_peri  9.383e-05  9.455e-04  2.040e+02   0.099    0.921    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_p
## time2       -0.431              
## ACRT_peri   -0.159  0.069       
## tm2:ACRT_pr  0.069 -0.159 -0.431
standardized_model_intrusions_distress_rt_peri_t2 <- standardize_parameters(model_intrusions_distress_rt_peri_t2)
print(standardized_model_intrusions_distress_rt_peri_t2)
## # Standardization method: refit
## 
## Parameter            | Std. Coef. |        95% CI
## -------------------------------------------------
## (Intercept)          |       0.03 | [-0.11, 0.17]
## time [2]             |      -0.06 | [-0.18, 0.06]
## ACRT peri            |      -0.03 | [-0.17, 0.11]
## time [2] × ACRT peri |   5.99e-03 | [-0.11, 0.12]
anova(model_intrusions_distress_rt_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                 Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time           0.35120 0.35120     1   204  1.0914 0.2974
## ACRT_peri      0.05828 0.05828     1   204  0.1811 0.6709
## time:ACRT_peri 0.00317 0.00317     1   204  0.0098 0.9211
eta_squared(model_intrusions_distress_rt_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter      | Eta2 (partial) |       95% CI
## ----------------------------------------------
## time           |       5.32e-03 | [0.00, 1.00]
## ACRT_peri      |       8.87e-04 | [0.00, 1.00]
## time:ACRT_peri |       4.83e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.629
##      Marginal R2: 0.002
model_intrusions_distress_rt_Nperi_t2<- lmer(intrusionsdistress ~ time * ACRT_Nperi + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_rt_Nperi_t2) #Intrusions symptoms Reaction Time ACRT_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ time * ACRT_Nperi + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1033
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.54289 -0.47303 -0.05587  0.45914  2.92929 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5441   0.7377  
##  Residual                0.3201   0.5658  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                    Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)       2.064e+00  6.510e-02  2.922e+02  31.703   <2e-16 ***
## time2            -6.412e-02  5.603e-02  2.040e+02  -1.145    0.254    
## ACRT_Nperi       -1.029e-04  1.092e-03  2.922e+02  -0.094    0.925    
## time2:ACRT_Nperi  9.859e-04  9.395e-04  2.040e+02   1.049    0.295    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) time2  ACRT_N
## time2       -0.430              
## ACRT_Nperi  -0.100  0.043       
## tm2:ACRT_Np  0.043 -0.100 -0.430
standardized_model_intrusions_distress_rt_Nperi_t2 <- standardize_parameters(model_intrusions_distress_rt_Nperi_t2)
print(standardized_model_intrusions_distress_rt_Nperi_t2)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |       0.03 | [-0.11, 0.17]
## time [2]              |      -0.06 | [-0.18, 0.06]
## ACRT Nperi            |  -6.59e-03 | [-0.14, 0.13]
## time [2] × ACRT Nperi |       0.06 | [-0.06, 0.18]
anova(model_intrusions_distress_rt_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                  Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## time            0.41931 0.41931     1   204  1.3100 0.2537
## ACRT_Nperi      0.05016 0.05016     1   204  0.1567 0.6926
## time:ACRT_Nperi 0.35250 0.35250     1   204  1.1013 0.2952
eta_squared(model_intrusions_distress_rt_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter       | Eta2 (partial) |       95% CI
## -----------------------------------------------
## time            |       6.38e-03 | [0.00, 1.00]
## ACRT_Nperi      |       7.68e-04 | [0.00, 1.00]
## time:ACRT_Nperi |       5.37e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.631
##      Marginal R2: 0.003

##H2 - RNT X Affective Control ##Cross Sectional ### H2-T1 Intrusions

#Intrusions 

model_intrusions_dp_mod_neg <- lm(t1intrusionsTotal ~ ACdP_neg*t1rtqTotal, data = final_data)
summary(model_intrusions_dp_mod_neg) #Intrusions mod Dprime ACdP_neg
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_neg * t1rtqTotal, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.7608 -2.3543 -0.4392  1.9350  8.9451 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          1.366796   0.545824   2.504   0.0129 *  
## ACdP_neg            -0.220755   0.273523  -0.807   0.4204    
## t1rtqTotal           0.131848   0.019528   6.752 1.07e-10 ***
## ACdP_neg:t1rtqTotal  0.009566   0.009275   1.031   0.3034    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.971 on 243 degrees of freedom
## Multiple R-squared:  0.2038, Adjusted R-squared:  0.194 
## F-statistic: 20.73 on 3 and 243 DF,  p-value: 5.387e-12
standardized_model_intrusions_dp_mod_neg <- standardize_parameters(model_intrusions_dp_mod_neg)
print(standardized_model_intrusions_dp_mod_neg)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |  -3.24e-03 | [-0.12, 0.11]
## ACdP neg              |       0.02 | [-0.10, 0.13]
## t1rtqTotal            |       0.44 | [ 0.32, 0.55]
## ACdP neg × t1rtqTotal |       0.05 | [-0.05, 0.16]
anova(model_intrusions_dp_mod_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                      Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACdP_neg              1    6.12    6.12  0.6934    0.4058    
## t1rtqTotal            1  533.66  533.66 60.4445 2.142e-13 ***
## ACdP_neg:t1rtqTotal   1    9.39    9.39  1.0637    0.3034    
## Residuals           243 2145.42    8.83                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACdP_neg            |       2.85e-03 | [0.00, 1.00]
## t1rtqTotal          |           0.20 | [0.13, 1.00]
## ACdP_neg:t1rtqTotal |       4.36e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_neg)
## # R2 for Linear Regression
##        R2: 0.204
##   adj. R2: 0.194
model_intrusions_dp_mod_peri <- lm(t1intrusionsTotal ~ ACdP_peri*t1rtqTotal, data = final_data)
summary(model_intrusions_dp_mod_peri) #Intrusions mod Dprime ACdP_peri
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_peri * t1rtqTotal, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.7045 -2.1760 -0.4892  2.0958  8.9942 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           1.003280   0.525183   1.910   0.0573 .  
## ACdP_peri             0.337907   0.240393   1.406   0.1611    
## t1rtqTotal            0.145117   0.018678   7.769 2.22e-13 ***
## ACdP_peri:t1rtqTotal -0.009063   0.008726  -1.039   0.3000    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.965 on 243 degrees of freedom
## Multiple R-squared:  0.2074, Adjusted R-squared:  0.1976 
## F-statistic: 21.19 on 3 and 243 DF,  p-value: 3.138e-12
standardized_model_intrusions_dp_mod_peri <- standardize_parameters(model_intrusions_dp_mod_peri)
print(standardized_model_intrusions_dp_mod_peri)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |   1.44e-03 | [-0.11, 0.11]
## ACdP peri              |       0.06 | [-0.06, 0.17]
## t1rtqTotal             |       0.45 | [ 0.34, 0.56]
## ACdP peri × t1rtqTotal |      -0.05 | [-0.16, 0.05]
anova(model_intrusions_dp_mod_peri)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                       Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACdP_peri              1   15.17   15.17  1.7255    0.1902    
## t1rtqTotal             1  534.19  534.19 60.7792 1.869e-13 ***
## ACdP_peri:t1rtqTotal   1    9.48    9.48  1.0787    0.3000    
## Residuals            243 2135.75    8.79                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter            | Eta2 (partial) |       95% CI
## ----------------------------------------------------
## ACdP_peri            |       7.05e-03 | [0.00, 1.00]
## t1rtqTotal           |           0.20 | [0.13, 1.00]
## ACdP_peri:t1rtqTotal |       4.42e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_peri)
## # R2 for Linear Regression
##        R2: 0.207
##   adj. R2: 0.198
model_intrusions_dp_mod_Nperi <- lm(t1intrusionsTotal ~ ACdP_Nperi*t1rtqTotal, data = final_data)
summary(model_intrusions_dp_mod_Nperi) #Intrusions mod Dprime ACdP_Nperi
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_Nperi * t1rtqTotal, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.9575 -2.2282 -0.3998  2.1549  8.9579 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            1.297807   0.506455   2.563   0.0110 *  
## ACdP_Nperi             0.660199   0.265930   2.483   0.0137 *  
## t1rtqTotal             0.135240   0.017914   7.549  8.8e-13 ***
## ACdP_Nperi:t1rtqTotal -0.022756   0.009691  -2.348   0.0197 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.941 on 243 degrees of freedom
## Multiple R-squared:  0.2198, Adjusted R-squared:  0.2102 
## F-statistic: 22.82 on 3 and 243 DF,  p-value: 4.755e-13
standardized_model_intrusions_dp_mod_Nperi <- standardize_parameters(model_intrusions_dp_mod_Nperi )
print(standardized_model_intrusions_dp_mod_Nperi)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |         95% CI
## -----------------------------------------------------
## (Intercept)             |  -4.09e-03 | [-0.12,  0.11]
## ACdP Nperi              |       0.03 | [-0.08,  0.14]
## t1rtqTotal              |       0.44 | [ 0.33,  0.55]
## ACdP Nperi × t1rtqTotal |      -0.13 | [-0.23, -0.02]
anova(model_intrusions_dp_mod_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                        Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACdP_Nperi              1    2.83    2.83  0.3274   0.56771    
## t1rtqTotal              1  541.70  541.70 62.6123 8.897e-14 ***
## ACdP_Nperi:t1rtqTotal   1   47.70   47.70  5.5138   0.01967 *  
## Residuals             243 2102.35    8.65                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter             | Eta2 (partial) |       95% CI
## -----------------------------------------------------
## ACdP_Nperi            |       1.35e-03 | [0.00, 1.00]
## t1rtqTotal            |           0.20 | [0.13, 1.00]
## ACdP_Nperi:t1rtqTotal |           0.02 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_Nperi)
## # R2 for Linear Regression
##        R2: 0.220
##   adj. R2: 0.210
model_intrusions_RT_mod_neg <- lm(t1intrusionsTotal ~ ACRT_neg*t1rtqTotal, data = final_data)
summary(model_intrusions_RT_mod_neg) #Intrusions mod Reaction time ACRT_neg
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_neg * t1rtqTotal, data = final_data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.362 -2.330 -0.433  2.118  9.410 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          1.202e+00  5.071e-01   2.370   0.0185 *  
## ACRT_neg            -3.273e-03  8.987e-03  -0.364   0.7160    
## t1rtqTotal           1.397e-01  1.787e-02   7.817 1.64e-13 ***
## ACRT_neg:t1rtqTotal -9.515e-05  3.238e-04  -0.294   0.7691    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.959 on 243 degrees of freedom
## Multiple R-squared:  0.2106, Adjusted R-squared:  0.2008 
## F-statistic:  21.6 on 3 and 243 DF,  p-value: 1.945e-12
standardized_model_intrusions_RT_mod_neg <- standardize_parameters(model_intrusions_RT_mod_neg)
print(standardized_model_intrusions_RT_mod_neg)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |  -3.02e-04 | [-0.11, 0.11]
## ACRT neg              |      -0.10 | [-0.22, 0.01]
## t1rtqTotal            |       0.44 | [ 0.33, 0.56]
## ACRT neg × t1rtqTotal |      -0.02 | [-0.14, 0.10]
anova(model_intrusions_RT_mod_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                      Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACRT_neg              1   32.33   32.33  3.6926   0.05582 .  
## t1rtqTotal            1  534.27  534.27 61.0316 1.687e-13 ***
## ACRT_neg:t1rtqTotal   1    0.76    0.76  0.0863   0.76915    
## Residuals           243 2127.24    8.75                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACRT_neg            |           0.01 | [0.00, 1.00]
## t1rtqTotal          |           0.20 | [0.13, 1.00]
## ACRT_neg:t1rtqTotal |       3.55e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_neg)
## # R2 for Linear Regression
##        R2: 0.211
##   adj. R2: 0.201
model_intrusions_RT_mod_peri <- lm(t1intrusionsTotal ~ ACRT_peri*t1rtqTotal, data = final_data)
summary(model_intrusions_RT_mod_peri) #Intrusions mod Reaction time ACRT_peri
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_peri * t1rtqTotal, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.4163 -2.3333 -0.3523  1.9921  9.7996 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           1.211e+00  5.119e-01   2.365   0.0188 *  
## ACRT_peri            -8.150e-03  8.558e-03  -0.952   0.3419    
## t1rtqTotal            1.411e-01  1.820e-02   7.752 2.47e-13 ***
## ACRT_peri:t1rtqTotal  6.942e-05  3.184e-04   0.218   0.8276    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.954 on 243 degrees of freedom
## Multiple R-squared:  0.2128, Adjusted R-squared:  0.2031 
## F-statistic:  21.9 on 3 and 243 DF,  p-value: 1.377e-12
standardized_model_intrusions_RT_mod_peri <- standardize_parameters(model_intrusions_RT_mod_peri)
print(standardized_model_intrusions_RT_mod_peri)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |  -6.24e-04 | [-0.11, 0.11]
## ACRT peri              |      -0.11 | [-0.22, 0.00]
## t1rtqTotal             |       0.45 | [ 0.34, 0.56]
## ACRT peri × t1rtqTotal |       0.01 | [-0.10, 0.13]
anova(model_intrusions_RT_mod_peri )
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                       Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACRT_peri              1   22.47   22.47  2.5745    0.1099    
## t1rtqTotal             1  550.60  550.60 63.0777 7.374e-14 ***
## ACRT_peri:t1rtqTotal   1    0.41    0.41  0.0475    0.8276    
## Residuals            243 2121.11    8.73                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter            | Eta2 (partial) |       95% CI
## ----------------------------------------------------
## ACRT_peri            |           0.01 | [0.00, 1.00]
## t1rtqTotal           |           0.21 | [0.14, 1.00]
## ACRT_peri:t1rtqTotal |       1.96e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_peri)
## # R2 for Linear Regression
##        R2: 0.213
##   adj. R2: 0.203
model_intrusions_RT_mod_Nperi <- lm(t1intrusionsTotal ~ ACRT_Nperi*t1rtqTotal, data = final_data)
summary(model_intrusions_RT_mod_Nperi) #Intrusions mod reaction time ACRT_Nperi 
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_Nperi * t1rtqTotal, data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.6656 -2.3396 -0.4466  2.0969  9.6081 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            1.2180036  0.5133632   2.373   0.0184 *  
## ACRT_Nperi            -0.0059341  0.0085764  -0.692   0.4897    
## t1rtqTotal             0.1383890  0.0182308   7.591 6.79e-13 ***
## ACRT_Nperi:t1rtqTotal  0.0002069  0.0003067   0.675   0.5005    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.976 on 243 degrees of freedom
## Multiple R-squared:  0.2015, Adjusted R-squared:  0.1916 
## F-statistic: 20.44 on 3 and 243 DF,  p-value: 7.636e-12
standardized_model_intrusions_RT_mod_Nperi <- standardize_parameters(model_intrusions_RT_mod_Nperi)
print(standardized_model_intrusions_RT_mod_Nperi)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |        95% CI
## ----------------------------------------------------
## (Intercept)             |  -2.52e-03 | [-0.12, 0.11]
## ACRT Nperi              |  -8.72e-03 | [-0.12, 0.10]
## t1rtqTotal              |       0.45 | [ 0.33, 0.56]
## ACRT Nperi × t1rtqTotal |       0.04 | [-0.08, 0.15]
anova(model_intrusions_RT_mod_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                        Df  Sum Sq Mean Sq F value    Pr(>F)    
## ACRT_Nperi              1    0.94    0.94  0.1065    0.7444    
## t1rtqTotal              1  537.93  537.93 60.7507 1.891e-13 ***
## ACRT_Nperi:t1rtqTotal   1    4.03    4.03  0.4552    0.5005    
## Residuals             243 2151.69    8.85                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter             | Eta2 (partial) |       95% CI
## -----------------------------------------------------
## ACRT_Nperi            |       4.38e-04 | [0.00, 1.00]
## t1rtqTotal            |           0.20 | [0.13, 1.00]
## ACRT_Nperi:t1rtqTotal |       1.87e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_Nperi)
## # R2 for Linear Regression
##        R2: 0.201
##   adj. R2: 0.192

H2-T1 Distress

#Intrusions distress 
model_intrusions_distress_dp_mod_neg <- lm(t1_thoughts_distress_level ~ ACdP_neg*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_dp_mod_neg) #Intrusions distress mod Dprime ACdP_neg
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_neg * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.79530 -0.48686 -0.03673  0.48087  1.88114 
## 
## Coefficients:
##                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          0.861673   0.137153   6.283 1.54e-09 ***
## ACdP_neg            -0.025280   0.068594  -0.369    0.713    
## t1rtqTotal           0.044502   0.004902   9.079  < 2e-16 ***
## ACdP_neg:t1rtqTotal  0.001519   0.002326   0.653    0.514    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7451 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3021, Adjusted R-squared:  0.2934 
## F-statistic: 34.91 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_dp_mod_neg <- standardize_parameters(model_intrusions_distress_dp_mod_neg)
print(standardized_model_intrusions_distress_dp_mod_neg )
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |  -1.91e-03 | [-0.11, 0.10]
## ACdP neg              |       0.03 | [-0.08, 0.14]
## t1rtqTotal            |       0.54 | [ 0.43, 0.65]
## ACdP neg × t1rtqTotal |       0.03 | [-0.07, 0.13]
anova(model_intrusions_distress_dp_mod_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                      Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACdP_neg              1   0.803   0.803   1.4463 0.2303    
## t1rtqTotal            1  57.112  57.112 102.8698 <2e-16 ***
## ACdP_neg:t1rtqTotal   1   0.237   0.237   0.4263 0.5144    
## Residuals           242 134.356   0.555                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACdP_neg            |       5.94e-03 | [0.00, 1.00]
## t1rtqTotal          |           0.30 | [0.22, 1.00]
## ACdP_neg:t1rtqTotal |       1.76e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_neg)
## # R2 for Linear Regression
##        R2: 0.302
##   adj. R2: 0.293
model_intrusions_distress_dp_mod_peri <- lm(t1_thoughts_distress_level ~ ACdP_peri*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_dp_mod_peri) #Intrusions distress mod Dprime ACdP_peri
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_peri * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.7793 -0.4852 -0.0435  0.4813  1.8592 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           0.857424   0.131666   6.512 4.25e-10 ***
## ACdP_peri            -0.024595   0.060155  -0.409    0.683    
## t1rtqTotal            0.044338   0.004678   9.478  < 2e-16 ***
## ACdP_peri:t1rtqTotal  0.002324   0.002184   1.064    0.288    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7418 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3082, Adjusted R-squared:  0.2996 
## F-statistic: 35.93 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_dp_mod_peri <- standardize_parameters(model_intrusions_distress_dp_mod_peri)
print(standardized_model_intrusions_distress_dp_mod_peri)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |  -1.40e-03 | [-0.11, 0.10]
## ACdP peri              |       0.08 | [-0.03, 0.18]
## t1rtqTotal             |       0.54 | [ 0.44, 0.65]
## ACdP peri × t1rtqTotal |       0.05 | [-0.04, 0.15]
anova(model_intrusions_distress_dp_mod_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                       Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACdP_peri              1   1.431   1.431   2.6009 0.1081    
## t1rtqTotal             1  57.272  57.272 104.0673 <2e-16 ***
## ACdP_peri:t1rtqTotal   1   0.624   0.624   1.1331 0.2882    
## Residuals            242 133.181   0.550                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter            | Eta2 (partial) |       95% CI
## ----------------------------------------------------
## ACdP_peri            |           0.01 | [0.00, 1.00]
## t1rtqTotal           |           0.30 | [0.22, 1.00]
## ACdP_peri:t1rtqTotal |       4.66e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_peri)
## # R2 for Linear Regression
##        R2: 0.308
##   adj. R2: 0.300
model_intrusions_distress_dp_mod_Nperi <- lm(t1_thoughts_distress_level ~ ACdP_Nperi*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_dp_mod_Nperi) #Intrusions distress mod Dprime ACdP_Nperi
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_Nperi * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.80558 -0.47995 -0.03517  0.48786  1.86668 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            0.8283827  0.1285576   6.444 6.25e-10 ***
## ACdP_Nperi            -0.0005007  0.0673672  -0.007    0.994    
## t1rtqTotal             0.0462513  0.0045421  10.183  < 2e-16 ***
## ACdP_Nperi:t1rtqTotal  0.0009231  0.0024549   0.376    0.707    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.745 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3022, Adjusted R-squared:  0.2936 
## F-statistic: 34.94 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_dp_mod_Nperi <- standardize_parameters(model_intrusions_distress_dp_mod_Nperi)
print(standardized_model_intrusions_distress_dp_mod_Nperi)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |        95% CI
## ----------------------------------------------------
## (Intercept)             |   6.08e-04 | [-0.10, 0.11]
## ACdP Nperi              |       0.05 | [-0.06, 0.15]
## t1rtqTotal              |       0.55 | [ 0.44, 0.66]
## ACdP Nperi × t1rtqTotal |       0.02 | [-0.08, 0.12]
anova(model_intrusions_distress_dp_mod_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                        Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACdP_Nperi              1   0.143   0.143   0.2579 0.6120    
## t1rtqTotal              1  57.958  57.958 104.4148 <2e-16 ***
## ACdP_Nperi:t1rtqTotal   1   0.078   0.078   0.1414 0.7072    
## Residuals             242 134.328   0.555                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter             | Eta2 (partial) |       95% CI
## -----------------------------------------------------
## ACdP_Nperi            |       1.06e-03 | [0.00, 1.00]
## t1rtqTotal            |           0.30 | [0.23, 1.00]
## ACdP_Nperi:t1rtqTotal |       5.84e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_Nperi)
## # R2 for Linear Regression
##        R2: 0.302
##   adj. R2: 0.294
model_intrusions_distress_RT_mod_neg <- lm(t1_thoughts_distress_level ~ ACRT_neg*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_RT_mod_neg) #Intrusions distress mod Reaction time ACRT_neg
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_neg * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.8068 -0.4710 -0.0375  0.4705  1.8811 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          8.355e-01  1.282e-01   6.518  4.1e-10 ***
## ACRT_neg            -2.303e-04  2.269e-03  -0.102    0.919    
## t1rtqTotal           4.589e-02  4.512e-03  10.171  < 2e-16 ***
## ACRT_neg:t1rtqTotal  2.970e-06  8.172e-05   0.036    0.971    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7463 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.2999, Adjusted R-squared:  0.2912 
## F-statistic: 34.56 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_RT_mod_neg <- standardize_parameters(model_intrusions_distress_RT_mod_neg)
print(standardized_model_intrusions_distress_RT_mod_neg)
## # Standardization method: refit
## 
## Parameter             | Std. Coef. |        95% CI
## --------------------------------------------------
## (Intercept)           |   3.91e-05 | [-0.11, 0.11]
## ACRT neg              |      -0.01 | [-0.12, 0.10]
## t1rtqTotal            |       0.55 | [ 0.44, 0.65]
## ACRT neg × t1rtqTotal |   2.08e-03 | [-0.11, 0.12]
anova(model_intrusions_distress_RT_mod_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                      Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACRT_neg              1   0.081   0.081   0.1451 0.7036    
## t1rtqTotal            1  57.656  57.656 103.5306 <2e-16 ***
## ACRT_neg:t1rtqTotal   1   0.001   0.001   0.0013 0.9710    
## Residuals           242 134.770   0.557                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACRT_neg            |       5.99e-04 | [0.00, 1.00]
## t1rtqTotal          |           0.30 | [0.22, 1.00]
## ACRT_neg:t1rtqTotal |       5.46e-06 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_neg)
## # R2 for Linear Regression
##        R2: 0.300
##   adj. R2: 0.291
model_intrusions_distress_RT_mod_peri <- lm(t1_thoughts_distress_level ~ ACRT_peri*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_RT_mod_peri) #Intrusions distress mod Reaction time ACRT_peri
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_peri * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.77449 -0.49776 -0.00132  0.51894  1.94514 
## 
## Coefficients:
##                        Estimate Std. Error t value Pr(>|t|)    
## (Intercept)           8.173e-01  1.292e-01   6.327  1.2e-09 ***
## ACRT_peri             1.244e-03  2.156e-03   0.577    0.564    
## t1rtqTotal            4.695e-02  4.586e-03  10.238  < 2e-16 ***
## ACRT_peri:t1rtqTotal -7.788e-05  8.018e-05  -0.971    0.332    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7438 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3046, Adjusted R-squared:  0.296 
## F-statistic: 35.34 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_RT_mod_peri <- standardize_parameters(model_intrusions_distress_RT_mod_peri)
print(standardized_model_intrusions_distress_RT_mod_peri)
## # Standardization method: refit
## 
## Parameter              | Std. Coef. |        95% CI
## ---------------------------------------------------
## (Intercept)            |   2.52e-03 | [-0.10, 0.11]
## ACRT peri              |      -0.05 | [-0.16, 0.05]
## t1rtqTotal             |       0.55 | [ 0.45, 0.66]
## ACRT peri × t1rtqTotal |      -0.05 | [-0.16, 0.06]
anova(model_intrusions_distress_RT_mod_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                       Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACRT_peri              1   0.079   0.079   0.1421 0.7065    
## t1rtqTotal             1  58.041  58.041 104.9260 <2e-16 ***
## ACRT_peri:t1rtqTotal   1   0.522   0.522   0.9434 0.3324    
## Residuals            242 133.866   0.553                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter            | Eta2 (partial) |       95% CI
## ----------------------------------------------------
## ACRT_peri            |       5.87e-04 | [0.00, 1.00]
## t1rtqTotal           |           0.30 | [0.23, 1.00]
## ACRT_peri:t1rtqTotal |       3.88e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_peri)
## # R2 for Linear Regression
##        R2: 0.305
##   adj. R2: 0.296
model_intrusions_distress_RT_mod_Nperi <- lm(t1_thoughts_distress_level ~ ACRT_Nperi*t1rtqTotal, data = final_data)
summary(model_intrusions_distress_RT_mod_Nperi) #Intrusions distress mod Reaction time ACRT_Nperi
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_Nperi * t1rtqTotal, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.79694 -0.47655 -0.02866  0.50165  1.91914 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            8.195e-01  1.287e-01   6.367 9.58e-10 ***
## ACRT_Nperi             1.227e-03  2.146e-03   0.572    0.568    
## t1rtqTotal             4.673e-02  4.565e-03  10.236  < 2e-16 ***
## ACRT_Nperi:t1rtqTotal -6.740e-05  7.673e-05  -0.878    0.381    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7445 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.3033, Adjusted R-squared:  0.2946 
## F-statistic: 35.11 on 3 and 242 DF,  p-value: < 2.2e-16
standardized_model_intrusions_distress_RT_mod_Nperi <- standardize_parameters(model_intrusions_distress_RT_mod_Nperi)
print(standardized_model_intrusions_distress_RT_mod_Nperi)
## # Standardization method: refit
## 
## Parameter               | Std. Coef. |        95% CI
## ----------------------------------------------------
## (Intercept)             |   3.06e-03 | [-0.10, 0.11]
## ACRT Nperi              |      -0.04 | [-0.14, 0.07]
## t1rtqTotal              |       0.55 | [ 0.45, 0.66]
## ACRT Nperi × t1rtqTotal |      -0.05 | [-0.15, 0.06]
anova(model_intrusions_distress_RT_mod_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                        Df  Sum Sq Mean Sq  F value Pr(>F)    
## ACRT_Nperi              1   0.000   0.000   0.0001 0.9937    
## t1rtqTotal              1  57.952  57.952 104.5587 <2e-16 ***
## ACRT_Nperi:t1rtqTotal   1   0.428   0.428   0.7716 0.3806    
## Residuals             242 134.129   0.554                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter             | Eta2 (partial) |       95% CI
## -----------------------------------------------------
## ACRT_Nperi            |       2.57e-07 | [0.00, 1.00]
## t1rtqTotal            |           0.30 | [0.23, 1.00]
## ACRT_Nperi:t1rtqTotal |       3.18e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_Nperi)
## # R2 for Linear Regression
##        R2: 0.303
##   adj. R2: 0.295
#run simple slopes on intrusions ACdpNperi (Perinatal Negative over Negative Generic)
probe_interaction(model_intrusions_dp_mod_Nperi, pred = ACdP_Nperi, modx = t1rtqTotal, johnson_neyman = TRUE, jnplot = TRUE, interval = TRUE, x.label = "Affective control Nperi",
y.label = "Intrusions", main.title = "Moderation of Intrusions",
                  color.class = "Paired")
## The color.class argument is deprecated. Please use 'colors' instead.
## JOHNSON-NEYMAN INTERVAL
## 
## When t1rtqTotal is OUTSIDE the interval [17.93, 58.70], the slope of
## ACdP_Nperi is p < .05.
## 
## Note: The range of observed values of t1rtqTotal is [10.00, 50.00]

## SIMPLE SLOPES ANALYSIS
## 
## Slope of ACdP_Nperi when t1rtqTotal = 15.76792 (- 1 SD): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.30   0.14     2.14   0.03
## 
## Slope of ACdP_Nperi when t1rtqTotal = 26.32794 (Mean): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.06   0.11     0.56   0.57
## 
## Slope of ACdP_Nperi when t1rtqTotal = 36.88795 (+ 1 SD): 
## 
##    Est.   S.E.   t val.      p
## ------- ------ -------- ------
##   -0.18   0.16    -1.14   0.25

#Calculate standardized betas for simple slopes 
# 1 below SD
# Step 1: Calculate SD
N <- 247
SE <- 0.14
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.30
standardised_below <- SD * beta

# Print the result
print(standardised_below)
## [1] 0.6600818
# Average 
# Step 1: Calculate SD
N <- 247
SE <- 0.11
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.06
standardised_av <- SD * beta

# Print the result
print(standardised_av)
## [1] 0.1037271
# Above
# Step 1: Calculate SD
N <- 247
SE <- 0.16
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- -0.18
standardised_above <- SD * beta

# Print the result
print(standardised_above)
## [1] -0.4526275
#relevant graph
# Create interaction plot with simple slopes and data points
interaction_plot_intrusions_ACdP_Nperi <- interact_plot(model_intrusions_dp_mod_Nperi, 
                                                        pred = ACdP_Nperi, 
                                                        modx = t1rtqTotal,
                                                        plot.points = TRUE, 
                                                        point.alpha = 0.5,
                                                        legend.main = "Levels of Repetitive Negative Thinking") +
                                          theme_minimal() +
                                          labs(x = "Affective Control: Negative Perinatal over Generic Negative (D-Prime)",
                                               y = "Intrusions") +
                                           theme(panel.grid.major = element_blank(),
                                                panel.grid.minor = element_blank(),
                                                axis.line = element_line())  # Keep axis lines



# Show the plot
print(interaction_plot_intrusions_ACdP_Nperi)

#1-Month follow up

# Converting time to a factor
final_dataT2_long$time <- as.factor(final_dataT2_long$time)

###H2 -T2 Intrusions

#T2 moderation RNT (1 Month - follow up)
model_intrusions_dp_mod_neg_t2 <- lmer(intrusions ~ (ACdP_neg*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_mod_neg_t2) #Intrusions mod Dprime ACdP_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_neg * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2048.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.3075 -0.5531 -0.0785  0.4520  3.4241 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.243    2.060   
##  Residual                4.731    2.175   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                      Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)          1.703961   0.562993 403.993294   3.027  0.00263 ** 
## ACdP_neg            -0.147361   0.283769 396.240785  -0.519  0.60384    
## rtq                  0.116919   0.020146 400.636342   5.804 1.32e-08 ***
## time2                0.457262   0.671287 222.804360   0.681  0.49647    
## ACdP_neg:rtq         0.007485   0.009453 402.034164   0.792  0.42893    
## ACdP_neg:time2      -0.324222   0.322443 212.857097  -1.006  0.31579    
## rtq:time2           -0.030218   0.025283 227.813575  -1.195  0.23325    
## ACdP_neg:rtq:time2   0.009915   0.011093 216.410493   0.894  0.37242    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_n rtq    time2  ACdP_: ACP_:2 rtq:t2
## ACdP_neg    -0.369                                          
## rtq         -0.920  0.345                                   
## time2       -0.526  0.181  0.498                            
## ACdP_ng:rtq  0.368 -0.913 -0.400 -0.185                     
## ACdP_ng:tm2  0.197 -0.515 -0.188 -0.400  0.480              
## rtq:time2    0.461 -0.154 -0.501 -0.941  0.180  0.389       
## ACdP_ng:r:2 -0.185  0.458  0.201  0.423 -0.502 -0.928 -0.457
standardized_model_intrusions_dp_mod_neg_t2 <- standardize_parameters(model_intrusions_dp_mod_neg_t2)
print(standardized_model_intrusions_dp_mod_neg_t2 )
## # Standardization method: refit
## 
## Parameter                   | Std. Coef. |        95% CI
## --------------------------------------------------------
## (Intercept)                 |       0.05 | [-0.08, 0.17]
## ACdP neg                    |       0.02 | [-0.10, 0.15]
## rtq                         |       0.38 | [ 0.26, 0.49]
## time [2]                    |      -0.11 | [-0.24, 0.02]
## ACdP neg × rtq              |       0.04 | [-0.06, 0.15]
## ACdP neg × time [2]         |      -0.04 | [-0.17, 0.09]
## rtq × time [2]              |      -0.07 | [-0.21, 0.07]
## (ACdP neg × rtq) × time [2] |       0.06 | [-0.07, 0.18]
anova(model_intrusions_dp_mod_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                    Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## ACdP_neg            7.630   7.630     1 294.67  1.6129    0.2051    
## rtq               157.818 157.818     1 367.45 33.3601 1.633e-08 ***
## time                2.195   2.195     1 222.80  0.4640    0.4965    
## ACdP_neg:rtq       10.858  10.858     1 317.45  2.2952    0.1308    
## ACdP_neg:time       4.783   4.783     1 212.86  1.0111    0.3158    
## rtq:time            6.758   6.758     1 227.81  1.4285    0.2333    
## ACdP_neg:rtq:time   3.779   3.779     1 216.41  0.7989    0.3724    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter         | Eta2 (partial) |       95% CI
## -------------------------------------------------
## ACdP_neg          |       5.44e-03 | [0.00, 1.00]
## rtq               |           0.08 | [0.04, 1.00]
## time              |       2.08e-03 | [0.00, 1.00]
## ACdP_neg:rtq      |       7.18e-03 | [0.00, 1.00]
## ACdP_neg:time     |       4.73e-03 | [0.00, 1.00]
## rtq:time          |       6.23e-03 | [0.00, 1.00]
## ACdP_neg:rtq:time |       3.68e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.549
##      Marginal R2: 0.144
model_intrusions_dp_mod_peri_t2 <- lmer(intrusions ~ (ACdP_peri*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_mod_peri_t2 ) #Intrusions mod Dprime ACdP_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_peri * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2048.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4499 -0.5426 -0.0906  0.4542  3.3835 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.276    2.068   
##  Residual                4.712    2.171   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                       Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)           1.366229   0.541422 403.998927   2.523    0.012 *  
## ACdP_peri             0.376039   0.242870 403.797955   1.548    0.122    
## rtq                   0.128909   0.019391 400.550240   6.648 9.75e-11 ***
## time2                 0.384747   0.643059 221.743343   0.598    0.550    
## ACdP_peri:rtq        -0.009627   0.008994 400.120916  -1.070    0.285    
## ACdP_peri:time2      -0.373284   0.289436 221.668651  -1.290    0.198    
## rtq:time2            -0.025800   0.024034 226.122802  -1.073    0.284    
## ACdP_peri:rtq:time2   0.010675   0.010958 225.979309   0.974    0.331    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_p rtq    time2  ACdP_: ACP_:2 rtq:t2
## ACdP_peri   -0.265                                          
## rtq         -0.915  0.259                                   
## time2       -0.526  0.133  0.496                            
## ACdP_pr:rtq  0.255 -0.890 -0.308 -0.133                     
## ACdP_pr:tm2  0.130 -0.517 -0.130 -0.321  0.478              
## rtq:time2    0.467 -0.129 -0.511 -0.937  0.154  0.322       
## ACdP_pr:r:2 -0.126  0.474  0.153  0.324 -0.532 -0.920 -0.369
standardized_model_intrusions_dp_mod_peri_t2 <- standardize_parameters(model_intrusions_dp_mod_peri_t2)
print(standardized_model_intrusions_dp_mod_peri_t2 )
## # Standardization method: refit
## 
## Parameter                    | Std. Coef. |        95% CI
## ---------------------------------------------------------
## (Intercept)                  |       0.05 | [-0.08, 0.18]
## ACdP peri                    |       0.08 | [-0.05, 0.20]
## rtq                          |       0.38 | [ 0.27, 0.50]
## time [2]                     |      -0.10 | [-0.23, 0.03]
## ACdP peri × rtq              |      -0.06 | [-0.16, 0.05]
## ACdP peri × time [2]         |      -0.06 | [-0.19, 0.07]
## rtq × time [2]               |      -0.06 | [-0.20, 0.08]
## (ACdP peri × rtq) × time [2] |       0.06 | [-0.06, 0.19]
anova(model_intrusions_dp_mod_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                     Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## ACdP_peri            3.879   3.879     1 335.38  0.8232    0.3649    
## rtq                224.552 224.552     1 368.17 47.6524 2.237e-11 ***
## time                 1.687   1.687     1 221.74  0.3580    0.5502    
## ACdP_peri:rtq        1.482   1.482     1 369.73  0.3144    0.5753    
## ACdP_peri:time       7.838   7.838     1 221.67  1.6633    0.1985    
## rtq:time             5.430   5.430     1 226.12  1.1523    0.2842    
## ACdP_peri:rtq:time   4.472   4.472     1 225.98  0.9491    0.3310    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter          | Eta2 (partial) |       95% CI
## --------------------------------------------------
## ACdP_peri          |       2.45e-03 | [0.00, 1.00]
## rtq                |           0.11 | [0.07, 1.00]
## time               |       1.61e-03 | [0.00, 1.00]
## ACdP_peri:rtq      |       8.50e-04 | [0.00, 1.00]
## ACdP_peri:time     |       7.45e-03 | [0.00, 1.00]
## rtq:time           |       5.07e-03 | [0.00, 1.00]
## ACdP_peri:rtq:time |       4.18e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.549
##      Marginal R2: 0.141
model_intrusions_dp_mod_Nperi_t2 <- lmer(intrusions ~ (ACdP_Nperi*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_mod_Nperi_t2) #Intrusions mod Dprime ACdP_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_Nperi * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2044.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.3032 -0.5523 -0.0756  0.4481  3.3431 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.096    2.024   
##  Residual                4.752    2.180   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                        Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)            1.656282   0.521923 403.987487   3.173  0.00162 ** 
## ACdP_Nperi             0.625119   0.267982 403.975743   2.333  0.02015 *  
## rtq                    0.120069   0.018498 401.295944   6.491 2.52e-10 ***
## time2                  0.141196   0.614157 221.644946   0.230  0.81838    
## ACdP_Nperi:rtq        -0.021358   0.009901 399.819294  -2.157  0.03158 *  
## ACdP_Nperi:time2      -0.111216   0.329743 224.629266  -0.337  0.73622    
## rtq:time2             -0.019128   0.022668 226.044578  -0.844  0.39964    
## ACdP_Nperi:rtq:time2   0.001745   0.012632 229.467040   0.138  0.89022    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_N rtq    time2  ACdP_N: ACP_N:2 rtq:t2
## ACdP_Nperi   0.087                                            
## rtq         -0.918 -0.096                                     
## time2       -0.546 -0.063  0.517                              
## ACdP_Npr:rt -0.098 -0.899  0.115  0.071                       
## ACdP_Npr:t2 -0.058 -0.504  0.065  0.104  0.467                
## rtq:time2    0.488  0.061 -0.532 -0.936 -0.072  -0.127        
## ACdP_Npr::2  0.057  0.450 -0.067 -0.127 -0.501  -0.929   0.158
standardized_model_intrusions_dp_mod_Nperi_t2 <- standardize_parameters(model_intrusions_dp_mod_Nperi_t2)
print(standardized_model_intrusions_dp_mod_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                     | Std. Coef. |         95% CI
## -----------------------------------------------------------
## (Intercept)                   |       0.05 | [-0.08,  0.17]
## ACdP Nperi                    |       0.04 | [-0.08,  0.17]
## rtq                           |       0.38 | [ 0.26,  0.49]
## time [2]                      |      -0.10 | [-0.23,  0.02]
## ACdP Nperi × rtq              |      -0.12 | [-0.22, -0.01]
## ACdP Nperi × time [2]         |      -0.04 | [-0.17,  0.09]
## rtq × time [2]                |      -0.06 | [-0.20,  0.08]
## (ACdP Nperi × rtq) × time [2] |   9.57e-03 | [-0.13,  0.15]
anova(model_intrusions_dp_mod_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                      Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## ACdP_Nperi           28.291  28.291     1 338.96  5.9539   0.01520 *  
## rtq                 234.258 234.258     1 363.38 49.3005 1.085e-11 ***
## time                  0.251   0.251     1 221.64  0.0529   0.81838    
## ACdP_Nperi:rtq       26.486  26.486     1 369.77  5.5741   0.01875 *  
## ACdP_Nperi:time       0.541   0.541     1 224.63  0.1138   0.73622    
## rtq:time              3.384   3.384     1 226.04  0.7121   0.39964    
## ACdP_Nperi:rtq:time   0.091   0.091     1 229.47  0.0191   0.89022    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_dp_mod_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACdP_Nperi          |           0.02 | [0.00, 1.00]
## rtq                 |           0.12 | [0.07, 1.00]
## time                |       2.38e-04 | [0.00, 1.00]
## ACdP_Nperi:rtq      |           0.01 | [0.00, 1.00]
## ACdP_Nperi:time     |       5.06e-04 | [0.00, 1.00]
## rtq:time            |       3.14e-03 | [0.00, 1.00]
## ACdP_Nperi:rtq:time |       8.32e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_mod_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.545
##      Marginal R2: 0.154
model_intrusions_RT_mod_neg_t2 <- lmer(intrusions ~ (ACRT_neg*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_RT_mod_neg_t2) #Intrusions mod Reaction time ACRT_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_neg * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2070
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2994 -0.5637 -0.0545  0.4318  3.3117 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.085    2.021   
##  Residual                4.715    2.171   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                      Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)         1.624e+00  5.185e-01  4.039e+02   3.133  0.00186 ** 
## ACRT_neg           -7.894e-03  8.994e-03  4.036e+02  -0.878  0.38065    
## rtq                 1.225e-01  1.832e-02  4.019e+02   6.684 7.78e-11 ***
## time2               1.405e-01  6.084e-01  2.211e+02   0.231  0.81762    
## ACRT_neg:rtq        1.420e-05  3.249e-04  4.032e+02   0.044  0.96515    
## ACRT_neg:time2     -1.315e-02  1.030e-02  2.191e+02  -1.277  0.20294    
## rtq:time2          -1.726e-02  2.234e-02  2.255e+02  -0.773  0.44060    
## ACRT_neg:rtq:time2  5.961e-04  3.958e-04  2.237e+02   1.506  0.13344    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_n rtq    time2  ACRT_n: ACRT_:2 rtq:t2
## ACRT_neg    -0.038                                            
## rtq         -0.917  0.020                                     
## time2       -0.544  0.010  0.514                              
## ACRT_ng:rtq  0.021 -0.925 -0.011 -0.001                       
## ACRT_ng:tm2  0.010 -0.563  0.000 -0.002  0.536                
## rtq:time2    0.487 -0.005 -0.532 -0.935  0.000  -0.025        
## ACRT_ng:r:2 -0.003  0.481 -0.002 -0.026 -0.520  -0.937   0.050
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_RT_mod_neg_t2 <- standardize_parameters(model_intrusions_RT_mod_neg_t2)
print(standardized_model_intrusions_RT_mod_neg_t2)
## # Standardization method: refit
## 
## Parameter                   | Std. Coef. |         95% CI
## ---------------------------------------------------------
## (Intercept)                 |       0.05 | [-0.08,  0.17]
## ACRT neg                    |      -0.14 | [-0.26, -0.01]
## rtq                         |       0.38 | [ 0.27,  0.49]
## time [2]                    |      -0.09 | [-0.22,  0.04]
## ACRT neg × rtq              |   2.67e-03 | [-0.12,  0.12]
## ACRT neg × time [2]         |       0.04 | [-0.09,  0.17]
## rtq × time [2]              |      -0.05 | [-0.18,  0.09]
## (ACRT neg × rtq) × time [2] |       0.11 | [-0.03,  0.26]
anova(model_intrusions_RT_mod_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                    Sum Sq Mean Sq NumDF  DenDF F value  Pr(>F)    
## ACRT_neg           17.861  17.861     1 327.41  3.7884 0.05246 .  
## rtq               251.535 251.535     1 360.96 53.3517 1.8e-12 ***
## time                0.251   0.251     1 221.14  0.0533 0.81762    
## ACRT_neg:rtq        5.907   5.907     1 352.65  1.2530 0.26374    
## ACRT_neg:time       7.689   7.689     1 219.14  1.6308 0.20294    
## rtq:time            2.814   2.814     1 225.51  0.5968 0.44060    
## ACRT_neg:rtq:time  10.695  10.695     1 223.71  2.2685 0.13344    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_neg_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter         | Eta2 (partial) |       95% CI
## -------------------------------------------------
## ACRT_neg          |           0.01 | [0.00, 1.00]
## rtq               |           0.13 | [0.08, 1.00]
## time              |       2.41e-04 | [0.00, 1.00]
## ACRT_neg:rtq      |       3.54e-03 | [0.00, 1.00]
## ACRT_neg:time     |       7.39e-03 | [0.00, 1.00]
## rtq:time          |       2.64e-03 | [0.00, 1.00]
## ACRT_neg:rtq:time |           0.01 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_neg_t2 )
## # R2 for Mixed Models
## 
##   Conditional R2: 0.550
##      Marginal R2: 0.160
model_intrusions_RT_mod_peri_t2 <- lmer(intrusions ~ (ACRT_peri*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_RT_mod_peri_t2) #Intrusions mod Reaction time ACRT_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_peri * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2073.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.4352 -0.5421 -0.0843  0.4504  3.2727 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.318    2.078   
##  Residual                4.659    2.158   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                       Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)          1.628e+00  5.269e-01  4.038e+02   3.089  0.00215 ** 
## ACRT_peri           -8.703e-03  8.712e-03  4.026e+02  -0.999  0.31843    
## rtq                  1.233e-01  1.875e-02  4.024e+02   6.572 1.54e-10 ***
## time2                1.920e-01  6.089e-01  2.193e+02   0.315  0.75279    
## ACRT_peri:rtq        1.175e-04  3.260e-04  4.037e+02   0.360  0.71869    
## ACRT_peri:time2     -1.075e-03  9.809e-03  2.165e+02  -0.110  0.91282    
## rtq:time2           -2.255e-02  2.244e-02  2.229e+02  -1.005  0.31603    
## ACRT_peri:rtq:time2  3.101e-04  3.845e-04  2.202e+02   0.807  0.42075    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_p rtq    time2  ACRT_p: ACRT_:2 rtq:t2
## ACRT_peri   -0.152                                            
## rtq         -0.916  0.161                                     
## time2       -0.538  0.068  0.508                              
## ACRT_pr:rtq  0.153 -0.914 -0.192 -0.070                       
## ACRT_pr:tm2  0.073 -0.552 -0.080 -0.133  0.520                
## rtq:time2    0.484 -0.073 -0.528 -0.935  0.089   0.138        
## ACRT_pr:r:2 -0.074  0.481  0.094  0.129 -0.526  -0.929  -0.156
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_RT_mod_peri_t2 <- standardize_parameters(model_intrusions_RT_mod_peri_t2)
print(standardized_model_intrusions_RT_mod_peri_t2)
## # Standardization method: refit
## 
## Parameter                    | Std. Coef. |        95% CI
## ---------------------------------------------------------
## (Intercept)                  |       0.05 | [-0.08, 0.17]
## ACRT peri                    |      -0.10 | [-0.23, 0.02]
## rtq                          |       0.39 | [ 0.27, 0.50]
## time [2]                     |      -0.10 | [-0.22, 0.03]
## ACRT peri × rtq              |       0.02 | [-0.10, 0.14]
## ACRT peri × time [2]         |       0.12 | [-0.01, 0.25]
## rtq × time [2]               |      -0.06 | [-0.20, 0.07]
## (ACRT peri × rtq) × time [2] |       0.06 | [-0.08, 0.20]
anova(model_intrusions_RT_mod_peri_t2 )
## Type III Analysis of Variance Table with Satterthwaite's method
##                     Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## ACRT_peri            7.531   7.531     1 321.47  1.6164    0.2045    
## rtq                228.747 228.747     1 359.96 49.0997 1.204e-11 ***
## time                 0.463   0.463     1 219.33  0.0994    0.7528    
## ACRT_peri:rtq        4.480   4.480     1 348.51  0.9616    0.3275    
## ACRT_peri:time       0.056   0.056     1 216.51  0.0120    0.9128    
## rtq:time             4.705   4.705     1 222.91  1.0099    0.3160    
## ACRT_peri:rtq:time   3.031   3.031     1 220.22  0.6507    0.4207    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_peri_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter          | Eta2 (partial) |       95% CI
## --------------------------------------------------
## ACRT_peri          |       5.00e-03 | [0.00, 1.00]
## rtq                |           0.12 | [0.07, 1.00]
## time               |       4.53e-04 | [0.00, 1.00]
## ACRT_peri:rtq      |       2.75e-03 | [0.00, 1.00]
## ACRT_peri:time     |       5.55e-05 | [0.00, 1.00]
## rtq:time           |       4.51e-03 | [0.00, 1.00]
## ACRT_peri:rtq:time |       2.95e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.555
##      Marginal R2: 0.143
model_intrusions_RT_mod_Nperi_t2 <- lmer(intrusions ~ (ACRT_Nperi*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_RT_mod_Nperi_t2) #Intrusions mod reaction time ACRT_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_Nperi * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2074.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2774 -0.5503 -0.0540  0.4440  3.2891 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 4.267    2.066   
##  Residual                4.688    2.165   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                        Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)           1.603e+00  5.247e-01  4.040e+02   3.054   0.0024 ** 
## ACRT_Nperi           -1.838e-03  8.698e-03  4.040e+02  -0.211   0.8327    
## rtq                   1.215e-01  1.869e-02  4.011e+02   6.501 2.37e-10 ***
## time2                 1.237e-01  6.125e-01  2.206e+02   0.202   0.8401    
## ACRT_Nperi:rtq        1.502e-04  3.081e-04  4.013e+02   0.488   0.6261    
## ACRT_Nperi:time2      1.285e-02  9.958e-03  2.198e+02   1.291   0.1981    
## rtq:time2            -1.809e-02  2.271e-02  2.247e+02  -0.796   0.4267    
## ACRT_Nperi:rtq:time2 -3.125e-04  3.732e-04  2.243e+02  -0.837   0.4032    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_Np rtq    time2  ACRT_Np: ACRT_N:2 rtq:t2
## ACRT_Nperi  -0.108                                               
## rtq         -0.916  0.125                                        
## time2       -0.540  0.057   0.511                                
## ACRT_Npr:rt  0.127 -0.914  -0.166 -0.070                         
## ACRT_Npr:t2  0.061 -0.559  -0.073 -0.124  0.530                  
## rtq:time2    0.482 -0.063  -0.526 -0.936  0.084    0.148         
## ACRT_Npr::2 -0.067  0.483   0.087  0.149 -0.528   -0.931   -0.190
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_RT_mod_Nperi_t2<- standardize_parameters(model_intrusions_RT_mod_Nperi_t2)
print(standardized_model_intrusions_RT_mod_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                     | Std. Coef. |        95% CI
## ----------------------------------------------------------
## (Intercept)                   |       0.05 | [-0.08, 0.17]
## ACRT Nperi                    |       0.04 | [-0.09, 0.16]
## rtq                           |       0.38 | [ 0.27, 0.49]
## time [2]                      |      -0.09 | [-0.22, 0.03]
## ACRT Nperi × rtq              |       0.03 | [-0.08, 0.14]
## ACRT Nperi × time [2]         |       0.09 | [-0.04, 0.22]
## rtq × time [2]                |      -0.06 | [-0.20, 0.07]
## (ACRT Nperi × rtq) × time [2] |      -0.06 | [-0.19, 0.08]
anova(model_intrusions_RT_mod_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                      Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## ACRT_Nperi            1.898   1.898     1 335.98  0.4049    0.5250    
## rtq                 232.645 232.645     1 365.79 49.6252 9.291e-12 ***
## time                  0.191   0.191     1 220.55  0.0408    0.8401    
## ACRT_Nperi:rtq        0.002   0.002     1 364.88  0.0005    0.9817    
## ACRT_Nperi:time       7.811   7.811     1 219.79  1.6661    0.1981    
## rtq:time              2.973   2.973     1 224.69  0.6341    0.4267    
## ACRT_Nperi:rtq:time   3.288   3.288     1 224.34  0.7013    0.4032    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_RT_mod_Nperi_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACRT_Nperi          |       1.20e-03 | [0.00, 1.00]
## rtq                 |           0.12 | [0.07, 1.00]
## time                |       1.85e-04 | [0.00, 1.00]
## ACRT_Nperi:rtq      |       1.45e-06 | [0.00, 1.00]
## ACRT_Nperi:time     |       7.52e-03 | [0.00, 1.00]
## rtq:time            |       2.81e-03 | [0.00, 1.00]
## ACRT_Nperi:rtq:time |       3.12e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_RT_mod_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.553
##      Marginal R2: 0.146
#Run simple slopes for Nperi x RNT interaction at 1-Month
sim_slopes(model_intrusions_dp_mod_Nperi_t2, pred = ACdP_Nperi, modx = rtq)
## JOHNSON-NEYMAN INTERVAL
## 
## When rtq is OUTSIDE the interval [16.14, 90.70], the slope of ACdP_Nperi is
## p < .05.
## 
## Note: The range of observed values of rtq is [10.00, 50.00]
## 
## SIMPLE SLOPES ANALYSIS
## 
## Slope of ACdP_Nperi when rtq = 15.35146 (- 1 SD): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.30   0.15     2.02   0.04
## 
## Slope of ACdP_Nperi when rtq = 25.52427 (Mean): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.08   0.12     0.68   0.50
## 
## Slope of ACdP_Nperi when rtq = 35.69708 (+ 1 SD): 
## 
##    Est.   S.E.   t val.      p
## ------- ------ -------- ------
##   -0.14   0.16    -0.84   0.40
# Create interaction plot with simple slopes and data points
interaction_plot_intrusions_ACdP_Nperi_1M <- interact_plot(model_intrusions_dp_mod_Nperi_t2, 
                                                        pred = ACdP_Nperi, 
                                                        modx = rtq,
                                                        plot.points = TRUE, 
                                                        point.alpha = 0.5,
                                                        legend.main = "Levels of Repetitive Negative Thinking") +
                                          theme_minimal() +
                                          labs(x = "Affective Control: Perinatal over Generic Negative D-Prime",
                                               y = "Intrusions 1-Month") +
                                           theme(panel.grid.major = element_blank(),
                                                panel.grid.minor = element_blank(),
                                                axis.line = element_line())  # Keep axis lines



# Show the plot
print(interaction_plot_intrusions_ACdP_Nperi_1M)

###H2-T2 Distress

#Intrusion Distress - Dprime
model_intrusions_distress_dp_mod_neg_t2 <- lmer(intrusionsdistress ~ (ACdP_neg*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_mod_neg_t2) #Intrusions distress mod Dprime ACdP_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_neg * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 937.4
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.25876 -0.55186 -0.05809  0.56694  2.45811 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2208   0.4699  
##  Residual                0.3309   0.5753  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                      Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)         9.277e-01  1.423e-01  4.040e+02   6.517 2.13e-10 ***
## ACdP_neg           -5.217e-02  7.132e-02  3.968e+02  -0.731    0.465    
## rtq                 4.368e-02  5.111e-03  4.023e+02   8.546 2.68e-16 ***
## time2              -2.326e-01  1.765e-01  2.201e+02  -1.318    0.189    
## ACdP_neg:rtq        2.065e-03  2.382e-03  4.016e+02   0.867    0.387    
## ACdP_neg:time2      1.302e-02  8.499e-02  2.083e+02   0.153    0.878    
## rtq:time2           7.722e-03  6.642e-03  2.258e+02   1.163    0.246    
## ACdP_neg:rtq:time2  3.105e-04  2.922e-03  2.124e+02   0.106    0.915    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_n rtq    time2  ACdP_: ACP_:2 rtq:t2
## ACdP_neg    -0.370                                          
## rtq         -0.923  0.347                                   
## time2       -0.552  0.194  0.521                            
## ACdP_ng:rtq  0.370 -0.915 -0.401 -0.197                     
## ACdP_ng:tm2  0.207 -0.545 -0.197 -0.400  0.506              
## rtq:time2    0.487 -0.168 -0.527 -0.940  0.195  0.388       
## ACdP_ng:r:2 -0.197  0.487  0.214  0.422 -0.532 -0.928 -0.456
standardized_model_intrusions_distress_dp_mod_neg_t2 <- standardize_parameters(model_intrusions_distress_dp_mod_neg_t2)
print(standardized_model_intrusions_distress_dp_mod_neg_t2)
## # Standardization method: refit
## 
## Parameter                   | Std. Coef. |        95% CI
## --------------------------------------------------------
## (Intercept)                 |   9.65e-03 | [-0.10, 0.12]
## ACdP neg                    |   1.04e-03 | [-0.11, 0.11]
## rtq                         |       0.49 | [ 0.39, 0.59]
## time [2]                    |      -0.02 | [-0.15, 0.10]
## ACdP neg × rtq              |       0.04 | [-0.05, 0.13]
## ACdP neg × time [2]         |       0.04 | [-0.08, 0.16]
## rtq × time [2]              |       0.09 | [-0.04, 0.22]
## (ACdP neg × rtq) × time [2] |   6.15e-03 | [-0.11, 0.12]
anova(model_intrusions_distress_dp_mod_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                   Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
## ACdP_neg           0.192   0.192     1 275.31   0.5808 0.4466    
## rtq               38.848  38.848     1 346.00 117.3958 <2e-16 ***
## time               0.575   0.575     1 220.14   1.7362 0.1890    
## ACdP_neg:rtq       0.397   0.397     1 295.27   1.2002 0.2742    
## ACdP_neg:time      0.008   0.008     1 208.32   0.0235 0.8784    
## rtq:time           0.447   0.447     1 225.81   1.3514 0.2463    
## ACdP_neg:rtq:time  0.004   0.004     1 212.37   0.0113 0.9155    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter         | Eta2 (partial) |       95% CI
## -------------------------------------------------
## ACdP_neg          |       2.11e-03 | [0.00, 1.00]
## rtq               |           0.25 | [0.19, 1.00]
## time              |       7.82e-03 | [0.00, 1.00]
## ACdP_neg:rtq      |       4.05e-03 | [0.00, 1.00]
## ACdP_neg:time     |       1.13e-04 | [0.00, 1.00]
## rtq:time          |       5.95e-03 | [0.00, 1.00]
## ACdP_neg:rtq:time |       5.32e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.593
##      Marginal R2: 0.321
model_intrusions_distress_dp_mod_peri_t2 <- lmer(intrusionsdistress ~ (ACdP_peri*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_mod_peri_t2) #Intrusions distress mod Dprime ACdP_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_peri * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 933.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.21069 -0.55292 -0.05819  0.57813  2.42472 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2100   0.4582  
##  Residual                0.3323   0.5765  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                       Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)           0.912248   0.136084 403.925383   6.704 6.86e-11 ***
## ACdP_peri            -0.041525   0.060986 403.655630  -0.681    0.496    
## rtq                   0.043522   0.004895 402.606226   8.891  < 2e-16 ***
## time2                -0.199272   0.169607 222.461720  -1.175    0.241    
## ACdP_peri:rtq         0.002987   0.002271 402.371409   1.315    0.189    
## ACdP_peri:time2      -0.038722   0.076342 222.215764  -0.507    0.613    
## rtq:time2             0.006841   0.006332 227.770624   1.080    0.281    
## ACdP_peri:rtq:time2   0.001740   0.002887 227.769315   0.603    0.547    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_p rtq    time2  ACdP_: ACP_:2 rtq:t2
## ACdP_peri   -0.267                                          
## rtq         -0.919  0.262                                   
## time2       -0.558  0.144  0.524                            
## ACdP_pr:rtq  0.258 -0.895 -0.310 -0.143                     
## ACdP_pr:tm2  0.141 -0.550 -0.141 -0.319  0.506              
## rtq:time2    0.498 -0.140 -0.542 -0.936  0.166  0.321       
## ACdP_pr:r:2 -0.137  0.503  0.166  0.322 -0.561 -0.919 -0.368
standardized_model_intrusions_distress_dp_mod_peri_t2 <- standardize_parameters(model_intrusions_distress_dp_mod_peri_t2)
print(standardized_model_intrusions_distress_dp_mod_peri_t2)
## # Standardization method: refit
## 
## Parameter                    | Std. Coef. |        95% CI
## ---------------------------------------------------------
## (Intercept)                  |   9.47e-03 | [-0.10, 0.12]
## ACdP peri                    |       0.07 | [-0.04, 0.18]
## rtq                          |       0.50 | [ 0.40, 0.60]
## time [2]                     |      -0.02 | [-0.14, 0.10]
## ACdP peri × rtq              |       0.06 | [-0.03, 0.15]
## ACdP peri × time [2]         |       0.01 | [-0.11, 0.13]
## rtq × time [2]               |       0.09 | [-0.04, 0.21]
## (ACdP peri × rtq) × time [2] |       0.04 | [-0.08, 0.15]
anova(model_intrusions_distress_dp_mod_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                    Sum Sq Mean Sq NumDF  DenDF  F value  Pr(>F)    
## ACdP_peri           0.471   0.471     1 313.94   1.4174 0.23473    
## rtq                42.621  42.621     1 343.72 128.2487 < 2e-16 ***
## time                0.459   0.459     1 222.46   1.3804 0.24129    
## ACdP_peri:rtq       1.388   1.388     1 345.39   4.1761 0.04176 *  
## ACdP_peri:time      0.086   0.086     1 222.22   0.2573 0.61250    
## rtq:time            0.388   0.388     1 227.77   1.1671 0.28113    
## ACdP_peri:rtq:time  0.121   0.121     1 227.77   0.3631 0.54737    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter          | Eta2 (partial) |       95% CI
## --------------------------------------------------
## ACdP_peri          |       4.49e-03 | [0.00, 1.00]
## rtq                |           0.27 | [0.21, 1.00]
## time               |       6.17e-03 | [0.00, 1.00]
## ACdP_peri:rtq      |           0.01 | [0.00, 1.00]
## ACdP_peri:time     |       1.16e-03 | [0.00, 1.00]
## rtq:time           |       5.10e-03 | [0.00, 1.00]
## ACdP_peri:rtq:time |       1.59e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.592
##      Marginal R2: 0.334
model_intrusions_distress_dp_mod_Nperi_t2 <- lmer(intrusionsdistress ~ (ACdP_Nperi*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_mod_Nperi_t2) #Intrusions distress mod Dprime ACdP_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_Nperi * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 936.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2230 -0.5475 -0.0336  0.5592  2.4666 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2098   0.4580  
##  Residual                0.3372   0.5807  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                        Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)            0.866684   0.132384 403.904262   6.547 1.79e-10 ***
## ACdP_Nperi            -0.005965   0.067969 403.898723  -0.088    0.930    
## rtq                    0.046237   0.004709 402.820965   9.818  < 2e-16 ***
## time2                 -0.257147   0.162637 220.781698  -1.581    0.115    
## ACdP_Nperi:rtq         0.001485   0.002523 401.943986   0.589    0.557    
## ACdP_Nperi:time2      -0.053350   0.087264 223.887410  -0.611    0.542    
## rtq:time2              0.009502   0.005997 226.057397   1.584    0.114    
## ACdP_Nperi:rtq:time2   0.001624   0.003339 229.792758   0.486    0.627    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_N rtq    time2  ACdP_N: ACP_N:2 rtq:t2
## ACdP_Nperi   0.090                                            
## rtq         -0.921 -0.100                                     
## time2       -0.574 -0.064  0.540                              
## ACdP_Npr:rt -0.102 -0.903  0.119  0.072                       
## ACdP_Npr:t2 -0.060 -0.534  0.067  0.103  0.494                
## rtq:time2    0.514  0.064 -0.559 -0.935 -0.075  -0.125        
## ACdP_Npr::2  0.061  0.478 -0.070 -0.125 -0.530  -0.928   0.156
standardized_model_intrusions_distress_dp_mod_Nperi_t2 <- standardize_parameters(model_intrusions_distress_dp_mod_Nperi_t2)
print(standardized_model_intrusions_distress_dp_mod_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                     | Std. Coef. |        95% CI
## ----------------------------------------------------------
## (Intercept)                   |       0.01 | [-0.10, 0.12]
## ACdP Nperi                    |       0.06 | [-0.05, 0.17]
## rtq                           |       0.51 | [ 0.41, 0.61]
## time [2]                      |      -0.02 | [-0.14, 0.11]
## ACdP Nperi × rtq              |       0.03 | [-0.07, 0.13]
## ACdP Nperi × time [2]         |      -0.02 | [-0.15, 0.10]
## rtq × time [2]                |       0.10 | [-0.03, 0.23]
## (ACdP Nperi × rtq) × time [2] |       0.03 | [-0.10, 0.16]
anova(model_intrusions_distress_dp_mod_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                     Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
## ACdP_Nperi           0.107   0.107     1 318.66   0.3176 0.5735    
## rtq                 56.967  56.967     1 340.58 168.9228 <2e-16 ***
## time                 0.843   0.843     1 220.78   2.4999 0.1153    
## ACdP_Nperi:rtq       0.379   0.379     1 347.77   1.1246 0.2897    
## ACdP_Nperi:time      0.126   0.126     1 223.89   0.3738 0.5416    
## rtq:time             0.847   0.847     1 226.06   2.5106 0.1145    
## ACdP_Nperi:rtq:time  0.080   0.080     1 229.79   0.2367 0.6271    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_mod_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACdP_Nperi          |       9.96e-04 | [0.00, 1.00]
## rtq                 |           0.33 | [0.27, 1.00]
## time                |           0.01 | [0.00, 1.00]
## ACdP_Nperi:rtq      |       3.22e-03 | [0.00, 1.00]
## ACdP_Nperi:time     |       1.67e-03 | [0.00, 1.00]
## rtq:time            |           0.01 | [0.00, 1.00]
## ACdP_Nperi:rtq:time |       1.03e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_mod_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.584
##      Marginal R2: 0.325
#Intrusion Distress - Reaction Time

model_intrusions_distress_RT_mod_neg_t2 <- lmer(intrusionsdistress ~ (ACRT_neg*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_RT_mod_neg_t2) #Intrusions distress mod Reaction time ACRT_neg T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_neg * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 963.3
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.27002 -0.55003 -0.04139  0.56740  2.40566 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2122   0.4607  
##  Residual                0.3344   0.5783  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                      Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)         8.812e-01  1.317e-01  4.038e+02   6.691  7.4e-11 ***
## ACRT_neg           -1.431e-03  2.283e-03  4.034e+02  -0.627    0.531    
## rtq                 4.565e-02  4.670e-03  4.031e+02   9.775  < 2e-16 ***
## time2              -2.492e-01  1.611e-01  2.200e+02  -1.547    0.123    
## ACRT_neg:rtq        5.141e-05  8.272e-05  4.038e+02   0.622    0.535    
## ACRT_neg:time2     -2.837e-03  2.728e-03  2.177e+02  -1.040    0.300    
## rtq:time2           9.328e-03  5.912e-03  2.252e+02   1.578    0.116    
## ACRT_neg:rtq:time2  1.086e-04  1.048e-04  2.229e+02   1.037    0.301    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_n rtq    time2  ACRT_n: ACRT_:2 rtq:t2
## ACRT_neg    -0.034                                            
## rtq         -0.920  0.016                                     
## time2       -0.571  0.011  0.537                              
## ACRT_ng:rtq  0.017 -0.928 -0.006 -0.001                       
## ACRT_ng:tm2  0.011 -0.589  0.000 -0.004  0.558                
## rtq:time2    0.513 -0.005 -0.558 -0.935 -0.001  -0.023        
## ACRT_ng:r:2 -0.003  0.508 -0.003 -0.024 -0.548  -0.937   0.048
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_RT_mod_neg_t2<- standardize_parameters(model_intrusions_distress_RT_mod_neg_t2)
print(standardized_model_intrusions_distress_RT_mod_neg_t2)
## # Standardization method: refit
## 
## Parameter                   | Std. Coef. |        95% CI
## --------------------------------------------------------
## (Intercept)                 |       0.01 | [-0.10, 0.12]
## ACRT neg                    |  -7.77e-03 | [-0.12, 0.10]
## rtq                         |       0.50 | [ 0.40, 0.60]
## time [2]                    |      -0.01 | [-0.13, 0.11]
## ACRT neg × rtq              |       0.03 | [-0.07, 0.14]
## ACRT neg × time [2]         |  -4.20e-03 | [-0.13, 0.12]
## rtq × time [2]              |       0.11 | [-0.02, 0.23]
## (ACRT neg × rtq) × time [2] |       0.07 | [-0.06, 0.21]
anova(model_intrusions_distress_RT_mod_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                   Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
## ACRT_neg           0.797   0.797     1 307.11   2.3839 0.1236    
## rtq               55.861  55.861     1 338.93 167.0450 <2e-16 ***
## time               0.800   0.800     1 219.99   2.3923 0.1234    
## ACRT_neg:rtq       0.772   0.772     1 330.20   2.3100 0.1295    
## ACRT_neg:time      0.362   0.362     1 217.68   1.0814 0.2995    
## rtq:time           0.833   0.833     1 225.18   2.4899 0.1160    
## ACRT_neg:rtq:time  0.360   0.360     1 222.93   1.0751 0.3009    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_neg_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter         | Eta2 (partial) |       95% CI
## -------------------------------------------------
## ACRT_neg          |       7.70e-03 | [0.00, 1.00]
## rtq               |           0.33 | [0.27, 1.00]
## time              |           0.01 | [0.00, 1.00]
## ACRT_neg:rtq      |       6.95e-03 | [0.00, 1.00]
## ACRT_neg:time     |       4.94e-03 | [0.00, 1.00]
## rtq:time          |           0.01 | [0.00, 1.00]
## ACRT_neg:rtq:time |       4.80e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.587
##      Marginal R2: 0.325
model_intrusions_distress_RT_mod_peri_t2 <- lmer(intrusionsdistress ~ (ACRT_peri*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_RT_mod_peri_t2) #Intrusions distress mod Reaction time ACRT_peri T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_peri * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 964.1
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.22845 -0.54103 -0.03809  0.57382  2.41056 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2139   0.4625  
##  Residual                0.3343   0.5782  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                       Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)          8.721e-01  1.332e-01  4.036e+02   6.548 1.78e-10 ***
## ACRT_peri            1.991e-04  2.199e-03  4.024e+02   0.091    0.928    
## rtq                  4.630e-02  4.761e-03  4.036e+02   9.726  < 2e-16 ***
## time2               -2.206e-01  1.621e-01  2.192e+02  -1.361    0.175    
## ACRT_peri:rtq       -4.099e-05  8.259e-05  4.040e+02  -0.496    0.620    
## ACRT_peri:time2     -2.760e-03  2.613e-03  2.158e+02  -1.056    0.292    
## rtq:time2            7.630e-03  5.967e-03  2.237e+02   1.279    0.202    
## ACRT_peri:rtq:time2  1.355e-04  1.023e-04  2.203e+02   1.325    0.187    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_p rtq    time2  ACRT_p: ACRT_:2 rtq:t2
## ACRT_peri   -0.148                                            
## rtq         -0.920  0.157                                     
## time2       -0.570  0.074  0.536                              
## ACRT_pr:rtq  0.150 -0.918 -0.188 -0.076                       
## ACRT_pr:tm2  0.078 -0.583 -0.085 -0.135  0.547                
## rtq:time2    0.515 -0.079 -0.560 -0.934  0.096   0.139        
## ACRT_pr:r:2 -0.079  0.513  0.100  0.130 -0.559  -0.929  -0.157
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_RT_mod_peri_t2 <- standardize_parameters(model_intrusions_distress_RT_mod_peri_t2)
print(standardized_model_intrusions_RT_mod_peri_t2)
## # Standardization method: refit
## 
## Parameter                    | Std. Coef. |        95% CI
## ---------------------------------------------------------
## (Intercept)                  |       0.05 | [-0.08, 0.17]
## ACRT peri                    |      -0.10 | [-0.23, 0.02]
## rtq                          |       0.39 | [ 0.27, 0.50]
## time [2]                     |      -0.10 | [-0.22, 0.03]
## ACRT peri × rtq              |       0.02 | [-0.10, 0.14]
## ACRT peri × time [2]         |       0.12 | [-0.01, 0.25]
## rtq × time [2]               |      -0.06 | [-0.20, 0.07]
## (ACRT peri × rtq) × time [2] |       0.06 | [-0.08, 0.20]
anova(model_intrusions_distress_RT_mod_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                    Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
## ACRT_peri           0.146   0.146     1 298.67   0.4371 0.5091    
## rtq                53.576  53.576     1 333.97 160.2778 <2e-16 ***
## time                0.619   0.619     1 219.24   1.8525 0.1749    
## ACRT_peri:rtq       0.051   0.051     1 322.11   0.1521 0.6968    
## ACRT_peri:time      0.373   0.373     1 215.81   1.1154 0.2921    
## rtq:time            0.546   0.546     1 223.67   1.6349 0.2024    
## ACRT_peri:rtq:time  0.587   0.587     1 220.33   1.7548 0.1866    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_peri_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter          | Eta2 (partial) |       95% CI
## --------------------------------------------------
## ACRT_peri          |       1.46e-03 | [0.00, 1.00]
## rtq                |           0.32 | [0.26, 1.00]
## time               |       8.38e-03 | [0.00, 1.00]
## ACRT_peri:rtq      |       4.72e-04 | [0.00, 1.00]
## ACRT_peri:time     |       5.14e-03 | [0.00, 1.00]
## rtq:time           |       7.26e-03 | [0.00, 1.00]
## ACRT_peri:rtq:time |       7.90e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.588
##      Marginal R2: 0.324
model_intrusions_distress_RT_mod_Nperi_t2 <- lmer(intrusionsdistress ~ (ACRT_Nperi*rtq)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_RT_mod_Nperi_t2) #Intrusions distress mod Reaction time ACRT_Nperi T2
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_Nperi * rtq) * time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 965
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.23753 -0.54946 -0.05375  0.56995  2.32058 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.2161   0.4649  
##  Residual                0.3338   0.5778  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                        Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)           8.600e-01  1.329e-01  4.039e+02   6.471 2.82e-10 ***
## ACRT_Nperi            1.241e-03  2.202e-03  4.038e+02   0.564    0.573    
## rtq                   4.670e-02  4.753e-03  4.028e+02   9.825  < 2e-16 ***
## time2                -2.378e-01  1.624e-01  2.204e+02  -1.464    0.145    
## ACRT_Nperi:rtq       -7.438e-05  7.832e-05  4.029e+02  -0.950    0.343    
## ACRT_Nperi:time2      1.298e-04  2.641e-03  2.196e+02   0.049    0.961    
## rtq:time2             8.403e-03  6.017e-03  2.254e+02   1.396    0.164    
## ACRT_Nperi:rtq:time2  2.405e-05  9.887e-05  2.250e+02   0.243    0.808    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_Np rtq    time2  ACRT_Np: ACRT_N:2 rtq:t2
## ACRT_Nperi  -0.109                                               
## rtq         -0.920  0.127                                        
## time2       -0.570  0.061   0.536                                
## ACRT_Npr:rt  0.128 -0.918  -0.167 -0.074                         
## ACRT_Npr:t2  0.065 -0.587  -0.077 -0.124  0.553                  
## rtq:time2    0.511 -0.068  -0.555 -0.935  0.090    0.147         
## ACRT_Npr::2 -0.071  0.511   0.093  0.149 -0.557   -0.930   -0.190
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_RT_mod_Nperi_t2 <- standardize_parameters(model_intrusions_distress_RT_mod_Nperi_t2)
print(standardized_model_intrusions_RT_mod_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                     | Std. Coef. |        95% CI
## ----------------------------------------------------------
## (Intercept)                   |       0.05 | [-0.08, 0.17]
## ACRT Nperi                    |       0.04 | [-0.09, 0.16]
## rtq                           |       0.38 | [ 0.27, 0.49]
## time [2]                      |      -0.09 | [-0.22, 0.03]
## ACRT Nperi × rtq              |       0.03 | [-0.08, 0.14]
## ACRT Nperi × time [2]         |       0.09 | [-0.04, 0.22]
## rtq × time [2]                |      -0.06 | [-0.20, 0.07]
## (ACRT Nperi × rtq) × time [2] |      -0.06 | [-0.19, 0.08]
anova(model_intrusions_distress_RT_mod_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                     Sum Sq Mean Sq NumDF  DenDF  F value Pr(>F)    
## ACRT_Nperi           0.179   0.179     1 314.47   0.5366 0.4644    
## rtq                 54.839  54.839     1 342.07 164.2792 <2e-16 ***
## time                 0.716   0.716     1 220.44   2.1442 0.1445    
## ACRT_Nperi:rtq       0.304   0.304     1 341.07   0.9112 0.3405    
## ACRT_Nperi:time      0.001   0.001     1 219.59   0.0024 0.9608    
## rtq:time             0.651   0.651     1 225.43   1.9499 0.1640    
## ACRT_Nperi:rtq:time  0.020   0.020     1 225.03   0.0591 0.8081    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_RT_mod_Nperi_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter           | Eta2 (partial) |       95% CI
## ---------------------------------------------------
## ACRT_Nperi          |       1.70e-03 | [0.00, 1.00]
## rtq                 |           0.32 | [0.26, 1.00]
## time                |       9.63e-03 | [0.00, 1.00]
## ACRT_Nperi:rtq      |       2.66e-03 | [0.00, 1.00]
## ACRT_Nperi:time     |       1.10e-05 | [0.00, 1.00]
## rtq:time            |       8.58e-03 | [0.00, 1.00]
## ACRT_Nperi:rtq:time |       2.63e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_RT_mod_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.588
##      Marginal R2: 0.322
#check simple slopes of ACdp_peri (Perinegative - Neutral)
probe_interaction(model_intrusions_distress_dp_mod_peri_t2 , pred = ACdP_peri, modx = rtq, johnson_neyman = TRUE, jnplot = TRUE, interval = TRUE, x.label = "Affective control index - Perinegative Dprime (Peri -Neutral)",
y.label = "Intrusions Distress", main.title = "Moderation of Intrusion Distress",
                  color.class = "Paired")
## The color.class argument is deprecated. Please use 'colors' instead.
## JOHNSON-NEYMAN INTERVAL
## 
## The Johnson-Neyman interval could not be found. Is the p value for your
## interaction term below the specified alpha?

## SIMPLE SLOPES ANALYSIS
## 
## Slope of ACdP_peri when rtq = 15.35146 (- 1 SD): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.00   0.03     0.13   0.90
## 
## Slope of ACdP_peri when rtq = 25.52427 (Mean): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.03   0.03     1.27   0.21
## 
## Slope of ACdP_peri when rtq = 35.69708 (+ 1 SD): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.07   0.04     1.72   0.09

#standardise coeffcients 
# 1 below SD
# Step 1: Calculate SD
N <- 206
SE <- 0.13
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.00
standardised_below_distress <- SD * beta

# Print the result
print(standardised_below_distress)
## [1] 0
# Average
# Step 1: Calculate SD
N <- 206
SE <- 0.03
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.03
standardised_av_distress <- SD * beta

# Print the result
print(standardised_av_distress)
## [1] 0.01291743
# 1 above SD
# Step 1: Calculate SD
N <- 206
SE <- 0.04
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.07
standardised_above_distress <- SD * beta

# Print the result
print(standardised_above_distress)
## [1] 0.04018756
#relevent graph
interaction_plot_model_intrusions_distress_dp_mod_peri_t2 <- interact_plot(model_intrusions_distress_dp_mod_peri_t2, 
                                                        pred = ACdP_peri, 
                                                        modx = rtq,
                                                        plot.points = TRUE, 
                                                        point.alpha = 0.5,   # Keep points semi-transparent
                                                        point.color = "grey",  # Set points to black
                                                        legend.main = "Levels of Repetitive Negative Thinking") +
                                          theme_minimal() +
                                          labs(x = "Affective Control: Negative Perinatal (D-Prime)",
                                               y = "Intrusion-Related Distress") +
                                          theme(panel.grid.major = element_blank(),
                                                panel.grid.minor = element_blank(),
                                                axis.line = element_line()) 




# Show the plot
print(interaction_plot_model_intrusions_distress_dp_mod_peri_t2)

##H3 - Weeks since conception ##Cross sectional ### H3 -T1 Intrusions

#Intrusions 
model_intrusions_dp_c_neg <- lm(t1intrusionsTotal ~ ACdP_neg*t1_wks_since_conception, data = final_data)
summary(model_intrusions_dp_c_neg) #Intrusions conception Dprime
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_neg * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.3264 -2.9297 -0.1921  2.6528  7.6386 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       5.451e+00  5.023e-01  10.852   <2e-16 ***
## ACdP_neg                          8.430e-02  2.511e-01   0.336    0.737    
## t1_wks_since_conception          -1.004e-02  7.154e-03  -1.403    0.162    
## ACdP_neg:t1_wks_since_conception  3.889e-05  3.702e-03   0.011    0.992    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.311 on 243 degrees of freedom
## Multiple R-squared:  0.0112, Adjusted R-squared:  -0.001008 
## F-statistic: 0.9174 on 3 and 243 DF,  p-value: 0.4331
standardized_model_intrusions_dp_c_neg <- standardize_parameters(model_intrusions_dp_c_neg)
print(standardized_model_intrusions_dp_c_neg)
## # Standardization method: refit
## 
## Parameter                          | Std. Coef. |        95% CI
## ---------------------------------------------------------------
## (Intercept)                        |   7.31e-06 | [-0.13, 0.13]
## ACdP neg                           |       0.05 | [-0.08, 0.17]
## t1 wks since conception            |      -0.09 | [-0.22, 0.03]
## ACdP neg × t1 wks since conception |   6.53e-04 | [-0.12, 0.12]
anova(model_intrusions_dp_c_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                   Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_neg                           1    6.12  6.1222  0.5584 0.4556
## t1_wks_since_conception            1   24.05 24.0539  2.1938 0.1399
## ACdP_neg:t1_wks_since_conception   1    0.00  0.0012  0.0001 0.9916
## Residuals                        243 2664.41 10.9647
eta_squared(model_intrusions_dp_c_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                        | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------
## ACdP_neg                         |       2.29e-03 | [0.00, 1.00]
## t1_wks_since_conception          |       8.95e-03 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception |       4.54e-07 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_neg)
## # R2 for Linear Regression
##        R2: 0.011
##   adj. R2: -0.001
model_intrusions_dp_c_peri <- lm(t1intrusionsTotal ~ ACdP_peri*t1_wks_since_conception, data = final_data)
summary(model_intrusions_dp_c_peri) #Intrusions conception Dprime
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_peri * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.4928 -2.8809 -0.2598  2.4779  7.6809 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        5.341005   0.492424  10.846   <2e-16 ***
## ACdP_peri                          0.309801   0.248383   1.247    0.213    
## t1_wks_since_conception           -0.008467   0.007005  -1.209    0.228    
## ACdP_peri:t1_wks_since_conception -0.002952   0.003649  -0.809    0.419    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.301 on 243 degrees of freedom
## Multiple R-squared:  0.01718,    Adjusted R-squared:  0.005051 
## F-statistic: 1.416 on 3 and 243 DF,  p-value: 0.2386
standardized_model_intrusions_dp_c_peri <- standardize_parameters(model_intrusions_dp_c_peri)
print(standardized_model_intrusions_dp_c_peri)
## # Standardization method: refit
## 
## Parameter                           | Std. Coef. |        95% CI
## ----------------------------------------------------------------
## (Intercept)                         |  -4.30e-04 | [-0.13, 0.12]
## ACdP peri                           |       0.07 | [-0.06, 0.20]
## t1 wks since conception             |      -0.09 | [-0.22, 0.03]
## ACdP peri × t1 wks since conception |      -0.05 | [-0.18, 0.08]
anova(model_intrusions_dp_c_peri)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                    Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_peri                           1   15.17 15.1656  1.3916 0.2393
## t1_wks_since_conception             1   24.01 24.0111  2.2032 0.1390
## ACdP_peri:t1_wks_since_conception   1    7.13  7.1298  0.6542 0.4194
## Residuals                         243 2648.28 10.8983
eta_squared(model_intrusions_dp_c_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                         | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------
## ACdP_peri                         |       5.69e-03 | [0.00, 1.00]
## t1_wks_since_conception           |       8.99e-03 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception |       2.68e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_peri)
## # R2 for Linear Regression
##        R2: 0.017
##   adj. R2: 0.005
model_intrusions_dp_c_Nperi <- lm(t1intrusionsTotal ~ ACdP_Nperi*t1_wks_since_conception, data = final_data)
summary(model_intrusions_dp_c_Nperi) #Intrusions conception Dprime
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACdP_Nperi * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -5.509 -2.918 -0.223  2.629  7.648 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         5.534633   0.476669  11.611   <2e-16 ***
## ACdP_Nperi                          0.291695   0.280991   1.038    0.300    
## t1_wks_since_conception            -0.010499   0.006770  -1.551    0.122    
## ACdP_Nperi:t1_wks_since_conception -0.003814   0.004212  -0.906    0.366    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.308 on 243 degrees of freedom
## Multiple R-squared:  0.01342,    Adjusted R-squared:  0.001244 
## F-statistic: 1.102 on 3 and 243 DF,  p-value: 0.3489
standardized_model_intrusions_dp_c_Nperi <- standardize_parameters(model_intrusions_dp_c_Nperi)
print(standardized_model_intrusions_dp_c_Nperi)
## # Standardization method: refit
## 
## Parameter                            | Std. Coef. |        95% CI
## -----------------------------------------------------------------
## (Intercept)                          |   1.61e-04 | [-0.13, 0.13]
## ACdP Nperi                           |       0.03 | [-0.10, 0.15]
## t1 wks since conception              |      -0.10 | [-0.22, 0.03]
## ACdP Nperi × t1 wks since conception |      -0.06 | [-0.20, 0.07]
anova(model_intrusions_dp_c_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                     Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_Nperi                           1    2.83  2.8328  0.2589 0.6113
## t1_wks_since_conception              1   24.37 24.3673  2.2274 0.1369
## ACdP_Nperi:t1_wks_since_conception   1    8.97  8.9721  0.8201 0.3660
## Residuals                          243 2658.42 10.9400
eta_squared(model_intrusions_dp_c_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                          | Eta2 (partial) |       95% CI
## ------------------------------------------------------------------
## ACdP_Nperi                         |       1.06e-03 | [0.00, 1.00]
## t1_wks_since_conception            |       9.08e-03 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception |       3.36e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_Nperi)
## # R2 for Linear Regression
##        R2: 0.013
##   adj. R2: 0.001
model_intrusions_rt_c_neg <- lm(t1intrusionsTotal ~ ACRT_neg*t1_wks_since_conception, data = final_data)
summary(model_intrusions_rt_c_neg) #Intrusions conception Reaction time
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_neg * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.5321 -2.8350 -0.2801  2.5303  7.9839 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       5.587e+00  4.757e-01  11.746   <2e-16 ***
## ACRT_neg                         -7.671e-03  7.937e-03  -0.967    0.335    
## t1_wks_since_conception          -1.110e-02  6.744e-03  -1.646    0.101    
## ACRT_neg:t1_wks_since_conception  1.617e-05  1.125e-04   0.144    0.886    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.292 on 243 degrees of freedom
## Multiple R-squared:  0.02298,    Adjusted R-squared:  0.01092 
## F-statistic: 1.906 on 3 and 243 DF,  p-value: 0.1293
standardized_model_intrusions_rt_c_neg <- standardize_parameters(model_intrusions_rt_c_neg)
print(standardized_model_intrusions_rt_c_neg)
## # Standardization method: refit
## 
## Parameter                          | Std. Coef. |        95% CI
## ---------------------------------------------------------------
## (Intercept)                        |   7.39e-04 | [-0.12, 0.13]
## ACRT neg                           |      -0.12 | [-0.24, 0.01]
## t1 wks since conception            |      -0.10 | [-0.23, 0.02]
## ACRT neg × t1 wks since conception |   8.97e-03 | [-0.11, 0.13]
anova(model_intrusions_rt_c_neg)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                   Df  Sum Sq Mean Sq F value  Pr(>F)  
## ACRT_neg                           1   32.33  32.325  2.9837 0.08538 .
## t1_wks_since_conception            1   29.38  29.385  2.7123 0.10087  
## ACRT_neg:t1_wks_since_conception   1    0.22   0.224  0.0207 0.88584  
## Residuals                        243 2632.66  10.834                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_rt_c_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                        | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------
## ACRT_neg                         |           0.01 | [0.00, 1.00]
## t1_wks_since_conception          |           0.01 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception |       8.50e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_neg)
## # R2 for Linear Regression
##        R2: 0.023
##   adj. R2: 0.011
model_intrusions_rt_c_peri <- lm(t1intrusionsTotal ~ ACRT_peri*t1_wks_since_conception, data = final_data)
summary(model_intrusions_rt_c_peri) #Intrusions conception Reaction time
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_peri * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.3161 -2.7817 -0.1098  2.5979  7.5235 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        5.571e+00  4.822e-01  11.553   <2e-16 ***
## ACRT_peri                         -5.526e-03  7.963e-03  -0.694    0.488    
## t1_wks_since_conception           -1.034e-02  6.827e-03  -1.515    0.131    
## ACRT_peri:t1_wks_since_conception  3.421e-06  1.131e-04   0.030    0.976    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.3 on 243 degrees of freedom
## Multiple R-squared:  0.0178, Adjusted R-squared:  0.005672 
## F-statistic: 1.468 on 3 and 243 DF,  p-value: 0.2239
standardized_model_intrusions_rt_c_peri <- standardize_parameters(model_intrusions_rt_c_peri)
print(standardized_model_intrusions_rt_c_peri)
## # Standardization method: refit
## 
## Parameter                           | Std. Coef. |        95% CI
## ----------------------------------------------------------------
## (Intercept)                         |   4.51e-05 | [-0.12, 0.13]
## ACRT peri                           |      -0.09 | [-0.22, 0.03]
## t1 wks since conception             |      -0.10 | [-0.22, 0.03]
## ACRT peri × t1 wks since conception |   1.88e-03 | [-0.12, 0.12]
anova(model_intrusions_rt_c_peri)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                    Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_peri                           1   22.47  22.472  2.0633 0.1522
## t1_wks_since_conception             1   25.48  25.476  2.3391 0.1275
## ACRT_peri:t1_wks_since_conception   1    0.01   0.010  0.0009 0.9759
## Residuals                         243 2646.63  10.892
eta_squared(model_intrusions_rt_c_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                         | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------
## ACRT_peri                         |       8.42e-03 | [0.00, 1.00]
## t1_wks_since_conception           |       9.53e-03 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception |       3.77e-06 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_peri)
## # R2 for Linear Regression
##        R2: 0.018
##   adj. R2: 0.006
model_intrusions_rt_c_Nperi <- lm(t1intrusionsTotal ~ ACRT_Nperi*t1_wks_since_conception, data = final_data)
summary(model_intrusions_rt_c_Nperi) #Intrusions conception Reaction time
## 
## Call:
## lm(formula = t1intrusionsTotal ~ ACRT_Nperi * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -5.3875 -2.9112 -0.2692  2.6478  7.6146 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         5.498e+00  4.803e-01  11.448   <2e-16 ***
## ACRT_Nperi                          1.842e-03  7.861e-03   0.234    0.815    
## t1_wks_since_conception            -1.014e-02  6.882e-03  -1.473    0.142    
## ACRT_Nperi:t1_wks_since_conception -8.103e-06  1.172e-04  -0.069    0.945    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.314 on 243 degrees of freedom
## Multiple R-squared:  0.009637,   Adjusted R-squared:  -0.00259 
## F-statistic: 0.7882 on 3 and 243 DF,  p-value: 0.5015
standardized_model_intrusions_rt_c_Nperi <- standardize_parameters(model_intrusions_rt_c_Nperi)
print(standardized_model_intrusions_rt_c_Nperi)
## # Standardization method: refit
## 
## Parameter                            | Std. Coef. |        95% CI
## -----------------------------------------------------------------
## (Intercept)                          |   2.63e-04 | [-0.13, 0.13]
## ACRT Nperi                           |       0.02 | [-0.10, 0.15]
## t1 wks since conception              |      -0.10 | [-0.22, 0.03]
## ACRT Nperi × t1 wks since conception |  -4.54e-03 | [-0.13, 0.12]
anova(model_intrusions_rt_c_Nperi)
## Analysis of Variance Table
## 
## Response: t1intrusionsTotal
##                                     Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_Nperi                           1    0.94  0.9435  0.0859 0.7697
## t1_wks_since_conception              1   24.97 24.9713  2.2738 0.1329
## ACRT_Nperi:t1_wks_since_conception   1    0.05  0.0525  0.0048 0.9450
## Residuals                          243 2668.62 10.9820
eta_squared(model_intrusions_rt_c_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                          | Eta2 (partial) |       95% CI
## ------------------------------------------------------------------
## ACRT_Nperi                         |       3.53e-04 | [0.00, 1.00]
## t1_wks_since_conception            |       9.27e-03 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception |       1.97e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_Nperi)
## # R2 for Linear Regression
##        R2: 0.010
##   adj. R2: -0.003

###H3 -T1 Distress

#Intrusion Distress Dprime
model_intrusions_distress_dp_c_neg <- lm(t1_thoughts_distress_level ~ ACdP_neg*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_dp_c_neg) #Intrusions distress conception Dprime
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_neg * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.22128 -0.98320 -0.03716  0.89697  2.14243 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       1.9963915  0.1346084  14.831   <2e-16 ***
## ACdP_neg                          0.1641265  0.0667967   2.457   0.0147 *  
## t1_wks_since_conception           0.0005222  0.0019298   0.271   0.7869    
## ACdP_neg:t1_wks_since_conception -0.0022109  0.0009849  -2.245   0.0257 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8805 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.02543,    Adjusted R-squared:  0.01335 
## F-statistic: 2.105 on 3 and 242 DF,  p-value: 0.1002
standardized_model_intrusions_distress_dp_c_neg <- standardize_parameters(model_intrusions_distress_dp_c_neg)
print(standardized_model_intrusions_distress_dp_c_neg)
## # Standardization method: refit
## 
## Parameter                          | Std. Coef. |         95% CI
## ----------------------------------------------------------------
## (Intercept)                        |  -1.36e-03 | [-0.13,  0.12]
## ACdP neg                           |       0.05 | [-0.07,  0.18]
## t1 wks since conception            |      -0.03 | [-0.15,  0.10]
## ACdP neg × t1 wks since conception |      -0.14 | [-0.26, -0.02]
anova(model_intrusions_distress_dp_c_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                   Df  Sum Sq Mean Sq F value  Pr(>F)  
## ACdP_neg                           1   0.803  0.8029  1.0357 0.30984  
## t1_wks_since_conception            1   0.186  0.1857  0.2395 0.62502  
## ACdP_neg:t1_wks_since_conception   1   3.907  3.9069  5.0394 0.02568 *
## Residuals                        242 187.613  0.7753                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_c_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                        | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------
## ACdP_neg                         |       4.26e-03 | [0.00, 1.00]
## t1_wks_since_conception          |       9.89e-04 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception |           0.02 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_neg)
## # R2 for Linear Regression
##        R2: 0.025
##   adj. R2: 0.013
model_intrusions_distress_dp_c_peri <- lm(t1_thoughts_distress_level ~ ACdP_peri*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_dp_c_peri) #Intrusions distress conception Dprime
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_peri * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.42413 -0.99111 -0.03394  0.88702  2.03343 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.023e+00  1.324e-01  15.275   <2e-16 ***
## ACdP_peri                          1.516e-01  6.635e-02   2.285   0.0232 *  
## t1_wks_since_conception            5.801e-05  1.895e-03   0.031   0.9756    
## ACdP_peri:t1_wks_since_conception -1.830e-03  9.748e-04  -1.878   0.0616 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8818 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.02263,    Adjusted R-squared:  0.01051 
## F-statistic: 1.868 on 3 and 242 DF,  p-value: 0.1357
standardized_model_intrusions_distress_dp_c_peri <- standardize_parameters(model_intrusions_distress_dp_c_peri)
print(standardized_model_intrusions_distress_dp_c_peri)
## # Standardization method: refit
## 
## Parameter                           | Std. Coef. |        95% CI
## ----------------------------------------------------------------
## (Intercept)                         |  -1.14e-03 | [-0.13, 0.12]
## ACdP peri                           |       0.08 | [-0.05, 0.20]
## t1 wks since conception             |      -0.03 | [-0.15, 0.10]
## ACdP peri × t1 wks since conception |      -0.12 | [-0.25, 0.01]
anova(model_intrusions_distress_dp_c_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                    Df  Sum Sq Mean Sq F value  Pr(>F)  
## ACdP_peri                           1   1.431 1.43138  1.8410 0.17609  
## t1_wks_since_conception             1   0.183 0.18348  0.2360 0.62756  
## ACdP_peri:t1_wks_since_conception   1   2.741 2.74118  3.5257 0.06163 .
## Residuals                         242 188.152 0.77749                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_c_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                         | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------
## ACdP_peri                         |       7.55e-03 | [0.00, 1.00]
## t1_wks_since_conception           |       9.74e-04 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception |           0.01 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_peri)
## # R2 for Linear Regression
##        R2: 0.023
##   adj. R2: 0.011
model_intrusions_distress_dp_c_Nperi <- lm(t1_thoughts_distress_level ~ ACdP_Nperi*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_dp_c_Nperi) #Intrusions distress conception Dprime
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACdP_Nperi * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.11297 -1.01737 -0.05792  0.92648  2.02222 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         2.0995282  0.1294036  16.225   <2e-16 ***
## ACdP_Nperi                         -0.0155945  0.0757348  -0.206    0.837    
## t1_wks_since_conception            -0.0008502  0.0018506  -0.459    0.646    
## ACdP_Nperi:t1_wks_since_conception  0.0004887  0.0011358   0.430    0.667    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8908 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.002511,   Adjusted R-squared:  -0.009854 
## F-statistic: 0.2031 on 3 and 242 DF,  p-value: 0.8942
standardized_model_intrusions_distress_dp_c_Nperi <- standardize_parameters(model_intrusions_distress_dp_c_Nperi)
print(standardized_model_intrusions_distress_dp_c_Nperi)
## # Standardization method: refit
## 
## Parameter                            | Std. Coef. |        95% CI
## -----------------------------------------------------------------
## (Intercept)                          |   5.96e-06 | [-0.13, 0.13]
## ACdP Nperi                           |       0.03 | [-0.10, 0.16]
## t1 wks since conception              |      -0.03 | [-0.16, 0.10]
## ACdP Nperi × t1 wks since conception |       0.03 | [-0.11, 0.17]
anova(model_intrusions_distress_dp_c_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                     Df  Sum Sq Mean Sq F value Pr(>F)
## ACdP_Nperi                           1   0.143 0.14318  0.1804 0.6714
## t1_wks_since_conception              1   0.193 0.19332  0.2436 0.6220
## ACdP_Nperi:t1_wks_since_conception   1   0.147 0.14694  0.1852 0.6673
## Residuals                          242 192.025 0.79349
eta_squared(model_intrusions_distress_dp_c_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                          | Eta2 (partial) |       95% CI
## ------------------------------------------------------------------
## ACdP_Nperi                         |       7.45e-04 | [0.00, 1.00]
## t1_wks_since_conception            |       1.01e-03 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception |       7.65e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_Nperi)
## # R2 for Linear Regression
##        R2: 0.003
##   adj. R2: -0.010
#Intrusion Distress Reaction Time
model_intrusions_distress_rt_c_neg <- lm(t1_thoughts_distress_level ~ ACRT_neg*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_rt_c_neg) #Intrusions distress conception Reaction time
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_neg * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.19132 -1.01057 -0.05488  0.92835  2.02421 
## 
## Coefficients:
##                                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                       2.102e+00  1.296e-01  16.213   <2e-16 ***
## ACRT_neg                          1.044e-03  2.152e-03   0.485    0.628    
## t1_wks_since_conception          -9.465e-04  1.850e-03  -0.512    0.609    
## ACRT_neg:t1_wks_since_conception -2.213e-05  3.057e-05  -0.724    0.470    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8903 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.003691,   Adjusted R-squared:  -0.00866 
## F-statistic: 0.2988 on 3 and 242 DF,  p-value: 0.8262
standardized_model_intrusions_distress_rt_c_neg <- standardize_parameters(model_intrusions_distress_rt_c_neg)
print(standardized_model_intrusions_distress_rt_c_neg)
## # Standardization method: refit
## 
## Parameter                          | Std. Coef. |        95% CI
## ---------------------------------------------------------------
## (Intercept)                        |  -3.48e-03 | [-0.13, 0.12]
## ACRT neg                           |      -0.02 | [-0.15, 0.10]
## t1 wks since conception            |      -0.04 | [-0.16, 0.09]
## ACRT neg × t1 wks since conception |      -0.05 | [-0.17, 0.08]
anova(model_intrusions_distress_rt_c_neg)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                   Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_neg                           1   0.081 0.08078  0.1019 0.7498
## t1_wks_since_conception            1   0.214 0.21439  0.2705 0.6035
## ACRT_neg:t1_wks_since_conception   1   0.415 0.41531  0.5240 0.4698
## Residuals                        242 191.798 0.79255
eta_squared(model_intrusions_distress_rt_c_neg)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                        | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------
## ACRT_neg                         |       4.21e-04 | [0.00, 1.00]
## t1_wks_since_conception          |       1.12e-03 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception |       2.16e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_neg)
## # R2 for Linear Regression
##        R2: 0.004
##   adj. R2: -0.009
model_intrusions_distress_rt_c_peri <- lm(t1_thoughts_distress_level ~ ACRT_peri*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_rt_c_peri) #Intrusions distress mod Reaction time
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_peri * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.15977 -1.02346 -0.03469  0.93798  2.01506 
## 
## Coefficients:
##                                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                        2.122e+00  1.313e-01  16.160   <2e-16 ***
## ACRT_peri                         -1.740e-03  2.156e-03  -0.807    0.420    
## t1_wks_since_conception           -1.164e-03  1.873e-03  -0.621    0.535    
## ACRT_peri:t1_wks_since_conception  2.275e-05  3.071e-05   0.741    0.459    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8903 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.003695,   Adjusted R-squared:  -0.008656 
## F-statistic: 0.2992 on 3 and 242 DF,  p-value: 0.826
standardized_model_intrusions_distress_rt_c_peri <- standardize_parameters(model_intrusions_distress_rt_c_peri)
print(standardized_model_intrusions_distress_rt_c_peri)
## # Standardization method: refit
## 
## Parameter                           | Std. Coef. |        95% CI
## ----------------------------------------------------------------
## (Intercept)                         |   7.74e-04 | [-0.13, 0.13]
## ACRT peri                           |      -0.02 | [-0.15, 0.11]
## t1 wks since conception             |      -0.03 | [-0.16, 0.09]
## ACRT peri × t1 wks since conception |       0.05 | [-0.08, 0.17]
anova(model_intrusions_distress_rt_c_peri)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                    Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_peri                           1   0.079 0.07863  0.0992 0.7531
## t1_wks_since_conception             1   0.198 0.19760  0.2493 0.6180
## ACRT_peri:t1_wks_since_conception   1   0.435 0.43510  0.5490 0.4594
## Residuals                         242 191.797 0.79255
eta_squared(model_intrusions_distress_rt_c_peri)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                         | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------
## ACRT_peri                         |       4.10e-04 | [0.00, 1.00]
## t1_wks_since_conception           |       1.03e-03 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception |       2.26e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_peri)
## # R2 for Linear Regression
##        R2: 0.004
##   adj. R2: -0.009
model_intrusions_distress_rt_c_Nperi <- lm(t1_thoughts_distress_level ~ ACRT_Nperi*t1_wks_since_conception, data = final_data)
summary(model_intrusions_distress_rt_c_Nperi) #Intrusions distress mod reaction time
## 
## Call:
## lm(formula = t1_thoughts_distress_level ~ ACRT_Nperi * t1_wks_since_conception, 
##     data = final_data)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.36692 -0.99847 -0.04071  0.90899  1.96996 
## 
## Coefficients:
##                                      Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                         2.127e+00  1.296e-01  16.409   <2e-16 ***
## ACRT_Nperi                         -2.811e-03  2.105e-03  -1.336    0.183    
## t1_wks_since_conception            -1.408e-03  1.870e-03  -0.753    0.452    
## ACRT_Nperi:t1_wks_since_conception  4.765e-05  3.140e-05   1.518    0.130    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8872 on 242 degrees of freedom
##   (1 observation deleted due to missingness)
## Multiple R-squared:  0.01043,    Adjusted R-squared:  -0.001841 
## F-statistic: 0.8499 on 3 and 242 DF,  p-value: 0.4678
standardized_model_intrusions_distress_rt_c_Nperi <- standardize_parameters(model_intrusions_distress_rt_c_Nperi)
print(standardized_model_intrusions_distress_rt_c_Nperi)
## # Standardization method: refit
## 
## Parameter                            | Std. Coef. |        95% CI
## -----------------------------------------------------------------
## (Intercept)                          |  -5.87e-03 | [-0.13, 0.12]
## ACRT Nperi                           |       0.01 | [-0.11, 0.14]
## t1 wks since conception              |      -0.04 | [-0.16, 0.09]
## ACRT Nperi × t1 wks since conception |       0.10 | [-0.03, 0.23]
anova(model_intrusions_distress_rt_c_Nperi)
## Analysis of Variance Table
## 
## Response: t1_thoughts_distress_level
##                                     Df  Sum Sq Mean Sq F value Pr(>F)
## ACRT_Nperi                           1   0.000 0.00003  0.0000 0.9947
## t1_wks_since_conception              1   0.194 0.19439  0.2469 0.6197
## ACRT_Nperi:t1_wks_since_conception   1   1.813 1.81277  2.3028 0.1304
## Residuals                          242 190.501 0.78719
eta_squared(model_intrusions_distress_rt_c_Nperi)
## # Effect Size for ANOVA (Type I)
## 
## Parameter                          | Eta2 (partial) |       95% CI
## ------------------------------------------------------------------
## ACRT_Nperi                         |       1.81e-07 | [0.00, 1.00]
## t1_wks_since_conception            |       1.02e-03 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception |       9.43e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_Nperi)
## # R2 for Linear Regression
##        R2: 0.010
##   adj. R2: -0.002
tab_model (model_intrusions_distress_rt_c_Nperi)
  t 1 thoughts distress
level
Predictors Estimates CI p
(Intercept) 2.13 1.87 – 2.38 <0.001
ACRT Nperi -0.00 -0.01 – 0.00 0.183
t1 wks since conception -0.00 -0.01 – 0.00 0.452
ACRT Nperi × t1 wks since
conception
0.00 -0.00 – 0.00 0.130
Observations 246
R2 / R2 adjusted 0.010 / -0.002
#simple slopes for ACdp_neg and weeks since conception
probe_interaction(model_intrusions_distress_dp_c_neg , pred = ACdP_neg, modx = t1_wks_since_conception, johnson_neyman = TRUE, jnplot = TRUE, interval = TRUE, x.label = "Affective control index - Negative Dprime (Neg -Neutral)",
y.label = "Intrusions Distress", main.title = "Moderation of Intrusion Distress",
                  color.class = "Paired")
## The color.class argument is deprecated. Please use 'colors' instead.
## JOHNSON-NEYMAN INTERVAL
## 
## When t1_wks_since_conception is OUTSIDE the interval [42.17, 202.99], the
## slope of ACdP_neg is p < .05.
## 
## Note: The range of observed values of t1_wks_since_conception is [13.57,
## 132.70]

## SIMPLE SLOPES ANALYSIS
## 
## Slope of ACdP_neg when t1_wks_since_conception = 31.97976 (- 1 SD): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.09   0.04     2.24   0.03
## 
## Slope of ACdP_neg when t1_wks_since_conception = 62.82129 (Mean): 
## 
##   Est.   S.E.   t val.      p
## ------ ------ -------- ------
##   0.03   0.03     0.80   0.43
## 
## Slope of ACdP_neg when t1_wks_since_conception = 93.66282 (+ 1 SD): 
## 
##    Est.   S.E.   t val.      p
## ------- ------ -------- ------
##   -0.04   0.05    -0.94   0.35

#calculate coefficients
# 1 below SD
# Step 1: Calculate SD
N <- 247
SE <- 0.04
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.09
standardised_below_distress_c <- SD * beta

# Print the result
print(standardised_below_distress_c)
## [1] 0.05657844
# average
# Step 1: Calculate SD
N <- 247
SE <- 0.03
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- 0.03
standardised_av_distress_c <- SD * beta

# Print the result
print(standardised_av_distress_c)
## [1] 0.01414461
# 1 above SD
# Step 1: Calculate SD
N <- 247
SE <- 0.05
SD <- SE * sqrt(N)

# Step 2: Calculate the standardized beta
beta <- -0.04
standardised_above_distress_c <- SD * beta

# Print the result
print(standardised_above_distress_c)
## [1] -0.03143247
# relevant graph
# create interaction plot with simple slopes and data points
interaction_plot_model_intrusions_distress_dp_c_neg <- interact_plot(model_intrusions_distress_dp_c_neg, 
                                                        pred = ACdP_neg, 
                                                        modx = t1_wks_since_conception,
                                                        plot.points = TRUE, 
                                                        point.alpha = 0.5,
                                                        legend.main = "Peripartum Stage") +
                                          theme_minimal() +
                                          labs(x = "Affective Control: Negative Generic Content (D-Prime)",
                                               y = "Intrusion-Related Distress") +
                                           theme(panel.grid.major = element_blank(),
                                                panel.grid.minor = element_blank(),
                                                axis.line = element_line())  # Keep axis lines



# Show the plot
print(interaction_plot_model_intrusions_distress_dp_c_neg)

##1-Month follow up

# Converting time to a factor
final_dataT2_long$time <- as.factor(final_dataT2_long$time)

###H3 -T2 Intrusions

#Intrusions Dprime
model_intrusions_dp_c_neg_t2 <- lmer(intrusions ~ (ACdP_neg*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_c_neg_t2) #Intrusions conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_neg * t1_wks_since_conception) * time + (1 |  
##     Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2105.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6926 -0.5020 -0.1173  0.4466  3.0527 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.185    2.487   
##  Residual                4.678    2.163   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                          Estimate Std. Error         df t value
## (Intercept)                             5.087e+00  5.789e-01  3.051e+02   8.787
## ACdP_neg                                1.477e-01  2.743e-01  3.051e+02   0.538
## t1_wks_since_conception                -5.735e-03  8.018e-03  3.051e+02  -0.715
## time2                                  -5.308e-01  5.373e-01  2.020e+02  -0.988
## ACdP_neg:t1_wks_since_conception       -8.475e-04  3.941e-03  3.051e+02  -0.215
## ACdP_neg:time2                         -1.870e-01  2.546e-01  2.020e+02  -0.735
## t1_wks_since_conception:time2           2.065e-03  7.441e-03  2.020e+02   0.278
## ACdP_neg:t1_wks_since_conception:time2  2.592e-03  3.657e-03  2.020e+02   0.709
##                                        Pr(>|t|)    
## (Intercept)                              <2e-16 ***
## ACdP_neg                                  0.591    
## t1_wks_since_conception                   0.475    
## time2                                     0.324    
## ACdP_neg:t1_wks_since_conception          0.830    
## ACdP_neg:time2                            0.463    
## t1_wks_since_conception:time2             0.782    
## ACdP_neg:t1_wks_since_conception:time2    0.479    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_n t1_w__ time2  ACdP_:1___ ACP_:2 t1___:
## ACdP_neg    -0.354                                              
## t1_wks_snc_ -0.908  0.323                                       
## time2       -0.464  0.164  0.421                                
## ACdP_n:1___  0.311 -0.886 -0.346 -0.144                         
## ACdP_ng:tm2  0.164 -0.464 -0.150 -0.354  0.411                  
## t1_wks_s_:2  0.421 -0.150 -0.464 -0.908  0.160      0.323       
## ACP_:1___:2 -0.144  0.411  0.160  0.311 -0.464     -0.886 -0.346
standardized_model_intrusions_dp_c_neg_t2 <- standardize_parameters(model_intrusions_dp_c_neg_t2)
print(standardized_model_intrusions_dp_c_neg_t2)
## # Standardization method: refit
## 
## Parameter                                       | Std. Coef. |        95% CI
## ----------------------------------------------------------------------------
## (Intercept)                                     |       0.06 | [-0.08, 0.20]
## ACdP neg                                        |       0.05 | [-0.09, 0.19]
## t1 wks since conception                         |      -0.06 | [-0.20, 0.08]
## time [2]                                        |      -0.12 | [-0.25, 0.00]
## ACdP neg × t1 wks since conception              |      -0.01 | [-0.14, 0.12]
## ACdP neg × time [2]                             |  -9.86e-03 | [-0.14, 0.12]
## t1 wks since conception × time [2]              |       0.03 | [-0.09, 0.16]
## (ACdP neg × t1 wks since conception) × time [2] |       0.04 | [-0.08, 0.16]
anova(model_intrusions_dp_c_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                       Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## ACdP_neg                              0.2329  0.2329     1   202  0.0498 0.8237
## t1_wks_since_conception               2.0508  2.0508     1   202  0.4384 0.5086
## time                                  4.5659  4.5659     1   202  0.9761 0.3243
## ACdP_neg:t1_wks_since_conception      0.0773  0.0773     1   202  0.0165 0.8979
## ACdP_neg:time                         2.5238  2.5238     1   202  0.5396 0.4635
## t1_wks_since_conception:time          0.3603  0.3603     1   202  0.0770 0.7817
## ACdP_neg:t1_wks_since_conception:time 2.3503  2.3503     1   202  0.5025 0.4792
eta_squared(model_intrusions_dp_c_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter                             | Eta2 (partial) |       95% CI
## ---------------------------------------------------------------------
## ACdP_neg                              |       2.46e-04 | [0.00, 1.00]
## t1_wks_since_conception               |       2.17e-03 | [0.00, 1.00]
## time                                  |       4.81e-03 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception      |       8.18e-05 | [0.00, 1.00]
## ACdP_neg:time                         |       2.66e-03 | [0.00, 1.00]
## t1_wks_since_conception:time          |       3.81e-04 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception:time |       2.48e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.573
##      Marginal R2: 0.009
model_intrusions_dp_c_peri_t2 <- lmer(intrusions ~ (ACdP_peri*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_c_peri_t2) #Intrusions conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_peri * t1_wks_since_conception) * time + (1 |  
##     Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2103.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6999 -0.5025 -0.1065  0.4752  3.0620 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.150    2.480   
##  Residual                4.649    2.156   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                           Estimate Std. Error         df
## (Intercept)                               4.898666   0.569088 305.056571
## ACdP_peri                                 0.439639   0.270252 305.056572
## t1_wks_since_conception                  -0.003402   0.007872 305.056571
## time2                                    -0.455953   0.528050 202.000000
## ACdP_peri:t1_wks_since_conception        -0.004474   0.003965 305.056572
## ACdP_peri:time2                          -0.315002   0.250763 202.000000
## t1_wks_since_conception:time2             0.001639   0.007305 202.000000
## ACdP_peri:t1_wks_since_conception:time2   0.003337   0.003679 202.000000
##                                         t value Pr(>|t|)    
## (Intercept)                               8.608 4.02e-16 ***
## ACdP_peri                                 1.627    0.105    
## t1_wks_since_conception                  -0.432    0.666    
## time2                                    -0.863    0.389    
## ACdP_peri:t1_wks_since_conception        -1.128    0.260    
## ACdP_peri:time2                          -1.256    0.211    
## t1_wks_since_conception:time2             0.224    0.823    
## ACdP_peri:t1_wks_since_conception:time2   0.907    0.365    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_p t1_w__ time2  ACdP_:1___ ACP_:2 t1___:
## ACdP_peri   -0.316                                              
## t1_wks_snc_ -0.908  0.289                                       
## time2       -0.464  0.146  0.421                                
## ACdP_p:1___  0.274 -0.894 -0.302 -0.127                         
## ACdP_pr:tm2  0.146 -0.464 -0.134 -0.316  0.415                  
## t1_wks_s_:2  0.421 -0.134 -0.464 -0.908  0.140      0.289       
## ACP_:1___:2 -0.127  0.415  0.140  0.274 -0.464     -0.894 -0.302
standardized_model_intrusions_dp_c_peri_t2 <- standardize_parameters(model_intrusions_dp_c_peri_t2)
print(standardized_model_intrusions_dp_c_peri_t2)
## # Standardization method: refit
## 
## Parameter                                        | Std. Coef. |        95% CI
## -----------------------------------------------------------------------------
## (Intercept)                                      |       0.06 | [-0.08, 0.20]
## ACdP peri                                        |       0.09 | [-0.05, 0.22]
## t1 wks since conception                          |      -0.06 | [-0.19, 0.08]
## time [2]                                         |      -0.12 | [-0.25, 0.00]
## ACdP peri × t1 wks since conception              |      -0.08 | [-0.22, 0.06]
## ACdP peri × time [2]                             |      -0.06 | [-0.18, 0.07]
## t1 wks since conception × time [2]               |       0.03 | [-0.09, 0.16]
## (ACdP peri × t1 wks since conception) × time [2] |       0.06 | [-0.07, 0.19]
anova(model_intrusions_dp_c_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                        Sum Sq Mean Sq NumDF DenDF F value
## ACdP_peri                              6.4564  6.4564     1   202  1.3888
## t1_wks_since_conception                0.6373  0.6373     1   202  0.1371
## time                                   3.4660  3.4660     1   202  0.7456
## ACdP_peri:t1_wks_since_conception      2.9648  2.9648     1   202  0.6378
## ACdP_peri:time                         7.3357  7.3357     1   202  1.5780
## t1_wks_since_conception:time           0.2341  0.2341     1   202  0.0504
## ACdP_peri:t1_wks_since_conception:time 3.8245  3.8245     1   202  0.8227
##                                        Pr(>F)
## ACdP_peri                              0.2400
## t1_wks_since_conception                0.7116
## time                                   0.3889
## ACdP_peri:t1_wks_since_conception      0.4255
## ACdP_peri:time                         0.2105
## t1_wks_since_conception:time           0.8227
## ACdP_peri:t1_wks_since_conception:time 0.3655
eta_squared(model_intrusions_dp_c_peri_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter                              | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------------
## ACdP_peri                              |       6.83e-03 | [0.00, 1.00]
## t1_wks_since_conception                |       6.78e-04 | [0.00, 1.00]
## time                                   |       3.68e-03 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception      |       3.15e-03 | [0.00, 1.00]
## ACdP_peri:time                         |       7.75e-03 | [0.00, 1.00]
## t1_wks_since_conception:time           |       2.49e-04 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception:time |       4.06e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.576
##      Marginal R2: 0.014
model_intrusions_dp_c_Nperi_t2 <- lmer(intrusions ~ (ACdP_Nperi*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_dp_c_Nperi_t2 ) #Intrusions conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACdP_Nperi * t1_wks_since_conception) * time +  
##     (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2104.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6552 -0.4916 -0.1074  0.4530  3.0746 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.155    2.481   
##  Residual                4.674    2.162   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                            Estimate Std. Error         df
## (Intercept)                               5.229e+00  5.413e-01  3.054e+02
## ACdP_Nperi                                3.785e-01  3.037e-01  3.054e+02
## t1_wks_since_conception                  -6.985e-03  7.521e-03  3.054e+02
## time2                                    -6.770e-01  5.029e-01  2.020e+02
## ACdP_Nperi:t1_wks_since_conception       -4.784e-03  4.579e-03  3.054e+02
## ACdP_Nperi:time2                         -1.495e-01  2.822e-01  2.020e+02
## t1_wks_since_conception:time2             3.985e-03  6.988e-03  2.020e+02
## ACdP_Nperi:t1_wks_since_conception:time2  8.354e-04  4.254e-03  2.020e+02
##                                          t value Pr(>|t|)    
## (Intercept)                                9.660   <2e-16 ***
## ACdP_Nperi                                 1.246    0.214    
## t1_wks_since_conception                   -0.929    0.354    
## time2                                     -1.346    0.180    
## ACdP_Nperi:t1_wks_since_conception        -1.045    0.297    
## ACdP_Nperi:time2                          -0.530    0.597    
## t1_wks_since_conception:time2              0.570    0.569    
## ACdP_Nperi:t1_wks_since_conception:time2   0.196    0.845    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_N t1_w__ time2  ACdP_N:1___ ACP_N:2 t1___:
## ACdP_Nperi   0.047                                                
## t1_wks_snc_ -0.906 -0.052                                         
## time2       -0.465 -0.022  0.421                                  
## ACdP_N:1___ -0.050 -0.904  0.062  0.023                           
## ACdP_Npr:t2 -0.022 -0.465  0.024  0.047  0.420                    
## t1_wks_s_:2  0.421  0.024 -0.465 -0.906 -0.029      -0.052        
## ACP_N:1___:  0.023  0.420 -0.029 -0.050 -0.465      -0.904   0.062
standardized_model_intrusions_dp_c_Nperi_t2  <- standardize_parameters(model_intrusions_dp_c_Nperi_t2 )
print(standardized_model_intrusions_dp_c_Nperi_t2 )
## # Standardization method: refit
## 
## Parameter                                         | Std. Coef. |        95% CI
## ------------------------------------------------------------------------------
## (Intercept)                                       |       0.06 | [-0.08, 0.20]
## ACdP Nperi                                        |       0.04 | [-0.10, 0.18]
## t1 wks since conception                           |      -0.06 | [-0.20, 0.07]
## time [2]                                          |      -0.13 | [-0.25, 0.00]
## ACdP Nperi × t1 wks since conception              |      -0.08 | [-0.23, 0.07]
## ACdP Nperi × time [2]                             |      -0.05 | [-0.18, 0.08]
## t1 wks since conception × time [2]                |       0.04 | [-0.09, 0.16]
## (ACdP Nperi × t1 wks since conception) × time [2] |       0.01 | [-0.12, 0.15]
anova(model_intrusions_dp_c_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                         Sum Sq Mean Sq NumDF DenDF F value
## ACdP_Nperi                              5.9646  5.9646     1   202  1.2762
## t1_wks_since_conception                 2.6267  2.6267     1   202  0.5620
## time                                    8.4705  8.4705     1   202  1.8123
## ACdP_Nperi:t1_wks_since_conception      5.4184  5.4184     1   202  1.1593
## ACdP_Nperi:time                         1.3113  1.3113     1   202  0.2806
## t1_wks_since_conception:time            1.5198  1.5198     1   202  0.3252
## ACdP_Nperi:t1_wks_since_conception:time 0.1802  0.1802     1   202  0.0386
##                                         Pr(>F)
## ACdP_Nperi                              0.2600
## t1_wks_since_conception                 0.4543
## time                                    0.1797
## ACdP_Nperi:t1_wks_since_conception      0.2829
## ACdP_Nperi:time                         0.5969
## t1_wks_since_conception:time            0.5691
## ACdP_Nperi:t1_wks_since_conception:time 0.8445
eta_squared(model_intrusions_dp_c_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter                               | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------------
## ACdP_Nperi                              |       6.28e-03 | [0.00, 1.00]
## t1_wks_since_conception                 |       2.77e-03 | [0.00, 1.00]
## time                                    |       8.89e-03 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception      |       5.71e-03 | [0.00, 1.00]
## ACdP_Nperi:time                         |       1.39e-03 | [0.00, 1.00]
## t1_wks_since_conception:time            |       1.61e-03 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception:time |       1.91e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_dp_c_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.573
##      Marginal R2: 0.012
model_intrusions_rt_c_neg_t2 <- lmer(intrusions ~ (ACRT_neg*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_rt_c_neg_t2) #Intrusions conception Reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_neg * t1_wks_since_conception) * time + (1 |  
##     Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2127.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.82682 -0.50459 -0.09861  0.45897  3.06314 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 5.954    2.440   
##  Residual                4.663    2.159   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                          Estimate Std. Error         df t value
## (Intercept)                             5.313e+00  5.405e-01  3.073e+02   9.831
## ACRT_neg                               -6.097e-03  8.473e-03  3.073e+02  -0.720
## t1_wks_since_conception                -7.931e-03  7.476e-03  3.073e+02  -1.061
## time2                                  -6.261e-01  5.065e-01  2.020e+02  -1.236
## ACRT_neg:t1_wks_since_conception       -3.780e-05  1.182e-04  3.073e+02  -0.320
## ACRT_neg:time2                         -7.487e-03  7.941e-03  2.020e+02  -0.943
## t1_wks_since_conception:time2           3.560e-03  7.006e-03  2.020e+02   0.508
## ACRT_neg:t1_wks_since_conception:time2  1.214e-04  1.108e-04  2.020e+02   1.096
##                                        Pr(>|t|)    
## (Intercept)                              <2e-16 ***
## ACRT_neg                                  0.472    
## t1_wks_since_conception                   0.290    
## time2                                     0.218    
## ACRT_neg:t1_wks_since_conception          0.749    
## ACRT_neg:time2                            0.347    
## t1_wks_since_conception:time2             0.612    
## ACRT_neg:t1_wks_since_conception:time2    0.274    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_n t1_w__ time2  ACRT_n:1___ ACRT_:2 t1___:
## ACRT_neg    -0.126                                                
## t1_wks_snc_ -0.906  0.092                                         
## time2       -0.469  0.059  0.425                                  
## ACRT_n:1___  0.088 -0.896 -0.058 -0.041                           
## ACRT_ng:tm2  0.059 -0.469 -0.043 -0.126  0.420                    
## t1_wks_s_:2  0.425 -0.043 -0.469 -0.906  0.027       0.092        
## ACRT_:1___: -0.041  0.420  0.027  0.088 -0.469      -0.896  -0.058
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_rt_c_neg_t2 <- standardize_parameters(model_intrusions_rt_c_neg_t2)
print(standardized_model_intrusions_rt_c_neg_t2)
## # Standardization method: refit
## 
## Parameter                                       | Std. Coef. |         95% CI
## -----------------------------------------------------------------------------
## (Intercept)                                     |       0.06 | [-0.08,  0.20]
## ACRT neg                                        |      -0.16 | [-0.29, -0.02]
## t1 wks since conception                         |      -0.08 | [-0.21,  0.06]
## time [2]                                        |      -0.12 | [-0.25,  0.01]
## ACRT neg × t1 wks since conception              |      -0.02 | [-0.15,  0.11]
## ACRT neg × time [2]                             |   7.95e-03 | [-0.12,  0.14]
## t1 wks since conception × time [2]              |       0.04 | [-0.09,  0.17]
## (ACRT neg × t1 wks since conception) × time [2] |       0.07 | [-0.05,  0.19]
anova(model_intrusions_rt_c_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                       Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## ACRT_neg                              8.0582  8.0582     1   202  1.7283 0.1901
## t1_wks_since_conception               4.0455  4.0455     1   202  0.8677 0.3527
## time                                  7.1234  7.1234     1   202  1.5278 0.2179
## ACRT_neg:t1_wks_since_conception      0.2242  0.2242     1   202  0.0481 0.8267
## ACRT_neg:time                         4.1440  4.1440     1   202  0.8888 0.3469
## t1_wks_since_conception:time          1.2035  1.2035     1   202  0.2581 0.6120
## ACRT_neg:t1_wks_since_conception:time 5.5986  5.5986     1   202  1.2008 0.2745
eta_squared(model_intrusions_rt_c_neg_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                             | Eta2 (partial) |       95% CI
## ---------------------------------------------------------------------
## ACRT_neg                              |       8.48e-03 | [0.00, 1.00]
## t1_wks_since_conception               |       4.28e-03 | [0.00, 1.00]
## time                                  |       7.51e-03 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception      |       2.38e-04 | [0.00, 1.00]
## ACRT_neg:time                         |       4.38e-03 | [0.00, 1.00]
## t1_wks_since_conception:time          |       1.28e-03 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception:time |       5.91e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.574
##      Marginal R2: 0.031
model_intrusions_rt_c_peri_t2 <- lmer(intrusions ~ (ACRT_peri*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_rt_c_peri_t2) #Intrusions conception Reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_peri * t1_wks_since_conception) * time + (1 |  
##     Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2131.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.8409 -0.4807 -0.1258  0.4496  3.2305 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.203    2.491   
##  Residual                4.627    2.151   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                           Estimate Std. Error         df
## (Intercept)                              5.247e+00  5.485e-01  3.042e+02
## ACRT_peri                               -4.918e-03  8.766e-03  3.042e+02
## t1_wks_since_conception                 -6.566e-03  7.618e-03  3.042e+02
## time2                                   -6.507e-01  5.071e-01  2.020e+02
## ACRT_peri:t1_wks_since_conception       -2.154e-07  1.214e-04  3.042e+02
## ACRT_peri:time2                         -1.376e-03  8.104e-03  2.020e+02
## t1_wks_since_conception:time2            2.914e-03  7.042e-03  2.020e+02
## ACRT_peri:t1_wks_since_conception:time2  9.909e-05  1.122e-04  2.020e+02
##                                         t value Pr(>|t|)    
## (Intercept)                               9.565   <2e-16 ***
## ACRT_peri                                -0.561    0.575    
## t1_wks_since_conception                  -0.862    0.389    
## time2                                    -1.283    0.201    
## ACRT_peri:t1_wks_since_conception        -0.002    0.999    
## ACRT_peri:time2                          -0.170    0.865    
## t1_wks_since_conception:time2             0.414    0.679    
## ACRT_peri:t1_wks_since_conception:time2   0.883    0.378    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_p t1_w__ time2  ACRT_p:1___ ACRT_:2 t1___:
## ACRT_peri   -0.169                                                
## t1_wks_snc_ -0.906  0.154                                         
## time2       -0.462  0.078  0.419                                  
## ACRT_p:1___  0.154 -0.897 -0.170 -0.071                           
## ACRT_pr:tm2  0.078 -0.462 -0.071 -0.169  0.414                    
## t1_wks_s_:2  0.419 -0.071 -0.462 -0.906  0.079       0.154        
## ACRT_:1___: -0.071  0.414  0.079  0.154 -0.462      -0.897  -0.170
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_rt_c_peri_t2 <- standardize_parameters(model_intrusions_rt_c_peri_t2)
print(standardized_model_intrusions_rt_c_peri_t2)
## # Standardization method: refit
## 
## Parameter                                        | Std. Coef. |        95% CI
## -----------------------------------------------------------------------------
## (Intercept)                                      |       0.06 | [-0.07, 0.20]
## ACRT peri                                        |      -0.09 | [-0.23, 0.05]
## t1 wks since conception                          |      -0.06 | [-0.20, 0.08]
## time [2]                                         |      -0.13 | [-0.25, 0.00]
## ACRT peri × t1 wks since conception              |  -1.19e-04 | [-0.13, 0.13]
## ACRT peri × time [2]                             |       0.09 | [-0.04, 0.22]
## t1 wks since conception × time [2]               |       0.04 | [-0.09, 0.16]
## (ACRT peri × t1 wks since conception) × time [2] |       0.05 | [-0.07, 0.18]
anova(model_intrusions_rt_c_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                        Sum Sq Mean Sq NumDF DenDF F value
## ACRT_peri                              2.4063  2.4063     1   202  0.5200
## t1_wks_since_conception                2.6462  2.6462     1   202  0.5719
## time                                   7.6204  7.6204     1   202  1.6469
## ACRT_peri:t1_wks_since_conception      0.9722  0.9722     1   202  0.2101
## ACRT_peri:time                         0.1335  0.1335     1   202  0.0288
## t1_wks_since_conception:time           0.7926  0.7926     1   202  0.1713
## ACRT_peri:t1_wks_since_conception:time 3.6102  3.6102     1   202  0.7802
##                                        Pr(>F)
## ACRT_peri                              0.4717
## t1_wks_since_conception                0.4504
## time                                   0.2009
## ACRT_peri:t1_wks_since_conception      0.6472
## ACRT_peri:time                         0.8653
## t1_wks_since_conception:time           0.6794
## ACRT_peri:t1_wks_since_conception:time 0.3781
eta_squared(model_intrusions_rt_c_peri_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                              | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------------
## ACRT_peri                              |       2.57e-03 | [0.00, 1.00]
## t1_wks_since_conception                |       2.82e-03 | [0.00, 1.00]
## time                                   |       8.09e-03 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception      |       1.04e-03 | [0.00, 1.00]
## ACRT_peri:time                         |       1.43e-04 | [0.00, 1.00]
## t1_wks_since_conception:time           |       8.47e-04 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception:time |       3.85e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.578
##      Marginal R2: 0.011
model_intrusions_rt_c_Nperi_t2 <- lmer(intrusions ~ (ACRT_Nperi*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_rt_c_Nperi_t2) #Intrusions conception Reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusions ~ (ACRT_Nperi * t1_wks_since_conception) * time +  
##     (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 2129.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6705 -0.5010 -0.1144  0.4288  3.0482 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 6.072    2.464   
##  Residual                4.651    2.157   
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                            Estimate Std. Error         df
## (Intercept)                               5.236e+00  5.397e-01  3.059e+02
## ACRT_Nperi                                6.957e-04  8.509e-03  3.059e+02
## t1_wks_since_conception                  -7.632e-03  7.560e-03  3.059e+02
## time2                                    -6.470e-01  5.027e-01  2.020e+02
## ACRT_Nperi:t1_wks_since_conception        5.308e-05  1.250e-04  3.059e+02
## ACRT_Nperi:time2                          5.192e-03  7.925e-03  2.020e+02
## t1_wks_since_conception:time2             3.184e-03  7.041e-03  2.020e+02
## ACRT_Nperi:t1_wks_since_conception:time2 -7.657e-06  1.164e-04  2.020e+02
##                                          t value Pr(>|t|)    
## (Intercept)                                9.701   <2e-16 ***
## ACRT_Nperi                                 0.082    0.935    
## t1_wks_since_conception                   -1.010    0.314    
## time2                                     -1.287    0.200    
## ACRT_Nperi:t1_wks_since_conception         0.425    0.671    
## ACRT_Nperi:time2                           0.655    0.513    
## t1_wks_since_conception:time2              0.452    0.652    
## ACRT_Nperi:t1_wks_since_conception:time2  -0.066    0.948    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##              (Intr) ACRT_Np t1_w__ time2  ACRT_Np:1___ ACRT_N:2 t1___:
## ACRT_Nperi   -0.046                                                   
## t1_wks_snc_  -0.904  0.072                                            
## time2        -0.466  0.021   0.421                                    
## ACRT_Np:1___  0.071 -0.891  -0.126 -0.033                             
## ACRT_Npr:t2   0.021 -0.466  -0.034 -0.046  0.415                      
## t1_wks_s_:2   0.421 -0.034  -0.466 -0.904  0.059        0.072         
## ACRT_N:1___: -0.033  0.415   0.059  0.071 -0.466       -0.891   -0.126
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_rt_c_Nperi_t2 <- standardize_parameters(model_intrusions_rt_c_Nperi_t2)
print(standardized_model_intrusions_rt_c_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                                         | Std. Coef. |        95% CI
## ------------------------------------------------------------------------------
## (Intercept)                                       |       0.06 | [-0.08, 0.20]
## ACRT Nperi                                        |       0.08 | [-0.06, 0.21]
## t1 wks since conception                           |      -0.07 | [-0.21, 0.07]
## time [2]                                          |      -0.13 | [-0.25, 0.00]
## ACRT Nperi × t1 wks since conception              |       0.03 | [-0.11, 0.17]
## ACRT Nperi × time [2]                             |       0.08 | [-0.04, 0.21]
## t1 wks since conception × time [2]                |       0.03 | [-0.10, 0.16]
## (ACRT Nperi × t1 wks since conception) × time [2] |  -4.24e-03 | [-0.13, 0.12]
anova(model_intrusions_rt_c_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                         Sum Sq Mean Sq NumDF DenDF F value
## ACRT_Nperi                              0.8886  0.8886     1   202  0.1911
## t1_wks_since_conception                 3.7909  3.7909     1   202  0.8152
## time                                    7.7033  7.7033     1   202  1.6564
## ACRT_Nperi:t1_wks_since_conception      0.9222  0.9222     1   202  0.1983
## ACRT_Nperi:time                         1.9959  1.9959     1   202  0.4292
## t1_wks_since_conception:time            0.9508  0.9508     1   202  0.2044
## ACRT_Nperi:t1_wks_since_conception:time 0.0201  0.0201     1   202  0.0043
##                                         Pr(>F)
## ACRT_Nperi                              0.6625
## t1_wks_since_conception                 0.3677
## time                                    0.1996
## ACRT_Nperi:t1_wks_since_conception      0.6566
## ACRT_Nperi:time                         0.5131
## t1_wks_since_conception:time            0.6516
## ACRT_Nperi:t1_wks_since_conception:time 0.9476
eta_squared(model_intrusions_rt_c_Nperi_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                               | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------------
## ACRT_Nperi                              |       9.45e-04 | [0.00, 1.00]
## t1_wks_since_conception                 |       4.02e-03 | [0.00, 1.00]
## time                                    |       8.13e-03 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception      |       9.81e-04 | [0.00, 1.00]
## ACRT_Nperi:time                         |       2.12e-03 | [0.00, 1.00]
## t1_wks_since_conception:time            |       1.01e-03 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception:time |       2.14e-05 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_rt_c_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.575
##      Marginal R2: 0.021

###H3 - T2 Distress

#Intrusion distress Dprime
model_intrusions_distress_dp_c_neg_t2 <- lmer(intrusionsdistress ~ (ACdP_neg*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long) 
summary(model_intrusions_distress_dp_c_neg_t2) #Intrusions distress conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_neg * t1_wks_since_conception) * time +  
##     (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1056.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.53968 -0.47978 -0.05965  0.50667  2.83190 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5316   0.7291  
##  Residual                0.3199   0.5656  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                          Estimate Std. Error         df t value
## (Intercept)                             2.068e+00  1.621e-01  2.907e+02  12.758
## ACdP_neg                                1.423e-01  7.681e-02  2.907e+02   1.853
## t1_wks_since_conception                -2.474e-04  2.245e-03  2.907e+02  -0.110
## time2                                   4.252e-02  1.405e-01  2.020e+02   0.303
## ACdP_neg:t1_wks_since_conception       -2.005e-03  1.103e-03  2.907e+02  -1.817
## ACdP_neg:time2                         -4.904e-03  6.658e-02  2.020e+02  -0.074
## t1_wks_since_conception:time2          -1.949e-03  1.946e-03  2.020e+02  -1.002
## ACdP_neg:t1_wks_since_conception:time2  7.694e-04  9.564e-04  2.020e+02   0.805
##                                        Pr(>|t|)    
## (Intercept)                              <2e-16 ***
## ACdP_neg                                 0.0649 .  
## t1_wks_since_conception                  0.9123    
## time2                                    0.7625    
## ACdP_neg:t1_wks_since_conception         0.0703 .  
## ACdP_neg:time2                           0.9414    
## t1_wks_since_conception:time2            0.3178    
## ACdP_neg:t1_wks_since_conception:time2   0.4220    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_n t1_w__ time2  ACdP_:1___ ACP_:2 t1___:
## ACdP_neg    -0.354                                              
## t1_wks_snc_ -0.908  0.323                                       
## time2       -0.433  0.153  0.393                                
## ACdP_n:1___  0.311 -0.886 -0.346 -0.135                         
## ACdP_ng:tm2  0.153 -0.433 -0.140 -0.354  0.384                  
## t1_wks_s_:2  0.393 -0.140 -0.433 -0.908  0.150      0.323       
## ACP_:1___:2 -0.135  0.384  0.150  0.311 -0.433     -0.886 -0.346
standardized_model_intrusions_distress_dp_c_neg_t2 <- standardize_parameters(model_intrusions_distress_dp_c_neg_t2)
print(standardized_model_intrusions_distress_dp_c_neg_t2)
## # Standardization method: refit
## 
## Parameter                                       | Std. Coef. |        95% CI
## ----------------------------------------------------------------------------
## (Intercept)                                     |       0.03 | [-0.11, 0.16]
## ACdP neg                                        |       0.02 | [-0.11, 0.16]
## t1 wks since conception                         |      -0.05 | [-0.19, 0.09]
## time [2]                                        |      -0.06 | [-0.18, 0.06]
## ACdP neg × t1 wks since conception              |      -0.12 | [-0.25, 0.01]
## ACdP neg × time [2]                             |       0.09 | [-0.03, 0.21]
## t1 wks since conception × time [2]              |      -0.05 | [-0.17, 0.07]
## (ACdP neg × t1 wks since conception) × time [2] |       0.05 | [-0.07, 0.16]
anova(model_intrusions_distress_dp_c_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                        Sum Sq Mean Sq NumDF DenDF F value
## ACdP_neg                              1.30634 1.30634     1   202  4.0835
## t1_wks_since_conception               0.11670 0.11670     1   202  0.3648
## time                                  0.02930 0.02930     1   202  0.0916
## ACdP_neg:t1_wks_since_conception      0.84901 0.84901     1   202  2.6539
## ACdP_neg:time                         0.00174 0.00174     1   202  0.0054
## t1_wks_since_conception:time          0.32091 0.32091     1   202  1.0031
## ACdP_neg:t1_wks_since_conception:time 0.20706 0.20706     1   202  0.6472
##                                        Pr(>F)  
## ACdP_neg                              0.04462 *
## t1_wks_since_conception               0.54653  
## time                                  0.76248  
## ACdP_neg:t1_wks_since_conception      0.10485  
## ACdP_neg:time                         0.94136  
## t1_wks_since_conception:time          0.31775  
## ACdP_neg:t1_wks_since_conception:time 0.42205  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_c_neg_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter                             | Eta2 (partial) |       95% CI
## ---------------------------------------------------------------------
## ACdP_neg                              |           0.02 | [0.00, 1.00]
## t1_wks_since_conception               |       1.80e-03 | [0.00, 1.00]
## time                                  |       4.53e-04 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception      |           0.01 | [0.00, 1.00]
## ACdP_neg:time                         |       2.69e-05 | [0.00, 1.00]
## t1_wks_since_conception:time          |       4.94e-03 | [0.00, 1.00]
## ACdP_neg:t1_wks_since_conception:time |       3.19e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.634
##      Marginal R2: 0.026
model_intrusions_distress_dp_c_peri_t2 <- lmer(intrusionsdistress ~ (ACdP_peri*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_c_peri_t2) #Intrusions distress conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_peri * t1_wks_since_conception) *  
##     time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1058.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.55031 -0.47174 -0.06301  0.50304  2.80773 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5333   0.7302  
##  Residual                0.3215   0.5670  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                           Estimate Std. Error         df
## (Intercept)                              2.075e+00  1.601e-01  2.908e+02
## ACdP_peri                                1.478e-01  7.603e-02  2.908e+02
## t1_wks_since_conception                 -5.207e-04  2.215e-03  2.908e+02
## time2                                    7.795e-02  1.389e-01  2.020e+02
## ACdP_peri:t1_wks_since_conception       -1.784e-03  1.115e-03  2.908e+02
## ACdP_peri:time2                         -6.058e-02  6.595e-02  2.020e+02
## t1_wks_since_conception:time2           -2.167e-03  1.921e-03  2.020e+02
## ACdP_peri:t1_wks_since_conception:time2  1.148e-03  9.676e-04  2.020e+02
##                                         t value Pr(>|t|)    
## (Intercept)                              12.958   <2e-16 ***
## ACdP_peri                                 1.944   0.0529 .  
## t1_wks_since_conception                  -0.235   0.8143    
## time2                                     0.561   0.5752    
## ACdP_peri:t1_wks_since_conception        -1.599   0.1109    
## ACdP_peri:time2                          -0.919   0.3594    
## t1_wks_since_conception:time2            -1.128   0.2606    
## ACdP_peri:t1_wks_since_conception:time2   1.186   0.2369    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_p t1_w__ time2  ACdP_:1___ ACP_:2 t1___:
## ACdP_peri   -0.316                                              
## t1_wks_snc_ -0.908  0.289                                       
## time2       -0.434  0.137  0.394                                
## ACdP_p:1___  0.274 -0.894 -0.302 -0.119                         
## ACdP_pr:tm2  0.137 -0.434 -0.125 -0.316  0.388                  
## t1_wks_s_:2  0.394 -0.125 -0.434 -0.908  0.131      0.289       
## ACP_:1___:2 -0.119  0.388  0.131  0.274 -0.434     -0.894 -0.302
standardized_model_intrusions_distress_dp_c_peri_t2 <- standardize_parameters(model_intrusions_distress_dp_c_peri_t2)
print(standardized_model_intrusions_distress_dp_c_peri_t2)
## # Standardization method: refit
## 
## Parameter                                        | Std. Coef. |        95% CI
## -----------------------------------------------------------------------------
## (Intercept)                                      |       0.03 | [-0.11, 0.16]
## ACdP peri                                        |       0.06 | [-0.07, 0.20]
## t1 wks since conception                          |      -0.05 | [-0.19, 0.09]
## time [2]                                         |      -0.06 | [-0.18, 0.06]
## ACdP peri × t1 wks since conception              |      -0.11 | [-0.25, 0.03]
## ACdP peri × time [2]                             |       0.03 | [-0.09, 0.15]
## t1 wks since conception × time [2]               |      -0.05 | [-0.17, 0.07]
## (ACdP peri × t1 wks since conception) × time [2] |       0.07 | [-0.05, 0.19]
anova(model_intrusions_distress_dp_c_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                         Sum Sq Mean Sq NumDF DenDF F value
## ACdP_peri                              0.94608 0.94608     1   202  2.9424
## t1_wks_since_conception                0.20778 0.20778     1   202  0.6462
## time                                   0.10130 0.10130     1   202  0.3151
## ACdP_peri:t1_wks_since_conception      0.46568 0.46568     1   202  1.4483
## ACdP_peri:time                         0.27136 0.27136     1   202  0.8440
## t1_wks_since_conception:time           0.40919 0.40919     1   202  1.2726
## ACdP_peri:t1_wks_since_conception:time 0.45243 0.45243     1   202  1.4071
##                                         Pr(>F)  
## ACdP_peri                              0.08781 .
## t1_wks_since_conception                0.42241  
## time                                   0.57522  
## ACdP_peri:t1_wks_since_conception      0.23020  
## ACdP_peri:time                         0.35936  
## t1_wks_since_conception:time           0.26061  
## ACdP_peri:t1_wks_since_conception:time 0.23693  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_dp_c_peri_t2 )
## # Effect Size for ANOVA (Type III)
## 
## Parameter                              | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------------
## ACdP_peri                              |           0.01 | [0.00, 1.00]
## t1_wks_since_conception                |       3.19e-03 | [0.00, 1.00]
## time                                   |       1.56e-03 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception      |       7.12e-03 | [0.00, 1.00]
## ACdP_peri:time                         |       4.16e-03 | [0.00, 1.00]
## t1_wks_since_conception:time           |       6.26e-03 | [0.00, 1.00]
## ACdP_peri:t1_wks_since_conception:time |       6.92e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.632
##      Marginal R2: 0.023
model_intrusions_distress_dp_c_Nperi_t2 <- lmer(intrusionsdistress ~ (ACdP_Nperi*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
summary(model_intrusions_distress_dp_c_Nperi_t2) #Intrusions distress conception Dprime
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACdP_Nperi * t1_wks_since_conception) *  
##     time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1061.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.55732 -0.47744 -0.05537  0.50896  2.90001 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5440   0.7376  
##  Residual                0.3219   0.5674  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                            Estimate Std. Error         df
## (Intercept)                               2.172e+00  1.531e-01  2.897e+02
## ACdP_Nperi                                3.958e-03  8.588e-02  2.897e+02
## t1_wks_since_conception                  -1.651e-03  2.127e-03  2.897e+02
## time2                                     3.676e-02  1.320e-01  2.020e+02
## ACdP_Nperi:t1_wks_since_conception        3.550e-04  1.295e-03  2.897e+02
## ACdP_Nperi:time2                         -5.780e-02  7.405e-02  2.020e+02
## t1_wks_since_conception:time2            -1.479e-03  1.834e-03  2.020e+02
## ACdP_Nperi:t1_wks_since_conception:time2  4.045e-04  1.117e-03  2.020e+02
##                                          t value Pr(>|t|)    
## (Intercept)                               14.192   <2e-16 ***
## ACdP_Nperi                                 0.046    0.963    
## t1_wks_since_conception                   -0.776    0.438    
## time2                                      0.279    0.781    
## ACdP_Nperi:t1_wks_since_conception         0.274    0.784    
## ACdP_Nperi:time2                          -0.781    0.436    
## t1_wks_since_conception:time2             -0.806    0.421    
## ACdP_Nperi:t1_wks_since_conception:time2   0.362    0.718    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACdP_N t1_w__ time2  ACdP_N:1___ ACP_N:2 t1___:
## ACdP_Nperi   0.047                                                
## t1_wks_snc_ -0.906 -0.052                                         
## time2       -0.431 -0.020  0.391                                  
## ACdP_N:1___ -0.050 -0.904  0.062  0.021                           
## ACdP_Npr:t2 -0.020 -0.431  0.023  0.047  0.390                    
## t1_wks_s_:2  0.391  0.023 -0.431 -0.906 -0.027      -0.052        
## ACP_N:1___:  0.021  0.390 -0.027 -0.050 -0.431      -0.904   0.062
standardized_model_intrusions_distress_dp_c_Nperi_t2 <- standardize_parameters(model_intrusions_distress_dp_c_Nperi_t2)
print(standardized_model_intrusions_distress_dp_c_Nperi_t2)
## # Standardization method: refit
## 
## Parameter                                         | Std. Coef. |        95% CI
## ------------------------------------------------------------------------------
## (Intercept)                                       |       0.03 | [-0.11, 0.17]
## ACdP Nperi                                        |       0.05 | [-0.09, 0.19]
## t1 wks since conception                           |      -0.06 | [-0.19, 0.08]
## time [2]                                          |      -0.06 | [-0.18, 0.06]
## ACdP Nperi × t1 wks since conception              |       0.02 | [-0.13, 0.17]
## ACdP Nperi × time [2]                             |      -0.06 | [-0.18, 0.06]
## t1 wks since conception × time [2]                |      -0.05 | [-0.17, 0.07]
## (ACdP Nperi × t1 wks since conception) × time [2] |       0.02 | [-0.10, 0.15]
anova(model_intrusions_distress_dp_c_Nperi_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                          Sum Sq Mean Sq NumDF DenDF F value
## ACdP_Nperi                              0.03335 0.03335     1   202  0.1036
## t1_wks_since_conception                 0.49935 0.49935     1   202  1.5511
## time                                    0.02497 0.02497     1   202  0.0776
## ACdP_Nperi:t1_wks_since_conception      0.07323 0.07323     1   202  0.2275
## ACdP_Nperi:time                         0.19612 0.19612     1   202  0.6092
## t1_wks_since_conception:time            0.20932 0.20932     1   202  0.6502
## ACdP_Nperi:t1_wks_since_conception:time 0.04225 0.04225     1   202  0.1312
##                                         Pr(>F)
## ACdP_Nperi                              0.7479
## t1_wks_since_conception                 0.2144
## time                                    0.7809
## ACdP_Nperi:t1_wks_since_conception      0.6339
## ACdP_Nperi:time                         0.4360
## t1_wks_since_conception:time            0.4210
## ACdP_Nperi:t1_wks_since_conception:time 0.7175
eta_squared(model_intrusions_distress_dp_c_Nperi_t2)
## # Effect Size for ANOVA (Type III)
## 
## Parameter                               | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------------
## ACdP_Nperi                              |       5.13e-04 | [0.00, 1.00]
## t1_wks_since_conception                 |       7.62e-03 | [0.00, 1.00]
## time                                    |       3.84e-04 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception      |       1.12e-03 | [0.00, 1.00]
## ACdP_Nperi:time                         |       3.01e-03 | [0.00, 1.00]
## t1_wks_since_conception:time            |       3.21e-03 | [0.00, 1.00]
## ACdP_Nperi:t1_wks_since_conception:time |       6.49e-04 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_dp_c_Nperi_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.632
##      Marginal R2: 0.010
#Intrusion Distress - Reaction Time
model_intrusions_distress_rt_c_neg_t2 <- lmer(intrusionsdistress ~ (ACRT_neg*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_rt_c_neg_t2) #Intrusions distress conception Reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_neg * t1_wks_since_conception) * time +  
##     (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1089
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.54342 -0.47713 -0.06544  0.48929  2.92637 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5412   0.7357  
##  Residual                0.3218   0.5673  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                          Estimate Std. Error         df t value
## (Intercept)                             2.171e+00  1.541e-01  2.900e+02  14.088
## ACRT_neg                                1.111e-03  2.416e-03  2.900e+02   0.460
## t1_wks_since_conception                -1.688e-03  2.131e-03  2.900e+02  -0.792
## time2                                   6.077e-02  1.331e-01  2.020e+02   0.457
## ACRT_neg:t1_wks_since_conception       -2.400e-05  3.370e-05  2.900e+02  -0.712
## ACRT_neg:time2                         -2.008e-03  2.086e-03  2.020e+02  -0.963
## t1_wks_since_conception:time2          -1.732e-03  1.841e-03  2.020e+02  -0.941
## ACRT_neg:t1_wks_since_conception:time2  1.670e-05  2.910e-05  2.020e+02   0.574
##                                        Pr(>|t|)    
## (Intercept)                              <2e-16 ***
## ACRT_neg                                  0.646    
## t1_wks_since_conception                   0.429    
## time2                                     0.648    
## ACRT_neg:t1_wks_since_conception          0.477    
## ACRT_neg:time2                            0.337    
## t1_wks_since_conception:time2             0.348    
## ACRT_neg:t1_wks_since_conception:time2    0.567    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_n t1_w__ time2  ACRT_n:1___ ACRT_:2 t1___:
## ACRT_neg    -0.126                                                
## t1_wks_snc_ -0.906  0.092                                         
## time2       -0.432  0.054  0.391                                  
## ACRT_n:1___  0.088 -0.896 -0.058 -0.038                           
## ACRT_ng:tm2  0.054 -0.432 -0.040 -0.126  0.387                    
## t1_wks_s_:2  0.391 -0.040 -0.432 -0.906  0.025       0.092        
## ACRT_:1___: -0.038  0.387  0.025  0.088 -0.432      -0.896  -0.058
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_rt_c_neg_t2 <- standardize_parameters(model_intrusions_distress_rt_c_neg_t2)
print(standardized_model_intrusions_distress_rt_c_neg_t2)
## # Standardization method: refit
## 
## Parameter                                       | Std. Coef. |        95% CI
## ----------------------------------------------------------------------------
## (Intercept)                                     |       0.03 | [-0.11, 0.16]
## ACRT neg                                        |      -0.03 | [-0.17, 0.11]
## t1 wks since conception                         |      -0.06 | [-0.20, 0.08]
## time [2]                                        |      -0.06 | [-0.18, 0.06]
## ACRT neg × t1 wks since conception              |      -0.05 | [-0.18, 0.08]
## ACRT neg × time [2]                             |      -0.06 | [-0.18, 0.06]
## t1 wks since conception × time [2]              |      -0.06 | [-0.17, 0.06]
## (ACRT neg × t1 wks since conception) × time [2] |       0.03 | [-0.08, 0.15]
anova(model_intrusions_distress_rt_c_neg_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                        Sum Sq Mean Sq NumDF DenDF F value
## ACRT_neg                              0.00078 0.00078     1   202  0.0024
## t1_wks_since_conception               0.56787 0.56787     1   202  1.7648
## time                                  0.06711 0.06711     1   202  0.2086
## ACRT_neg:t1_wks_since_conception      0.08524 0.08524     1   202  0.2649
## ACRT_neg:time                         0.29820 0.29820     1   202  0.9267
## t1_wks_since_conception:time          0.28489 0.28489     1   202  0.8854
## ACRT_neg:t1_wks_since_conception:time 0.10601 0.10601     1   202  0.3294
##                                       Pr(>F)
## ACRT_neg                              0.9608
## t1_wks_since_conception               0.1855
## time                                  0.6484
## ACRT_neg:t1_wks_since_conception      0.6073
## ACRT_neg:time                         0.3369
## t1_wks_since_conception:time          0.3479
## ACRT_neg:t1_wks_since_conception:time 0.5666
eta_squared(model_intrusions_distress_rt_c_neg_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                             | Eta2 (partial) |       95% CI
## ---------------------------------------------------------------------
## ACRT_neg                              |       1.20e-05 | [0.00, 1.00]
## t1_wks_since_conception               |       8.66e-03 | [0.00, 1.00]
## time                                  |       1.03e-03 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception      |       1.31e-03 | [0.00, 1.00]
## ACRT_neg:time                         |       4.57e-03 | [0.00, 1.00]
## t1_wks_since_conception:time          |       4.36e-03 | [0.00, 1.00]
## ACRT_neg:t1_wks_since_conception:time |       1.63e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_neg_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.632
##      Marginal R2: 0.014
model_intrusions_distress_rt_c_peri_t2 <- lmer(intrusionsdistress ~ (ACRT_peri*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_rt_c_peri_t2) #Intrusions distress mod Reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_peri * t1_wks_since_conception) *  
##     time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1090.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.48413 -0.47284 -0.05694  0.49905  2.84394 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5429   0.7368  
##  Residual                0.3229   0.5683  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                           Estimate Std. Error         df
## (Intercept)                              2.198e+00  1.551e-01  2.900e+02
## ACRT_peri                               -2.298e-03  2.479e-03  2.900e+02
## t1_wks_since_conception                 -2.002e-03  2.154e-03  2.900e+02
## time2                                    2.273e-02  1.340e-01  2.020e+02
## ACRT_peri:t1_wks_since_conception        2.822e-05  3.431e-05  2.900e+02
## ACRT_peri:time2                          1.596e-03  2.141e-03  2.020e+02
## t1_wks_since_conception:time2           -1.255e-03  1.860e-03  2.020e+02
## ACRT_peri:t1_wks_since_conception:time2 -2.322e-05  2.963e-05  2.020e+02
##                                         t value Pr(>|t|)    
## (Intercept)                              14.173   <2e-16 ***
## ACRT_peri                                -0.927    0.355    
## t1_wks_since_conception                  -0.930    0.353    
## time2                                     0.170    0.865    
## ACRT_peri:t1_wks_since_conception         0.822    0.412    
## ACRT_peri:time2                           0.746    0.457    
## t1_wks_since_conception:time2            -0.675    0.501    
## ACRT_peri:t1_wks_since_conception:time2  -0.784    0.434    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) ACRT_p t1_w__ time2  ACRT_p:1___ ACRT_:2 t1___:
## ACRT_peri   -0.169                                                
## t1_wks_snc_ -0.906  0.154                                         
## time2       -0.432  0.073  0.391                                  
## ACRT_p:1___  0.154 -0.897 -0.170 -0.067                           
## ACRT_pr:tm2  0.073 -0.432 -0.066 -0.169  0.387                    
## t1_wks_s_:2  0.391 -0.066 -0.432 -0.906  0.073       0.154        
## ACRT_:1___: -0.067  0.387  0.073  0.154 -0.432      -0.897  -0.170
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_rt_c_peri_t2 <- standardize_parameters(model_intrusions_distress_rt_c_peri_t2)
print(standardized_model_intrusions_distress_rt_c_peri_t2)
## # Standardization method: refit
## 
## Parameter                                        | Std. Coef. |        95% CI
## -----------------------------------------------------------------------------
## (Intercept)                                      |       0.03 | [-0.11, 0.17]
## ACRT peri                                        |      -0.03 | [-0.17, 0.11]
## t1 wks since conception                          |      -0.06 | [-0.19, 0.08]
## time [2]                                         |      -0.06 | [-0.18, 0.06]
## ACRT peri × t1 wks since conception              |       0.06 | [-0.08, 0.19]
## ACRT peri × time [2]                             |   5.22e-03 | [-0.11, 0.12]
## t1 wks since conception × time [2]               |      -0.05 | [-0.17, 0.07]
## (ACRT peri × t1 wks since conception) × time [2] |      -0.05 | [-0.16, 0.07]
anova(model_intrusions_distress_rt_c_peri_t2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                         Sum Sq Mean Sq NumDF DenDF F value
## ACRT_peri                              0.14532 0.14532     1   202  0.4500
## t1_wks_since_conception                0.59177 0.59177     1   202  1.8325
## time                                   0.00930 0.00930     1   202  0.0288
## ACRT_peri:t1_wks_since_conception      0.09298 0.09298     1   202  0.2879
## ACRT_peri:time                         0.17956 0.17956     1   202  0.5560
## t1_wks_since_conception:time           0.14699 0.14699     1   202  0.4552
## ACRT_peri:t1_wks_since_conception:time 0.19829 0.19829     1   202  0.6140
##                                        Pr(>F)
## ACRT_peri                              0.5031
## t1_wks_since_conception                0.1773
## time                                   0.8654
## ACRT_peri:t1_wks_since_conception      0.5921
## ACRT_peri:time                         0.4567
## t1_wks_since_conception:time           0.5007
## ACRT_peri:t1_wks_since_conception:time 0.4342
eta_squared(model_intrusions_distress_rt_c_peri_t2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                              | Eta2 (partial) |       95% CI
## ----------------------------------------------------------------------
## ACRT_peri                              |       2.22e-03 | [0.00, 1.00]
## t1_wks_since_conception                |       8.99e-03 | [0.00, 1.00]
## time                                   |       1.43e-04 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception      |       1.42e-03 | [0.00, 1.00]
## ACRT_peri:time                         |       2.75e-03 | [0.00, 1.00]
## t1_wks_since_conception:time           |       2.25e-03 | [0.00, 1.00]
## ACRT_peri:t1_wks_since_conception:time |       3.03e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_peri_t2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.631
##      Marginal R2: 0.010
model_intrusions_distress_rt_c_NperiT2 <- lmer(intrusionsdistress ~ (ACRT_Nperi*t1_wks_since_conception)*time + (1 | Prolific_ID), data = final_dataT2_long)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## Warning: Some predictor variables are on very different scales: consider
## rescaling
summary(model_intrusions_distress_rt_c_NperiT2) #Intrusions distress mod reaction time
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: intrusionsdistress ~ (ACRT_Nperi * t1_wks_since_conception) *  
##     time + (1 | Prolific_ID)
##    Data: final_dataT2_long
## 
## REML criterion at convergence: 1086.6
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.55121 -0.46936 -0.05707  0.49928  2.90680 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Prolific_ID (Intercept) 0.5408   0.7354  
##  Residual                0.3193   0.5650  
## Number of obs: 412, groups:  Prolific_ID, 206
## 
## Fixed effects:
##                                            Estimate Std. Error         df
## (Intercept)                               2.191e+00  1.529e-01  2.895e+02
## ACRT_Nperi                               -3.448e-03  2.410e-03  2.895e+02
## t1_wks_since_conception                  -2.125e-03  2.141e-03  2.895e+02
## time2                                     3.343e-02  1.317e-01  2.020e+02
## ACRT_Nperi:t1_wks_since_conception        5.642e-05  3.540e-05  2.895e+02
## ACRT_Nperi:time2                          3.453e-03  2.077e-03  2.020e+02
## t1_wks_since_conception:time2            -1.388e-03  1.845e-03  2.020e+02
## ACRT_Nperi:t1_wks_since_conception:time2 -3.938e-05  3.050e-05  2.020e+02
##                                          t value Pr(>|t|)    
## (Intercept)                               14.334   <2e-16 ***
## ACRT_Nperi                                -1.431   0.1536    
## t1_wks_since_conception                   -0.992   0.3218    
## time2                                      0.254   0.7999    
## ACRT_Nperi:t1_wks_since_conception         1.594   0.1121    
## ACRT_Nperi:time2                           1.663   0.0979 .  
## t1_wks_since_conception:time2             -0.752   0.4526    
## ACRT_Nperi:t1_wks_since_conception:time2  -1.291   0.1981    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##              (Intr) ACRT_Np t1_w__ time2  ACRT_Np:1___ ACRT_N:2 t1___:
## ACRT_Nperi   -0.046                                                   
## t1_wks_snc_  -0.904  0.072                                            
## time2        -0.431  0.020   0.390                                    
## ACRT_Np:1___  0.071 -0.891  -0.126 -0.031                             
## ACRT_Npr:t2   0.020 -0.431  -0.031 -0.046  0.384                      
## t1_wks_s_:2   0.390 -0.031  -0.431 -0.904  0.054        0.072         
## ACRT_N:1___: -0.031  0.384   0.054  0.071 -0.431       -0.891   -0.126
## fit warnings:
## Some predictor variables are on very different scales: consider rescaling
standardized_model_intrusions_distress_rt_c_NperiT2 <- standardize_parameters(model_intrusions_distress_rt_c_NperiT2)
print(standardized_model_intrusions_distress_rt_c_NperiT2)
## # Standardization method: refit
## 
## Parameter                                         | Std. Coef. |        95% CI
## ------------------------------------------------------------------------------
## (Intercept)                                       |       0.02 | [-0.12, 0.16]
## ACRT Nperi                                        |       0.01 | [-0.12, 0.15]
## t1 wks since conception                           |      -0.06 | [-0.20, 0.08]
## time [2]                                          |      -0.06 | [-0.17, 0.06]
## ACRT Nperi × t1 wks since conception              |       0.11 | [-0.03, 0.25]
## ACRT Nperi × time [2]                             |       0.06 | [-0.06, 0.18]
## t1 wks since conception × time [2]                |      -0.05 | [-0.17, 0.07]
## (ACRT Nperi × t1 wks since conception) × time [2] |      -0.08 | [-0.19, 0.04]
anova(model_intrusions_distress_rt_c_NperiT2)
## Type III Analysis of Variance Table with Satterthwaite's method
##                                          Sum Sq Mean Sq NumDF DenDF F value
## ACRT_Nperi                              0.19993 0.19993     1   202  0.6262
## t1_wks_since_conception                 0.67960 0.67960     1   202  2.1285
## time                                    0.02056 0.02056     1   202  0.0644
## ACRT_Nperi:t1_wks_since_conception      0.42203 0.42203     1   202  1.3218
## ACRT_Nperi:time                         0.88294 0.88294     1   202  2.7654
## t1_wks_since_conception:time            0.18079 0.18079     1   202  0.5662
## ACRT_Nperi:t1_wks_since_conception:time 0.53226 0.53226     1   202  1.6671
##                                          Pr(>F)  
## ACRT_Nperi                              0.42968  
## t1_wks_since_conception                 0.14613  
## time                                    0.79992  
## ACRT_Nperi:t1_wks_since_conception      0.25163  
## ACRT_Nperi:time                         0.09787 .
## t1_wks_since_conception:time            0.45263  
## ACRT_Nperi:t1_wks_since_conception:time 0.19812  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
eta_squared(model_intrusions_distress_rt_c_NperiT2)
## Warning: Some predictor variables are on very different scales: consider
## rescaling
## # Effect Size for ANOVA (Type III)
## 
## Parameter                               | Eta2 (partial) |       95% CI
## -----------------------------------------------------------------------
## ACRT_Nperi                              |       3.09e-03 | [0.00, 1.00]
## t1_wks_since_conception                 |           0.01 | [0.00, 1.00]
## time                                    |       3.19e-04 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception      |       6.50e-03 | [0.00, 1.00]
## ACRT_Nperi:time                         |           0.01 | [0.00, 1.00]
## t1_wks_since_conception:time            |       2.80e-03 | [0.00, 1.00]
## ACRT_Nperi:t1_wks_since_conception:time |       8.19e-03 | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].
r2(model_intrusions_distress_rt_c_NperiT2)
## # R2 for Mixed Models
## 
##   Conditional R2: 0.635
##      Marginal R2: 0.017