Cumulative Burdens Analysis

Published

15 Aug 2025

Analysis Code

Setup and Files

Details of the data and packages used within this Quarto Document:

Code
rm(list=ls())
# Empty R envrionment to avoid conflicts or overwriting alternative session data.

##  Packages for Analysis & Presentation
library("tidyverse")                                                           
# Package `tidyverse` used for data manipulation and presentation.
library("data.table")                                                           
# Package `data.table  used for data manipulation and presentation.
library("gtsummary")                                                            
# Package `gtsummary` used for summary statistics and table formatting
library("flextable")                                                            
# Package `flextable`used for table formatting.
library("ggpubr")
# Package `ggpubr`used for figure formatting.
library("ggstatsplot")
# Package `ggstatsplot`used for figure formatting.
library("GGally")
# Package `GGally`used for figure formatting.
library("gridExtra")
# Package `gridExtra`used for figure arranging.
library("rempsyc")
# Package `flextable`used for table formatting.
library("easystats")
# Package `easystats`used for model evaluation and general statistics.
library("rstatix")
# Package `rstatix` used for piped workflows in statistical analysis.
library("nnet")
# Package `nnet` used for multinomial logistic regression modelling.

df <- read.csv("csvdata.csv")
labelled_df <- haven::read_sav("Data_CPTSD_stressors_project.sav")
# Compare probable diagnosis coding.
# Recode symptoms for caseness and calculate symptom endorsement.
df2 <- df |>                                                           
dplyr::rowwise() |> 
dplyr::mutate_at(vars(PTSD1_R:DSO9_R),
          list(~ if_else(.x >= 2, true = 1, false = 0))) |> 
dplyr::mutate( 
  Re        = sum(PTSD1_R, PTSD2_R, na.rm = T),
  Av        = sum(PTSD3_R, PTSD4_R, na.rm = T),
  Th          = sum(PTSD5_R, PTSD6_R, na.rm = T),
  PTSDfi    = sum(PTSD7_R, PTSD8_R, PTSD9_R, na.rm = T), 
  AD        = sum(DSO1_R, DSO2_R, na.rm = T),
  NSC       = sum(DSO3_R, DSO4_R, na.rm = T),
  DR        = sum(DSO5_R, DSO6_R, na.rm = T),
  DSOfi     = sum(DSO7_R, DSO8_R, DSO9_R, na.rm = T)) |> 
dplyr::mutate( 
  Re_case           = ifelse(Re > 0, 1, 0),
  Av_case           = ifelse(Av > 0, 1, 0),
  Th_case           = ifelse(Th > 0, 1, 0),
  PTSDfi_case   = ifelse(PTSDfi > 0, 1, 0),
  AD_case           = ifelse(AD > 0, 1, 0),
  NSC_case      = ifelse(NSC > 0, 1, 0),
  DR_case           = ifelse(DR > 0, 1, 0),
  DSOfi_case    = ifelse(DSOfi > 0, 1, 0),
  PTSD_diag     = ifelse(Re_case + Av_case + Th_case + PTSDfi_case == 4, 1, 0),
  CPTSD_diag    = ifelse(PTSD_diag + AD_case + NSC_case + DR_case + DSOfi_case == 5, 2, 0),
  CPTSD_PTSD_Diagnosis      = ifelse(CPTSD_diag == 2, 2, ifelse(PTSD_diag == 1, 1, 0)))


# Print table of symptom endorsement and probable diagnosis.
df2 |> 
  dplyr::select(Re_case, Av_case, Th_case, PTSDfi_case,
                AD_case, NSC_case, DR_case, DSOfi_case,
                CPTSD_PTSD_Diagnosis) |> 
  dplyr::mutate(CPTSD_PTSD_Diagnosis = factor(CPTSD_PTSD_Diagnosis, 
                                  levels = c(0, 1, 2), 
                                  labels = c("No diagosis", "PTSD", "CPTSD"))) |> 
  gtsummary::tbl_summary(
    label = list(Re_case     = "Reexperiencing",
                 Av_case     = "Avoidance", 
                 Th_case     = "Sense of Threat", 
                 PTSDfi_case = "Functional Impairment (PTSD)",
                 AD_case     = "Affective Dysregulation", 
                 NSC_case    = "Negative Self Concept", 
                 DR_case     = "Disturbed Relationships", 
                 DSOfi_case  = "Functional Impairment (DSO)",
                 CPTSD_PTSD_Diagnosis    = "Diagnostic Category based on ICD-11 Criteria"), 
    digits = list(all_continuous() ~ 2, all_categorical() ~ c(0, 2)),
    missing = "no")
Characteristic N = 7101
Reexperiencing 265 (37.32%)
Avoidance 375 (52.82%)
Sense of Threat 324 (45.63%)
Functional Impairment (PTSD) 304 (42.82%)
Affective Dysregulation 466 (65.63%)
Negative Self Concept 263 (37.04%)
Disturbed Relationships 343 (48.31%)
Functional Impairment (DSO) 354 (49.86%)
Diagnostic Category based on ICD-11 Criteria
    No diagosis 564 (79.44%)
    PTSD 50 (7.04%)
    CPTSD 96 (13.52%)
1 n (%)
# Demographic Summary Table
tbla <- df |> 
  dplyr::select(age, gender, familystatus, income, education,
                Job_1, Job_2, Job_3, Job_4) |> 
  dplyr::mutate(
    gender = dplyr::recode(gender, 
                           "1" = "Male",
                           "2" = "Female",
                           "3" = "Diverse",
                           "0" = "Diverse"),
    familystatus = dplyr::recode(familystatus,
                                 "1" = "In a relationship",
                                 "2" = "Not in a relationship"),
    income = dplyr::recode_factor(income,
                           "1" = "Well below average",
                           "2" = "Below average",
                           "3" = "Average",
                           "4" = "Above average",
                           "5" = "Well above average"),
    education = dplyr::recode_factor(education,
                              "1" = "Primary school",
                              "2" = "Secondary school",
                              "3" = "Vocational school",
                              "4" = "Bachelors degree",
                              "5" = "Masters degree",
                              "6" = "Doctoral degree")) |> 
  tbl_summary(label = list(age          = "Age (years)", 
                           gender       = "Gender", 
                           familystatus = "Relationship Status", 
                           income       = "Income", 
                           education    = "Highest educational attainment",
                           Job_1        = "Not in paid employment", 
                           Job_2        = "Student/retired", 
                           Job_3        = "Employed part time", 
                           Job_4        = "Employed full time"),
              statistic = list(all_continuous() ~ "{mean} ({sd})",  
                               all_categorical() ~ "{n} ({p}%)"),
              digits = list(all_continuous() ~ 2,  
                            all_categorical() ~ c(0,2))); tbla
Characteristic N = 7101
Age (years) 26.85 (11.90)
Gender
    Diverse 5 (0.70%)
    Female 549 (77.32%)
    Male 156 (21.97%)
Relationship Status
    In a relationship 376 (52.96%)
    Not in a relationship 334 (47.04%)
Income
    Well below average 288 (40.56%)
    Below average 162 (22.82%)
    Average 182 (25.63%)
    Above average 65 (9.15%)
    Well above average 13 (1.83%)
Highest educational attainment
    Primary school 17 (2.39%)
    Secondary school 476 (67.04%)
    Vocational school 83 (11.69%)
    Bachelors degree 83 (11.69%)
    Masters degree 45 (6.34%)
    Doctoral degree 6 (0.85%)
Not in paid employment 62 (8.73%)
Student/retired 509 (71.69%)
Employed part time 208 (29.30%)
Employed full time 91 (12.82%)
1 Mean (SD); n (%)
# General APA-style summary statistics for event endorsements..
Event_Summary_Table <- df |>
  dplyr::select(ITEM_total_A_krit, ITEM_total_psyThr, Life_events_tot) |> 
  psych::describe() |> 
  # Format results table in APA style using `rempsyc::nice_table`.
  rownames_to_column(var = "Variable") |> 
  dplyr::select(Variable, n, mean, sd, 
                median, min, max, 
                skew, kurtosis) |> 
  nice_table(); Event_Summary_Table

Variable

n

mean

sd

median

min

max

skew

kurtosis

ITEM_total_A_krit

710

3.73

2.82

3.00

0.00

17.00

1.06

1.40

ITEM_total_psyThr

710

3.79

3.23

3.00

0.00

14.00

0.70

-0.28

Life_events_tot

710

2.40

1.87

2.00

0.00

9.00

0.71

0.05

# Check parametric assumptions for A-criteria trauma total.
Trauma_anova <- afex::aov_ez(
  id = "X",
  dv = "ITEM_total_A_krit",
  within = NULL,
  between = "CPTSD_PTSD_Diagnosis",
  data = df)
Converting to factor: CPTSD_PTSD_Diagnosis
Contrasts set to contr.sum for the following variables: CPTSD_PTSD_Diagnosis
check_homogeneity(Trauma_anova)
Warning: Variances differ between groups (Levene's Test, p = 0.000).
check_normality(Trauma_anova) |> plot(type = "qq")

# Check parametric assumptions for Psychological Threat total.
Threat_anova <- afex::aov_ez(
  id = "X",
  dv = "ITEM_total_psyThr",
  within = NULL,
  between = "CPTSD_PTSD_Diagnosis",
  data = df)
Converting to factor: CPTSD_PTSD_Diagnosis
Contrasts set to contr.sum for the following variables: CPTSD_PTSD_Diagnosis
check_homogeneity(Threat_anova)
OK: There is not clear evidence for different variances across groups (Levene's Test, p = 0.147).
check_normality(Threat_anova) |> plot(type = "qq")

# Check parametric assumptions for Life Stress total.
LifeStress_anova <- afex::aov_ez(
  id = "X",
  dv = "Life_events_tot",
  within = NULL,
  between = "CPTSD_PTSD_Diagnosis",
  data = df)
Converting to factor: CPTSD_PTSD_Diagnosis
Contrasts set to contr.sum for the following variables: CPTSD_PTSD_Diagnosis
check_homogeneity(LifeStress_anova)
OK: There is not clear evidence for different variances across groups (Levene's Test, p = 0.229).
check_normality(LifeStress_anova) |> plot(type = "qq")

df_plot <- df |> 
  dplyr::mutate(CPTSD_PTSD_Diagnosis = dplyr::recode_factor(CPTSD_PTSD_Diagnosis, 
                                                            "0" = "No diagnosis",
                                                            "1" = "PTSD",
                                                            "2" = "CPTSD"))

# Comparison of Trauma by Diagnostic Group.
fig1 <-
ggviolin(df_plot, x = "CPTSD_PTSD_Diagnosis", y = "ITEM_total_A_krit", 
         fill = "CPTSD_PTSD_Diagnosis",
         palette = c("grey", "#6287AF", "#f99820"),
         add = "boxplot", add.params = list(fill = "white")) +
  stat_compare_means(comparisons = list( c("No diagnosis", "PTSD"), 
                                         c("PTSD", "CPTSD"), 
                                         c("No diagnosis", "CPTSD")), 
                     label = "p.signif") + # Add significance levels
  stat_compare_means(label.y = 25,         # Add global p-value
                     method = "kruskal.test",
                     aes(label = paste0("Kruskal-Wallis: italic(p)", 
                                        scales::label_pvalue()(..p..))),
  parse = TRUE) + 
  theme(legend.position = "none",
        axis.title.x = element_blank(), 
        axis.text.x = element_blank(), 
        axis.ticks = element_blank()) +
  labs(y = "Total Crtierion A Traumas")

Trauma_KrusEffsize <- df |> kruskal_effsize(ITEM_total_A_krit ~ CPTSD_PTSD_Diagnosis)
df |> kruskal_test(ITEM_total_A_krit ~ CPTSD_PTSD_Diagnosis) |> 
        cbind(Trauma_KrusEffsize$effsize, Trauma_KrusEffsize$magnitude) |> 
  rename("Effect Size"= "Trauma_KrusEffsize$effsize",
         "Magnitude" = "Trauma_KrusEffsize$magnitude") |> 
  nice_table(title = "Criterion A Events x Probable Diagnosis", 
             col.format.p = 9,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = eta^2")

Criterion A Events x Probable Diagnosis

.y.

n

statistic

df

p

Method

Effect Size

Magnitude

ITEM_total_A_krit

710

55.87

2

< .001***

Kruskal-Wallis

0.08

moderate

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = eta^2

# Comparison of Psychological Threat Endorsement by Diagnostic Group.
fig2 <-
ggviolin(df_plot, x = "CPTSD_PTSD_Diagnosis", y = "ITEM_total_psyThr", 
         fill = "CPTSD_PTSD_Diagnosis",
         palette = c("grey", "#6287AF", "#f99820"),
         add = "boxplot", add.params = list(fill = "white")) + 
  stat_compare_means(comparisons = list( c("No diagnosis", "PTSD"), 
                                         c("PTSD", "CPTSD"), 
                                         c("No diagnosis", "CPTSD")), 
                     label = "p.signif") +
  stat_compare_means(label.y = 25,         # Add global p-value
                     method = "kruskal.test",
                     aes(label = paste0("Kruskal-Wallis: italic(p)", 
                                        scales::label_pvalue()(..p..))),
  parse = TRUE) + 
  theme(legend.position = "none",
        axis.title.x = element_blank(), 
        axis.text.x = element_blank(), 
        axis.ticks = element_blank()) +
  labs(y = "Total Psychologically Threatening Events")

PsychThreat_KrusEffsize <- df |> kruskal_effsize(ITEM_total_psyThr ~ CPTSD_PTSD_Diagnosis)
df |> kruskal_test(ITEM_total_psyThr ~ CPTSD_PTSD_Diagnosis) |> 
        cbind(PsychThreat_KrusEffsize$effsize, PsychThreat_KrusEffsize$magnitude) |> 
  rename("Effect Size"= "PsychThreat_KrusEffsize$effsize",
         "Magnitude" = "PsychThreat_KrusEffsize$magnitude") |> 
  nice_table(title = "Psycholgically Threatening Events x Probable Diagnosis", 
             col.format.p = 9,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = eta^2")

Psycholgically Threatening Events x Probable Diagnosis

.y.

n

statistic

df

p

Method

Effect Size

Magnitude

ITEM_total_psyThr

710

78.02

2

< .001***

Kruskal-Wallis

0.11

moderate

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = eta^2

# Comparison of Life Stressor Endorsement by Diagnostic Group.
fig3 <-
ggviolin(df_plot, x = "CPTSD_PTSD_Diagnosis", y = "Life_events_tot", 
         fill = "CPTSD_PTSD_Diagnosis",
         palette = c("grey", "#6287AF", "#f99820"),
         add = "boxplot", add.params = list(fill = "white"))+
  stat_compare_means(comparisons = list( c("No diagnosis", "PTSD"), 
                                         c("PTSD", "CPTSD"), 
                                         c("No diagnosis", "CPTSD")), 
                     label = "p.signif") + # Add significance levels
  stat_compare_means(label.y = 15,         # Add global p-value
                     method = "kruskal.test",
                     aes(label = paste0("Kruskal-Wallis: italic(p)", 
                                        scales::label_pvalue()(..p..))),
  parse = TRUE) + 
  theme(legend.position = "none",
        axis.title.x = element_blank()) +
  labs(y = "Total Stressful Life Events")

LifeEvents_KrusEffsize <- df |> kruskal_effsize(Life_events_tot ~ CPTSD_PTSD_Diagnosis)
df |> kruskal_test(Life_events_tot ~ CPTSD_PTSD_Diagnosis) |> 
        cbind(LifeEvents_KrusEffsize$effsize, LifeEvents_KrusEffsize$magnitude) |> 
  rename("Effect Size"= "LifeEvents_KrusEffsize$effsize",
         "Magnitude" = "LifeEvents_KrusEffsize$magnitude") |> 
  nice_table(title = "Stressful Life Events x Probable Diagnosis", 
             col.format.p = 9,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = eta^2")

Stressful Life Events x Probable Diagnosis

.y.

n

statistic

df

p

Method

Effect Size

Magnitude

Life_events_tot

710

79.29

2

< .001***

Kruskal-Wallis

0.11

moderate

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = eta^2

Violin_plots <- grid.arrange(fig1, fig2, fig3,
                             nrow = 3)

# Summary of Trauma and Stressor experiences by group
# Quantitative comparison using Kruskal-Wallis Test
df |> 
  dplyr::select(CPTSD_PTSD_Diagnosis, ITEM_total_A_krit, ITEM_total_psyThr, Life_events_tot) |> 
  dplyr::mutate(CPTSD_PTSD_Diagnosis = dplyr::recode_factor(CPTSD_PTSD_Diagnosis, 
                                                          "0" = "No diagnosis",
                                                          "1" = "PTSD",
                                                          "2" = "CPTSD")) |> 
  tbl_summary(by = CPTSD_PTSD_Diagnosis,
              statistic = list(all_continuous() ~ "{mean} ({sd})",  
                               all_categorical() ~ "{n} ({p}%)"),
              digits    = list(all_continuous() ~ c(2,2),  
                               all_categorical() ~ 2)) |> 
  add_overall() |> 
  add_p(pvalue_fun = function(x) 
           style_pvalue(x, digits = 3) |> 
           stringr::str_replace("0.", " .")) |> 
    modify_header(p.value   = "***p*-value**")
Characteristic Overall
N = 7101
No diagnosis
N = 5641
PTSD
N = 501
CPTSD
N = 961
p-value2
ITEM_total_A_krit 3.73 (2.82) 3.28 (2.48) 4.90 (2.77) 5.72 (3.62) < .001
ITEM_total_psyThr 3.79 (3.23) 3.26 (2.98) 4.76 (3.44) 6.45 (3.19) < .001
Life_events_tot 2.40 (1.87) 2.09 (1.73) 3.04 (2.03) 3.89 (1.78) < .001
1 Mean (SD)
2 Kruskal-Wallis rank sum test
# Pairwise comparisons using Wilcoxon rank-sum tests with Bonferroni correction.
# A criteria trauma x Probable Diagnosis
Trauma_Effsize <- df |>  
wilcox_effsize(ITEM_total_A_krit ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") 

df |>                                                           
pairwise_wilcox_test(ITEM_total_A_krit ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") |>
  dplyr::select(".y.":"p.adj") |> 
      cbind(Trauma_Effsize$effsize, Trauma_Effsize$magnitude) |> 
  rename("Effect Size" = "Trauma_Effsize$effsize",
         "Magnitude" = "Trauma_Effsize$magnitude") |> 
  nice_table(title = "Criterion A Events x Probable Diagnosis", 
             col.format.p = 8,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = Wilcoxon r")

Criterion A Events x Probable Diagnosis

.y.

group1

group2

n1

η2

statistic

p

p.adj

Effect Size

Magnitude

ITEM_total_A_krit

0

1

564

50

9,252.00

< .001***

< .001***

0.16

small

ITEM_total_A_krit

0

2

564

96

15,638.50

< .001***

< .001***

0.26

small

ITEM_total_A_krit

1

2

50

96

2,141.50

.285

.855

0.09

small

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = Wilcoxon r

# Psychologically Threatening Events x Probable Diagnosis
PsychThreat_Effsize <- df |>  
wilcox_effsize(ITEM_total_psyThr ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") 

df |>                                                            
pairwise_wilcox_test(ITEM_total_psyThr ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") |> 
  dplyr::select(".y.":"p.adj") |> 
    cbind(PsychThreat_Effsize$effsize, PsychThreat_Effsize$magnitude) |> 
  rename("Effect Size" = "PsychThreat_Effsize$effsize",
         "Magnitude" = "PsychThreat_Effsize$magnitude") |> 
  nice_table(title = "Psycholgically Threatening Experiences x Probable Diagnosis", 
             col.format.p = 8,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = Wilcoxon r")

Psycholgically Threatening Experiences x Probable Diagnosis

.y.

group1

group2

n1

η2

statistic

p

p.adj

Effect Size

Magnitude

ITEM_total_psyThr

0

1

564

50

10,446.50

.002**

.006**

0.12

small

ITEM_total_psyThr

0

2

564

96

12,391.50

< .001***

< .001***

0.33

moderate

ITEM_total_psyThr

1

2

50

96

1,705.50

.004**

.012*

0.24

small

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = Wilcoxon r

# Stressful Life Events x Probable Diagnosis
LifeStress_Effsize <- df |>  
wilcox_effsize(Life_events_tot ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") 

df |>                                                            
pairwise_wilcox_test(Life_events_tot ~ CPTSD_PTSD_Diagnosis, alternative = "two.sided",
            p.adjust.method = "bonferroni") |>
  dplyr::select(".y.":"p.adj") |> 
  cbind(LifeStress_Effsize$effsize, LifeStress_Effsize$magnitude) |> 
  rename("Effect Size" = "LifeStress_Effsize$effsize",
         "Magnitude" = "LifeStress_Effsize$magnitude") |> 
  nice_table(title = "Stressful Life Events x Probable Diagnosis", 
             col.format.p = 8,
             note = "0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
             Effect Size = Wilcoxon r")

Stressful Life Events x Probable Diagnosis

.y.

group1

group2

n1

η2

statistic

p

p.adj

Effect Size

Magnitude

Life_events_tot

0

1

564

50

10,212.00

.001***

.003**

0.13

small

Life_events_tot

0

2

564

96

12,467.00

< .001***

< .001***

0.33

moderate

Life_events_tot

1

2

50

96

1,759.50

.008**

.023*

0.22

small

Note. 0 = No diagnosis, 1 = PTSD, 2 = CPTSD,
Effect Size = Wilcoxon r

Effect sizes for Kruskal-Wallis tests are reported as eta^2 based on the H statistic. Eta-squared values range from 0 to 1 and interpretation in this section applies commonly used thresholds: < 0.06 indicative of a small effect, 0.06 - 0.14 indicative of moderate effect, and >= 0.14 indicative of large effect (Cohen, 1988).

Effect size (Wilcoxon r) for each contrast varies from 0 to 1 with values < 0.3 indicative of a small effect, 0.30 - 0.5 indicative of moderate effect, and >= 0.5 indicative of large effect (Cohen, 1992; Field et al., 2012).

Multinomial Logistic Regression

# Create dataframe `df_regression` in environment to call for analyses.
df_regression <- df 

# Inspect variable contrasts using `ggpairs`.
df_plot |> dplyr::select(age, CPTSD_PTSD_Diagnosis,
                    ITEM_total_A_krit, ITEM_total_psyThr, Life_events_tot) |> 
ggpairs(
  mapping = ggplot2::aes(color = CPTSD_PTSD_Diagnosis),
  lower = list(continuous = wrap("smooth", method = "lm"),
               combo = "dot_no_facet")) +
  scale_fill_manual(
    values = c("No diagnosis" = "grey",
               "PTSD"         = "#6287AF", 
               "CPTSD"        = "#f99820")) +
  scale_colour_manual(
    values = c("No diagnosis" = "grey",
               "PTSD"         = "#6287AF", 
               "CPTSD"        = "#f99820"))

# Fit multinomial logistic regression model using `nnet`.
model1 <- multinom(CPTSD_PTSD_Diagnosis ~ Life_events_tot + ITEM_total_A_krit + 
                    ITEM_total_psyThr + age,
            data = df_regression)
# weights:  18 (10 variable)
initial  value 780.014725 
iter  10 value 426.283311
final  value 389.374072 
converged
# Check model assumptions using `performance`.
check_model(model1)

# Model with moderated effects.
model2 <- multinom(CPTSD_PTSD_Diagnosis ~ age +
                     Life_events_tot   : ITEM_total_psyThr +
                     Life_events_tot   : ITEM_total_A_krit +
                     ITEM_total_psyThr : ITEM_total_A_krit,
            data = df_regression)
# weights:  18 (10 variable)
initial  value 780.014725 
iter  10 value 431.203326
iter  20 value 399.270440
final  value 399.270238 
converged
# Check model assumptions using `performance`.
check_model(model2)

Direct Effects Model

# Display model fit.
# Print Chi-square statistic by comparing predictor `model` to NULL.
anova(multinom(CPTSD_PTSD_Diagnosis ~ 1, data = df_regression), model1)
# weights:  6 (2 variable)
initial  value 780.014725 
final  value 454.588955 
converged
Likelihood ratio tests of Multinomial Models

Response: CPTSD_PTSD_Diagnosis
                                                          Model Resid. df
1                                                             1      1418
2 Life_events_tot + ITEM_total_A_krit + ITEM_total_psyThr + age      1410
  Resid. Dev   Test    Df LR stat. Pr(Chi)
1   909.1779                              
2   778.7481 1 vs 2     8 130.4298       0
# Print available model fit information from `performance`.
model_performance(model1) |> nice_table(title = "Regression Model Fit Statistics")
Can't calculate log-loss.

Regression Model Fit Statistics

AIC

AICc

BIC

R2

R2_adjusted

RMSE

Sigma

798.75

799.06

844.40

.14

0.14

0.32

1.05

# Display nice_table of results using `gtsummary`.
# Function arguments used to format table in APA style.
model1_tab <- model1 |> 
tbl_regression(exponentiate = TRUE,
               pvalue_fun = function(x) 
                 style_pvalue(x, digits = 3) |> 
                 stringr::str_replace("0.", " ."),
               label = list(ITEM_total_A_krit = "A-criteria Trauma Total", 
                            ITEM_total_psyThr = "Psychological Threat Total", 
                            Life_events_tot   = "Total Current Life Stressors",
                            age               = "Age (Years)")) |> 
  modify_column_unhide(columns = statistic) |>   
  modify_column_unhide(columns = std.error) |>
  modify_header(label     = "**Variable**",
                statistic = "**Beta**",
                p.value   = "***p*-value**") |>
  modify_table_body(~ .x |> 
     relocate(c(statistic, std.error), .before = estimate)) |> 
    as_gt() |>
  gt::tab_source_note(gt::md("Outcome Variables: 1 = PTSD, 2 = CPTSD;
                             *Reference category = No diagnosis*")); model1_tab
Variable Beta SE OR 95% CI p-value
1
Total Current Life Stressors 2.43 0.085 1.23 1.04, 1.45 .015
A-criteria Trauma Total 1.95 0.059 1.12 1.00, 1.26 .052
Psychological Threat Total 1.28 0.053 1.07 0.96, 1.19 .201
Age (Years) 2.30 0.011 1.03 1.00, 1.05 .021
2
Total Current Life Stressors 4.91 0.067 1.39 1.22, 1.59 < .001
A-criteria Trauma Total 2.51 0.046 1.12 1.03, 1.23 .012
Psychological Threat Total 4.44 0.042 1.21 1.11, 1.31 < .001
Age (Years) 0.530 0.012 1.01 0.98, 1.03 .596
Abbreviations: CI = Confidence Interval, OR = Odds Ratio, SE = Standard Error
Outcome Variables: 1 = PTSD, 2 = CPTSD; Reference category = No diagnosis

Interaction Model

# Display model fit.
# Print Chi-square statistic by comparing predictor `model` to NULL.
anova(multinom(CPTSD_PTSD_Diagnosis ~ 1, data = df_regression), model2)
# weights:  6 (2 variable)
initial  value 780.014725 
final  value 454.588955 
converged
Likelihood ratio tests of Multinomial Models

Response: CPTSD_PTSD_Diagnosis
                                                                                                              Model
1                                                                                                                 1
2 age + Life_events_tot:ITEM_total_psyThr + Life_events_tot:ITEM_total_A_krit + ITEM_total_psyThr:ITEM_total_A_krit
  Resid. df Resid. Dev   Test    Df LR stat. Pr(Chi)
1      1418   909.1779                              
2      1410   798.5405 1 vs 2     8 110.6374       0
# Print available model fit information from `performance`.
model_performance(model2) |> nice_table(title = "Moderation Model Fit Statistics")
Can't calculate log-loss.

Moderation Model Fit Statistics

AIC

AICc

BIC

R2

R2_adjusted

RMSE

Sigma

818.54

818.86

864.19

.12

0.12

0.32

1.07

# Display nice_table of results using `gtsummary`.
# Function args used to format table in APA style.
model2_tab <- model2 |> 
tbl_regression(exponentiate = TRUE,
               pvalue_fun = function(x) 
                 style_pvalue(x, digits = 3) |> 
                 stringr::str_replace("0.", " ."),
               label = list(age = "Age (Years)")) |> 
  modify_column_unhide(columns = c(statistic, std.error)) |>   
  modify_header(label     = "**Variable**",
                statistic = "**Beta**",
                p.value   = "***p*-value**") |>
  modify_table_body(~ .x |> 
     relocate(c(statistic, std.error), .before = estimate)) |> 
    as_gt() |>
  gt::tab_source_note(gt::md("Outcome Variables: 1 = PTSD, 2 = CPTSD;
                             *Reference category = No diagnosis*")); model2_tab
Variable Beta SE OR 95% CI p-value
1
Age (Years) 2.32 0.011 1.03 1.00, 1.05 .021
Life_events_tot * ITEM_total_psyThr 2.43 0.013 1.03 1.01, 1.06 .015
Life_events_tot * ITEM_total_A_krit 0.908 0.015 1.01 0.98, 1.04 .364
ITEM_total_psyThr * ITEM_total_A_krit 0.264 0.008 1.00 0.99, 1.02 .792
2
Age (Years) 0.276 0.011 1.00 0.98, 1.03 .782
Life_events_tot * ITEM_total_psyThr 3.85 0.011 1.04 1.02, 1.06 < .001
Life_events_tot * ITEM_total_A_krit 0.760 0.012 1.01 0.99, 1.03 .447
ITEM_total_psyThr * ITEM_total_A_krit 1.97 0.006 1.01 1.00, 1.02 .049
Abbreviations: CI = Confidence Interval, OR = Odds Ratio, SE = Standard Error
Outcome Variables: 1 = PTSD, 2 = CPTSD; Reference category = No diagnosis
# Plots to illustrate moderation effects.
library("ggeffects")
# Life_events_tot:ITEM_total_psyThr
ggemmeans(model2, 
          terms = c("Life_events_tot","ITEM_total_psyThr")) |>
  plot()

# ITEM_total_A_krit:ITEM_total_psyThr
ggemmeans(model2, 
          terms = c("ITEM_total_A_krit","ITEM_total_psyThr")) |>
  plot()

References

# Display version information and
# references for packages used in this Quarto document using `report`.
report(sessionInfo())
Analyses were conducted using the R Statistical language (version 4.5.1; R Core
Team, 2025) on Windows 11 x64 (build 26100), using the packages gridExtra
(version 2.3; Auguie B, 2017), data.table (version 1.17.8; Barrett T et al.,
2025), effectsize (version 1.0.1; Ben-Shachar MS et al., 2020), flextable
(version 0.9.9; Gohel D, Skintzos P, 2025), lubridate (version 1.9.4; Grolemund
G, Wickham H, 2011), rstatix (version 0.7.2; Kassambara A, 2023), ggpubr
(version 0.6.1; Kassambara A, 2025), ggeffects (version 2.3.0; Lüdecke D,
2018), parameters (version 0.27.0; Lüdecke D et al., 2020), performance
(version 0.15.0; Lüdecke D et al., 2021), easystats (version 0.7.5; Lüdecke D
et al., 2022), see (version 0.11.0; Lüdecke D et al., 2021), insight (version
1.3.1; Lüdecke D et al., 2019), bayestestR (version 0.16.1; Makowski D et al.,
2019), modelbased (version 0.12.0; Makowski D et al., 2025), report (version
0.6.1; Makowski D et al., 2023), correlation (version 0.8.8; Makowski D et al.,
2022), tibble (version 3.3.0; Müller K, Wickham H, 2025), ggstatsplot (version
0.13.1; Patil I, 2021), datawizard (version 1.1.0; Patil I et al., 2022),
GGally (version 2.2.1; Schloerke B et al., 2024), gtsummary (version 2.2.0;
Sjoberg D et al., 2021), rempsyc (version 0.1.9; Thériault R, 2023), nnet
(version 7.3.20; Venables WN, Ripley BD, 2002), ggplot2 (version 3.5.2; Wickham
H, 2016), forcats (version 1.0.0; Wickham H, 2023), stringr (version 1.5.1;
Wickham H, 2023), tidyverse (version 2.0.0; Wickham H et al., 2019), dplyr
(version 1.1.4; Wickham H et al., 2023), purrr (version 1.0.4; Wickham H, Henry
L, 2025), readr (version 2.1.5; Wickham H et al., 2024) and tidyr (version
1.3.1; Wickham H et al., 2024).

References
----------
  - Auguie B (2017). _gridExtra: Miscellaneous Functions for "Grid" Graphics_.
doi:10.32614/CRAN.package.gridExtra
<https://doi.org/10.32614/CRAN.package.gridExtra>, R package version 2.3,
<https://CRAN.R-project.org/package=gridExtra>.
  - Barrett T, Dowle M, Srinivasan A, Gorecki J, Chirico M, Hocking T,
Schwendinger B, Krylov I (2025). _data.table: Extension of `data.frame`_.
doi:10.32614/CRAN.package.data.table
<https://doi.org/10.32614/CRAN.package.data.table>, R package version 1.17.8,
<https://CRAN.R-project.org/package=data.table>.
  - Ben-Shachar MS, Lüdecke D, Makowski D (2020). "effectsize: Estimation of
Effect Size Indices and Standardized Parameters." _Journal of Open Source
Software_, *5*(56), 2815. doi:10.21105/joss.02815
<https://doi.org/10.21105/joss.02815>, <https://doi.org/10.21105/joss.02815>.
  - Gohel D, Skintzos P (2025). _flextable: Functions for Tabular Reporting_.
doi:10.32614/CRAN.package.flextable
<https://doi.org/10.32614/CRAN.package.flextable>, R package version 0.9.9,
<https://CRAN.R-project.org/package=flextable>.
  - Grolemund G, Wickham H (2011). "Dates and Times Made Easy with lubridate."
_Journal of Statistical Software_, *40*(3), 1-25.
<https://www.jstatsoft.org/v40/i03/>.
  - Kassambara A (2023). _rstatix: Pipe-Friendly Framework for Basic Statistical
Tests_. doi:10.32614/CRAN.package.rstatix
<https://doi.org/10.32614/CRAN.package.rstatix>, R package version 0.7.2,
<https://CRAN.R-project.org/package=rstatix>.
  - Kassambara A (2025). _ggpubr: 'ggplot2' Based Publication Ready Plots_.
doi:10.32614/CRAN.package.ggpubr
<https://doi.org/10.32614/CRAN.package.ggpubr>, R package version 0.6.1,
<https://CRAN.R-project.org/package=ggpubr>.
  - Lüdecke D (2018). "ggeffects: Tidy Data Frames of Marginal Effects from
Regression Models." _Journal of Open Source Software_, *3*(26), 772.
doi:10.21105/joss.00772 <https://doi.org/10.21105/joss.00772>.
  - Lüdecke D, Ben-Shachar M, Patil I, Makowski D (2020). "Extracting, Computing
and Exploring the Parameters of Statistical Models using R." _Journal of Open
Source Software_, *5*(53), 2445. doi:10.21105/joss.02445
<https://doi.org/10.21105/joss.02445>.
  - Lüdecke D, Ben-Shachar M, Patil I, Waggoner P, Makowski D (2021).
"performance: An R Package for Assessment, Comparison and Testing of
Statistical Models." _Journal of Open Source Software_, *6*(60), 3139.
doi:10.21105/joss.03139 <https://doi.org/10.21105/joss.03139>.
  - Lüdecke D, Ben-Shachar M, Patil I, Wiernik B, Bacher E, Thériault R, Makowski
D (2022). "easystats: Framework for Easy Statistical Modeling, Visualization,
and Reporting." _CRAN_. doi:10.32614/CRAN.package.easystats
<https://doi.org/10.32614/CRAN.package.easystats>, R package,
<https://easystats.github.io/easystats/>.
  - Lüdecke D, Patil I, Ben-Shachar M, Wiernik B, Waggoner P, Makowski D (2021).
"see: An R Package for Visualizing Statistical Models." _Journal of Open Source
Software_, *6*(64), 3393. doi:10.21105/joss.03393
<https://doi.org/10.21105/joss.03393>.
  - Lüdecke D, Waggoner P, Makowski D (2019). "insight: A Unified Interface to
Access Information from Model Objects in R." _Journal of Open Source Software_,
*4*(38), 1412. doi:10.21105/joss.01412 <https://doi.org/10.21105/joss.01412>.
  - Makowski D, Ben-Shachar M, Lüdecke D (2019). "bayestestR: Describing Effects
and their Uncertainty, Existence and Significance within the Bayesian
Framework." _Journal of Open Source Software_, *4*(40), 1541.
doi:10.21105/joss.01541 <https://doi.org/10.21105/joss.01541>,
<https://joss.theoj.org/papers/10.21105/joss.01541>.
  - Makowski D, Ben-Shachar M, Wiernik B, Patil I, Thériault R, Lüdecke D (2025).
"modelbased: An R package to make the most out of your statistical models
through marginal means, marginal effects, and model predictions." _Journal of
Open Source Software_, *10*(109), 7969. doi:10.21105/joss.07969
<https://doi.org/10.21105/joss.07969>,
<https://joss.theoj.org/papers/10.21105/joss.07969>.
  - Makowski D, Lüdecke D, Patil I, Thériault R, Ben-Shachar M, Wiernik B (2023).
"Automated Results Reporting as a Practical Tool to Improve Reproducibility and
Methodological Best Practices Adoption." _CRAN_.
<https://easystats.github.io/report/>.
  - Makowski D, Wiernik B, Patil I, Lüdecke D, Ben-Shachar M (2022).
"correlation: Methods for Correlation Analysis." Version 0.8.3,
<https://CRAN.R-project.org/package=correlation>. Makowski D, Ben-Shachar M,
Patil I, Lüdecke D (2020). "Methods and Algorithms for Correlation Analysis in
R." _Journal of Open Source Software_, *5*(51), 2306. doi:10.21105/joss.02306
<https://doi.org/10.21105/joss.02306>,
<https://joss.theoj.org/papers/10.21105/joss.02306>.
  - Müller K, Wickham H (2025). _tibble: Simple Data Frames_.
doi:10.32614/CRAN.package.tibble
<https://doi.org/10.32614/CRAN.package.tibble>, R package version 3.3.0,
<https://CRAN.R-project.org/package=tibble>.
  - Patil I (2021). "Visualizations with statistical details: The 'ggstatsplot'
approach." _Journal of Open Source Software_, *6*(61), 3167.
doi:10.21105/joss.03167 <https://doi.org/10.21105/joss.03167>,
<https://doi.org/10.21105/joss.03167>.
  - Patil I, Makowski D, Ben-Shachar M, Wiernik B, Bacher E, Lüdecke D (2022).
"datawizard: An R Package for Easy Data Preparation and Statistical
Transformations." _Journal of Open Source Software_, *7*(78), 4684.
doi:10.21105/joss.04684 <https://doi.org/10.21105/joss.04684>.
  - R Core Team (2025). _R: A Language and Environment for Statistical
Computing_. R Foundation for Statistical Computing, Vienna, Austria.
<https://www.R-project.org/>.
  - Schloerke B, Cook D, Larmarange J, Briatte F, Marbach M, Thoen E, Elberg A,
Crowley J (2024). _GGally: Extension to 'ggplot2'_.
doi:10.32614/CRAN.package.GGally
<https://doi.org/10.32614/CRAN.package.GGally>, R package version 2.2.1,
<https://CRAN.R-project.org/package=GGally>.
  - Sjoberg D, Whiting K, Curry M, Lavery J, Larmarange J (2021). "Reproducible
Summary Tables with the gtsummary Package." _The R Journal_, *13*, 570-580.
doi:10.32614/RJ-2021-053 <https://doi.org/10.32614/RJ-2021-053>,
<https://doi.org/10.32614/RJ-2021-053>.
  - Thériault R (2023). "rempsyc: Convenience functions for psychology." _Journal
of Open Source Software_, *8*(87), 5466. doi:10.21105/joss.05466
<https://doi.org/10.21105/joss.05466>, <https://doi.org/10.21105/joss.05466>.
  - Venables WN, Ripley BD (2002). _Modern Applied Statistics with S_, Fourth
edition. Springer, New York. ISBN 0-387-95457-0,
<https://www.stats.ox.ac.uk/pub/MASS4/>.
  - Wickham H (2016). _ggplot2: Elegant Graphics for Data Analysis_.
Springer-Verlag New York. ISBN 978-3-319-24277-4,
<https://ggplot2.tidyverse.org>.
  - Wickham H (2023). _forcats: Tools for Working with Categorical Variables
(Factors)_. doi:10.32614/CRAN.package.forcats
<https://doi.org/10.32614/CRAN.package.forcats>, R package version 1.0.0,
<https://CRAN.R-project.org/package=forcats>.
  - Wickham H (2023). _stringr: Simple, Consistent Wrappers for Common String
Operations_. doi:10.32614/CRAN.package.stringr
<https://doi.org/10.32614/CRAN.package.stringr>, R package version 1.5.1,
<https://CRAN.R-project.org/package=stringr>.
  - Wickham H, Averick M, Bryan J, Chang W, McGowan LD, François R, Grolemund G,
Hayes A, Henry L, Hester J, Kuhn M, Pedersen TL, Miller E, Bache SM, Müller K,
Ooms J, Robinson D, Seidel DP, Spinu V, Takahashi K, Vaughan D, Wilke C, Woo K,
Yutani H (2019). "Welcome to the tidyverse." _Journal of Open Source Software_,
*4*(43), 1686. doi:10.21105/joss.01686 <https://doi.org/10.21105/joss.01686>.
  - Wickham H, François R, Henry L, Müller K, Vaughan D (2023). _dplyr: A Grammar
of Data Manipulation_. doi:10.32614/CRAN.package.dplyr
<https://doi.org/10.32614/CRAN.package.dplyr>, R package version 1.1.4,
<https://CRAN.R-project.org/package=dplyr>.
  - Wickham H, Henry L (2025). _purrr: Functional Programming Tools_.
doi:10.32614/CRAN.package.purrr <https://doi.org/10.32614/CRAN.package.purrr>,
R package version 1.0.4, <https://CRAN.R-project.org/package=purrr>.
  - Wickham H, Hester J, Bryan J (2024). _readr: Read Rectangular Text Data_.
doi:10.32614/CRAN.package.readr <https://doi.org/10.32614/CRAN.package.readr>,
R package version 2.1.5, <https://CRAN.R-project.org/package=readr>.
  - Wickham H, Vaughan D, Girlich M (2024). _tidyr: Tidy Messy Data_.
doi:10.32614/CRAN.package.tidyr <https://doi.org/10.32614/CRAN.package.tidyr>,
R package version 1.3.1, <https://CRAN.R-project.org/package=tidyr>.