Published

January 13, 2026

Introduction

Code
source("Survival/utils.R")

# Setup analysis environment
analysis_setup <- setup_analysis()
paths <- analysis_setup$paths
demo <- analysis_setup$demo

flare.df <- readRDS(paste0(paths$outdir, "flares-biochem.RDS"))
flare.cd.df <- readRDS(paste0(paths$outdir, "flares-biochem-cd.RDS"))
flare.uc.df <- readRDS(paste0(paths$outdir, "flares-biochem-uc.RDS"))

Sensitivity analyses are available which control for smoking status by imputing missing smoking data and control for FC as a continuous variable via splines.

Total meat protein

Protein intake from animal sources is not found to be significantly associated with flares in CD. However, there is evidence of an association for UC. At present, it is difficult to explore this in more detail (e.g. by meat type).

Crohn’s disease

Code
# Categorize meat protein by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "Meat_sum", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "Meat_sum",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/meat",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/meat.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9330 1.3884 2.6912 0.0001
catFC 50-250 1.3110 0.9289 1.8504 0.1235
catFC > 250 1.9974 1.3682 2.9160 0.0003
IMD2 0.7245 0.3828 1.3713 0.3222
IMD3 0.9050 0.4996 1.6395 0.7420
IMD4 0.8296 0.4564 1.5079 0.5400
IMD5 0.9966 0.5737 1.7313 0.9904
dqi_tot 1.0039 0.9902 1.0177 0.5800
Meat_sum_cat[24.9,35.8) 0.9972 0.6580 1.5114 0.9896
Meat_sum_cat[35.8,50.6) 0.8668 0.5687 1.3213 0.5064
Meat_sum_cat[50.6,331] 0.9280 0.5963 1.4442 0.7406
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2035 1.0000 0.6519
cat 1.0755 2.0000 0.5841
IMD 3.0237 4.0000 0.5539
dqi_tot 0.1664 1.0000 0.6834
Meat_sum_cat 1.3198 3.0000 0.7244
GLOBAL 5.5992 11.0001 0.8987
Warning: `gather_()` was deprecated in tidyr 1.2.0.
ℹ Please use `gather()` instead.
ℹ The deprecated feature was likely used in the survminer package.
  Please report the issue at <https://github.com/kassambara/survminer/issues>.
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "Meat_sum",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/meat",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
   )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/meat.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2718 0.8442 1.9160 0.2501
catFC 50-250 1.9436 1.2242 3.0859 0.0048
catFC > 250 2.9448 1.7832 4.8629 0.0000
IMD2 0.5613 0.2421 1.3010 0.1781
IMD3 0.7347 0.3371 1.6014 0.4381
IMD4 0.6942 0.3202 1.5051 0.3552
IMD5 0.6491 0.3135 1.3436 0.2443
dqi_tot 1.0027 0.9849 1.0208 0.7668
Meat_sum_cat[24.9,35.8) 1.3035 0.7468 2.2752 0.3509
Meat_sum_cat[35.8,50.6) 1.1908 0.6836 2.0743 0.5374
Meat_sum_cat[50.6,331] 0.9684 0.5387 1.7407 0.9145
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0858 0.9758 0.7605
cat 10.6562 1.9802 0.0047
IMD 2.8910 3.9262 0.5646
dqi_tot 2.8736 0.9913 0.0890
Meat_sum_cat 2.8562 2.9740 0.4098
GLOBAL 21.6864 17.0383 0.1989
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize meat protein by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "Meat_sum", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "Meat_sum",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/meat",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
   )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/meat.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7482 1.3166 2.3214 0.0001
catFC 50-250 1.8207 1.3322 2.4883 0.0002
catFC > 250 2.1674 1.5186 3.0933 0.0000
IMD2 1.5406 0.8082 2.9368 0.1892
IMD3 1.3026 0.7003 2.4229 0.4038
IMD4 1.4203 0.7876 2.5613 0.2434
IMD5 1.3201 0.7406 2.3529 0.3464
dqi_tot 1.0034 0.9904 1.0166 0.6107
Meat_sum_cat[24.9,35.8) 1.1736 0.7894 1.7448 0.4289
Meat_sum_cat[35.8,50.6) 1.3622 0.9159 2.0259 0.1270
Meat_sum_cat[50.6,331] 1.2700 0.8408 1.9185 0.2560
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0456 0.9999 0.8309
cat 3.8911 1.9999 0.1429
IMD 2.6428 3.9999 0.6192
dqi_tot 0.6440 1.0000 0.4223
Meat_sum_cat 11.4044 2.9999 0.0097
GLOBAL 18.1848 11.0089 0.0776
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "Meat_sum",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/meat",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/meat.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2917 0.8895 1.8756 0.1787
catFC 50-250 1.9278 1.2624 2.9439 0.0024
catFC > 250 2.4267 1.4961 3.9360 0.0003
IMD2 1.6747 0.6343 4.4215 0.2979
IMD3 1.5942 0.6246 4.0687 0.3293
IMD4 2.6769 1.1151 6.4257 0.0275
IMD5 1.6306 0.6779 3.9222 0.2749
dqi_tot 1.0115 0.9934 1.0301 0.2147
Meat_sum_cat[24.9,35.8) 1.3961 0.7831 2.4891 0.2580
Meat_sum_cat[35.8,50.6) 1.5504 0.8753 2.7461 0.1327
Meat_sum_cat[50.6,331] 2.1853 1.2371 3.8603 0.0071
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1730 0.9851 0.6714
cat 7.0075 1.9595 0.0288
IMD 1.8409 3.9355 0.7564
dqi_tot 0.0332 0.9866 0.8513
Meat_sum_cat 1.1868 2.9607 0.7498
GLOBAL 10.4857 18.8915 0.9376
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
newdata <- flare.uc.df %>%
  mutate(Meat_sum_cat = "[0,24.9)",
         hardflare_time = 365.25,
         hardflare = 1)
predict(fit.me, newdata = newdata, type = "expected", se.fit = TRUE)$fit %>%
  mean(na.rm = TRUE)
[1] 0.05691642
Code
newdata <- flare.uc.df %>%
  mutate(cat = "FC < 50",
         hardflare_time = 730,
         hardflare = 1)
predict(fit.me, newdata = newdata, type = "expected", se.fit = TRUE)$fit %>%
  mean(na.rm = TRUE)
[1] 0.1191729
Code
newdata <- flare.uc.df %>%
  mutate(Meat_sum_cat = "[50.6,331]",
         hardflare_time = 365.25,
         hardflare = 1)
predict(fit.me, newdata = newdata, type = "expected", se.fit = TRUE)$fit %>%
  mean(na.rm = TRUE)
[1] 0.1243808
Code
newdata <- flare.uc.df %>%
  mutate(Meat_sum_cat = "[50.6,331]",
         hardflare_time = 730,
         hardflare = 1)
predict(fit.me, newdata = newdata, type = "expected", se.fit = TRUE)$fit %>%
  mean(na.rm = TRUE)
[1] 0.2615111

Inflammatory bowel disease

Code
# Categorize meat protein by quantiles
flare.df <- categorize_by_quantiles(flare.df, "Meat_sum", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "Meat_sum",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/meat",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/meat.png")

Code
invisible(
  cox_summary(
    fit.me,
    plot_base_path = "plots/ibd/soft-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7655 1.4275 2.1834 0.0000
catFC 50-250 1.5389 1.2227 1.9369 0.0002
catFC > 250 2.0361 1.5728 2.6359 0.0000
IMD2 1.0276 0.6548 1.6126 0.9059
IMD3 1.0568 0.6893 1.6202 0.7999
IMD4 1.1037 0.7289 1.6712 0.6412
IMD5 1.1073 0.7443 1.6474 0.6149
dqi_tot 1.0035 0.9941 1.0129 0.4646
Meat_sum_cat[24.9,35.8) 1.0840 0.8143 1.4429 0.5806
Meat_sum_cat[35.8,50.6) 1.1101 0.8338 1.4779 0.4743
Meat_sum_cat[50.6,331] 1.0996 0.8149 1.4839 0.5346
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0003 1.0000 0.9858
cat 0.8204 2.0000 0.6635
IMD 4.6867 4.0000 0.3210
dqi_tot 0.9433 1.0000 0.3314
Meat_sum_cat 7.6387 3.0000 0.0541
GLOBAL 13.9143 11.0002 0.2378
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "Meat_sum",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat protein quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/meat",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + Meat_sum_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/meat.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/meat"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2339 0.9394 1.6209 0.1309
catFC 50-250 1.8917 1.3882 2.5777 0.0001
catFC > 250 2.6316 1.8634 3.7165 0.0000
IMD2 0.9745 0.5203 1.8252 0.9357
IMD3 1.0492 0.5795 1.8996 0.8740
IMD4 1.4170 0.8068 2.4888 0.2252
IMD5 1.0324 0.5939 1.7948 0.9100
dqi_tot 1.0063 0.9937 1.0191 0.3262
Meat_sum_cat[24.9,35.8) 1.3293 0.8923 1.9805 0.1616
Meat_sum_cat[35.8,50.6) 1.3662 0.9215 2.0256 0.1204
Meat_sum_cat[50.6,331] 1.5038 1.0091 2.2411 0.0450
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1190 0.9876 0.7253
cat 6.5934 1.9792 0.0362
IMD 2.3284 3.9449 0.6674
dqi_tot 1.4570 0.9915 0.2252
Meat_sum_cat 1.2857 2.9785 0.7289
GLOBAL 12.6525 22.9723 0.9587
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/meat-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/meat-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Overall meat intake

Crohn’s disease

Code
# Categorize overall meat intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "meat_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "meat_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/meat_overall",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-overall-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9283 1.3852 2.6842 0.0001
catFC 50-250 1.3105 0.9275 1.8516 0.1252
catFC > 250 2.0021 1.3693 2.9275 0.0003
IMD2 0.7228 0.3804 1.3732 0.3215
IMD3 0.8950 0.4922 1.6273 0.7161
IMD4 0.8338 0.4587 1.5153 0.5509
IMD5 0.9839 0.5656 1.7115 0.9542
dqi_tot 1.0027 0.9881 1.0175 0.7219
meat_overall_cat[59.5,101 0.9729 0.6398 1.4793 0.8976
meat_overall_cat[101,153) 0.8923 0.5762 1.3816 0.6094
meat_overall_cat[153,927] 0.8927 0.5557 1.4341 0.6388
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2004 1.0000 0.6544
cat 1.0758 2.0000 0.5840
IMD 3.0383 4.0000 0.5514
dqi_tot 0.1606 1.0000 0.6886
meat_overall_cat 2.8814 3.0000 0.4103
GLOBAL 8.0855 11.0001 0.7056
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "meat_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/meat_overall",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-overall-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3000 0.8615 1.9619 0.2114
catFC 50-250 1.9286 1.2142 3.0635 0.0054
catFC > 250 2.9723 1.7957 4.9199 0.0000
IMD2 0.5555 0.2385 1.2939 0.1730
IMD3 0.7479 0.3427 1.6325 0.4658
IMD4 0.7130 0.3285 1.5478 0.3924
IMD5 0.6695 0.3239 1.3842 0.2790
dqi_tot 1.0012 0.9821 1.0207 0.9048
meat_overall_cat[59.5,101 0.8740 0.5032 1.5183 0.6328
meat_overall_cat[101,153) 0.9062 0.5151 1.5943 0.7326
meat_overall_cat[153,927] 0.8502 0.4650 1.5545 0.5981
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1074 0.9741 0.7330
cat 10.3961 1.9794 0.0054
IMD 2.7691 3.9317 0.5865
dqi_tot 2.8689 0.9910 0.0892
meat_overall_cat 0.4851 2.9711 0.9197
GLOBAL 16.1019 17.2467 0.5339
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize overall meat intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "meat_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "meat_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/meat_overall",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-overall-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7285 1.2992 2.2997 0.0002
catFC 50-250 1.8389 1.3440 2.5161 0.0001
catFC > 250 2.1393 1.4976 3.0559 0.0000
IMD2 1.4663 0.7712 2.7881 0.2431
IMD3 1.2909 0.6936 2.4025 0.4204
IMD4 1.3819 0.7648 2.4970 0.2839
IMD5 1.2718 0.7126 2.2698 0.4158
dqi_tot 1.0039 0.9895 1.0184 0.5978
meat_overall_cat[59.5,101 0.9258 0.6231 1.3755 0.7026
meat_overall_cat[101,153) 1.2290 0.8270 1.8266 0.3077
meat_overall_cat[153,927] 1.0747 0.6919 1.6693 0.7484
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0329 1.0000 0.8562
cat 3.7928 2.0000 0.1501
IMD 2.6095 4.0000 0.6251
dqi_tot 0.6535 1.0000 0.4189
meat_overall_cat 8.7443 3.0000 0.0329
GLOBAL 15.7031 11.0001 0.1525
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "meat_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/meat_overall",
  break_time_by = 500
) 

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "meat-overall-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3107 0.8948 1.9200 0.1648
catFC 50-250 1.9627 1.2813 3.0063 0.0019
catFC > 250 2.3648 1.4567 3.8391 0.0005
IMD2 1.6660 0.6329 4.3854 0.3013
IMD3 1.5465 0.6044 3.9569 0.3631
IMD4 2.6029 1.0826 6.2585 0.0326
IMD5 1.5688 0.6520 3.7747 0.3148
dqi_tot 1.0190 0.9986 1.0398 0.0686
meat_overall_cat[59.5,101 0.7688 0.4211 1.4037 0.3921
meat_overall_cat[101,153) 1.5264 0.8791 2.6503 0.1330
meat_overall_cat[153,927] 1.9492 1.0666 3.5619 0.0300
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1586 0.9811 0.6827
cat 6.5851 1.9573 0.0356
IMD 1.8899 3.9269 0.7461
dqi_tot 0.0381 0.9811 0.8394
meat_overall_cat 1.1463 2.9449 0.7570
GLOBAL 10.6928 19.8397 0.9510
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize overall meat intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "meat_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "meat_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/meat_overall",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7617 1.4244 2.1790 0.0000
catFC 50-250 1.5474 1.2287 1.9487 0.0002
catFC > 250 2.0422 1.5777 2.6433 0.0000
IMD2 1.0254 0.6541 1.6076 0.9129
IMD3 1.0649 0.6939 1.6340 0.7736
IMD4 1.1039 0.7295 1.6704 0.6402
IMD5 1.1042 0.7422 1.6429 0.6247
dqi_tot 1.0034 0.9932 1.0137 0.5115
meat_overall_cat[59.5,101 0.9658 0.7267 1.2835 0.8105
meat_overall_cat[101,153) 1.0830 0.8101 1.4477 0.5905
meat_overall_cat[153,927] 0.9958 0.7241 1.3696 0.9794
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0001 1.0000 0.9915
cat 0.8075 2.0000 0.6678
IMD 4.6669 4.0000 0.3232
dqi_tot 0.9546 1.0000 0.3286
meat_overall_cat 3.7140 3.0000 0.2940
GLOBAL 10.0527 11.0002 0.5257
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "meat_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Meat intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/meat_overall",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + meat_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/meat_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/meat_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2443 0.9466 1.6356 0.1172
catFC 50-250 1.9230 1.4102 2.6222 0.0000
catFC > 250 2.6521 1.8787 3.7439 0.0000
IMD2 0.9601 0.5133 1.7960 0.8987
IMD3 1.0478 0.5783 1.8982 0.8777
IMD4 1.4264 0.8129 2.5030 0.2157
IMD5 1.0348 0.5956 1.7981 0.9033
dqi_tot 1.0091 0.9953 1.0231 0.1972
meat_overall_cat[59.5,101 0.8306 0.5560 1.2407 0.3646
meat_overall_cat[101,153) 1.2094 0.8216 1.7803 0.3352
meat_overall_cat[153,927] 1.3007 0.8612 1.9645 0.2114
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1207 0.9880 0.7236
cat 6.3624 1.9795 0.0407
IMD 2.4822 3.9450 0.6394
dqi_tot 1.4650 0.9898 0.2235
meat_overall_cat 1.9016 2.9717 0.5878
GLOBAL 11.7018 23.1150 0.9759
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/meat_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/meat_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Overall fish intake

Crohn’s disease

Code
# Categorize overall fish intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "fish_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fish_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/fish_overall",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fish-overall-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8915 1.3593 2.6322 0.0002
catFC 50-250 1.3197 0.9329 1.8669 0.1171
catFC > 250 2.0898 1.4279 3.0585 0.0001
IMD2 0.7647 0.4051 1.4436 0.4080
IMD3 0.9021 0.4976 1.6357 0.7344
IMD4 0.8322 0.4594 1.5075 0.5446
IMD5 1.0438 0.5998 1.8164 0.8795
dqi_tot 1.0058 0.9919 1.0199 0.4186
fish_overall_cat[16.4,36. 0.5914 0.3778 0.9256 0.0215
fish_overall_cat[36.5,65. 0.6846 0.4467 1.0493 0.0820
fish_overall_cat[65.8,647 0.8655 0.5684 1.3179 0.5006
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1702 1.0000 0.6800
cat 1.1851 2.0000 0.5529
IMD 2.9824 4.0000 0.5608
dqi_tot 0.1405 1.0000 0.7078
fish_overall_cat 2.7091 3.0000 0.4387
GLOBAL 7.8593 11.0001 0.7259
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fish_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/fish_overall",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fish-overall-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3102 0.8666 1.9809 0.2002
catFC 50-250 1.8784 1.1759 3.0005 0.0083
catFC > 250 3.1436 1.8906 5.2272 0.0000
IMD2 0.6667 0.2863 1.5525 0.3472
IMD3 0.8078 0.3638 1.7937 0.6001
IMD4 0.7195 0.3301 1.5684 0.4077
IMD5 0.7555 0.3612 1.5801 0.4564
dqi_tot 1.0060 0.9875 1.0249 0.5266
BMI 1.0157 0.9803 1.0524 0.3885
fish_overall_cat[16.4,36. 0.4418 0.2418 0.8072 0.0079
fish_overall_cat[36.5,65. 0.5899 0.3344 1.0404 0.0683
fish_overall_cat[65.8,647 0.7671 0.4491 1.3102 0.3317
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0875 0.9705 0.7562
cat 9.5266 1.9809 0.0083
IMD 2.6789 3.9281 0.6017
dqi_tot 2.6709 0.9911 0.1010
BMI 1.2451 0.9802 0.2588
fish_overall_cat 9.8922 2.9629 0.0189
GLOBAL 25.7218 17.9134 0.1038
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize overall fish intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "fish_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fish_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/fish_overall",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fish-overall-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7033 1.2752 2.2751 0.0003
catFC 50-250 1.7671 1.2775 2.4443 0.0006
catFC > 250 2.0722 1.4510 2.9594 0.0001
IMD2 1.5200 0.7951 2.9058 0.2054
IMD3 1.1686 0.6205 2.2008 0.6295
IMD4 1.4071 0.7743 2.5570 0.2624
IMD5 1.2361 0.6872 2.2233 0.4792
dqi_tot 0.9962 0.9830 1.0095 0.5737
BMI 0.9773 0.9481 1.0074 0.1383
fish_overall_cat[16.4,36. 1.1858 0.7883 1.7838 0.4132
fish_overall_cat[36.5,65. 1.1459 0.7555 1.7379 0.5216
fish_overall_cat[65.8,647 1.4914 1.0061 2.2109 0.0466
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0111 1.0000 0.9161
cat 3.5361 2.0000 0.1707
IMD 2.6892 4.0000 0.6111
dqi_tot 0.7602 1.0000 0.3833
BMI 0.9453 1.0000 0.3309
fish_overall_cat 0.6666 3.0000 0.8810
GLOBAL 8.9045 12.0001 0.7111
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fish_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/fish_overall",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fish-overall-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1941 0.8159 1.7478 0.3613
catFC 50-250 2.0229 1.2996 3.1488 0.0018
catFC > 250 2.4586 1.5117 3.9986 0.0003
IMD2 1.6328 0.6183 4.3116 0.3223
IMD3 1.3160 0.5102 3.3947 0.5701
IMD4 2.4180 1.0087 5.7962 0.0478
IMD5 1.4286 0.5916 3.4499 0.4277
dqi_tot 1.0002 0.9821 1.0186 0.9857
BMI 0.9605 0.9204 1.0024 0.0641
fish_overall_cat[16.4,36. 0.8017 0.4619 1.3914 0.4320
fish_overall_cat[36.5,65. 0.8688 0.5070 1.4889 0.6088
fish_overall_cat[65.8,647 1.1617 0.6953 1.9410 0.5671
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0334 0.9883 0.8515
cat 5.4126 1.9571 0.0641
IMD 1.2035 3.9340 0.8713
dqi_tot 0.0001 0.9865 0.9922
BMI 0.6022 0.9887 0.4334
fish_overall_cat 2.4436 2.9667 0.4794
GLOBAL 12.4545 18.9576 0.8637
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize overall fish intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "fish_overall", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fish_overall",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/fish_overall",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7632 1.4212 2.1875 0.0000
catFC 50-250 1.4793 1.1694 1.8713 0.0011
catFC > 250 2.0110 1.5523 2.6053 0.0000
IMD2 1.0159 0.6451 1.5999 0.9458
IMD3 1.0071 0.6520 1.5557 0.9744
IMD4 1.1380 0.7503 1.7261 0.5429
IMD5 1.1013 0.7368 1.6461 0.6380
dqi_tot 1.0012 0.9916 1.0108 0.8128
BMI 0.9950 0.9753 1.0151 0.6231
fish_overall_cat[16.4,36. 0.8621 0.6390 1.1630 0.3313
fish_overall_cat[36.5,65. 0.9355 0.6958 1.2576 0.6586
fish_overall_cat[65.8,647 1.1716 0.8795 1.5608 0.2792
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0037 1.0000 0.9515
cat 1.0850 2.0000 0.5813
IMD 5.0340 4.0000 0.2838
dqi_tot 1.3398 1.0000 0.2471
BMI 0.0088 1.0000 0.9255
fish_overall_cat 0.6613 3.0000 0.8823
GLOBAL 8.6555 12.0002 0.7321
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fish_overall",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fish intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/fish_overall",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fish_overall_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/fish_overall.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/fish_overall"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2361 0.9377 1.6295 0.1327
catFC 50-250 1.8663 1.3583 2.5642 0.0001
catFC > 250 2.6575 1.8774 3.7618 0.0000
IMD2 0.9622 0.5142 1.8005 0.9040
IMD3 0.9640 0.5288 1.7574 0.9048
IMD4 1.3841 0.7874 2.4331 0.2587
IMD5 1.0097 0.5785 1.7622 0.9728
dqi_tot 1.0022 0.9894 1.0152 0.7350
BMI 0.9909 0.9645 1.0181 0.5086
fish_overall_cat[16.4,36. 0.6319 0.4235 0.9427 0.0245
fish_overall_cat[36.5,65. 0.7394 0.5040 1.0846 0.1225
fish_overall_cat[65.8,647 0.9716 0.6734 1.4018 0.8775
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0378 0.9882 0.8422
cat 6.5833 1.9803 0.0365
IMD 1.5618 3.9428 0.8089
dqi_tot 1.8820 0.9922 0.1685
BMI 1.9590 0.9878 0.1592
fish_overall_cat 8.8737 2.9790 0.0305
GLOBAL 20.5269 22.9338 0.6061
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fish_overall-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fish_overall-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Dietary fibre

Crohn’s disease

Code
# Categorize dietary fibre by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "fibre", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fibre",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/fibre",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fibre-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8864 1.3475 2.6408 0.0002
catFC 50-250 1.2975 0.9125 1.8450 0.1471
catFC > 250 2.0536 1.3992 3.0141 0.0002
IMD2 0.6955 0.3632 1.3319 0.2733
IMD3 0.9297 0.5101 1.6947 0.8120
IMD4 0.8450 0.4668 1.5296 0.5780
IMD5 0.9776 0.5611 1.7032 0.9362
dqi_tot 1.0068 0.9912 1.0226 0.3971
BMI 1.0079 0.9804 1.0363 0.5756
fibre_cat[17,22.9) 0.7511 0.4878 1.1567 0.1939
fibre_cat[22.9,29.4) 0.8966 0.5804 1.3851 0.6228
fibre_cat[29.4,170] 0.9582 0.5984 1.5342 0.8588
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2744 1.0000 0.6004
cat 0.8152 2.0000 0.6652
IMD 3.0351 4.0000 0.5520
dqi_tot 0.3396 1.0000 0.5600
BMI 1.3198 1.0000 0.2506
fibre_cat 5.1069 3.0000 0.1641
GLOBAL 10.6138 12.0001 0.5623
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fibre",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/fibre",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fibre-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3807 0.9086 2.0981 0.1308
catFC 50-250 1.8701 1.1707 2.9872 0.0088
catFC > 250 3.1224 1.8748 5.2003 0.0000
IMD2 0.6300 0.2709 1.4651 0.2833
IMD3 0.8054 0.3634 1.7849 0.5940
IMD4 0.7541 0.3466 1.6404 0.4766
IMD5 0.7123 0.3415 1.4858 0.3657
dqi_tot 0.9978 0.9779 1.0182 0.8345
BMI 1.0165 0.9811 1.0533 0.3648
fibre_cat[17,22.9) 1.0252 0.5798 1.8128 0.9319
fibre_cat[22.9,29.4) 1.4448 0.8175 2.5534 0.2053
fibre_cat[29.4,170] 1.3901 0.7530 2.5660 0.2923
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0861 0.9701 0.7579
cat 10.1182 1.9787 0.0062
IMD 2.6037 3.9266 0.6148
dqi_tot 2.7993 0.9906 0.0931
BMI 1.1389 0.9815 0.2803
fibre_cat 9.7004 2.9616 0.0206
GLOBAL 22.6456 18.6611 0.2362
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize fibre by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "fibre", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fibre",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/fibre",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fibre-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6926 1.2636 2.2672 0.0004
catFC 50-250 1.7837 1.2980 2.4513 0.0004
catFC > 250 2.1170 1.4803 3.0274 0.0000
IMD2 1.3861 0.7239 2.6542 0.3246
IMD3 1.1466 0.6076 2.1636 0.6728
IMD4 1.3385 0.7390 2.4243 0.3361
IMD5 1.1956 0.6643 2.1520 0.5512
dqi_tot 1.0010 0.9871 1.0151 0.8880
BMI 0.9759 0.9471 1.0056 0.1111
fibre_cat[17,22.9) 0.8763 0.5895 1.3026 0.5138
fibre_cat[22.9,29.4) 0.9668 0.6292 1.4855 0.8776
fibre_cat[29.4,170] 0.8254 0.5346 1.2744 0.3866
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0057 1.0000 0.9400
cat 3.5363 2.0000 0.1706
IMD 2.6179 4.0000 0.6236
dqi_tot 0.7523 1.0000 0.3858
BMI 0.9507 1.0000 0.3295
fibre_cat 1.0506 3.0000 0.7890
GLOBAL 9.0611 12.0001 0.6977
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fibre",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/fibre",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fibre-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2319 0.8386 1.8095 0.2879
catFC 50-250 2.0087 1.3018 3.0992 0.0016
catFC > 250 2.4709 1.5197 4.0173 0.0003
IMD2 1.7192 0.6445 4.5859 0.2790
IMD3 1.3779 0.5312 3.5743 0.5099
IMD4 2.4505 1.0190 5.8931 0.0453
IMD5 1.4399 0.5943 3.4885 0.4194
dqi_tot 0.9996 0.9808 1.0188 0.9682
BMI 0.9644 0.9247 1.0057 0.0900
fibre_cat[17,22.9) 1.2507 0.7094 2.2052 0.4394
fibre_cat[22.9,29.4) 1.4394 0.7917 2.6169 0.2324
fibre_cat[29.4,170] 1.1698 0.6416 2.1328 0.6088
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0292 0.9895 0.8613
cat 5.5323 1.9568 0.0604
IMD 1.1150 3.9308 0.8859
dqi_tot 0.0010 0.9893 0.9731
BMI 0.5841 0.9886 0.4403
fibre_cat 4.7052 2.9522 0.1893
GLOBAL 12.4623 19.3462 0.8777
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize dietary fibre by quantiles
flare.df <- categorize_by_quantiles(flare.df, "fibre", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fibre",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/fibre",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7669 1.4224 2.1947 0.0000
catFC 50-250 1.4980 1.1859 1.8921 0.0007
catFC > 250 2.0311 1.5676 2.6318 0.0000
IMD2 0.9612 0.6100 1.5147 0.8645
IMD3 0.9914 0.6418 1.5315 0.9690
IMD4 1.0909 0.7201 1.6527 0.6815
IMD5 1.0688 0.7154 1.5967 0.7454
dqi_tot 1.0037 0.9935 1.0141 0.4747
BMI 0.9941 0.9744 1.0142 0.5609
fibre_cat[17,22.9) 0.8419 0.6320 1.1214 0.2393
fibre_cat[22.9,29.4) 0.9420 0.6978 1.2717 0.6964
fibre_cat[29.4,170] 0.8956 0.6554 1.2238 0.4888
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0038 1.0000 0.9511
cat 1.0906 2.0000 0.5797
IMD 5.0884 4.0000 0.2783
dqi_tot 1.3417 1.0000 0.2467
BMI 0.0088 1.0000 0.9251
fibre_cat 3.6398 3.0000 0.3031
GLOBAL 11.6255 12.0002 0.4762
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fibre",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fibre quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/fibre",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fibre_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/fibre.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/fibre"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2919 0.9786 1.7056 0.0707
catFC 50-250 1.8669 1.3629 2.5572 0.0001
catFC > 250 2.6881 1.8992 3.8048 0.0000
IMD2 0.9718 0.5183 1.8219 0.9289
IMD3 0.9699 0.5321 1.7679 0.9206
IMD4 1.3801 0.7858 2.4238 0.2623
IMD5 0.9849 0.5646 1.7182 0.9573
dqi_tot 0.9985 0.9851 1.0122 0.8328
BMI 0.9923 0.9659 1.0194 0.5742
fibre_cat[17,22.9) 1.1513 0.7780 1.7040 0.4811
fibre_cat[22.9,29.4) 1.4022 0.9376 2.0971 0.0997
fibre_cat[29.4,170] 1.2760 0.8406 1.9370 0.2523
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0422 0.9882 0.8334
cat 6.5765 1.9786 0.0365
IMD 1.6603 3.9441 0.7910
dqi_tot 2.0448 0.9939 0.1516
BMI 1.9420 0.9890 0.1612
fibre_cat 11.5963 2.9788 0.0087
GLOBAL 22.1617 22.8286 0.5002
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fibre-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fibre-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Polyunsaturated fatty acids

The SAP states n-6 PUFAs will be investigated. However, the FFQ data extract lists PUFA collectively, presumably describing both n-3 and n-6 PUFAs. For now, these data will be used.

Crohn’s disease

Code
# Categorize PUFA by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "PUFA_percEng", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "PUFA_percEng",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/pufa",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "pufa-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + PUFA_percEng_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9094 1.3738 2.6539 0.0001
catFC 50-250 1.2909 0.9127 1.8257 0.1489
catFC > 250 1.9690 1.3482 2.8756 0.0005
IMD2 0.7145 0.3783 1.3493 0.3000
IMD3 0.8979 0.4955 1.6269 0.7224
IMD4 0.8463 0.4671 1.5331 0.5819
IMD5 0.9825 0.5652 1.7079 0.9502
PUFA_percEng_cat[4.54,5.1 0.7530 0.4955 1.1443 0.1839
PUFA_percEng_cat[5.17,5.9 0.6531 0.4246 1.0045 0.0525
PUFA_percEng_cat[5.92,12. 0.9356 0.6336 1.3814 0.7378
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1923 1.0000 0.6610
cat 1.1166 2.0000 0.5722
IMD 3.2044 4.0000 0.5242
PUFA_percEng_cat 0.9104 3.0000 0.8229
GLOBAL 5.3470 10.0001 0.8668
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "PUFA_percEng",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/pufa",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "pufa-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + PUFA_percEng_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3456 0.8895 2.0355 0.1599
catFC 50-250 1.8559 1.1640 2.9588 0.0094
catFC > 250 2.8788 1.7356 4.7751 0.0000
IMD2 0.6383 0.2747 1.4829 0.2965
IMD3 0.8351 0.3771 1.8497 0.6570
IMD4 0.7877 0.3621 1.7136 0.5473
IMD5 0.7257 0.3490 1.5090 0.3907
dqi_tot 1.0035 0.9857 1.0217 0.7013
BMI 1.0187 0.9834 1.0553 0.3026
PUFA_percEng_cat[4.54,5.1 1.1055 0.6301 1.9395 0.7266
PUFA_percEng_cat[5.17,5.9 1.0967 0.6237 1.9285 0.7486
PUFA_percEng_cat[5.92,12. 1.3012 0.7520 2.2517 0.3466
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0505 0.9726 0.8128
cat 10.2964 1.9788 0.0057
IMD 2.7271 3.9317 0.5938
dqi_tot 2.8444 0.9892 0.0903
BMI 1.2067 0.9786 0.2657
PUFA_percEng_cat 8.4728 2.9524 0.0358
GLOBAL 27.3020 18.3585 0.0817
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize PUFA by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "PUFA_percEng", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "PUFA_percEng",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/pufa",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "pufa-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6993 1.2731 2.2683 0.0003
catFC 50-250 1.8254 1.3279 2.5092 0.0002
catFC > 250 2.1008 1.4690 3.0042 0.0000
IMD2 1.4206 0.7448 2.7094 0.2866
IMD3 1.1143 0.5917 2.0984 0.7375
IMD4 1.3211 0.7286 2.3953 0.3591
IMD5 1.1679 0.6490 2.1015 0.6047
dqi_tot 0.9995 0.9867 1.0125 0.9433
BMI 0.9799 0.9508 1.0099 0.1861
PUFA_percEng_cat[4.54,5.1 0.8929 0.6036 1.3208 0.5706
PUFA_percEng_cat[5.17,5.9 0.8670 0.5867 1.2811 0.4737
PUFA_percEng_cat[5.92,12. 1.1782 0.8065 1.7212 0.3965
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0129 1.0000 0.9097
cat 3.5443 2.0000 0.1700
IMD 2.6609 4.0000 0.6161
dqi_tot 0.7367 1.0000 0.3907
BMI 0.8724 1.0000 0.3503
PUFA_percEng_cat 2.7154 3.0000 0.4376
GLOBAL 11.2593 12.0001 0.5068
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "PUFA_percEng",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/pufa",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "pufa-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + PUFA_percEng_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2077 0.8256 1.7666 0.3308
catFC 50-250 2.0348 1.3195 3.1378 0.0013
catFC > 250 2.5288 1.5496 4.1269 0.0002
IMD2 1.5333 0.5814 4.0436 0.3877
IMD3 1.2567 0.4866 3.2454 0.6369
IMD4 2.2494 0.9365 5.4030 0.0698
IMD5 1.3583 0.5604 3.2920 0.4978
dqi_tot 1.0020 0.9844 1.0200 0.8236
BMI 0.9618 0.9219 1.0035 0.0722
PUFA_percEng_cat[4.54,5.1 0.9134 0.5480 1.5223 0.7281
PUFA_percEng_cat[5.17,5.9 0.7609 0.4497 1.2875 0.3086
PUFA_percEng_cat[5.92,12. 0.8666 0.5136 1.4621 0.5916
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0277 0.9890 0.8646
cat 5.3713 1.9576 0.0655
IMD 1.1788 3.9319 0.8753
dqi_tot 0.0028 0.9861 0.9558
BMI 0.5505 0.9901 0.4542
PUFA_percEng_cat 3.2562 2.9455 0.3449
GLOBAL 11.7781 19.4010 0.9072
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize PUFA by quantiles
flare.df <- categorize_by_quantiles(flare.df, "PUFA_percEng", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "PUFA_percEng",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/pufa",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + PUFA_percEng_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7648 1.4228 2.1890 0.0000
catFC 50-250 1.5003 1.1877 1.8953 0.0007
catFC > 250 2.0190 1.5584 2.6157 0.0000
IMD2 0.9653 0.6131 1.5199 0.8789
IMD3 0.9886 0.6403 1.5266 0.9589
IMD4 1.0873 0.7173 1.6481 0.6933
IMD5 1.0602 0.7092 1.5850 0.7755
dqi_tot 1.0021 0.9928 1.0115 0.6604
BMI 0.9966 0.9768 1.0168 0.7386
PUFA_percEng_cat[4.54,5.1 0.8545 0.6423 1.1369 0.2805
PUFA_percEng_cat[5.17,5.9 0.7679 0.5757 1.0243 0.0724
PUFA_percEng_cat[5.92,12. 1.0490 0.7990 1.3772 0.7306
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0016 1.0000 0.9682
cat 1.0598 2.0000 0.5887
IMD 5.2193 4.0000 0.2655
dqi_tot 1.3435 1.0000 0.2464
BMI 0.0112 1.0000 0.9155
PUFA_percEng_cat 3.8212 3.0000 0.2814
GLOBAL 11.7195 12.0002 0.4685
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "PUFA_percEng",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "PUFA intake (by g) quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/pufa",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + PUFA_percEng_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/pufa.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/pufa"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2527 0.9498 1.6521 0.1107
catFC 50-250 1.8650 1.3617 2.5542 0.0001
catFC > 250 2.6139 1.8490 3.6952 0.0000
IMD2 0.9178 0.4912 1.7151 0.7880
IMD3 0.9535 0.5230 1.7383 0.8765
IMD4 1.3506 0.7689 2.3724 0.2956
IMD5 0.9680 0.5550 1.6884 0.9088
dqi_tot 1.0025 0.9901 1.0151 0.6944
BMI 0.9926 0.9662 1.0197 0.5902
PUFA_percEng_cat[4.54,5.1 1.0478 0.7206 1.5234 0.8070
PUFA_percEng_cat[5.17,5.9 0.8868 0.6056 1.2986 0.5371
PUFA_percEng_cat[5.92,12. 1.0675 0.7343 1.5517 0.7323
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0286 0.9889 0.8625
cat 6.8811 1.9800 0.0314
IMD 1.6066 3.9463 0.8011
dqi_tot 2.0684 0.9924 0.1490
BMI 1.8498 0.9903 0.1718
PUFA_percEng_cat 5.0558 2.9659 0.1643
GLOBAL 17.2508 22.9415 0.7942
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/pufa-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/pufa-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Alcohol

Crohn’s disease

Code
levels(flare.cd.df$weekly_units_cat) <- c("Less than 0.1 units", "0.1-14 units", "More than 14 units")

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "weekly_units",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/cd/soft-flare/diet/alcohol",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "alcohol-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9240 1.3836 2.6755 0.0001
catFC 50-250 1.3085 0.9267 1.8476 0.1266
catFC > 250 1.9956 1.3676 2.9120 0.0003
IMD2 0.7340 0.3873 1.3909 0.3430
IMD3 0.9118 0.5020 1.6560 0.7616
IMD4 0.8567 0.4732 1.5508 0.6095
IMD5 0.9919 0.5676 1.7332 0.9772
dqi_tot 1.0044 0.9911 1.0179 0.5216
weekly_units_cat0.1-14 un 1.1384 0.7834 1.6543 0.4965
weekly_units_catMore than 1.0104 0.6292 1.6226 0.9657
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2109 1.0000 0.6461
cat 1.0765 2.0000 0.5838
IMD 3.0218 4.0000 0.5542
dqi_tot 0.1535 1.0000 0.6952
weekly_units_cat 1.1095 2.0000 0.5742
GLOBAL 5.4315 10.0001 0.8606
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "weekly_units",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/cd/hard-flare/diet/alcohol",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "alcohol-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3074 0.8674 1.9706 0.2004
catFC 50-250 1.9156 1.2054 3.0442 0.0060
catFC > 250 2.9310 1.7751 4.8395 0.0000
IMD2 0.5551 0.2401 1.2834 0.1687
IMD3 0.7504 0.3435 1.6393 0.4714
IMD4 0.7350 0.3404 1.5870 0.4331
IMD5 0.6713 0.3249 1.3871 0.2818
dqi_tot 1.0020 0.9843 1.0201 0.8254
weekly_units_cat0.1-14 un 1.3116 0.7996 2.1516 0.2827
weekly_units_catMore than 1.0861 0.5763 2.0469 0.7985
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1008 0.9712 0.7397
cat 10.4872 1.9805 0.0052
IMD 2.5684 3.9302 0.6216
dqi_tot 2.7257 0.9911 0.0976
weekly_units_cat 0.4922 1.9803 0.7777
GLOBAL 16.1802 16.4398 0.4716
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "weekly_units",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/uc/soft-flare/diet/alcohol",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "alcohol-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7340 1.2985 2.3157 0.0002
catFC 50-250 1.8738 1.3697 2.5632 0.0001
catFC > 250 2.1340 1.4957 3.0447 0.0000
IMD2 1.4926 0.7851 2.8375 0.2218
IMD3 1.3096 0.7029 2.4399 0.3956
IMD4 1.4079 0.7813 2.5372 0.2549
IMD5 1.2903 0.7222 2.3055 0.3893
dqi_tot 1.0016 0.9889 1.0146 0.8018
weekly_units_cat0.1-14 un 1.2605 0.8651 1.8366 0.2280
weekly_units_catMore than 1.3208 0.8604 2.0276 0.2033
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0219 1.0000 0.8823
cat 3.7394 2.0000 0.1542
IMD 2.5880 4.0000 0.6289
dqi_tot 0.6727 1.0000 0.4121
weekly_units_cat 0.8942 2.0000 0.6395
GLOBAL 8.2012 10.0001 0.6092
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "weekly_units",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/uc/hard-flare/diet/alcohol",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "alcohol-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2522 0.8590 1.8254 0.2422
catFC 50-250 2.0090 1.3172 3.0640 0.0012
catFC > 250 2.5282 1.5529 4.1162 0.0002
IMD2 1.5712 0.5969 4.1361 0.3602
IMD3 1.4267 0.5588 3.6428 0.4574
IMD4 2.4126 1.0098 5.7637 0.0475
IMD5 1.5018 0.6244 3.6119 0.3638
dqi_tot 1.0052 0.9879 1.0229 0.5562
weekly_units_cat0.1-14 un 1.1579 0.7021 1.9096 0.5657
weekly_units_catMore than 1.4369 0.8201 2.5176 0.2052
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1628 0.9862 0.6810
cat 6.9801 1.9586 0.0292
IMD 1.7087 3.9355 0.7810
dqi_tot 0.0256 0.9868 0.8692
weekly_units_cat 0.6344 1.9750 0.7225
GLOBAL 9.7244 17.9992 0.9405
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "weekly_units",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/ibd/soft-flare/diet/alcohol",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7649 1.4258 2.1848 0.0000
catFC 50-250 1.5463 1.2284 1.9464 0.0002
catFC > 250 2.0316 1.5696 2.6296 0.0000
IMD2 1.0056 0.6423 1.5746 0.9805
IMD3 1.0501 0.6841 1.6120 0.8231
IMD4 1.0976 0.7258 1.6600 0.6590
IMD5 1.0840 0.7274 1.6156 0.6918
dqi_tot 1.0028 0.9937 1.0120 0.5491
weekly_units_cat0.1-14 un 1.1767 0.9051 1.5300 0.2243
weekly_units_catMore than 1.1808 0.8651 1.6118 0.2950
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0000 1.0000 0.9960
cat 0.8063 2.0000 0.6682
IMD 4.6788 4.0000 0.3219
dqi_tot 0.9807 1.0000 0.3220
weekly_units_cat 1.5977 2.0000 0.4498
GLOBAL 7.9236 10.0002 0.6363
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "weekly_units",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Alcohol units per week",
  plot_base_path = "plots/ibd/hard-flare/diet/alcohol",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + weekly_units_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/alcohol.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/alcohol"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2291 0.9351 1.6156 0.1391
catFC 50-250 1.9028 1.3959 2.5937 0.0000
catFC > 250 2.6480 1.8736 3.7425 0.0000
IMD2 0.9061 0.4848 1.6936 0.7574
IMD3 1.0103 0.5570 1.8325 0.9731
IMD4 1.3591 0.7756 2.3815 0.2837
IMD5 0.9790 0.5626 1.7035 0.9400
dqi_tot 1.0033 0.9910 1.0158 0.5964
weekly_units_cat0.1-14 un 1.2293 0.8667 1.7436 0.2469
weekly_units_catMore than 1.3030 0.8634 1.9666 0.2075
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1151 0.9883 0.7299
cat 6.5040 1.9789 0.0379
IMD 2.3167 3.9437 0.6693
dqi_tot 1.5553 0.9921 0.2104
weekly_units_cat 0.7209 1.9821 0.6932
GLOBAL 11.2182 22.2382 0.9740
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/alcohol-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/alcohol-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

NOVA score

The SAP states emulsifiers (specifically lecithin) will be investigated. However, data on emulsifiers are not available in the FFQ data extract. As a proxy for emulsifiers, this report will look at ultra-processed foods via Nova scores (Monteiro et al. 2017).

Crohn’s disease

Code
# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "NOVAScore",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Nova score",
  plot_base_path = "plots/cd/soft-flare/diet/nova",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "nova-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9041 1.3630 2.6598 0.0002
catFC 50-250 1.2913 0.9079 1.8365 0.1549
catFC > 250 2.0473 1.3967 3.0011 0.0002
IMD2 0.7306 0.3793 1.4071 0.3479
IMD3 0.9623 0.5254 1.7625 0.9009
IMD4 0.8866 0.4863 1.6165 0.6945
IMD5 1.0227 0.5837 1.7917 0.9376
dqi_tot 1.0058 0.9921 1.0196 0.4099
BMI 1.0091 0.9813 1.0377 0.5237
NOVAScore_catProcessed cu 0.9416 0.6123 1.4480 0.7841
NOVAScore_catProcessed fo 1.1200 0.7347 1.7074 0.5983
NOVAScore_catUltra-proces 1.0418 0.6817 1.5922 0.8497
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2700 1.0000 0.6033
cat 0.7511 2.0000 0.6869
IMD 3.0377 4.0000 0.5515
dqi_tot 0.3613 1.0000 0.5478
BMI 1.3237 1.0000 0.2499
NOVAScore_cat 3.3740 3.0000 0.3375
GLOBAL 7.9593 12.0001 0.7883
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "NOVAScore",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Nova Score",
  plot_base_path = "plots/cd/hard-flare/diet/nova",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "nova-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3765 0.9071 2.0889 0.1332
catFC 50-250 1.9265 1.2064 3.0765 0.0060
catFC > 250 3.0753 1.8471 5.1204 0.0000
IMD2 0.5750 0.2455 1.3464 0.2024
IMD3 0.7991 0.3604 1.7718 0.5810
IMD4 0.7288 0.3351 1.5848 0.4247
IMD5 0.6597 0.3155 1.3792 0.2689
dqi_tot 1.0045 0.9866 1.0228 0.6226
BMI 1.0213 0.9859 1.0579 0.2409
NOVAScore_catProcessed cu 1.4982 0.8659 2.5924 0.1484
NOVAScore_catProcessed fo 1.3744 0.7708 2.4508 0.2812
NOVAScore_catUltra-proces 1.0451 0.5865 1.8623 0.8809
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0551 0.9677 0.8032
cat 10.1241 1.9797 0.0062
IMD 2.6049 3.9203 0.6136
dqi_tot 2.6694 0.9897 0.1009
BMI 1.3680 0.9768 0.2359
NOVAScore_cat 2.7791 2.9458 0.4173
GLOBAL 17.0559 18.9993 0.5860
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "NOVAScore",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Nova score",
  plot_base_path = "plots/uc/soft-flare/diet/nova",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "nova-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6755 1.2539 2.2390 0.0005
catFC 50-250 1.7983 1.3085 2.4713 0.0003
catFC > 250 2.0842 1.4585 2.9783 0.0001
IMD2 1.3629 0.7130 2.6053 0.3490
IMD3 1.1200 0.5942 2.1110 0.7260
IMD4 1.3073 0.7193 2.3759 0.3794
IMD5 1.1683 0.6489 2.1034 0.6041
dqi_tot 0.9997 0.9869 1.0126 0.9617
BMI 0.9764 0.9475 1.0063 0.1206
NOVAScore_catProcessed cu 0.8762 0.5993 1.2810 0.4953
NOVAScore_catProcessed fo 0.8984 0.6159 1.3105 0.5781
NOVAScore_catUltra-proces 0.8615 0.5817 1.2758 0.4568
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0068 1.0000 0.9341
cat 3.5965 2.0000 0.1656
IMD 2.6425 4.0000 0.6193
dqi_tot 0.7671 1.0000 0.3811
BMI 0.9279 1.0000 0.3354
NOVAScore_cat 2.4869 3.0000 0.4777
GLOBAL 11.7588 12.0001 0.4652
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "NOVAScore",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Nova score",
  plot_base_path = "plots/uc/hard-flare/diet/nova",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "nova-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2403 0.8458 1.8188 0.2703
catFC 50-250 2.0398 1.3207 3.1505 0.0013
catFC > 250 2.5646 1.5724 4.1832 0.0002
IMD2 1.7138 0.6466 4.5423 0.2787
IMD3 1.4122 0.5442 3.6644 0.4781
IMD4 2.4869 1.0324 5.9903 0.0422
IMD5 1.4772 0.6083 3.5870 0.3888
dqi_tot 1.0022 0.9846 1.0200 0.8109
BMI 0.9636 0.9235 1.0053 0.0864
NOVAScore_catProcessed cu 1.5453 0.8991 2.6561 0.1153
NOVAScore_catProcessed fo 1.6050 0.9309 2.7674 0.0887
NOVAScore_catUltra-proces 1.4460 0.8215 2.5455 0.2011
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0230 0.9864 0.8756
cat 5.3361 1.9527 0.0664
IMD 1.1314 3.9238 0.8825
dqi_tot 0.0031 0.9868 0.9534
BMI 0.5418 0.9878 0.4569
NOVAScore_cat 5.2061 2.9510 0.1526
GLOBAL 12.9505 19.7960 0.8723
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "NOVAScore",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Nova score",
  plot_base_path = "plots/ibd/soft-flare/diet/nova",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7682 1.4251 2.1939 0.0000
catFC 50-250 1.4961 1.1835 1.8912 0.0008
catFC > 250 2.0124 1.5527 2.6082 0.0000
IMD2 0.9890 0.6278 1.5580 0.9620
IMD3 1.0112 0.6550 1.5611 0.9600
IMD4 1.1080 0.7308 1.6800 0.6290
IMD5 1.0847 0.7257 1.6212 0.6919
dqi_tot 1.0027 0.9935 1.0121 0.5656
BMI 0.9950 0.9752 1.0153 0.6287
NOVAScore_catProcessed cu 0.8931 0.6731 1.1849 0.4331
NOVAScore_catProcessed fo 0.9836 0.7431 1.3020 0.9081
NOVAScore_catUltra-proces 0.9197 0.6909 1.2243 0.5665
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0048 1.0000 0.9445
cat 1.1276 2.0000 0.5690
IMD 5.0570 4.0000 0.2815
dqi_tot 1.3838 1.0000 0.2395
BMI 0.0111 1.0000 0.9162
NOVAScore_cat 3.0069 3.0000 0.3906
GLOBAL 10.9489 12.0002 0.5333
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "NOVAScore",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Nova score",
  plot_base_path = "plots/ibd/hard-flare/diet/nova",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + NOVAScore_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/nova.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/nova"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2847 0.9734 1.6954 0.0768
catFC 50-250 1.8810 1.3722 2.5785 0.0001
catFC > 250 2.7187 1.9203 3.8488 0.0000
IMD2 0.9405 0.5026 1.7600 0.8479
IMD3 0.9990 0.5481 1.8208 0.9973
IMD4 1.3848 0.7883 2.4326 0.2575
IMD5 0.9837 0.5636 1.7171 0.9540
dqi_tot 1.0029 0.9906 1.0154 0.6447
BMI 0.9942 0.9677 1.0215 0.6741
NOVAScore_catProcessed cu 1.4771 1.0092 2.1621 0.0448
NOVAScore_catProcessed fo 1.4512 0.9798 2.1494 0.0631
NOVAScore_catUltra-proces 1.2239 0.8198 1.8272 0.3230
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0289 0.9869 0.8611
cat 6.6825 1.9794 0.0347
IMD 1.5841 3.9431 0.8049
dqi_tot 1.9343 0.9922 0.1627
BMI 2.0039 0.9889 0.1547
NOVAScore_cat 2.8452 2.9706 0.4109
GLOBAL 13.9078 22.7588 0.9241
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/nova-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/nova-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

UPF intake

As an alternative approach to characterising ultra-processed food, we considered the percentage of daily energy intake sourced from ultra-processed food and drink (Nova 4).

Crohn’s disease

Code
# Categorize UPF percentage by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "UPF_perc", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "UPF_perc",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/cd/soft-flare/diet/UPF",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "upf-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9145 1.3685 2.6784 0.0001
catFC 50-250 1.3268 0.9315 1.8898 0.1171
catFC > 250 2.0624 1.4060 3.0252 0.0002
IMD2 0.6973 0.3640 1.3360 0.2772
IMD3 0.9313 0.5110 1.6972 0.8161
IMD4 0.8491 0.4683 1.5396 0.5901
IMD5 0.9655 0.5521 1.6885 0.9020
dqi_tot 1.0053 0.9913 1.0195 0.4614
BMI 1.0076 0.9802 1.0359 0.5903
UPF_perc_cat[36.8,44.3) 1.1193 0.7185 1.7437 0.6182
UPF_perc_cat[44.3,52.6) 1.1578 0.7484 1.7911 0.5104
UPF_perc_cat[52.6,92.5] 0.9745 0.6198 1.5322 0.9109
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2738 1.0000 0.6008
cat 0.7941 2.0000 0.6723
IMD 3.0290 4.0000 0.5530
dqi_tot 0.3616 1.0000 0.5476
BMI 1.2818 1.0000 0.2576
UPF_perc_cat 5.2147 3.0000 0.1567
GLOBAL 10.1947 12.0001 0.5989
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "UPF_perc",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/cd/hard-flare/diet/UPF",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "upf-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3186 0.8713 1.9957 0.1908
catFC 50-250 1.7965 1.1231 2.8737 0.0145
catFC > 250 2.8936 1.7406 4.8105 0.0000
IMD2 0.6606 0.2850 1.5312 0.3337
IMD3 0.8629 0.3905 1.9070 0.7156
IMD4 0.8169 0.3771 1.7698 0.6081
IMD5 0.7533 0.3619 1.5679 0.4488
dqi_tot 1.0010 0.9826 1.0198 0.9154
BMI 1.0199 0.9848 1.0563 0.2691
UPF_perc_cat[36.8,44.3) 1.0173 0.5886 1.7582 0.9510
UPF_perc_cat[44.3,52.6) 0.6137 0.3424 1.1001 0.1011
UPF_perc_cat[52.6,92.5] 0.8593 0.4931 1.4977 0.5928
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0409 0.9749 0.8316
cat 10.3600 1.9766 0.0055
IMD 2.6281 3.9274 0.6106
dqi_tot 2.6978 0.9900 0.0991
BMI 1.2001 0.9812 0.2678
UPF_perc_cat 1.9745 2.9726 0.5726
GLOBAL 18.0051 17.8046 0.4422
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize UPF percentage by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "UPF_perc", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "UPF_perc",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/uc/soft-flare/diet/UPF",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "upf-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6886 1.2634 2.2567 0.0004
catFC 50-250 1.9565 1.4163 2.7028 0.0000
catFC > 250 2.2499 1.5707 3.2228 0.0000
IMD2 1.3050 0.6834 2.4921 0.4200
IMD3 1.0649 0.5652 2.0063 0.8458
IMD4 1.2670 0.6990 2.2968 0.4355
IMD5 1.0858 0.6007 1.9625 0.7852
dqi_tot 0.9944 0.9811 1.0079 0.4132
BMI 0.9753 0.9466 1.0050 0.1018
UPF_perc_cat[36.8,44.3) 0.5985 0.4148 0.8636 0.0061
UPF_perc_cat[44.3,52.6) 0.5624 0.3809 0.8304 0.0038
UPF_perc_cat[52.6,92.5] 0.5871 0.3917 0.8800 0.0099
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0065 0.9990 0.9358
cat 3.3668 1.9979 0.1854
IMD 2.4615 3.9959 0.6509
dqi_tot 0.7873 0.9996 0.3748
BMI 0.8257 0.9994 0.3633
UPF_perc_cat 0.3640 2.9981 0.9475
GLOBAL 8.8670 12.2308 0.7312
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "UPF_perc",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/uc/hard-flare/diet/UPF",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "upf-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2067 0.8251 1.7648 0.3327
catFC 50-250 2.1249 1.3740 3.2864 0.0007
catFC > 250 2.7076 1.6569 4.4246 0.0001
IMD2 1.4523 0.5479 3.8496 0.4531
IMD3 1.2522 0.4827 3.2487 0.6437
IMD4 2.2537 0.9374 5.4182 0.0694
IMD5 1.3310 0.5463 3.2429 0.5292
dqi_tot 0.9973 0.9793 1.0157 0.7755
BMI 0.9576 0.9177 0.9992 0.0459
UPF_perc_cat[36.8,44.3) 0.5626 0.3412 0.9275 0.0241
UPF_perc_cat[44.3,52.6) 0.4536 0.2598 0.7919 0.0054
UPF_perc_cat[52.6,92.5] 0.7752 0.4700 1.2787 0.3187
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0395 0.9884 0.8387
cat 5.1651 1.9539 0.0724
IMD 1.1683 3.9311 0.8770
dqi_tot 0.0010 0.9856 0.9728
BMI 0.5583 0.9861 0.4495
UPF_perc_cat 6.7840 2.9591 0.0768
GLOBAL 13.2005 20.0426 0.8702
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize UPF percentage by quantiles
flare.df <- categorize_by_quantiles(flare.df, "UPF_perc", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "UPF_perc",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/ibd/soft-flare/diet/UPF",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7470 1.4077 2.1679 0.0000
catFC 50-250 1.5065 1.1924 1.9034 0.0006
catFC > 250 2.0201 1.5599 2.6162 0.0000
IMD2 0.9629 0.6117 1.5157 0.8702
IMD3 0.9912 0.6422 1.5298 0.9682
IMD4 1.0878 0.7179 1.6484 0.6914
IMD5 1.0509 0.7025 1.5720 0.8091
dqi_tot 1.0004 0.9909 1.0100 0.9335
BMI 0.9961 0.9765 1.0162 0.7034
UPF_perc_cat[36.8,44.3) 0.8250 0.6262 1.0868 0.1713
UPF_perc_cat[44.3,52.6) 0.8052 0.6071 1.0680 0.1328
UPF_perc_cat[52.6,92.5] 0.7405 0.5512 0.9948 0.0461
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0061 1.0000 0.9379
cat 1.1551 2.0000 0.5613
IMD 4.9207 4.0000 0.2955
dqi_tot 1.3621 1.0000 0.2432
BMI 0.0163 1.0000 0.8983
UPF_perc_cat 2.1786 3.0000 0.5362
GLOBAL 9.4588 12.0002 0.6633
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "UPF_perc",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "UPF as % of energy",
  plot_base_path = "plots/ibd/hard-flare/diet/UPF",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + UPF_perc_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/UPF.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/UPF"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2431 0.9425 1.6397 0.1234
catFC 50-250 1.8265 1.3343 2.5002 0.0002
catFC > 250 2.6243 1.8574 3.7077 0.0000
IMD2 0.9195 0.4916 1.7197 0.7927
IMD3 0.9574 0.5250 1.7459 0.8871
IMD4 1.3706 0.7806 2.4066 0.2724
IMD5 0.9917 0.5670 1.7344 0.9766
dqi_tot 0.9998 0.9871 1.0127 0.9750
BMI 0.9922 0.9657 1.0193 0.5674
UPF_perc_cat[36.8,44.3) 0.7500 0.5232 1.0751 0.1173
UPF_perc_cat[44.3,52.6) 0.5211 0.3508 0.7741 0.0012
UPF_perc_cat[52.6,92.5] 0.8113 0.5607 1.1739 0.2672
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0227 0.9900 0.8776
cat 6.9955 1.9796 0.0296
IMD 1.4707 3.9447 0.8256
dqi_tot 1.8680 0.9920 0.1700
BMI 1.8535 0.9889 0.1710
UPF_perc_cat 4.0100 2.9741 0.2568
GLOBAL 15.7585 22.4833 0.8468
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/UPF-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/UPF-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Processed food subgroups

Breads and cereals

Crohn’s disease

Code
# Categorize bread intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "breadIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "breadIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/breadIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "breadIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8549 1.3254 2.5960 0.0003
catFC 50-250 1.3338 0.9385 1.8956 0.1082
catFC > 250 2.0756 1.4177 3.0388 0.0002
IMD2 0.7180 0.3723 1.3845 0.3227
IMD3 0.9704 0.5295 1.7787 0.9227
IMD4 0.8580 0.4716 1.5612 0.6161
IMD5 1.0216 0.5822 1.7927 0.9406
dqi_tot 1.0053 0.9918 1.0191 0.4432
BMI 1.0101 0.9820 1.0390 0.4866
breadIntake_cat[1.97,3.23 0.6838 0.4456 1.0492 0.0819
breadIntake_cat[3.23,4.84 0.7591 0.4942 1.1659 0.2080
breadIntake_cat[4.84,18.9 0.8312 0.5455 1.2665 0.3896
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2772 1.0000 0.5985
cat 0.7971 2.0000 0.6713
IMD 2.9801 4.0000 0.5612
dqi_tot 0.3946 1.0000 0.5299
BMI 1.3054 1.0000 0.2532
breadIntake_cat 1.5017 3.0000 0.6819
GLOBAL 6.7240 12.0001 0.8753
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "breadIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/breadIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "breadIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2818 0.8447 1.9450 0.2433
catFC 50-250 1.8953 1.1894 3.0202 0.0072
catFC > 250 2.9513 1.7806 4.8916 0.0000
IMD2 0.6239 0.2670 1.4577 0.2759
IMD3 0.8269 0.3720 1.8380 0.6409
IMD4 0.7789 0.3576 1.6967 0.5294
IMD5 0.7324 0.3497 1.5338 0.4089
dqi_tot 1.0028 0.9848 1.0211 0.7634
BMI 1.0211 0.9852 1.0582 0.2523
breadIntake_cat[1.97,3.23 0.6760 0.3934 1.1616 0.1563
breadIntake_cat[3.23,4.84 0.6910 0.3951 1.2083 0.1948
breadIntake_cat[4.84,18.9 0.6121 0.3483 1.0758 0.0880
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0425 0.9718 0.8275
cat 10.1284 1.9763 0.0061
IMD 2.7110 3.9248 0.5955
dqi_tot 2.7449 0.9888 0.0961
BMI 1.2185 0.9801 0.2639
breadIntake_cat 1.3541 2.9611 0.7096
GLOBAL 18.0861 18.7513 0.5002
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize bread intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "breadIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "breadIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/breadIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "breadIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5974 1.1901 2.1439 0.0018
catFC 50-250 1.8289 1.3305 2.5139 0.0002
catFC > 250 2.0796 1.4545 2.9734 0.0001
IMD2 1.3869 0.7273 2.6447 0.3206
IMD3 1.1062 0.5857 2.0892 0.7558
IMD4 1.2738 0.7010 2.3144 0.4271
IMD5 1.1090 0.6140 2.0030 0.7317
dqi_tot 0.9994 0.9868 1.0122 0.9267
BMI 0.9753 0.9463 1.0051 0.1038
breadIntake_cat[1.97,3.23 1.3883 0.9667 1.9938 0.0756
breadIntake_cat[3.23,4.84 0.9952 0.6658 1.4876 0.9815
breadIntake_cat[4.84,18.9 0.7822 0.5191 1.1787 0.2403
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0088 1.0000 0.9253
cat 3.5302 2.0000 0.1712
IMD 2.4471 4.0000 0.6541
dqi_tot 0.7841 1.0000 0.3759
BMI 1.0910 1.0000 0.2962
breadIntake_cat 7.5792 3.0000 0.0556
GLOBAL 16.2972 12.0001 0.1780
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "breadIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/breadIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "breadIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1108 0.7546 1.6353 0.5942
catFC 50-250 2.0656 1.3386 3.1876 0.0010
catFC > 250 2.5389 1.5578 4.1380 0.0002
IMD2 1.4995 0.5674 3.9625 0.4138
IMD3 1.2679 0.4881 3.2937 0.6261
IMD4 2.2312 0.9250 5.3818 0.0740
IMD5 1.3244 0.5436 3.2265 0.5363
dqi_tot 1.0023 0.9846 1.0202 0.8025
BMI 0.9618 0.9222 1.0032 0.0700
breadIntake_cat[1.97,3.23 1.3021 0.7918 2.1411 0.2983
breadIntake_cat[3.23,4.84 1.1248 0.6651 1.9022 0.6609
breadIntake_cat[4.84,18.9 0.6735 0.3785 1.1986 0.1789
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0579 0.9871 0.8054
cat 5.1146 1.9520 0.0742
IMD 1.2813 3.9305 0.8576
dqi_tot 0.0007 0.9866 0.9770
BMI 0.5239 0.9883 0.4645
breadIntake_cat 3.5288 2.9512 0.3095
GLOBAL 11.1126 19.6917 0.9368
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize bread intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "breadIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "breadIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/breadIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7298 1.3914 2.1506 0.0000
catFC 50-250 1.5032 1.1900 1.8989 0.0006
catFC > 250 2.0014 1.5449 2.5927 0.0000
IMD2 0.9930 0.6309 1.5629 0.9758
IMD3 1.0106 0.6549 1.5593 0.9621
IMD4 1.1187 0.7383 1.6949 0.5968
IMD5 1.0831 0.7252 1.6177 0.6966
dqi_tot 1.0025 0.9932 1.0118 0.6035
BMI 0.9952 0.9753 1.0154 0.6369
breadIntake_cat[1.97,3.23 1.0110 0.7695 1.3284 0.9371
breadIntake_cat[3.23,4.84 0.8747 0.6552 1.1678 0.3640
breadIntake_cat[4.84,18.9 0.8229 0.6141 1.1027 0.1918
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0067 1.0000 0.9346
cat 1.1012 2.0000 0.5766
IMD 4.9448 4.0000 0.2930
dqi_tot 1.4125 1.0000 0.2346
BMI 0.0107 1.0000 0.9175
breadIntake_cat 1.9383 3.0000 0.5853
GLOBAL 9.5634 12.0002 0.6542
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "breadIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Bread/cereal intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/breadIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + breadIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/breadIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/breadIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1999 0.9078 1.5860 0.2003
catFC 50-250 1.8702 1.3660 2.5605 0.0001
catFC > 250 2.6057 1.8425 3.6850 0.0000
IMD2 0.9120 0.4876 1.7058 0.7731
IMD3 0.9527 0.5226 1.7370 0.8745
IMD4 1.3641 0.7767 2.3957 0.2798
IMD5 0.9665 0.5544 1.6848 0.9043
dqi_tot 1.0028 0.9903 1.0154 0.6668
BMI 0.9910 0.9646 1.0182 0.5140
breadIntake_cat[1.97,3.23 1.0072 0.7018 1.4455 0.9691
breadIntake_cat[3.23,4.84 0.9468 0.6516 1.3759 0.7744
breadIntake_cat[4.84,18.9 0.6680 0.4480 0.9960 0.0478
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0416 0.9886 0.8347
cat 6.6262 1.9786 0.0356
IMD 1.6491 3.9447 0.7931
dqi_tot 1.9561 0.9920 0.1603
BMI 1.7776 0.9887 0.1800
breadIntake_cat 0.3860 2.9751 0.9414
GLOBAL 12.2429 22.9608 0.9661
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/breadIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/breadIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Sweets and desserts/snack foods

Crohn’s disease

Code
# Categorize sweet intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "sweetIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "sweetIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/sweetIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "sweetIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8949 1.3541 2.6516 0.0002
catFC 50-250 1.3187 0.9275 1.8750 0.1234
catFC > 250 2.0504 1.4008 3.0011 0.0002
IMD2 0.7147 0.3722 1.3726 0.3131
IMD3 0.9678 0.5283 1.7728 0.9155
IMD4 0.8756 0.4816 1.5917 0.6630
IMD5 1.0159 0.5800 1.7795 0.9559
dqi_tot 1.0056 0.9918 1.0196 0.4272
BMI 1.0077 0.9799 1.0363 0.5920
sweetIntake_cat[2.83,4.36 1.0612 0.7023 1.6036 0.7778
sweetIntake_cat[4.36,6.17 0.8063 0.5172 1.2571 0.3421
sweetIntake_cat[6.17,17.3 1.0362 0.6645 1.6157 0.8754
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2861 1.0000 0.5928
cat 0.8500 2.0000 0.6538
IMD 3.0084 4.0000 0.5564
dqi_tot 0.3710 1.0000 0.5425
BMI 1.3535 1.0000 0.2447
sweetIntake_cat 10.1113 3.0000 0.0176
GLOBAL 15.2266 12.0001 0.2293
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "sweetIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/sweetIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "sweetIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3925 0.9159 2.1172 0.1214
catFC 50-250 1.8455 1.1581 2.9407 0.0100
catFC > 250 2.9263 1.7688 4.8413 0.0000
IMD2 0.6548 0.2812 1.5249 0.3263
IMD3 0.8444 0.3807 1.8729 0.6774
IMD4 0.8018 0.3683 1.7454 0.5778
IMD5 0.7467 0.3585 1.5553 0.4352
dqi_tot 1.0025 0.9845 1.0209 0.7851
BMI 1.0194 0.9841 1.0561 0.2851
sweetIntake_cat[2.83,4.36 0.7477 0.4309 1.2972 0.3010
sweetIntake_cat[4.36,6.17 0.7720 0.4479 1.3306 0.3515
sweetIntake_cat[6.17,17.3 0.9325 0.5337 1.6294 0.8062
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0651 0.9718 0.7885
cat 10.1084 1.9788 0.0062
IMD 2.6137 3.9315 0.6138
dqi_tot 2.7412 0.9905 0.0965
BMI 1.0543 0.9802 0.2983
sweetIntake_cat 0.6600 2.9648 0.8787
GLOBAL 17.0427 18.1954 0.5334
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize sweet intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "sweetIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "sweetIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/sweetIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "sweetIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7292 1.2927 2.3131 0.0002
catFC 50-250 1.8689 1.3547 2.5782 0.0001
catFC > 250 2.0887 1.4617 2.9848 0.0001
IMD2 1.3991 0.7344 2.6653 0.3071
IMD3 1.1566 0.6119 2.1863 0.6542
IMD4 1.3474 0.7434 2.4423 0.3258
IMD5 1.1844 0.6576 2.1333 0.5729
dqi_tot 0.9978 0.9850 1.0108 0.7425
BMI 0.9767 0.9479 1.0063 0.1216
sweetIntake_cat[2.83,4.36 0.7848 0.5340 1.1534 0.2174
sweetIntake_cat[4.36,6.17 0.7567 0.5144 1.1130 0.1568
sweetIntake_cat[6.17,17.3 0.7399 0.5054 1.0830 0.1212
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0034 1.0000 0.9532
cat 3.4572 2.0000 0.1775
IMD 2.5656 4.0000 0.6329
dqi_tot 0.7507 1.0000 0.3862
BMI 0.8299 1.0000 0.3623
sweetIntake_cat 1.0874 3.0000 0.7801
GLOBAL 9.2010 12.0001 0.6857
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "sweetIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/sweetIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "sweetIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2478 0.8519 1.8277 0.2555
catFC 50-250 2.2171 1.4295 3.4385 0.0004
catFC > 250 2.6535 1.6269 4.3280 0.0001
IMD2 1.4938 0.5653 3.9472 0.4182
IMD3 1.2641 0.4863 3.2855 0.6306
IMD4 2.3158 0.9616 5.5768 0.0611
IMD5 1.4183 0.5832 3.4491 0.4409
dqi_tot 1.0008 0.9832 1.0187 0.9302
BMI 0.9600 0.9204 1.0014 0.0584
sweetIntake_cat[2.83,4.36 0.6915 0.4125 1.1592 0.1617
sweetIntake_cat[4.36,6.17 0.5093 0.2909 0.8916 0.0182
sweetIntake_cat[6.17,17.3 0.8931 0.5484 1.4543 0.6495
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0144 0.9879 0.9017
cat 5.0681 1.9578 0.0763
IMD 1.2835 3.9288 0.8571
dqi_tot 0.0006 0.9853 0.9790
BMI 0.6578 0.9881 0.4128
sweetIntake_cat 1.2028 2.9501 0.7441
GLOBAL 8.3018 19.3980 0.9862
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize sweet intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "sweetIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "sweetIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/sweetIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7904 1.4429 2.2216 0.0000
catFC 50-250 1.5176 1.2007 1.9180 0.0005
catFC > 250 2.0398 1.5742 2.6432 0.0000
IMD2 0.9882 0.6277 1.5558 0.9591
IMD3 1.0169 0.6583 1.5708 0.9398
IMD4 1.1179 0.7371 1.6953 0.6000
IMD5 1.0921 0.7300 1.6340 0.6680
dqi_tot 1.0016 0.9923 1.0111 0.7334
BMI 0.9945 0.9747 1.0147 0.5895
sweetIntake_cat[2.83,4.36 0.9113 0.6895 1.2045 0.5140
sweetIntake_cat[4.36,6.17 0.7899 0.5917 1.0544 0.1095
sweetIntake_cat[6.17,17.3 0.8874 0.6664 1.1815 0.4133
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0085 1.0000 0.9267
cat 1.1156 2.0000 0.5725
IMD 4.9991 4.0000 0.2874
dqi_tot 1.3854 1.0000 0.2392
BMI 0.0158 1.0000 0.9000
sweetIntake_cat 3.4165 3.0000 0.3318
GLOBAL 10.7231 12.0002 0.5528
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "sweetIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Sweet/dessert/snack intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/sweetIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + sweetIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/sweetIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/sweetIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3142 0.9958 1.7344 0.0536
catFC 50-250 1.9148 1.3966 2.6252 0.0001
catFC > 250 2.7022 1.9120 3.8189 0.0000
IMD2 0.9503 0.5082 1.7771 0.8732
IMD3 0.9898 0.5425 1.8057 0.9733
IMD4 1.4306 0.8128 2.5181 0.2145
IMD5 1.0293 0.5888 1.7993 0.9193
dqi_tot 1.0008 0.9883 1.0135 0.8997
BMI 0.9918 0.9652 1.0191 0.5507
sweetIntake_cat[2.83,4.36 0.7056 0.4852 1.0260 0.0679
sweetIntake_cat[4.36,6.17 0.6232 0.4235 0.9171 0.0164
sweetIntake_cat[6.17,17.3 0.9359 0.6504 1.3467 0.7213
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0198 0.9883 0.8850
cat 6.5739 1.9810 0.0367
IMD 1.5344 3.9465 0.8143
dqi_tot 1.9481 0.9928 0.1614
BMI 1.8910 0.9895 0.1669
sweetIntake_cat 1.2166 2.9700 0.7441
GLOBAL 13.0420 22.4327 0.9409
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/sweetIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/sweetIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Artificially and sugar-sweetened beverages

Crohn’s disease

Code
# Categorize drink intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "drinkIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "drinkIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/drinkIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "drinkIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9387 1.3871 2.7097 0.0001
catFC 50-250 1.3069 0.9204 1.8556 0.1346
catFC > 250 2.0454 1.3967 2.9956 0.0002
IMD2 0.6844 0.3543 1.3220 0.2589
IMD3 0.9238 0.5071 1.6829 0.7957
IMD4 0.8419 0.4637 1.5286 0.5717
IMD5 0.9577 0.5483 1.6727 0.8792
dqi_tot 1.0050 0.9913 1.0189 0.4744
BMI 1.0118 0.9847 1.0397 0.3967
drinkIntake_cat[0.301,4.2 0.9939 0.6424 1.5378 0.9781
drinkIntake_cat[4.21,14.4 0.9088 0.5884 1.4038 0.6665
drinkIntake_cat[14.4,120] 0.7704 0.5103 1.1632 0.2147
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2680 1.0000 0.6047
cat 0.7967 2.0000 0.6714
IMD 3.0215 4.0000 0.5542
dqi_tot 0.3622 1.0000 0.5473
BMI 1.2701 1.0000 0.2597
drinkIntake_cat 3.7125 3.0000 0.2942
GLOBAL 8.2120 12.0001 0.7684
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "drinkIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/drinkIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "drinkIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3563 0.8966 2.0518 0.1490
catFC 50-250 1.8557 1.1651 2.9557 0.0092
catFC > 250 2.8668 1.7284 4.7549 0.0000
IMD2 0.6255 0.2693 1.4530 0.2752
IMD3 0.8000 0.3630 1.7633 0.5800
IMD4 0.7414 0.3439 1.5984 0.4452
IMD5 0.6791 0.3274 1.4089 0.2987
dqi_tot 1.0016 0.9835 1.0200 0.8630
BMI 1.0224 0.9879 1.0582 0.2055
drinkIntake_cat[0.301,4.2 0.9249 0.5338 1.6026 0.7807
drinkIntake_cat[4.21,14.4 0.7356 0.4179 1.2950 0.2873
drinkIntake_cat[14.4,120] 0.7043 0.4133 1.2000 0.1973
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0773 0.9732 0.7711
cat 10.2074 1.9787 0.0059
IMD 2.6390 3.9298 0.6090
dqi_tot 2.8909 0.9919 0.0881
BMI 1.1251 0.9790 0.2824
drinkIntake_cat 1.3282 2.9696 0.7173
GLOBAL 18.0110 17.9838 0.4538
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize drink intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "drinkIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "drinkIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/drinkIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "drinkIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7014 1.2739 2.2724 0.0003
catFC 50-250 1.7909 1.3030 2.4616 0.0003
catFC > 250 2.1016 1.4714 3.0016 0.0000
IMD2 1.4569 0.7625 2.7838 0.2546
IMD3 1.1699 0.6213 2.2028 0.6270
IMD4 1.3703 0.7558 2.4846 0.2994
IMD5 1.1926 0.6627 2.1462 0.5568
dqi_tot 0.9987 0.9859 1.0117 0.8487
BMI 0.9755 0.9462 1.0058 0.1118
drinkIntake_cat[0.301,4.2 0.8015 0.5556 1.1561 0.2364
drinkIntake_cat[4.21,14.4 0.9130 0.6222 1.3397 0.6418
drinkIntake_cat[14.4,120] 0.8593 0.5746 1.2849 0.4600
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0079 1.0000 0.9293
cat 3.6394 2.0000 0.1621
IMD 2.6102 4.0000 0.6250
dqi_tot 0.7818 1.0000 0.3766
BMI 0.9537 1.0000 0.3288
drinkIntake_cat 0.5990 3.0000 0.8967
GLOBAL 9.3916 12.0001 0.6692
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "drinkIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/drinkIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "drinkIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2449 0.8499 1.8236 0.2607
catFC 50-250 2.1052 1.3646 3.2477 0.0008
catFC > 250 2.4862 1.5237 4.0568 0.0003
IMD2 1.7016 0.6410 4.5171 0.2859
IMD3 1.4188 0.5468 3.6820 0.4721
IMD4 2.3502 0.9770 5.6535 0.0564
IMD5 1.5243 0.6283 3.6983 0.3512
dqi_tot 1.0026 0.9849 1.0206 0.7761
BMI 0.9550 0.9149 0.9969 0.0356
drinkIntake_cat[0.301,4.2 0.7606 0.4436 1.3041 0.3199
drinkIntake_cat[4.21,14.4 1.3462 0.7968 2.2744 0.2666
drinkIntake_cat[14.4,120] 1.2901 0.7450 2.2340 0.3632
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0245 0.9892 0.8725
cat 5.2533 1.9559 0.0694
IMD 1.2098 3.9323 0.8701
dqi_tot 0.0022 0.9840 0.9609
BMI 0.5083 0.9895 0.4717
drinkIntake_cat 0.7603 2.9415 0.8516
GLOBAL 8.8895 19.2237 0.9776
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize drink intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "drinkIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "drinkIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/drinkIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7889 1.4415 2.2201 0.0000
catFC 50-250 1.5012 1.1881 1.8969 0.0007
catFC > 250 2.0239 1.5627 2.6213 0.0000
IMD2 0.9935 0.6312 1.5639 0.9776
IMD3 1.0123 0.6563 1.5615 0.9558
IMD4 1.1166 0.7371 1.6915 0.6028
IMD5 1.0689 0.7158 1.5962 0.7446
dqi_tot 1.0018 0.9925 1.0112 0.7089
BMI 0.9969 0.9771 1.0171 0.7582
drinkIntake_cat[0.301,4.2 0.8903 0.6737 1.1767 0.4143
drinkIntake_cat[4.21,14.4 0.8810 0.6620 1.1724 0.3847
drinkIntake_cat[14.4,120] 0.7940 0.5968 1.0562 0.1131
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0048 1.0000 0.9450
cat 1.0779 2.0000 0.5834
IMD 5.0199 4.0000 0.2853
dqi_tot 1.3981 1.0000 0.2370
BMI 0.0131 1.0000 0.9090
drinkIntake_cat 2.4121 3.0000 0.4914
GLOBAL 10.1127 12.0002 0.6061
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "drinkIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Artificially and sugar-sweetened drink intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/drinkIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + drinkIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/drinkIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/drinkIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2599 0.9561 1.6602 0.1007
catFC 50-250 1.8566 1.3558 2.5423 0.0001
catFC > 250 2.6100 1.8476 3.6871 0.0000
IMD2 0.9362 0.5011 1.7492 0.8362
IMD3 0.9624 0.5281 1.7539 0.9003
IMD4 1.3519 0.7701 2.3734 0.2937
IMD5 0.9825 0.5630 1.7147 0.9506
dqi_tot 1.0025 0.9901 1.0151 0.6931
BMI 0.9913 0.9647 1.0187 0.5304
drinkIntake_cat[0.301,4.2 0.8415 0.5749 1.2319 0.3749
drinkIntake_cat[4.21,14.4 0.9888 0.6803 1.4373 0.9531
drinkIntake_cat[14.4,120] 0.9565 0.6543 1.3981 0.8183
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0391 0.9891 0.8399
cat 6.9377 1.9802 0.0305
IMD 1.5860 3.9442 0.8046
dqi_tot 1.9924 0.9924 0.1566
BMI 1.8574 0.9907 0.1710
drinkIntake_cat 0.6547 2.9754 0.8811
GLOBAL 12.9558 22.6243 0.9466
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/drinkIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/drinkIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Animal-based products (processed meat)

Crohn’s disease

Code
# Categorize processed meat intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "processedMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "processedMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/processedMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedMeatIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9199 1.3724 2.6857 0.0001
catFC 50-250 1.2723 0.8939 1.8109 0.1811
catFC > 250 1.9885 1.3563 2.9153 0.0004
IMD2 0.7296 0.3805 1.3992 0.3427
IMD3 0.9467 0.5172 1.7326 0.8589
IMD4 0.8582 0.4738 1.5542 0.6137
IMD5 1.0046 0.5749 1.7554 0.9872
dqi_tot 1.0084 0.9938 1.0232 0.2606
BMI 1.0066 0.9790 1.0350 0.6424
processedMeatIntake_cat[0 1.0300 0.6543 1.6213 0.8984
processedMeatIntake_cat[1 1.2643 0.8094 1.9749 0.3026
processedMeatIntake_cat[2 1.1644 0.7125 1.9030 0.5437
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2725 1.0000 0.6016
cat 0.7333 2.0000 0.6931
IMD 2.9914 4.0000 0.5593
dqi_tot 0.3530 1.0000 0.5524
BMI 1.3234 1.0000 0.2500
processedMeatIntake_cat 0.6750 3.0000 0.8791
GLOBAL 5.8796 12.0001 0.9220
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "processedMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/processedMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedMeatIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3115 0.8651 1.9881 0.2015
catFC 50-250 1.8233 1.1442 2.9052 0.0115
catFC > 250 2.8472 1.7164 4.7231 0.0001
IMD2 0.6080 0.2606 1.4187 0.2498
IMD3 0.7856 0.3533 1.7468 0.5539
IMD4 0.7381 0.3410 1.5978 0.4409
IMD5 0.6906 0.3291 1.4492 0.3276
dqi_tot 1.0026 0.9834 1.0222 0.7908
BMI 1.0181 0.9829 1.0546 0.3168
processedMeatIntake_cat[0 1.0403 0.5762 1.8782 0.8958
processedMeatIntake_cat[1 1.2417 0.7073 2.1799 0.4509
processedMeatIntake_cat[2 0.8596 0.4488 1.6465 0.6482
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0592 0.9759 0.7994
cat 10.2015 1.9786 0.0059
IMD 2.7767 3.9304 0.5849
dqi_tot 2.8063 0.9895 0.0926
BMI 1.0919 0.9828 0.2907
processedMeatIntake_cat 0.6043 2.9621 0.8915
GLOBAL 17.3198 18.0697 0.5060
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize processed meat intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "processedMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "processedMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/processedMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedMeatIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6876 1.2597 2.2607 0.0005
catFC 50-250 1.8379 1.3343 2.5317 0.0002
catFC > 250 2.1064 1.4712 3.0160 0.0000
IMD2 1.3897 0.7283 2.6515 0.3182
IMD3 1.1285 0.5988 2.1269 0.7085
IMD4 1.3316 0.7349 2.4125 0.3450
IMD5 1.1648 0.6464 2.0992 0.6116
dqi_tot 0.9975 0.9837 1.0116 0.7285
BMI 0.9775 0.9486 1.0074 0.1392
processedMeatIntake_cat[0 0.7309 0.4976 1.0736 0.1100
processedMeatIntake_cat[1 0.8183 0.5511 1.2152 0.3204
processedMeatIntake_cat[2 0.8006 0.5248 1.2213 0.3020
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0021 1.0000 0.9639
cat 3.5998 2.0000 0.1653
IMD 2.6384 4.0000 0.6200
dqi_tot 0.7445 1.0000 0.3882
BMI 0.9629 1.0000 0.3265
processedMeatIntake_cat 1.8816 3.0000 0.5973
GLOBAL 11.4615 12.0001 0.4898
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "processedMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/processedMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedMeatIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2333 0.8371 1.8170 0.2889
catFC 50-250 1.9897 1.2858 3.0790 0.0020
catFC > 250 2.4280 1.4846 3.9708 0.0004
IMD2 1.6005 0.6064 4.2242 0.3422
IMD3 1.3379 0.5162 3.4673 0.5491
IMD4 2.3690 0.9851 5.6971 0.0540
IMD5 1.4421 0.5929 3.5077 0.4195
dqi_tot 1.0050 0.9861 1.0244 0.6065
BMI 0.9602 0.9204 1.0017 0.0600
processedMeatIntake_cat[0 1.1841 0.7006 2.0012 0.5279
processedMeatIntake_cat[1 1.1236 0.6408 1.9702 0.6842
processedMeatIntake_cat[2 1.3063 0.7237 2.3581 0.3752
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0299 0.9888 0.8593
cat 5.5116 1.9552 0.0609
IMD 1.2369 3.9299 0.8652
dqi_tot 0.0003 0.9856 0.9847
BMI 0.5831 0.9897 0.4411
processedMeatIntake_cat 3.3900 2.9535 0.3279
GLOBAL 11.4414 19.6258 0.9251
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize processed meat intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "processedMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "processedMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/processedMeatIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7738 1.4278 2.2036 0.0000
catFC 50-250 1.5001 1.1855 1.8983 0.0007
catFC > 250 2.0101 1.5496 2.6074 0.0000
IMD2 0.9877 0.6276 1.5545 0.9575
IMD3 1.0248 0.6636 1.5825 0.9122
IMD4 1.1136 0.7352 1.6867 0.6116
IMD5 1.0896 0.7293 1.6280 0.6754
dqi_tot 1.0029 0.9929 1.0129 0.5767
BMI 0.9945 0.9747 1.0148 0.5936
processedMeatIntake_cat[0 0.8575 0.6408 1.1474 0.3008
processedMeatIntake_cat[1 1.0003 0.7466 1.3401 0.9984
processedMeatIntake_cat[2 0.9493 0.6912 1.3037 0.7479
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0058 1.0000 0.9393
cat 1.0843 2.0000 0.5815
IMD 5.0889 4.0000 0.2783
dqi_tot 1.4005 1.0000 0.2366
BMI 0.0083 1.0000 0.9273
processedMeatIntake_cat 1.8553 3.0000 0.6030
GLOBAL 10.5504 12.0002 0.5678
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "processedMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed meat intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/processedMeatIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/processedMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/processedMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2601 0.9534 1.6654 0.1043
catFC 50-250 1.8272 1.3323 2.5059 0.0002
catFC > 250 2.5606 1.8081 3.6263 0.0000
IMD2 0.9287 0.4958 1.7396 0.8173
IMD3 0.9532 0.5216 1.7420 0.8762
IMD4 1.3466 0.7662 2.3665 0.3010
IMD5 0.9717 0.5549 1.7016 0.9200
dqi_tot 1.0034 0.9900 1.0170 0.6229
BMI 0.9921 0.9656 1.0192 0.5622
processedMeatIntake_cat[0 1.0861 0.7356 1.6036 0.6779
processedMeatIntake_cat[1 1.1960 0.8077 1.7709 0.3716
processedMeatIntake_cat[2 1.0518 0.6819 1.6223 0.8194
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0299 0.9898 0.8597
cat 6.8809 1.9794 0.0314
IMD 1.6227 3.9444 0.7979
dqi_tot 2.0094 0.9907 0.1545
BMI 1.9520 0.9903 0.1604
processedMeatIntake_cat 2.9126 2.9733 0.4006
GLOBAL 14.6590 22.6204 0.8958
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/processedMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/processedMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Plant-based alternatives

Crohn’s disease

Code
# Categorize processed plant intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "processedPlantIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "processedPlantIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/processedPlantIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedPlantIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9000 1.3617 2.6512 0.0002
catFC 50-250 1.2962 0.9130 1.8402 0.1468
catFC > 250 2.0441 1.3974 2.9900 0.0002
IMD2 0.6911 0.3602 1.3258 0.2663
IMD3 0.9222 0.5061 1.6805 0.7914
IMD4 0.8536 0.4718 1.5443 0.6008
IMD5 0.9828 0.5640 1.7128 0.9513
dqi_tot 1.0050 0.9912 1.0190 0.4807
BMI 1.0083 0.9809 1.0364 0.5561
processedPlantIntake_cat[ 1.1581 0.8189 1.6379 0.4064
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2615 1.0000 0.6091
cat 0.7725 2.0000 0.6796
IMD 3.0236 4.0000 0.5539
dqi_tot 0.3814 1.0000 0.5369
BMI 1.2745 1.0000 0.2589
processedPlantIntake_cat 0.1920 1.0000 0.6613
GLOBAL 5.5195 10.0001 0.8539
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "processedPlantIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/processedPlantIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedPlantIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3411 0.8879 2.0257 0.1630
catFC 50-250 1.8471 1.1607 2.9394 0.0096
catFC > 250 2.9260 1.7696 4.8379 0.0000
IMD2 0.6122 0.2647 1.4157 0.2513
IMD3 0.8044 0.3653 1.7712 0.5889
IMD4 0.7524 0.3492 1.6211 0.4676
IMD5 0.7063 0.3416 1.4603 0.3480
dqi_tot 1.0025 0.9844 1.0210 0.7861
BMI 1.0184 0.9834 1.0547 0.3070
processedPlantIntake_cat[ 1.1481 0.7332 1.7978 0.5461
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0587 0.9730 0.7991
cat 10.3351 1.9797 0.0056
IMD 2.6687 3.9328 0.6042
dqi_tot 2.7554 0.9896 0.0956
BMI 1.1366 0.9814 0.2807
processedPlantIntake_cat 0.0891 0.9900 0.7616
GLOBAL 17.0586 15.8412 0.3711
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize processed plant intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "processedPlantIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "processedPlantIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/processedPlantIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedPlantIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6856 1.2624 2.2507 0.0004
catFC 50-250 1.8090 1.3150 2.4885 0.0003
catFC > 250 2.0717 1.4515 2.9570 0.0001
IMD2 1.4160 0.7437 2.6958 0.2897
IMD3 1.1473 0.6108 2.1551 0.6693
IMD4 1.3481 0.7453 2.4385 0.3233
IMD5 1.1873 0.6609 2.1331 0.5657
dqi_tot 0.9989 0.9860 1.0119 0.8640
BMI 0.9761 0.9474 1.0056 0.1119
processedPlantIntake_cat[ 1.0707 0.7769 1.4755 0.6765
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0050 1.0000 0.9435
cat 3.5698 2.0000 0.1678
IMD 2.5950 4.0000 0.6277
dqi_tot 0.7488 1.0000 0.3869
BMI 0.9742 1.0000 0.3236
processedPlantIntake_cat 1.1736 1.0000 0.2787
GLOBAL 8.8987 10.0001 0.5418
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "processedPlantIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/processedPlantIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "processedPlantIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2233 0.8353 1.7915 0.3005
catFC 50-250 1.9811 1.2828 3.0596 0.0020
catFC > 250 2.4871 1.5282 4.0477 0.0002
IMD2 1.5340 0.5818 4.0444 0.3870
IMD3 1.2889 0.5001 3.3218 0.5993
IMD4 2.3256 0.9708 5.5712 0.0583
IMD5 1.3975 0.5782 3.3777 0.4573
dqi_tot 1.0036 0.9859 1.0217 0.6899
BMI 0.9612 0.9217 1.0025 0.0649
processedPlantIntake_cat[ 0.7892 0.4980 1.2506 0.3136
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0305 0.9874 0.8577
cat 5.4999 1.9554 0.0613
IMD 1.2414 3.9288 0.8643
dqi_tot 0.0020 0.9851 0.9621
BMI 0.5662 0.9888 0.4474
processedPlantIntake_cat 3.4042 0.9842 0.0636
GLOBAL 11.1370 17.6787 0.8769
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize processed plant intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "processedPlantIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "processedPlantIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/processedPlantIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7684 1.4261 2.1928 0.0000
catFC 50-250 1.5022 1.1893 1.8975 0.0006
catFC > 250 2.0154 1.5564 2.6099 0.0000
IMD2 0.9812 0.6238 1.5434 0.9347
IMD3 1.0036 0.6504 1.5486 0.9872
IMD4 1.1042 0.7291 1.6722 0.6397
IMD5 1.0751 0.7199 1.6056 0.7233
dqi_tot 1.0021 0.9927 1.0115 0.6643
BMI 0.9945 0.9749 1.0145 0.5870
processedPlantIntake_cat[ 1.0751 0.8519 1.3569 0.5419
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0052 1.0000 0.9428
cat 1.0830 2.0000 0.5819
IMD 5.0486 4.0000 0.2824
dqi_tot 1.3966 1.0000 0.2373
BMI 0.0079 1.0000 0.9290
processedPlantIntake_cat 1.0240 1.0000 0.3116
GLOBAL 8.6179 10.0002 0.5687
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "processedPlantIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Processed plant-based alternative intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/processedPlantIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + processedPlantIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/processedPlantIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/processedPlantIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2614 0.9571 1.6624 0.0992
catFC 50-250 1.8514 1.3523 2.5348 0.0001
catFC > 250 2.6033 1.8429 3.6774 0.0000
IMD2 0.9248 0.4953 1.7265 0.8060
IMD3 0.9545 0.5242 1.7380 0.8790
IMD4 1.3442 0.7663 2.3579 0.3023
IMD5 0.9743 0.5590 1.6982 0.9268
dqi_tot 1.0029 0.9904 1.0156 0.6504
BMI 0.9920 0.9657 1.0191 0.5609
processedPlantIntake_cat[ 0.9551 0.6958 1.3110 0.7761
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0338 0.9886 0.8506
cat 6.8441 1.9799 0.0320
IMD 1.6035 3.9456 0.8016
dqi_tot 2.0050 0.9925 0.1553
BMI 1.8960 0.9889 0.1663
processedPlantIntake_cat 1.4651 0.9928 0.2243
GLOBAL 13.3482 20.6346 0.8844
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/processedPlantIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/processedPlantIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Un-processed/minimally processed food subgroups

Fruit

Crohn’s disease

Code
# Categorize fruit intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "fruitIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fruitIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/fruitIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fruitIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fruitIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8801 1.3416 2.6347 0.0002
catFC 50-250 1.3110 0.9224 1.8633 0.1311
catFC > 250 2.0366 1.3915 2.9809 0.0003
IMD2 0.7110 0.3703 1.3654 0.3056
IMD3 0.9318 0.5089 1.7062 0.8189
IMD4 0.8559 0.4727 1.5497 0.6075
IMD5 0.9888 0.5665 1.7259 0.9684
dqi_tot 1.0053 0.9897 1.0212 0.5090
BMI 1.0086 0.9813 1.0367 0.5410
fruitIntake_cat[2.1,5.64) 1.1255 0.7253 1.7464 0.5980
fruitIntake_cat[5.64,10.4 1.0556 0.6734 1.6548 0.8136
fruitIntake_cat[10.4,62.9 1.0500 0.6325 1.7433 0.8503
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2610 1.0000 0.6094
cat 0.8034 2.0000 0.6692
IMD 3.0519 4.0000 0.5492
dqi_tot 0.3626 1.0000 0.5470
BMI 1.3223 1.0000 0.2502
fruitIntake_cat 0.5976 3.0000 0.8970
GLOBAL 6.3144 12.0001 0.8994
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "fruitIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/fruitIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fruitIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fruitIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3601 0.8927 2.0723 0.1522
catFC 50-250 1.8300 1.1495 2.9135 0.0109
catFC > 250 2.8711 1.7311 4.7617 0.0000
IMD2 0.5956 0.2560 1.3853 0.2289
IMD3 0.8086 0.3627 1.8027 0.6035
IMD4 0.7497 0.3465 1.6220 0.4644
IMD5 0.7014 0.3375 1.4576 0.3419
dqi_tot 1.0057 0.9851 1.0267 0.5919
BMI 1.0174 0.9824 1.0537 0.3336
fruitIntake_cat[2.1,5.64) 0.7104 0.3904 1.2927 0.2630
fruitIntake_cat[5.64,10.4 0.9883 0.5654 1.7277 0.9672
fruitIntake_cat[10.4,62.9 0.8585 0.4521 1.6301 0.6409
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0676 0.9724 0.7850
cat 10.3750 1.9788 0.0054
IMD 2.7906 3.9322 0.5828
dqi_tot 2.6125 0.9875 0.1043
BMI 1.0987 0.9792 0.2881
fruitIntake_cat 2.0898 2.9692 0.5482
GLOBAL 18.2208 18.2141 0.4555
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize fruit intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "fruitIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fruitIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/fruitIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fruitIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6800 1.2564 2.2464 0.0005
catFC 50-250 1.8014 1.3116 2.4740 0.0003
catFC > 250 2.0619 1.4435 2.9454 0.0001
IMD2 1.3888 0.7267 2.6541 0.3202
IMD3 1.1294 0.5995 2.1278 0.7064
IMD4 1.3261 0.7313 2.4046 0.3527
IMD5 1.1680 0.6472 2.1076 0.6062
dqi_tot 0.9984 0.9842 1.0129 0.8291
BMI 0.9761 0.9474 1.0056 0.1114
fruitIntake_cat[2.1,5.64) 1.0907 0.7154 1.6630 0.6866
fruitIntake_cat[5.64,10.4 1.1470 0.7525 1.7482 0.5237
fruitIntake_cat[10.4,62.9 1.0947 0.6921 1.7314 0.6989
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0057 1.0000 0.9399
cat 3.5410 2.0000 0.1702
IMD 2.6427 4.0000 0.6193
dqi_tot 0.7629 1.0000 0.3824
BMI 0.9614 1.0000 0.3268
fruitIntake_cat 3.2348 3.0000 0.3568
GLOBAL 11.2109 12.0001 0.5109
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "fruitIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/fruitIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "fruitIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + fruitIntake_cat + dqi_tot + BMI + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2010 0.8195 1.7602 0.3476
catFC 50-250 2.0242 1.3124 3.1221 0.0014
catFC > 250 2.4981 1.5330 4.0708 0.0002
IMD2 1.5567 0.5886 4.1174 0.3725
IMD3 1.3012 0.5039 3.3603 0.5865
IMD4 2.3414 0.9743 5.6269 0.0572
IMD5 1.4003 0.5763 3.4025 0.4574
fruitIntake_cat[2.1,5.64) 0.9611 0.5489 1.6828 0.8895
fruitIntake_cat[5.64,10.4 0.8897 0.5009 1.5806 0.6903
fruitIntake_cat[10.4,62.9 1.1199 0.6155 2.0375 0.7108
dqi_tot 0.9998 0.9802 1.0198 0.9862
BMI 0.9617 0.9220 1.0030 0.0686
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0255 0.9883 0.8699
cat 5.4338 1.9546 0.0633
IMD 1.1608 3.9313 0.8783
fruitIntake_cat 1.5003 2.9573 0.6746
dqi_tot 0.0000 0.9856 0.9977
BMI 0.5821 0.9901 0.4416
GLOBAL 9.7198 19.5655 0.9677
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize fruit intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "fruitIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fruitIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/fruitIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fruitIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7482 1.4072 2.1718 0.0000
catFC 50-250 1.5051 1.1912 1.9018 0.0006
catFC > 250 2.0149 1.5550 2.6107 0.0000
IMD2 0.9835 0.6254 1.5468 0.9426
IMD3 1.0060 0.6519 1.5525 0.9785
IMD4 1.0986 0.7253 1.6641 0.6572
IMD5 1.0673 0.7144 1.5946 0.7504
dqi_tot 1.0008 0.9903 1.0114 0.8837
BMI 0.9945 0.9749 1.0145 0.5853
fruitIntake_cat[2.1,5.64) 1.1596 0.8572 1.5687 0.3369
fruitIntake_cat[5.64,10.4 1.1359 0.8380 1.5398 0.4115
fruitIntake_cat[10.4,62.9 1.1427 0.8171 1.5981 0.4357
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0033 1.0000 0.9544
cat 1.0633 2.0000 0.5876
IMD 5.0824 4.0000 0.2789
dqi_tot 1.4036 1.0000 0.2361
BMI 0.0121 1.0000 0.9125
fruitIntake_cat 2.9476 3.0000 0.3998
GLOBAL 10.9461 12.0002 0.5336
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "fruitIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Fruit intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/fruitIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + fruitIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/fruitIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/fruitIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2627 0.9556 1.6686 0.1009
catFC 50-250 1.8532 1.3536 2.5373 0.0001
catFC > 250 2.5946 1.8348 3.6690 0.0000
IMD2 0.9219 0.4934 1.7227 0.7988
IMD3 0.9605 0.5271 1.7503 0.8953
IMD4 1.3513 0.7700 2.3713 0.2941
IMD5 0.9789 0.5611 1.7078 0.9400
dqi_tot 1.0018 0.9878 1.0160 0.8014
BMI 0.9927 0.9663 1.0197 0.5921
fruitIntake_cat[2.1,5.64) 0.8518 0.5709 1.2710 0.4321
fruitIntake_cat[5.64,10.4 0.9814 0.6624 1.4539 0.9253
fruitIntake_cat[10.4,62.9 1.0112 0.6576 1.5550 0.9596
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0368 0.9890 0.8445
cat 6.9646 1.9793 0.0301
IMD 1.6437 3.9450 0.7942
dqi_tot 1.9133 0.9931 0.1652
BMI 1.9272 0.9888 0.1628
fruitIntake_cat 0.2770 2.9729 0.9630
GLOBAL 12.8189 23.1032 0.9574
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fruitIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/fruitIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Vegetable and legumes

Crohn’s disease

Code
# Categorize vegetable intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "vegIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "vegIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/vegIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "vegIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9542 1.3887 2.7500 0.0001
catFC 50-250 1.3117 0.9233 1.8633 0.1299
catFC > 250 2.0201 1.3811 2.9548 0.0003
IMD2 0.7181 0.3746 1.3765 0.3185
IMD3 0.9734 0.5321 1.7806 0.9303
IMD4 0.8601 0.4742 1.5598 0.6197
IMD5 1.0221 0.5857 1.7837 0.9386
dqi_tot 1.0070 0.9917 1.0225 0.3717
BMI 1.0067 0.9794 1.0348 0.6325
vegIntake_cat[5.04,8.43) 0.9828 0.6360 1.5189 0.9379
vegIntake_cat[8.43,13.4) 0.7986 0.5053 1.2621 0.3355
vegIntake_cat[13.4,63.1] 0.9932 0.6210 1.5883 0.9772
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2757 1.0000 0.5995
cat 0.7686 2.0000 0.6809
IMD 3.1235 4.0000 0.5374
dqi_tot 0.3712 1.0000 0.5424
BMI 1.2712 1.0000 0.2595
vegIntake_cat 5.4228 3.0000 0.1433
GLOBAL 10.2926 12.0001 0.5903
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "vegIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/vegIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "vegIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3135 0.8600 2.0063 0.2070
catFC 50-250 1.8911 1.1869 3.0133 0.0073
catFC > 250 2.9526 1.7842 4.8860 0.0000
IMD2 0.6118 0.2620 1.4285 0.2561
IMD3 0.8509 0.3814 1.8985 0.6934
IMD4 0.7557 0.3466 1.6478 0.4813
IMD5 0.7251 0.3460 1.5195 0.3945
dqi_tot 1.0001 0.9802 1.0204 0.9941
BMI 1.0133 0.9781 1.0497 0.4642
vegIntake_cat[5.04,8.43) 0.9201 0.5234 1.6172 0.7722
vegIntake_cat[8.43,13.4) 0.8766 0.4838 1.5884 0.6641
vegIntake_cat[13.4,63.1] 1.4911 0.8106 2.7427 0.1989
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0507 0.9722 0.8124
cat 10.6924 1.9751 0.0046
IMD 2.6346 3.9177 0.6079
dqi_tot 2.9512 0.9900 0.0846
BMI 1.0876 0.9776 0.2900
vegIntake_cat 3.1115 2.9567 0.3674
GLOBAL 19.7739 19.3391 0.4299
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize vegetable intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "vegIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "vegIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/vegIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "vegIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6437 1.2249 2.2056 0.0009
catFC 50-250 1.8196 1.3214 2.5058 0.0002
catFC > 250 2.0643 1.4466 2.9458 0.0001
IMD2 1.3744 0.7202 2.6228 0.3348
IMD3 1.1272 0.5971 2.1278 0.7119
IMD4 1.3313 0.7335 2.4163 0.3468
IMD5 1.1300 0.6274 2.0353 0.6839
dqi_tot 0.9963 0.9824 1.0104 0.6053
BMI 0.9760 0.9473 1.0056 0.1106
vegIntake_cat[5.04,8.43) 1.0931 0.7228 1.6531 0.6731
vegIntake_cat[8.43,13.4) 1.2690 0.8365 1.9251 0.2625
vegIntake_cat[13.4,63.1] 1.2381 0.8002 1.9156 0.3374
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0077 1.0000 0.9303
cat 3.5328 2.0000 0.1709
IMD 2.6145 4.0000 0.6243
dqi_tot 0.7308 1.0000 0.3926
BMI 0.9252 1.0000 0.3361
vegIntake_cat 0.1588 3.0000 0.9839
GLOBAL 9.0796 12.0001 0.6961
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "vegIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/vegIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "vegIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1590 0.7857 1.7097 0.4569
catFC 50-250 2.0402 1.3207 3.1516 0.0013
catFC > 250 2.4817 1.5249 4.0390 0.0003
IMD2 1.5765 0.5956 4.1727 0.3594
IMD3 1.3322 0.5147 3.4479 0.5544
IMD4 2.4411 1.0109 5.8950 0.0473
IMD5 1.3612 0.5603 3.3072 0.4960
dqi_tot 0.9959 0.9769 1.0153 0.6784
BMI 0.9614 0.9219 1.0027 0.0669
vegIntake_cat[5.04,8.43) 1.2609 0.7109 2.2363 0.4279
vegIntake_cat[8.43,13.4) 1.8195 1.0385 3.1880 0.0365
vegIntake_cat[13.4,63.1] 1.4784 0.8126 2.6896 0.2004
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0269 0.9888 0.8664
cat 5.3609 1.9584 0.0659
IMD 1.2294 3.9333 0.8668
dqi_tot 0.0000 0.9881 0.9957
BMI 0.5082 0.9880 0.4711
vegIntake_cat 4.4812 2.9426 0.2070
GLOBAL 12.4241 18.9236 0.8638
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize vegetable intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "vegIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "vegIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/vegIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7538 1.4078 2.1849 0.0000
catFC 50-250 1.5153 1.1992 1.9146 0.0005
catFC > 250 2.0105 1.5525 2.6035 0.0000
IMD2 0.9657 0.6138 1.5195 0.8801
IMD3 0.9971 0.6460 1.5390 0.9895
IMD4 1.0856 0.7164 1.6451 0.6984
IMD5 1.0677 0.7144 1.5959 0.7492
dqi_tot 1.0014 0.9913 1.0117 0.7847
BMI 0.9938 0.9741 1.0138 0.5380
vegIntake_cat[5.04,8.43) 1.0054 0.7469 1.3533 0.9716
vegIntake_cat[8.43,13.4) 0.9993 0.7366 1.3557 0.9964
vegIntake_cat[13.4,63.1] 1.0946 0.7983 1.5010 0.5746
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0050 1.0000 0.9435
cat 1.0871 2.0000 0.5807
IMD 5.0962 4.0000 0.2776
dqi_tot 1.3847 1.0000 0.2393
BMI 0.0088 1.0000 0.9254
vegIntake_cat 2.2038 3.0000 0.5312
GLOBAL 9.6259 12.0002 0.6488
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "vegIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Vegetable/legume intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/vegIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + vegIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/vegIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/vegIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1993 0.9045 1.5902 0.2067
catFC 50-250 1.8806 1.3731 2.5758 0.0001
catFC > 250 2.6248 1.8579 3.7082 0.0000
IMD2 0.8961 0.4790 1.6765 0.7314
IMD3 0.9424 0.5168 1.7186 0.8465
IMD4 1.3206 0.7510 2.3225 0.3342
IMD5 0.9518 0.5448 1.6628 0.8621
dqi_tot 0.9980 0.9844 1.0117 0.7710
BMI 0.9912 0.9649 1.0182 0.5205
vegIntake_cat[5.04,8.43) 1.0275 0.6898 1.5306 0.8938
vegIntake_cat[8.43,13.4) 1.1983 0.8025 1.7892 0.3765
vegIntake_cat[13.4,63.1] 1.4011 0.9170 2.1406 0.1189
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0275 0.9885 0.8649
cat 6.9737 1.9790 0.0299
IMD 1.6200 3.9445 0.7984
dqi_tot 2.0266 0.9941 0.1534
BMI 1.8300 0.9887 0.1737
vegIntake_cat 0.5625 2.9674 0.9018
GLOBAL 12.9337 22.7376 0.9491
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/vegIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/vegIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Red meat

Crohn’s disease

Code
# Categorize red meat intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "redMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "redMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/redMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "redMeatIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8753 1.3428 2.6191 0.0002
catFC 50-250 1.3044 0.9190 1.8513 0.1369
catFC > 250 2.0075 1.3712 2.9391 0.0003
IMD2 0.7102 0.3706 1.3611 0.3025
IMD3 0.9471 0.5196 1.7263 0.8591
IMD4 0.8601 0.4753 1.5563 0.6183
IMD5 1.0063 0.5770 1.7550 0.9824
dqi_tot 1.0057 0.9921 1.0195 0.4115
BMI 1.0080 0.9805 1.0362 0.5723
redMeatIntake_cat[0.365,0 0.8424 0.5779 1.2279 0.3723
redMeatIntake_cat[0.861,9 0.9142 0.6253 1.3365 0.6433
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2574 1.0000 0.6119
cat 0.7623 2.0000 0.6831
IMD 3.0114 4.0000 0.5559
dqi_tot 0.3696 1.0000 0.5432
BMI 1.2684 1.0000 0.2601
redMeatIntake_cat 1.0317 2.0000 0.5970
GLOBAL 6.0729 11.0001 0.8685
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "redMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/redMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "redMeatIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2987 0.8610 1.9588 0.2127
catFC 50-250 1.8671 1.1739 2.9697 0.0084
catFC > 250 2.8795 1.7423 4.7592 0.0000
IMD2 0.6504 0.2809 1.5058 0.3152
IMD3 0.8574 0.3876 1.8966 0.7040
IMD4 0.7642 0.3546 1.6468 0.4924
IMD5 0.7387 0.3565 1.5306 0.4151
dqi_tot 1.0026 0.9849 1.0206 0.7740
BMI 1.0202 0.9842 1.0574 0.2751
redMeatIntake_cat[0.365,0 0.8405 0.5244 1.3473 0.4704
redMeatIntake_cat[0.861,9 0.6369 0.3715 1.0919 0.1009
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0659 0.9760 0.7888
cat 10.3796 1.9822 0.0055
IMD 2.5244 3.9375 0.6307
dqi_tot 2.6842 0.9914 0.1002
BMI 1.0069 0.9847 0.3107
redMeatIntake_cat 1.6621 1.9696 0.4285
GLOBAL 18.0302 15.9356 0.3181
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize red meat intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "redMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "redMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/redMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "redMeatIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7023 1.2751 2.2726 0.0003
catFC 50-250 1.7708 1.2882 2.4343 0.0004
catFC > 250 2.0473 1.4331 2.9247 0.0001
IMD2 1.3587 0.7128 2.5898 0.3517
IMD3 1.1233 0.5974 2.1122 0.7182
IMD4 1.3179 0.7280 2.3857 0.3620
IMD5 1.1601 0.6446 2.0875 0.6204
dqi_tot 0.9987 0.9855 1.0120 0.8437
BMI 0.9773 0.9485 1.0070 0.1328
redMeatIntake_cat[0.365,0 1.1968 0.8642 1.6573 0.2796
redMeatIntake_cat[0.861,9 0.9164 0.6424 1.3072 0.6299
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0027 1.0000 0.9587
cat 3.6510 2.0000 0.1611
IMD 2.6642 4.0000 0.6155
dqi_tot 0.7140 1.0000 0.3981
BMI 0.8837 1.0000 0.3472
redMeatIntake_cat 1.2673 2.0000 0.5307
GLOBAL 9.1883 11.0001 0.6045
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "redMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/redMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "redMeatIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2067 0.8255 1.7637 0.3320
catFC 50-250 1.9946 1.2929 3.0772 0.0018
catFC > 250 2.4769 1.5176 4.0427 0.0003
IMD2 1.6324 0.6176 4.3146 0.3231
IMD3 1.3157 0.5099 3.3953 0.5705
IMD4 2.3450 0.9787 5.6188 0.0559
IMD5 1.4085 0.5827 3.4048 0.4469
dqi_tot 1.0085 0.9902 1.0270 0.3644
BMI 0.9567 0.9174 0.9978 0.0390
redMeatIntake_cat[0.365,0 1.3080 0.8204 2.0855 0.2592
redMeatIntake_cat[0.861,9 1.8056 1.1496 2.8358 0.0103
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0459 0.9903 0.8271
cat 5.6937 1.9571 0.0557
IMD 1.1733 3.9294 0.8760
dqi_tot 0.0002 0.9859 0.9895
BMI 0.5398 0.9896 0.4584
redMeatIntake_cat 0.0083 1.9747 0.9955
GLOBAL 8.2307 17.8596 0.9734
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize red meat intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "redMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "redMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/redMeatIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7739 1.4304 2.1998 0.0000
catFC 50-250 1.4981 1.1860 1.8924 0.0007
catFC > 250 2.0132 1.5542 2.6076 0.0000
IMD2 0.9808 0.6235 1.5427 0.9330
IMD3 1.0026 0.6497 1.5472 0.9906
IMD4 1.0998 0.7261 1.6658 0.6534
IMD5 1.0726 0.7180 1.6025 0.7321
dqi_tot 1.0022 0.9928 1.0116 0.6521
BMI 0.9951 0.9754 1.0152 0.6295
redMeatIntake_cat[0.365,0 1.0340 0.8098 1.3202 0.7888
redMeatIntake_cat[0.861,9 0.9216 0.7134 1.1905 0.5320
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0059 1.0000 0.9388
cat 1.1034 2.0000 0.5760
IMD 5.0734 4.0000 0.2798
dqi_tot 1.3470 1.0000 0.2458
BMI 0.0112 1.0000 0.9159
redMeatIntake_cat 1.7438 2.0000 0.4182
GLOBAL 9.2067 11.0002 0.6028
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "redMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "Red meat intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/redMeatIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + redMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/redMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/redMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2625 0.9578 1.6640 0.0981
catFC 50-250 1.8516 1.3519 2.5360 0.0001
catFC > 250 2.6146 1.8499 3.6954 0.0000
IMD2 0.9265 0.4962 1.7300 0.8106
IMD3 0.9563 0.5248 1.7426 0.8839
IMD4 1.3470 0.7679 2.3628 0.2989
IMD5 0.9748 0.5591 1.6996 0.9283
dqi_tot 1.0031 0.9906 1.0158 0.6256
BMI 0.9914 0.9650 1.0185 0.5302
redMeatIntake_cat[0.365,0 1.0040 0.7241 1.3919 0.9811
redMeatIntake_cat[0.861,9 1.1188 0.8037 1.5573 0.5060
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0348 0.9885 0.8484
cat 6.8825 1.9796 0.0314
IMD 1.6366 3.9457 0.7955
dqi_tot 1.9757 0.9920 0.1583
BMI 1.8905 0.9886 0.1668
redMeatIntake_cat 0.7511 1.9791 0.6820
GLOBAL 13.6333 21.6243 0.9038
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/redMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/redMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

White meat

Crohn’s disease

Code
# Categorize white meat intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "whiteMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "whiteMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/whiteMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteMeatIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + whiteMeatIntake_cat + dqi_tot + BMI + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8873 1.3481 2.6422 0.0002
catFC 50-250 1.3091 0.9213 1.8600 0.1329
catFC > 250 2.0572 1.4045 3.0132 0.0002
IMD2 0.7018 0.3660 1.3458 0.2865
IMD3 0.9586 0.5255 1.7486 0.8904
IMD4 0.8582 0.4744 1.5526 0.6132
IMD5 0.9984 0.5725 1.7411 0.9955
whiteMeatIntake_cat[0.426 0.8350 0.5366 1.2994 0.4242
whiteMeatIntake_cat[1.06, 0.7647 0.4805 1.2169 0.2577
whiteMeatIntake_cat[1.88, 0.9321 0.6077 1.4296 0.7471
dqi_tot 1.0054 0.9917 1.0193 0.4407
BMI 1.0080 0.9805 1.0363 0.5706
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2479 1.0000 0.6186
cat 0.8277 2.0000 0.6611
IMD 3.0804 4.0000 0.5445
whiteMeatIntake_cat 8.1780 3.0000 0.0425
dqi_tot 0.3487 1.0000 0.5548
BMI 1.2754 1.0000 0.2588
GLOBAL 12.8119 12.0001 0.3829
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "whiteMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/whiteMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteMeatIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3429 0.8871 2.0331 0.1635
catFC 50-250 1.8461 1.1560 2.9481 0.0103
catFC > 250 3.0321 1.8303 5.0229 0.0000
IMD2 0.6183 0.2647 1.4442 0.2666
IMD3 0.8853 0.3981 1.9688 0.7652
IMD4 0.7618 0.3509 1.6538 0.4915
IMD5 0.7301 0.3506 1.5201 0.4005
dqi_tot 1.0022 0.9843 1.0204 0.8089
BMI 1.0190 0.9836 1.0557 0.2963
whiteMeatIntake_cat[0.426 0.5386 0.3076 0.9429 0.0303
whiteMeatIntake_cat[1.06, 0.5090 0.2848 0.9098 0.0227
whiteMeatIntake_cat[1.88, 0.7308 0.4351 1.2274 0.2358
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1198 0.9747 0.7192
cat 9.6209 1.9772 0.0079
IMD 2.7614 3.9308 0.5877
dqi_tot 3.1257 0.9909 0.0761
BMI 0.9814 0.9811 0.3157
whiteMeatIntake_cat 2.9394 2.9670 0.3953
GLOBAL 21.6390 17.8144 0.2388
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize white meat intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "whiteMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "whiteMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/whiteMeatIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteMeatIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6907 1.2662 2.2575 0.0004
catFC 50-250 1.8008 1.3087 2.4779 0.0003
catFC > 250 2.0864 1.4592 2.9832 0.0001
IMD2 1.4120 0.7410 2.6906 0.2943
IMD3 1.1432 0.6083 2.1485 0.6775
IMD4 1.3505 0.7457 2.4459 0.3213
IMD5 1.1880 0.6604 2.1369 0.5653
dqi_tot 0.9997 0.9868 1.0128 0.9689
BMI 0.9762 0.9473 1.0059 0.1145
whiteMeatIntake_cat[0.426 1.0801 0.7292 1.5998 0.7006
whiteMeatIntake_cat[1.06, 1.0490 0.7224 1.5235 0.8014
whiteMeatIntake_cat[1.88, 1.0258 0.6851 1.5359 0.9016
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0061 1.0000 0.9378
cat 3.5527 2.0000 0.1693
IMD 2.6572 4.0000 0.6167
dqi_tot 0.7527 1.0000 0.3856
BMI 0.9437 1.0000 0.3313
whiteMeatIntake_cat 2.2827 3.0000 0.5158
GLOBAL 11.5067 12.0001 0.4861
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "whiteMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/whiteMeatIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteMeatIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2080 0.8259 1.7669 0.3300
catFC 50-250 1.9895 1.2906 3.0669 0.0018
catFC > 250 2.5817 1.5809 4.2161 0.0002
IMD2 1.6600 0.6280 4.3877 0.3068
IMD3 1.3605 0.5264 3.5165 0.5252
IMD4 2.3763 0.9885 5.7124 0.0531
IMD5 1.4230 0.5865 3.4523 0.4353
dqi_tot 1.0056 0.9877 1.0238 0.5438
BMI 0.9602 0.9204 1.0017 0.0601
whiteMeatIntake_cat[0.426 1.4066 0.8059 2.4551 0.2299
whiteMeatIntake_cat[1.06, 1.3778 0.8083 2.3483 0.2389
whiteMeatIntake_cat[1.88, 1.9050 1.1014 3.2949 0.0211
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0465 0.9882 0.8254
cat 5.5121 1.9616 0.0613
IMD 1.2786 3.9366 0.8587
dqi_tot 0.0026 0.9885 0.9573
BMI 0.5757 0.9902 0.4442
whiteMeatIntake_cat 2.8092 2.9636 0.4155
GLOBAL 11.4009 18.5192 0.8947
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize white meat intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "whiteMeatIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "whiteMeatIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/whiteMeatIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7709 1.4269 2.1979 0.0000
catFC 50-250 1.5011 1.1882 1.8964 0.0007
catFC > 250 2.0189 1.5586 2.6150 0.0000
IMD2 0.9841 0.6253 1.5487 0.9446
IMD3 1.0151 0.6575 1.5673 0.9460
IMD4 1.1060 0.7302 1.6753 0.6342
IMD5 1.0837 0.7255 1.6188 0.6946
dqi_tot 1.0024 0.9931 1.0118 0.6103
BMI 0.9941 0.9744 1.0142 0.5625
whiteMeatIntake_cat[0.426 0.9483 0.7088 1.2687 0.7208
whiteMeatIntake_cat[1.06, 0.9382 0.7025 1.2529 0.6656
whiteMeatIntake_cat[1.88, 0.9936 0.7452 1.3248 0.9650
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0045 1.0000 0.9466
cat 1.0963 2.0000 0.5780
IMD 5.0648 4.0000 0.2807
dqi_tot 1.3828 1.0000 0.2396
BMI 0.0090 1.0000 0.9246
whiteMeatIntake_cat 6.1537 3.0000 0.1044
GLOBAL 14.5079 12.0002 0.2695
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "whiteMeatIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White meat intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/whiteMeatIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteMeatIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/whiteMeatIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/whiteMeatIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2445 0.9442 1.6403 0.1205
catFC 50-250 1.8704 1.3660 2.5610 0.0001
catFC > 250 2.6241 1.8565 3.7090 0.0000
IMD2 0.9482 0.5073 1.7726 0.8678
IMD3 1.0017 0.5489 1.8280 0.9957
IMD4 1.3843 0.7884 2.4305 0.2576
IMD5 1.0005 0.5734 1.7457 0.9986
dqi_tot 1.0032 0.9907 1.0158 0.6189
BMI 0.9902 0.9639 1.0173 0.4741
whiteMeatIntake_cat[0.426 0.8970 0.6077 1.3241 0.5845
whiteMeatIntake_cat[1.06, 0.9039 0.6161 1.3261 0.6054
whiteMeatIntake_cat[1.88, 1.2086 0.8331 1.7532 0.3183
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0306 0.9897 0.8581
cat 6.5690 1.9794 0.0367
IMD 1.4597 3.9463 0.8278
dqi_tot 2.0433 0.9929 0.1515
BMI 1.8532 0.9882 0.1709
whiteMeatIntake_cat 2.5360 2.9711 0.4635
GLOBAL 15.2956 22.6568 0.8726
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/whiteMeatIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/whiteMeatIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Fish (white and oily)

Crohn’s disease

Code
# Categorize white fish intake by quantiles
flare.cd.df <- categorize_by_quantiles(flare.cd.df, "whiteFishIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "whiteFishIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/cd/soft-flare/diet/whiteFishIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteFishIntake-cd-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/soft-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/soft-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8518 1.3255 2.5870 0.0003
catFC 50-250 1.4540 1.0175 2.0779 0.0399
catFC > 250 2.1771 1.4827 3.1967 0.0001
IMD2 0.7516 0.3920 1.4410 0.3899
IMD3 0.9740 0.5326 1.7812 0.9318
IMD4 0.8406 0.4630 1.5264 0.5684
IMD5 1.1131 0.6339 1.9545 0.7091
dqi_tot 1.0080 0.9939 1.0223 0.2698
BMI 1.0082 0.9809 1.0364 0.5585
whiteFishIntake_cat[0.796 0.4737 0.2988 0.7508 0.0015
whiteFishIntake_cat[1.66, 0.6477 0.4185 1.0024 0.0513
whiteFishIntake_cat[2.88, 0.7955 0.5209 1.2148 0.2895
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.2468 1.0000 0.6193
cat 0.8197 2.0000 0.6638
IMD 3.1208 4.0000 0.5378
dqi_tot 0.2718 1.0000 0.6021
BMI 1.1602 1.0000 0.2814
whiteFishIntake_cat 1.4215 3.0000 0.7005
GLOBAL 6.9767 12.0001 0.8592
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/soft-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.cd.df,
  var_name = "whiteFishIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/cd/hard-flare/diet/whiteFishIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteFishIntake-cd-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "CD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/cd/hard-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/cd/hard-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3669 0.8962 2.0847 0.1467
catFC 50-250 2.0266 1.2588 3.2629 0.0036
catFC > 250 3.1633 1.8997 5.2672 0.0000
IMD2 0.6713 0.2893 1.5580 0.3535
IMD3 0.8165 0.3672 1.8157 0.6191
IMD4 0.7617 0.3512 1.6518 0.4907
IMD5 0.7861 0.3748 1.6486 0.5242
dqi_tot 1.0052 0.9869 1.0240 0.5780
BMI 1.0167 0.9812 1.0534 0.3605
whiteFishIntake_cat[0.796 0.3096 0.1668 0.5748 0.0002
whiteFishIntake_cat[1.66, 0.5213 0.2928 0.9282 0.0269
whiteFishIntake_cat[2.88, 0.7569 0.4458 1.2851 0.3024
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0086 0.9671 0.9192
cat 8.2453 1.9787 0.0158
IMD 3.3773 3.9247 0.4850
dqi_tot 2.4859 0.9898 0.1133
BMI 1.3059 0.9752 0.2463
whiteFishIntake_cat 11.0664 2.9536 0.0109
GLOBAL 27.4577 19.1135 0.0974
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/cd/hard-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Ulcerative colitis

Code
# Categorize white fish intake by quantiles
flare.uc.df <- categorize_by_quantiles(flare.uc.df, "whiteFishIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "whiteFishIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/uc/soft-flare/diet/whiteFishIntake",
  break_time_by = 200
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteFishIntake-uc-soft.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Soft") |>
  relocate(diagnosis, flare)
  )

# Display plot and model summary
knitr::include_graphics("plots/uc/soft-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/soft-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6795 1.2559 2.2461 0.0005
catFC 50-250 1.7231 1.2495 2.3763 0.0009
catFC > 250 2.0810 1.4563 2.9737 0.0001
IMD2 1.4833 0.7781 2.8277 0.2310
IMD3 1.1348 0.6038 2.1329 0.6944
IMD4 1.3866 0.7641 2.5160 0.2824
IMD5 1.2546 0.6956 2.2629 0.4510
dqi_tot 0.9948 0.9814 1.0083 0.4482
BMI 0.9802 0.9511 1.0102 0.1930
whiteFishIntake_cat[0.796 1.1316 0.7406 1.7293 0.5676
whiteFishIntake_cat[1.66, 1.1029 0.7386 1.6471 0.6320
whiteFishIntake_cat[2.88, 1.5903 1.0731 2.3568 0.0208
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0023 1.0000 0.9620
cat 3.3157 2.0000 0.1905
IMD 2.6930 4.0000 0.6104
dqi_tot 0.8417 1.0000 0.3589
BMI 0.9320 1.0000 0.3343
whiteFishIntake_cat 4.3829 3.0000 0.2230
GLOBAL 13.7361 12.0001 0.3179
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/soft-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.uc.df,
  var_name = "whiteFishIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/uc/hard-flare/diet/whiteFishIntake",
  break_time_by = 500
)

# Save plot as RDS
saveRDS(analysis_result$plot, paste0(paths$outdir, "whiteFishIntake-uc-hard.RDS"))

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "UC", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/uc/hard-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/uc/hard-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2043 0.8203 1.7682 0.3427
catFC 50-250 2.1393 1.3771 3.3234 0.0007
catFC > 250 2.5089 1.5391 4.0897 0.0002
IMD2 1.5800 0.6003 4.1587 0.3543
IMD3 1.3207 0.5126 3.4029 0.5645
IMD4 2.3071 0.9625 5.5300 0.0609
IMD5 1.3973 0.5772 3.3825 0.4583
dqi_tot 1.0029 0.9846 1.0215 0.7579
BMI 0.9582 0.9182 0.9999 0.0496
whiteFishIntake_cat[0.796 0.9208 0.5366 1.5801 0.7646
whiteFishIntake_cat[1.66, 0.7328 0.4234 1.2683 0.2666
whiteFishIntake_cat[2.88, 1.0419 0.6259 1.7342 0.8746
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0197 0.9901 0.8859
cat 5.2113 1.9615 0.0713
IMD 0.9526 3.9382 0.9124
dqi_tot 0.0077 0.9884 0.9277
BMI 0.5184 0.9894 0.4673
whiteFishIntake_cat 5.4156 2.9592 0.1401
GLOBAL 13.7950 18.1517 0.7509
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/uc/hard-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Inflammatory bowel disease

Code
# Categorize white fish intake by quantiles
flare.df <- categorize_by_quantiles(flare.df, "whiteFishIntake", reference_data = flare.df)

# Run survival analysis using utility function
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "whiteFishIntake",
  outcome_time = "softflare_time",
  outcome_event = "softflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/ibd/soft-flare/diet/whiteFishIntake",
  break_time_by = 200
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Soft") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/soft-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/soft-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.7195 1.3854 2.1340 0.0000
catFC 50-250 1.5094 1.1920 1.9113 0.0006
catFC > 250 2.0167 1.5563 2.6132 0.0000
IMD2 1.0305 0.6544 1.6227 0.8969
IMD3 1.0248 0.6636 1.5827 0.9119
IMD4 1.1336 0.7473 1.7196 0.5554
IMD5 1.1405 0.7619 1.7074 0.5230
dqi_tot 1.0008 0.9912 1.0105 0.8695
BMI 0.9957 0.9760 1.0157 0.6692
whiteFishIntake_cat[0.796 0.7342 0.5396 0.9990 0.0493
whiteFishIntake_cat[1.66, 0.8823 0.6588 1.1817 0.4009
whiteFishIntake_cat[2.88, 1.1629 0.8751 1.5452 0.2982
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0136 1.0000 0.9072
cat 1.0328 2.0000 0.5967
IMD 5.1923 4.0000 0.2681
dqi_tot 1.3542 1.0000 0.2445
BMI 0.0006 1.0000 0.9813
whiteFishIntake_cat 4.4596 3.0000 0.2159
GLOBAL 11.8491 12.0002 0.4579
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/soft-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Code
# Run survival analysis using utility function for objective flare
analysis_result <- run_survival_analysis(
  data = flare.df,
  var_name = "whiteFishIntake",
  outcome_time = "hardflare_time",
  outcome_event = "hardflare",
  legend_title = "White fish intake quantiles",
  plot_base_path = "plots/ibd/hard-flare/diet/whiteFishIntake",
  break_time_by = 500
)

# Run Cox model with categorical variable
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex + cat + IMD + dqi_tot + BMI + whiteFishIntake_cat + frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.df
)

hrs <- rbind(hrs, broom::tidy(fit.me) |> 
  filter(!grepl("^Sex|^cat|^IMD|^dqi_tot|^BMI|^frailty", term)) |>
  mutate(diagnosis = "IBD", flare ="Hard") |>
  relocate(diagnosis, flare)
  )


# Display plot and model summary
knitr::include_graphics("plots/ibd/hard-flare/diet/whiteFishIntake.png")

Code
invisible(cox_summary(fit.me, plot_base_path = "plots/ibd/hard-flare/diet/whiteFishIntake"))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2493 0.9455 1.6509 0.1174
catFC 50-250 1.9337 1.4033 2.6647 0.0001
catFC > 250 2.6610 1.8769 3.7726 0.0000
IMD2 0.9543 0.5111 1.7819 0.8832
IMD3 0.9657 0.5304 1.7585 0.9092
IMD4 1.3903 0.7921 2.4401 0.2509
IMD5 1.0164 0.5819 1.7754 0.9545
dqi_tot 1.0030 0.9902 1.0160 0.6489
BMI 0.9895 0.9631 1.0167 0.4451
whiteFishIntake_cat[0.796 0.5553 0.3721 0.8287 0.0040
whiteFishIntake_cat[1.66, 0.6371 0.4306 0.9428 0.0241
whiteFishIntake_cat[2.88, 0.9103 0.6326 1.3099 0.6128
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0005 0.9885 0.9822
cat 5.9214 1.9787 0.0507
IMD 1.5648 3.9443 0.8085
dqi_tot 1.8045 0.9919 0.1774
BMI 1.8165 0.9874 0.1750
whiteFishIntake_cat 13.4644 2.9681 0.0036
GLOBAL 24.5262 22.9639 0.3731
`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/whiteFishIntake-dfbeta.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

`geom_smooth()` using formula = 'y ~ x'
`geom_smooth()` using formula = 'y ~ x'

[1] “plots/ibd/hard-flare/diet/whiteFishIntake-martingale.png” attr(,“class”) [1] “knit_image_paths” “knit_asis”

Save tables with p-values and hazard ratios

Code
pvalues <- hrs |>
  select(diagnosis, flare, term, p.value)

# Create term labels dynamically based on actual data
# Count entries per diagnosis-flare combination to handle actual structure
term_patterns <- list(
  "Meat_sum_cat" = "Meat protein",
  "meat_overall_cat" = "Overall meat intake",
  "fish_overall_cat" = "Overall fish intake",
  "fibre_cat" = "Dietary fibre",
  "PUFA_percEng_cat" = "PUFA",
  "NOVA_Score" = "NOVA Score",
  "UPF_perc_cat" = "%UPF",
  "breadIntake_cat" = "Bread intake",
  "sweetIntake_cat" = "Sweet intake",
  "drinkIntake_cat" = "Drink intake",
  "processedMeatIntake_cat" = "Processed meat intake",
  "processedPlantIntake_cat" = "Processed plant intake",
  "fruitIntake_cat" = "Fruit intake",
  "vegIntake_cat" = "Vegetable intake",
  "redMeatIntake_cat" = "Red meat intake",
  "whiteMeatIntake_cat" = "White meat intake",
  "whiteFishIntake_cat" = "White fish intake"
)

# Replace term names with human-readable labels
pvalues <- pvalues |>
  mutate(
    clean_term = term,
    clean_term = case_when(
      grepl("Meat_sum_cat", term) ~ paste("Meat protein", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("meat_overall_cat", term) ~ paste("Overall meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fish_overall_cat", term) ~ paste("Overall fish intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fibre_cat", term) ~ paste("Dietary fibre", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("PUFA_percEng_cat", term) ~ paste("PUFA", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("NOVA_Score", term) ~ paste("NOVA Score", gsub(".*?(\\d+)", "\\1", term)),
      grepl("UPF_perc_cat", term) ~ paste("%UPF", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("breadIntake_cat", term) ~ paste("Bread intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("sweetIntake_cat", term) ~ paste("Sweet intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("drinkIntake_cat", term) ~ paste("Drink intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("processedMeatIntake_cat", term) ~ paste("Processed meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("processedPlantIntake_cat", term) ~ paste("Processed plant intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fruitIntake_cat", term) ~ paste("Fruit intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("vegIntake_cat", term) ~ paste("Vegetable intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("redMeatIntake_cat", term) ~ paste("Red meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("whiteMeatIntake_cat", term) ~ paste("White meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("whiteFishIntake_cat", term) ~ paste("White fish intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      TRUE ~ term
    )
  ) |>
  select(-term) |>
  rename(term = clean_term)

pvalues <- pvalues |>
  mutate(
    adjusted.p.value = ifelse(
      grepl(
        "^Meat|^%UP|^PUFA|^Dietary", term
      ),
      NA,
      p.value * 216
    )
  )
pvalues$adjusted.p.value <- ifelse(
  !is.na(pvalues$adjusted.p.value) & pvalues$adjusted.p.value > 1,
  1,
  pvalues$adjusted.p.value
)
Control for additional covariates

Crohn’s disease

Patient-reported flare

Total meat protein
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9570 1.3827 2.7699 0.0002
catFC 50-250 1.2352 0.8572 1.7799 0.2572
catFC > 250 1.9290 1.2994 2.8637 0.0011
IMD2 0.7057 0.3668 1.3576 0.2964
IMD3 0.8581 0.4637 1.5880 0.6260
IMD4 0.7910 0.4274 1.4638 0.4553
IMD5 0.9895 0.5633 1.7380 0.9706
dqi_tot 1.0057 0.9914 1.0201 0.4359
BMI 1.0033 0.9750 1.0324 0.8218
IBD Duration 0.9893 0.9750 1.0038 0.1485
TreatmentMono biologic 0.9935 0.6254 1.5781 0.9778
TreatmentCombo therapy 0.8739 0.4891 1.5613 0.6490
Treatment5-ASA 0.9445 0.3906 2.2840 0.8992
TreatmentNone reported 0.9506 0.6209 1.4554 0.8157
Age 1.0065 0.9943 1.0188 0.3007
Meat_sum_cat[24.9,35.8) 1.0892 0.6965 1.7031 0.7081
Meat_sum_cat[35.8,50.6) 1.0009 0.6404 1.5645 0.9968
Meat_sum_cat[50.6,331] 1.1092 0.6934 1.7741 0.6655
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0654 1.0000 0.7981
cat 1.4378 2.0000 0.4873
IMD 3.6591 4.0000 0.4541
dqi_tot 0.2315 1.0000 0.6304
BMI 1.0619 1.0000 0.3028
IBD Duration 2.5185 1.0000 0.1125
Treatment 7.4605 4.0000 0.1135
Age 1.1251 1.0000 0.2888
Meat_sum_cat 1.5786 3.0000 0.6643
GLOBAL 18.9635 18.0001 0.3941
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9653 1.3897 2.7792 0.0001
catFC 50-250 1.2371 0.8577 1.7844 0.2549
catFC > 250 1.9500 1.3106 2.9013 0.0010
IMD2 0.7196 0.3726 1.3896 0.3270
IMD3 0.8757 0.4714 1.6268 0.6745
IMD4 0.8098 0.4384 1.4957 0.5004
IMD5 0.9971 0.5680 1.7504 0.9919
dqi_tot 1.0070 0.9918 1.0225 0.3690
BMI 1.0023 0.9736 1.0319 0.8763
IBD Duration 0.9888 0.9745 1.0033 0.1290
TreatmentMono biologic 0.9885 0.6232 1.5679 0.9607
TreatmentCombo therapy 0.8638 0.4808 1.5518 0.6242
Treatment5-ASA 0.9521 0.3942 2.2994 0.9132
TreatmentNone reported 0.9453 0.6175 1.4471 0.7957
Age 1.0069 0.9946 1.0194 0.2735
meat_overall_cat[59.5,101 0.9466 0.6002 1.4931 0.8135
meat_overall_cat[101,153) 1.0421 0.6568 1.6532 0.8611
meat_overall_cat[153,927] 1.1154 0.6730 1.8488 0.6717
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0619 1.0000 0.8034
cat 1.4423 2.0000 0.4862
IMD 3.6451 4.0000 0.4562
dqi_tot 0.2423 1.0000 0.6225
BMI 1.1105 1.0000 0.2920
IBD Duration 2.4924 1.0000 0.1144
Treatment 7.4505 4.0000 0.1139
Age 1.1057 1.0000 0.2930
meat_overall_cat 2.0715 3.0000 0.5577
GLOBAL 19.7035 18.0001 0.3498
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9151 1.3541 2.7083 0.0002
catFC 50-250 1.2353 0.8562 1.7821 0.2585
catFC > 250 2.0225 1.3582 3.0116 0.0005
IMD2 0.7346 0.3817 1.4136 0.3557
IMD3 0.8591 0.4633 1.5930 0.6297
IMD4 0.7808 0.4230 1.4412 0.4287
IMD5 1.0268 0.5835 1.8069 0.9270
dqi_tot 1.0055 0.9909 1.0203 0.4642
BMI 1.0017 0.9734 1.0307 0.9099
IBD Duration 0.9893 0.9750 1.0038 0.1456
TreatmentMono biologic 0.9756 0.6158 1.5458 0.9163
TreatmentCombo therapy 0.7972 0.4443 1.4304 0.4474
Treatment5-ASA 0.9817 0.4052 2.3786 0.9675
TreatmentNone reported 0.9324 0.6114 1.4220 0.7451
Age 1.0069 0.9947 1.0192 0.2717
fish_overall_cat[16.4,36. 0.5796 0.3609 0.9308 0.0240
fish_overall_cat[36.5,65. 0.7297 0.4672 1.1395 0.1658
fish_overall_cat[65.8,647 0.8782 0.5612 1.3742 0.5697
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0381 1.0000 0.8452
cat 1.6089 2.0000 0.4473
IMD 3.5455 4.0000 0.4710
dqi_tot 0.1948 1.0000 0.6589
BMI 0.9832 1.0000 0.3214
IBD Duration 2.5987 1.0000 0.1069
Treatment 7.5191 4.0000 0.1109
Age 1.2334 1.0000 0.2667
fish_overall_cat 2.6878 3.0000 0.4423
GLOBAL 19.4658 18.0001 0.3637
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9653 1.3852 2.7884 0.0002
catFC 50-250 1.2221 0.8469 1.7634 0.2837
catFC > 250 1.9653 1.3213 2.9233 0.0009
IMD2 0.7015 0.3652 1.3473 0.2870
IMD3 0.8623 0.4660 1.5957 0.6371
IMD4 0.7909 0.4299 1.4548 0.4505
IMD5 0.9752 0.5559 1.7108 0.9304
dqi_tot 1.0037 0.9877 1.0199 0.6524
BMI 1.0033 0.9749 1.0326 0.8206
IBD Duration 0.9897 0.9754 1.0042 0.1635
TreatmentMono biologic 0.9949 0.6275 1.5775 0.9827
TreatmentCombo therapy 0.8711 0.4879 1.5554 0.6409
Treatment5-ASA 0.9590 0.3977 2.3125 0.9258
TreatmentNone reported 0.9425 0.6175 1.4386 0.7837
Age 1.0063 0.9942 1.0186 0.3083
fibre_cat[17,22.9) 0.8219 0.5264 1.2832 0.3882
fibre_cat[22.9,29.4) 1.0066 0.6446 1.5718 0.9770
fibre_cat[29.4,170] 1.0739 0.6592 1.7495 0.7746
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0602 1.0000 0.8062
cat 1.4716 2.0000 0.4791
IMD 3.6196 4.0000 0.4599
dqi_tot 0.2179 1.0000 0.6406
BMI 1.1122 1.0000 0.2916
IBD Duration 2.4585 1.0000 0.1169
Treatment 7.5461 4.0000 0.1097
Age 1.0993 1.0000 0.2944
fibre_cat 6.6767 3.0000 0.0829
GLOBAL 25.4124 18.0001 0.1140
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9051 1.3481 2.6922 0.0003
catFC 50-250 1.2360 0.8549 1.7870 0.2601
catFC > 250 1.9133 1.2889 2.8400 0.0013
IMD2 0.6946 0.3610 1.3368 0.2753
IMD3 0.8834 0.4763 1.6385 0.6941
IMD4 0.8319 0.4497 1.5387 0.5574
IMD5 0.9861 0.5597 1.7371 0.9612
dqi_tot 1.0037 0.9897 1.0179 0.6079
BMI 1.0055 0.9773 1.0344 0.7073
IBD Duration 0.9885 0.9742 1.0030 0.1191
TreatmentMono biologic 0.9804 0.6187 1.5535 0.9327
TreatmentCombo therapy 0.8094 0.4514 1.4513 0.4779
Treatment5-ASA 0.9582 0.3952 2.3229 0.9247
TreatmentNone reported 0.9106 0.5967 1.3896 0.6639
Age 1.0061 0.9940 1.0185 0.3233
PUFA_percEng_cat[4.54,5.1 0.8250 0.5338 1.2748 0.3862
PUFA_percEng_cat[5.17,5.9 0.6177 0.3896 0.9793 0.0405
PUFA_percEng_cat[5.92,12. 1.0421 0.6918 1.5698 0.8436
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0566 1.0000 0.8120
cat 1.4446 2.0000 0.4856
IMD 3.8316 4.0000 0.4293
dqi_tot 0.1937 1.0000 0.6599
BMI 0.9606 1.0000 0.3270
IBD Duration 2.5807 1.0000 0.1082
Treatment 7.7022 4.0000 0.1031
Age 1.1186 1.0000 0.2902
PUFA_percEng_cat 1.8214 3.0000 0.6103
GLOBAL 19.6056 18.0001 0.3555
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9515 1.3790 2.7616 0.0002
catFC 50-250 1.2178 0.8433 1.7587 0.2932
catFC > 250 1.9436 1.3080 2.8882 0.0010
IMD2 0.7269 0.3760 1.4049 0.3427
IMD3 0.8825 0.4742 1.6421 0.6931
IMD4 0.8185 0.4420 1.5156 0.5240
IMD5 1.0046 0.5692 1.7732 0.9873
dqi_tot 1.0047 0.9907 1.0190 0.5100
BMI 1.0037 0.9749 1.0334 0.8040
IBD Duration 0.9895 0.9751 1.0041 0.1564
TreatmentMono biologic 0.9768 0.6141 1.5536 0.9210
TreatmentCombo therapy 0.8636 0.4829 1.5442 0.6208
Treatment5-ASA 0.9459 0.3900 2.2942 0.9021
TreatmentNone reported 0.9428 0.6175 1.4395 0.7850
Age 1.0061 0.9940 1.0184 0.3238
NOVAScore_catProcessed cu 0.9412 0.6025 1.4702 0.7899
NOVAScore_catProcessed fo 1.0857 0.7027 1.6775 0.7110
NOVAScore_catUltra-proces 1.0917 0.7048 1.6911 0.6944
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0576 1.0000 0.8103
cat 1.4000 2.0000 0.4966
IMD 3.6346 4.0000 0.4577
dqi_tot 0.2283 1.0000 0.6328
BMI 1.0924 1.0000 0.2960
IBD Duration 2.4679 1.0000 0.1162
Treatment 7.5344 4.0000 0.1102
Age 1.0642 1.0000 0.3023
NOVAScore_cat 4.0425 3.0000 0.2569
GLOBAL 20.8430 18.0001 0.2874
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9608 1.3816 2.7829 0.0002
catFC 50-250 1.2583 0.8713 1.8172 0.2204
catFC > 250 1.9652 1.3220 2.9211 0.0008
IMD2 0.7015 0.3651 1.3477 0.2872
IMD3 0.8634 0.4667 1.5975 0.6399
IMD4 0.8184 0.4441 1.5082 0.5206
IMD5 0.9649 0.5487 1.6966 0.9012
dqi_tot 1.0041 0.9898 1.0186 0.5782
BMI 1.0026 0.9743 1.0318 0.8567
IBD Duration 0.9888 0.9743 1.0034 0.1319
TreatmentMono biologic 1.0168 0.6408 1.6133 0.9437
TreatmentCombo therapy 0.8888 0.4965 1.5912 0.6916
Treatment5-ASA 0.9364 0.3863 2.2703 0.8844
TreatmentNone reported 0.9852 0.6437 1.5079 0.9454
Age 1.0057 0.9933 1.0183 0.3679
UPF_perc_cat[36.8,44.3) 1.2539 0.7899 1.9905 0.3372
UPF_perc_cat[44.3,52.6) 1.1011 0.7009 1.7299 0.6760
UPF_perc_cat[52.6,92.5] 0.9772 0.6048 1.5791 0.9251
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0602 1.0000 0.8062
cat 1.4635 2.0000 0.4811
IMD 3.7560 4.0000 0.4400
dqi_tot 0.2222 1.0000 0.6373
BMI 1.0235 1.0000 0.3117
IBD Duration 2.5048 1.0000 0.1135
Treatment 7.6648 4.0000 0.1047
Age 1.1857 1.0000 0.2762
UPF_perc_cat 4.6596 3.0000 0.1985
GLOBAL 23.5957 18.0001 0.1687
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8921 1.3345 2.6828 0.0003
catFC 50-250 1.2730 0.8817 1.8380 0.1977
catFC > 250 1.9866 1.3372 2.9514 0.0007
IMD2 0.7183 0.3718 1.3876 0.3247
IMD3 0.9281 0.4981 1.7294 0.8143
IMD4 0.7952 0.4311 1.4667 0.4631
IMD5 1.0324 0.5845 1.8238 0.9124
dqi_tot 1.0042 0.9902 1.0184 0.5557
BMI 1.0044 0.9754 1.0342 0.7713
IBD Duration 0.9889 0.9747 1.0033 0.1299
TreatmentMono biologic 0.9527 0.5964 1.5219 0.8394
TreatmentCombo therapy 0.8535 0.4773 1.5263 0.5933
Treatment5-ASA 0.8888 0.3664 2.1560 0.7942
TreatmentNone reported 0.8899 0.5799 1.3656 0.5934
Age 1.0072 0.9949 1.0197 0.2522
breadIntake_cat[1.97,3.23 0.6206 0.3960 0.9724 0.0373
breadIntake_cat[3.23,4.84 0.7324 0.4699 1.1417 0.1692
breadIntake_cat[4.84,18.9 0.7283 0.4660 1.1382 0.1640
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0725 1.0000 0.7877
cat 1.4486 2.0000 0.4847
IMD 3.5587 4.0000 0.4690
dqi_tot 0.2565 1.0000 0.6125
BMI 1.0871 1.0000 0.2971
IBD Duration 2.4699 1.0000 0.1160
Treatment 7.4476 4.0000 0.1140
Age 1.2251 1.0000 0.2684
breadIntake_cat 1.3716 3.0000 0.7122
GLOBAL 18.2237 18.0001 0.4410
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9473 1.3742 2.7595 0.0002
catFC 50-250 1.2620 0.8739 1.8225 0.2146
catFC > 250 1.9560 1.3179 2.9029 0.0009
IMD2 0.7094 0.3681 1.3668 0.3048
IMD3 0.9011 0.4837 1.6787 0.7429
IMD4 0.8185 0.4424 1.5146 0.5236
IMD5 1.0046 0.5684 1.7758 0.9873
dqi_tot 1.0049 0.9907 1.0194 0.4998
BMI 1.0023 0.9733 1.0321 0.8793
IBD Duration 0.9902 0.9759 1.0048 0.1859
TreatmentMono biologic 0.9704 0.6118 1.5394 0.8986
TreatmentCombo therapy 0.8573 0.4790 1.5343 0.6041
Treatment5-ASA 0.8814 0.3613 2.1502 0.7815
TreatmentNone reported 0.9249 0.6063 1.4111 0.7173
Age 1.0059 0.9937 1.0181 0.3449
sweetIntake_cat[2.83,4.36 1.1380 0.7437 1.7413 0.5515
sweetIntake_cat[4.36,6.17 0.7808 0.4905 1.2431 0.2971
sweetIntake_cat[6.17,17.3 1.0628 0.6690 1.6885 0.7966
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0691 1.0000 0.7927
cat 1.5510 2.0000 0.4605
IMD 3.6042 4.0000 0.4622
dqi_tot 0.2218 1.0000 0.6377
BMI 1.1385 1.0000 0.2860
IBD Duration 2.5470 1.0000 0.1105
Treatment 7.6849 4.0000 0.1038
Age 1.1645 1.0000 0.2805
sweetIntake_cat 9.5066 3.0000 0.0233
GLOBAL 29.8986 18.0001 0.0384
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9813 1.4011 2.8015 0.0001
catFC 50-250 1.2453 0.8638 1.7952 0.2398
catFC > 250 1.9500 1.3135 2.8949 0.0009
IMD2 0.6937 0.3583 1.3429 0.2778
IMD3 0.8615 0.4661 1.5923 0.6343
IMD4 0.8049 0.4372 1.4819 0.4859
IMD5 0.9637 0.5487 1.6925 0.8976
dqi_tot 1.0045 0.9905 1.0187 0.5303
BMI 1.0083 0.9800 1.0373 0.5704
IBD Duration 0.9895 0.9753 1.0040 0.1553
TreatmentMono biologic 1.0154 0.6405 1.6098 0.9482
TreatmentCombo therapy 0.8676 0.4851 1.5515 0.6319
Treatment5-ASA 0.9654 0.3981 2.3412 0.9379
TreatmentNone reported 0.9623 0.6317 1.4659 0.8580
Age 1.0038 0.9910 1.0167 0.5647
drinkIntake_cat[0.301,4.2 0.9923 0.6285 1.5665 0.9735
drinkIntake_cat[4.21,14.4 0.8854 0.5662 1.3846 0.5937
drinkIntake_cat[14.4,120] 0.7623 0.4876 1.1920 0.2341
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0554 1.0000 0.8139
cat 1.4686 2.0000 0.4798
IMD 3.6744 4.0000 0.4519
dqi_tot 0.2362 1.0000 0.6269
BMI 1.0309 1.0000 0.3099
IBD Duration 2.4889 1.0000 0.1147
Treatment 7.6599 4.0000 0.1049
Age 1.1162 1.0000 0.2907
drinkIntake_cat 5.5068 3.0000 0.1382
GLOBAL 22.5760 18.0001 0.2074
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9956 1.4076 2.8292 0.0001
catFC 50-250 1.1897 0.8219 1.7221 0.3572
catFC > 250 1.8761 1.2601 2.7932 0.0019
IMD2 0.7301 0.3796 1.4044 0.3460
IMD3 0.8575 0.4613 1.5942 0.6271
IMD4 0.7937 0.4307 1.4629 0.4590
IMD5 0.9828 0.5577 1.7317 0.9521
dqi_tot 1.0083 0.9933 1.0235 0.2812
BMI 1.0008 0.9720 1.0305 0.9556
IBD Duration 0.9882 0.9738 1.0029 0.1155
TreatmentMono biologic 1.0186 0.6406 1.6195 0.9380
TreatmentCombo therapy 0.9176 0.5107 1.6488 0.7737
Treatment5-ASA 0.9981 0.4127 2.4138 0.9966
TreatmentNone reported 0.9929 0.6472 1.5232 0.9740
Age 1.0070 0.9948 1.0193 0.2640
processedMeatIntake_cat[0 1.0911 0.6812 1.7476 0.7169
processedMeatIntake_cat[1 1.3214 0.8285 2.1077 0.2420
processedMeatIntake_cat[2 1.2832 0.7677 2.1451 0.3414
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0645 1.0000 0.7995
cat 1.3432 2.0000 0.5109
IMD 3.6261 4.0000 0.4590
dqi_tot 0.2220 1.0000 0.6375
BMI 1.1178 1.0000 0.2904
IBD Duration 2.5166 1.0000 0.1127
Treatment 7.3618 4.0000 0.1180
Age 1.0939 1.0000 0.2956
processedMeatIntake_cat 0.7529 3.0000 0.8607
GLOBAL 17.5875 18.0001 0.4831
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9610 1.3873 2.7719 0.0001
catFC 50-250 1.2236 0.8489 1.7636 0.2793
catFC > 250 1.9500 1.3146 2.8927 0.0009
IMD2 0.6931 0.3605 1.3327 0.2718
IMD3 0.8574 0.4639 1.5846 0.6234
IMD4 0.7984 0.4347 1.4666 0.4681
IMD5 0.9718 0.5538 1.7051 0.9206
dqi_tot 1.0038 0.9896 1.0182 0.6031
BMI 1.0032 0.9748 1.0323 0.8286
IBD Duration 0.9885 0.9742 1.0031 0.1227
TreatmentMono biologic 0.9793 0.6172 1.5540 0.9294
TreatmentCombo therapy 0.8528 0.4766 1.5261 0.5918
Treatment5-ASA 0.9871 0.4084 2.3856 0.9770
TreatmentNone reported 0.9332 0.6104 1.4268 0.7497
Age 1.0073 0.9949 1.0199 0.2486
processedPlantIntake_cat[ 1.1873 0.8222 1.7147 0.3599
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0567 1.0000 0.8118
cat 1.3927 2.0000 0.4984
IMD 3.6695 4.0000 0.4526
dqi_tot 0.2438 1.0000 0.6214
BMI 1.0408 1.0000 0.3076
IBD Duration 2.5261 1.0000 0.1120
Treatment 7.5248 4.0000 0.1106
Age 1.1113 1.0000 0.2918
processedPlantIntake_cat 0.2318 1.0000 0.6302
GLOBAL 17.8866 16.0001 0.3306
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9361 1.3643 2.7477 0.0002
catFC 50-250 1.2389 0.8592 1.7863 0.2513
catFC > 250 1.9368 1.3046 2.8753 0.0010
IMD2 0.7114 0.3698 1.3686 0.3077
IMD3 0.8623 0.4635 1.6043 0.6400
IMD4 0.8019 0.4353 1.4773 0.4788
IMD5 0.9819 0.5585 1.7263 0.9494
dqi_tot 1.0044 0.9884 1.0207 0.5899
BMI 1.0040 0.9758 1.0330 0.7856
IBD Duration 0.9892 0.9749 1.0038 0.1467
TreatmentMono biologic 0.9969 0.6256 1.5885 0.9895
TreatmentCombo therapy 0.8734 0.4880 1.5632 0.6486
Treatment5-ASA 0.9705 0.4013 2.3469 0.9470
TreatmentNone reported 0.9578 0.6260 1.4655 0.8424
Age 1.0061 0.9939 1.0184 0.3274
fruitIntake_cat[2.1,5.64) 1.0927 0.6943 1.7197 0.7016
fruitIntake_cat[5.64,10.4 1.0442 0.6564 1.6612 0.8552
fruitIntake_cat[10.4,62.9 1.0492 0.6237 1.7648 0.8564
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0566 1.0000 0.8119
cat 1.4553 2.0000 0.4830
IMD 3.6766 4.0000 0.4515
dqi_tot 0.2280 1.0000 0.6330
BMI 1.0767 1.0000 0.2994
IBD Duration 2.5032 1.0000 0.1136
Treatment 7.5826 4.0000 0.1081
Age 1.1254 1.0000 0.2888
fruitIntake_cat 0.6626 3.0000 0.8820
GLOBAL 18.5584 18.0001 0.4195
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 2.0103 1.4089 2.8683 0.0001
catFC 50-250 1.2396 0.8601 1.7865 0.2494
catFC > 250 1.9257 1.2994 2.8539 0.0011
IMD2 0.7162 0.3730 1.3753 0.3160
IMD3 0.9028 0.4853 1.6795 0.7469
IMD4 0.7925 0.4298 1.4613 0.4563
IMD5 1.0134 0.5766 1.7813 0.9630
dqi_tot 1.0055 0.9900 1.0214 0.4872
BMI 1.0017 0.9735 1.0308 0.9060
IBD Duration 0.9887 0.9744 1.0031 0.1245
TreatmentMono biologic 0.9680 0.6103 1.5353 0.8902
TreatmentCombo therapy 0.8383 0.4685 1.4998 0.5523
Treatment5-ASA 0.9218 0.3809 2.2308 0.8568
TreatmentNone reported 0.9233 0.6022 1.4154 0.7141
Age 1.0066 0.9945 1.0188 0.2851
vegIntake_cat[5.04,8.43) 1.0292 0.6561 1.6145 0.9003
vegIntake_cat[8.43,13.4) 0.7980 0.4965 1.2826 0.3514
vegIntake_cat[13.4,63.1] 1.0394 0.6367 1.6970 0.8771
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0634 1.0000 0.8012
cat 1.4090 2.0000 0.4944
IMD 3.7773 4.0000 0.4370
dqi_tot 0.2365 1.0000 0.6267
BMI 1.0392 1.0000 0.3080
IBD Duration 2.5189 1.0000 0.1125
Treatment 7.5080 4.0000 0.1114
Age 1.0773 1.0000 0.2993
vegIntake_cat 7.1241 3.0000 0.0680
GLOBAL 25.6502 18.0001 0.1080
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9346 1.3677 2.7364 0.0002
catFC 50-250 1.2353 0.8575 1.7795 0.2567
catFC > 250 1.9180 1.2922 2.8469 0.0012
IMD2 0.7150 0.3720 1.3740 0.3141
IMD3 0.8784 0.4744 1.6265 0.6801
IMD4 0.8051 0.4379 1.4802 0.4853
IMD5 0.9955 0.5666 1.7489 0.9874
dqi_tot 1.0048 0.9908 1.0190 0.5012
BMI 1.0034 0.9752 1.0325 0.8133
IBD Duration 0.9892 0.9749 1.0037 0.1433
TreatmentMono biologic 0.9909 0.6255 1.5695 0.9688
TreatmentCombo therapy 0.8739 0.4893 1.5607 0.6488
Treatment5-ASA 0.9815 0.4059 2.3729 0.9669
TreatmentNone reported 0.9535 0.6256 1.4533 0.8248
Age 1.0066 0.9942 1.0191 0.3001
redMeatIntake_cat[0.365,0 0.8827 0.6001 1.2983 0.5261
redMeatIntake_cat[0.861,9 0.9352 0.6261 1.3970 0.7435
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0547 1.0000 0.8150
cat 1.4139 2.0000 0.4931
IMD 3.6365 4.0000 0.4574
dqi_tot 0.2314 1.0000 0.6305
BMI 1.0468 1.0000 0.3062
IBD Duration 2.4833 1.0000 0.1151
Treatment 7.5169 4.0000 0.1110
Age 1.1419 1.0000 0.2853
redMeatIntake_cat 0.9282 2.0000 0.6287
GLOBAL 17.6252 17.0001 0.4128
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9179 1.3522 2.7203 0.0003
catFC 50-250 1.2413 0.8604 1.7908 0.2477
catFC > 250 1.9306 1.2982 2.8712 0.0012
IMD2 0.7100 0.3687 1.3671 0.3056
IMD3 0.8793 0.4746 1.6289 0.6826
IMD4 0.7984 0.4343 1.4679 0.4687
IMD5 0.9899 0.5639 1.7378 0.9718
dqi_tot 1.0049 0.9909 1.0192 0.4921
BMI 1.0021 0.9737 1.0314 0.8839
IBD Duration 0.9898 0.9755 1.0044 0.1699
TreatmentMono biologic 1.0056 0.6343 1.5943 0.9810
TreatmentCombo therapy 0.8885 0.4950 1.5949 0.6921
Treatment5-ASA 0.9313 0.3846 2.2551 0.8746
TreatmentNone reported 0.9554 0.6251 1.4601 0.8330
Age 1.0067 0.9945 1.0191 0.2810
whiteMeatIntake_cat[0.426 0.9603 0.6025 1.5308 0.8649
whiteMeatIntake_cat[1.06, 0.8564 0.5242 1.3989 0.5357
whiteMeatIntake_cat[1.88, 1.0897 0.6918 1.7162 0.7111
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0542 1.0000 0.8160
cat 1.4999 2.0000 0.4724
IMD 3.7154 4.0000 0.4459
dqi_tot 0.2110 1.0000 0.6460
BMI 1.0535 1.0000 0.3047
IBD Duration 2.4871 1.0000 0.1148
Treatment 7.5884 4.0000 0.1079
Age 1.1587 1.0000 0.2817
whiteMeatIntake_cat 6.6175 3.0000 0.0851
GLOBAL 21.8440 18.0001 0.2390
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Objective flare

Total meat protein
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4258 0.9181 2.2141 0.1142
catFC 50-250 1.9044 1.1702 3.0992 0.0095
catFC > 250 3.0685 1.8239 5.1624 0.0000
IMD2 0.6264 0.2638 1.4877 0.2892
IMD3 0.7053 0.3066 1.6223 0.4113
IMD4 0.7980 0.3579 1.7794 0.5813
IMD5 0.7685 0.3628 1.6277 0.4916
dqi_tot 1.0051 0.9868 1.0238 0.5860
BMI 1.0129 0.9767 1.0505 0.4900
IBD Duration 0.9872 0.9675 1.0074 0.2128
TreatmentMono biologic 0.6623 0.3616 1.2130 0.1820
TreatmentCombo therapy 0.6341 0.3030 1.3267 0.2265
Treatment5-ASA 0.9051 0.2625 3.1203 0.8745
TreatmentNone reported 0.5871 0.3415 1.0091 0.0540
Age 0.9917 0.9764 1.0073 0.2974
Meat_sum_cat[24.9,35.8) 1.3188 0.7173 2.4244 0.3731
Meat_sum_cat[35.8,50.6) 1.4450 0.7971 2.6194 0.2252
Meat_sum_cat[50.6,331] 1.1721 0.6239 2.2020 0.6216
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0902 0.9707 0.7528
cat 12.8570 1.9803 0.0016
IMD 0.9454 3.9132 0.9116
dqi_tot 2.6824 0.9923 0.1004
BMI 1.5160 0.9815 0.2136
IBD Duration 0.0070 0.9887 0.9314
Treatment 2.3777 3.8853 0.6492
Age 4.7404 0.9816 0.0286
Meat_sum_cat 1.4170 2.9705 0.6964
GLOBAL 25.0449 23.3607 0.3677
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4743 0.9492 2.2899 0.0840
catFC 50-250 1.9208 1.1799 3.1268 0.0087
catFC > 250 3.1272 1.8567 5.2670 0.0000
IMD2 0.5976 0.2509 1.4237 0.2451
IMD3 0.7195 0.3123 1.6574 0.4394
IMD4 0.8005 0.3608 1.7760 0.5842
IMD5 0.8175 0.3890 1.7178 0.5948
dqi_tot 1.0038 0.9840 1.0240 0.7091
BMI 1.0153 0.9785 1.0535 0.4208
IBD Duration 0.9862 0.9664 1.0064 0.1782
TreatmentMono biologic 0.6776 0.3743 1.2269 0.1988
TreatmentCombo therapy 0.6364 0.3040 1.3325 0.2307
Treatment5-ASA 0.9275 0.2706 3.1792 0.9047
TreatmentNone reported 0.5624 0.3293 0.9607 0.0351
Age 0.9915 0.9759 1.0074 0.2919
meat_overall_cat[59.5,101 0.7251 0.3997 1.3152 0.2900
meat_overall_cat[101,153) 0.9222 0.5112 1.6635 0.7878
meat_overall_cat[153,927] 0.8652 0.4530 1.6526 0.6610
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1222 0.9722 0.7156
cat 12.4811 1.9815 0.0019
IMD 0.8460 3.9294 0.9277
dqi_tot 2.6621 0.9926 0.1017
BMI 1.4864 0.9861 0.2192
IBD Duration 0.0161 0.9907 0.8966
Treatment 2.3461 3.9054 0.6581
Age 4.6377 0.9835 0.0305
meat_overall_cat 1.5121 2.9746 0.6749
GLOBAL 22.0805 22.3445 0.4759
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4078 0.9090 2.1804 0.1254
catFC 50-250 1.8461 1.1308 3.0137 0.0142
catFC > 250 3.3715 1.9819 5.7354 0.0000
IMD2 0.7344 0.3068 1.7579 0.4882
IMD3 0.7459 0.3212 1.7321 0.4952
IMD4 0.8331 0.3703 1.8742 0.6589
IMD5 0.9165 0.4297 1.9552 0.8216
dqi_tot 1.0028 0.9836 1.0223 0.7761
BMI 1.0130 0.9770 1.0504 0.4830
IBD Duration 0.9853 0.9653 1.0058 0.1584
TreatmentMono biologic 0.6332 0.3471 1.1548 0.1361
TreatmentCombo therapy 0.5187 0.2454 1.0962 0.0856
Treatment5-ASA 1.0853 0.3115 3.7817 0.8977
TreatmentNone reported 0.5389 0.3161 0.9187 0.0231
Age 0.9911 0.9757 1.0067 0.2620
fish_overall_cat[16.4,36. 0.3895 0.2027 0.7486 0.0047
fish_overall_cat[36.5,65. 0.6436 0.3547 1.1677 0.1471
fish_overall_cat[65.8,647 1.0137 0.5703 1.8017 0.9631
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1378 0.9699 0.6983
cat 11.9756 1.9862 0.0025
IMD 0.8975 3.9217 0.9195
dqi_tot 2.4691 0.9938 0.1152
BMI 1.5991 0.9835 0.2021
IBD Duration 0.0003 0.9899 0.9858
Treatment 2.3097 3.8933 0.6630
Age 4.3097 0.9794 0.0367
fish_overall_cat 8.7595 2.9617 0.0316
GLOBAL 28.2603 22.3308 0.1796
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5104 0.9697 2.3525 0.0681
catFC 50-250 1.8547 1.1379 3.0231 0.0132
catFC > 250 3.2737 1.9347 5.5391 0.0000
IMD2 0.6188 0.2616 1.4635 0.2745
IMD3 0.6905 0.2996 1.5914 0.3847
IMD4 0.7931 0.3571 1.7615 0.5691
IMD5 0.8124 0.3843 1.7172 0.5864
dqi_tot 0.9968 0.9763 1.0177 0.7591
BMI 1.0131 0.9765 1.0512 0.4877
IBD Duration 0.9865 0.9666 1.0069 0.1945
TreatmentMono biologic 0.6681 0.3680 1.2128 0.1849
TreatmentCombo therapy 0.6415 0.3081 1.3353 0.2352
Treatment5-ASA 0.9400 0.2727 3.2399 0.9219
TreatmentNone reported 0.5830 0.3424 0.9925 0.0468
Age 0.9914 0.9759 1.0072 0.2839
fibre_cat[17,22.9) 1.0862 0.5909 1.9970 0.7900
fibre_cat[22.9,29.4) 1.5840 0.8746 2.8687 0.1291
fibre_cat[29.4,170] 1.5219 0.7930 2.9207 0.2067
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1402 0.9661 0.6943
cat 12.2248 1.9829 0.0022
IMD 0.7664 3.9192 0.9383
dqi_tot 2.7798 0.9907 0.0943
BMI 1.5050 0.9849 0.2161
IBD Duration 0.0196 0.9887 0.8857
Treatment 2.3763 3.8865 0.6497
Age 4.7345 0.9817 0.0287
fibre_cat 9.8540 2.9584 0.0191
GLOBAL 29.8237 22.9615 0.1532
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4532 0.9347 2.2591 0.0969
catFC 50-250 1.8967 1.1633 3.0924 0.0103
catFC > 250 2.9729 1.7607 5.0198 0.0000
IMD2 0.6480 0.2725 1.5411 0.3263
IMD3 0.7826 0.3357 1.8243 0.5702
IMD4 0.8936 0.3974 2.0092 0.7855
IMD5 0.8718 0.4095 1.8560 0.7219
dqi_tot 1.0027 0.9843 1.0214 0.7777
BMI 1.0145 0.9781 1.0522 0.4407
IBD Duration 0.9846 0.9647 1.0048 0.1339
TreatmentMono biologic 0.6404 0.3523 1.1643 0.1440
TreatmentCombo therapy 0.6000 0.2851 1.2628 0.1785
Treatment5-ASA 1.0267 0.2983 3.5342 0.9667
TreatmentNone reported 0.5510 0.3214 0.9447 0.0302
Age 0.9929 0.9773 1.0088 0.3810
PUFA_percEng_cat[4.54,5.1 1.2071 0.6639 2.1948 0.5373
PUFA_percEng_cat[5.17,5.9 1.1643 0.6403 2.1171 0.6180
PUFA_percEng_cat[5.92,12. 1.6861 0.9400 3.0246 0.0797
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0699 0.9686 0.7801
cat 12.6142 1.9807 0.0018
IMD 0.8460 3.9244 0.9273
dqi_tot 2.9517 0.9920 0.0848
BMI 1.5739 0.9771 0.2041
IBD Duration 0.0161 0.9901 0.8967
Treatment 2.4068 3.8956 0.6455
Age 4.9206 0.9822 0.0258
PUFA_percEng_cat 5.6180 2.9449 0.1271
GLOBAL 29.5319 23.1511 0.1687
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4972 0.9623 2.3296 0.0735
catFC 50-250 1.9442 1.1891 3.1788 0.0080
catFC > 250 3.1859 1.8829 5.3909 0.0000
IMD2 0.5659 0.2361 1.3561 0.2017
IMD3 0.6884 0.2972 1.5948 0.3837
IMD4 0.7634 0.3421 1.7040 0.5100
IMD5 0.7565 0.3566 1.6048 0.4670
dqi_tot 1.0042 0.9859 1.0228 0.6582
BMI 1.0163 0.9797 1.0542 0.3878
IBD Duration 0.9875 0.9676 1.0078 0.2265
TreatmentMono biologic 0.6723 0.3672 1.2311 0.1984
TreatmentCombo therapy 0.6639 0.3180 1.3861 0.2754
Treatment5-ASA 0.9018 0.2611 3.1150 0.8702
TreatmentNone reported 0.5856 0.3420 1.0026 0.0511
Age 0.9913 0.9758 1.0070 0.2766
NOVAScore_catProcessed cu 1.4672 0.8296 2.5949 0.1876
NOVAScore_catProcessed fo 1.3647 0.7487 2.4873 0.3100
NOVAScore_catUltra-proces 1.0972 0.5944 2.0251 0.7668
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1029 0.9630 0.7339
cat 12.4024 1.9803 0.0020
IMD 0.8203 3.9154 0.9305
dqi_tot 2.6810 0.9917 0.1004
BMI 1.7043 0.9796 0.1871
IBD Duration 0.0296 0.9879 0.8599
Treatment 2.3508 3.8824 0.6537
Age 4.8338 0.9823 0.0271
NOVAScore_cat 4.5958 2.9453 0.1975
GLOBAL 24.2642 23.4801 0.4167
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3762 0.8865 2.1362 0.1547
catFC 50-250 1.8108 1.1090 2.9567 0.0176
catFC > 250 2.9081 1.7217 4.9120 0.0001
IMD2 0.6260 0.2654 1.4765 0.2846
IMD3 0.7432 0.3231 1.7096 0.4850
IMD4 0.8348 0.3776 1.8458 0.6557
IMD5 0.8438 0.4006 1.7775 0.6551
dqi_tot 0.9988 0.9797 1.0182 0.8992
BMI 1.0170 0.9810 1.0544 0.3584
IBD Duration 0.9864 0.9663 1.0069 0.1915
TreatmentMono biologic 0.6629 0.3681 1.1940 0.1709
TreatmentCombo therapy 0.6323 0.3036 1.3172 0.2209
Treatment5-ASA 0.9592 0.2792 3.2948 0.9472
TreatmentNone reported 0.5591 0.3262 0.9581 0.0344
Age 0.9905 0.9748 1.0065 0.2423
UPF_perc_cat[36.8,44.3) 0.9553 0.5332 1.7116 0.8778
UPF_perc_cat[44.3,52.6) 0.5647 0.3072 1.0383 0.0659
UPF_perc_cat[52.6,92.5] 0.6696 0.3624 1.2370 0.2003
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0804 0.9734 0.7669
cat 12.7852 1.9816 0.0016
IMD 0.7226 3.9212 0.9443
dqi_tot 2.5822 0.9939 0.1072
BMI 1.5675 0.9837 0.2066
IBD Duration 0.0247 0.9897 0.8723
Treatment 2.2330 3.9124 0.6800
Age 4.9515 0.9850 0.0255
UPF_perc_cat 1.6450 2.9776 0.6451
GLOBAL 24.5636 21.8347 0.3096
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3896 0.8927 2.1631 0.1451
catFC 50-250 1.9313 1.1847 3.1483 0.0083
catFC > 250 3.0204 1.7945 5.0840 0.0000
IMD2 0.6122 0.2565 1.4613 0.2690
IMD3 0.7623 0.3273 1.7755 0.5293
IMD4 0.8362 0.3737 1.8710 0.6633
IMD5 0.8466 0.3965 1.8078 0.6671
dqi_tot 1.0016 0.9830 1.0205 0.8683
BMI 1.0142 0.9772 1.0525 0.4579
IBD Duration 0.9875 0.9679 1.0076 0.2212
TreatmentMono biologic 0.5802 0.3157 1.0665 0.0796
TreatmentCombo therapy 0.6149 0.2939 1.2862 0.1965
Treatment5-ASA 0.8696 0.2523 2.9979 0.8249
TreatmentNone reported 0.4986 0.2872 0.8657 0.0134
Age 0.9945 0.9789 1.0104 0.4963
breadIntake_cat[1.97,3.23 0.6424 0.3652 1.1299 0.1245
breadIntake_cat[3.23,4.84 0.6160 0.3426 1.1075 0.1055
breadIntake_cat[4.84,18.9 0.4781 0.2571 0.8888 0.0197
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0677 0.9667 0.7827
cat 12.6001 1.9784 0.0018
IMD 0.9141 3.9152 0.9166
dqi_tot 2.7101 0.9921 0.0987
BMI 1.6617 0.9813 0.1930
IBD Duration 0.0264 0.9882 0.8677
Treatment 2.3075 3.8921 0.6632
Age 4.8571 0.9819 0.0268
breadIntake_cat 0.8728 2.9658 0.8273
GLOBAL 23.4941 23.6374 0.4696
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5019 0.9663 2.3344 0.0706
catFC 50-250 1.8832 1.1558 3.0683 0.0110
catFC > 250 3.0074 1.7918 5.0475 0.0000
IMD2 0.6296 0.2664 1.4875 0.2915
IMD3 0.7317 0.3172 1.6878 0.4638
IMD4 0.8344 0.3767 1.8483 0.6555
IMD5 0.8489 0.4035 1.7859 0.6660
dqi_tot 1.0028 0.9842 1.0218 0.7693
BMI 1.0154 0.9789 1.0533 0.4138
IBD Duration 0.9863 0.9664 1.0067 0.1868
TreatmentMono biologic 0.6837 0.3778 1.2376 0.2092
TreatmentCombo therapy 0.6829 0.3272 1.4251 0.3095
Treatment5-ASA 0.9830 0.2828 3.4165 0.9784
TreatmentNone reported 0.5916 0.3445 1.0160 0.0571
Age 0.9909 0.9755 1.0066 0.2530
sweetIntake_cat[2.83,4.36 0.7547 0.4258 1.3375 0.3351
sweetIntake_cat[4.36,6.17 0.7649 0.4331 1.3506 0.3555
sweetIntake_cat[6.17,17.3 0.9197 0.5106 1.6566 0.7804
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1175 0.9709 0.7203
cat 12.6257 1.9830 0.0018
IMD 0.7718 3.9287 0.9381
dqi_tot 2.7080 0.9942 0.0991
BMI 1.3626 0.9847 0.2389
IBD Duration 0.0166 0.9890 0.8947
Treatment 2.2690 3.9054 0.6723
Age 4.7375 0.9837 0.0288
sweetIntake_cat 0.7682 2.9682 0.8531
GLOBAL 22.6525 21.9764 0.4202
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4830 0.9537 2.3061 0.0802
catFC 50-250 1.8965 1.1649 3.0877 0.0101
catFC > 250 3.0495 1.8080 5.1434 0.0000
IMD2 0.6044 0.2548 1.4336 0.2532
IMD3 0.6728 0.2923 1.5486 0.3515
IMD4 0.7718 0.3493 1.7053 0.5219
IMD5 0.7601 0.3616 1.5978 0.4693
dqi_tot 1.0011 0.9827 1.0198 0.9074
BMI 1.0214 0.9867 1.0574 0.2296
IBD Duration 0.9876 0.9682 1.0075 0.2216
TreatmentMono biologic 0.6787 0.3733 1.2339 0.2037
TreatmentCombo therapy 0.6459 0.3072 1.3581 0.2490
Treatment5-ASA 0.9574 0.2769 3.3107 0.9452
TreatmentNone reported 0.5676 0.3313 0.9722 0.0392
Age 0.9861 0.9700 1.0025 0.0953
drinkIntake_cat[0.301,4.2 0.7030 0.3921 1.2605 0.2369
drinkIntake_cat[4.21,14.4 0.5929 0.3299 1.0655 0.0805
drinkIntake_cat[14.4,120] 0.5114 0.2869 0.9116 0.0230
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1040 0.9706 0.7356
cat 12.3701 1.9818 0.0020
IMD 0.9965 3.9229 0.9044
dqi_tot 2.9561 0.9940 0.0848
BMI 1.4734 0.9757 0.2186
IBD Duration 0.0106 0.9902 0.9160
Treatment 2.3378 3.8852 0.6565
Age 4.7131 0.9857 0.0293
drinkIntake_cat 1.4753 2.9732 0.6832
GLOBAL 24.7881 22.4537 0.3315
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4411 0.9270 2.2402 0.1045
catFC 50-250 1.8487 1.1330 3.0164 0.0139
catFC > 250 2.9601 1.7561 4.9896 0.0000
IMD2 0.6165 0.2582 1.4721 0.2761
IMD3 0.6967 0.3007 1.6144 0.3993
IMD4 0.7901 0.3566 1.7503 0.5615
IMD5 0.8093 0.3809 1.7197 0.5822
dqi_tot 1.0037 0.9838 1.0240 0.7192
BMI 1.0140 0.9775 1.0520 0.4567
IBD Duration 0.9875 0.9675 1.0079 0.2283
TreatmentMono biologic 0.6872 0.3797 1.2438 0.2153
TreatmentCombo therapy 0.6793 0.3252 1.4187 0.3034
Treatment5-ASA 0.9641 0.2809 3.3092 0.9537
TreatmentNone reported 0.5834 0.3417 0.9960 0.0483
Age 0.9914 0.9759 1.0072 0.2850
processedMeatIntake_cat[0 0.9817 0.5291 1.8214 0.9534
processedMeatIntake_cat[1 1.1865 0.6548 2.1500 0.5729
processedMeatIntake_cat[2 0.9168 0.4589 1.8313 0.8055
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1082 0.9720 0.7313
cat 12.5552 1.9819 0.0018
IMD 0.8467 3.9268 0.9274
dqi_tot 2.7855 0.9924 0.0941
BMI 1.4152 0.9855 0.2304
IBD Duration 0.0170 0.9887 0.8933
Treatment 2.2942 3.8984 0.6666
Age 4.5695 0.9831 0.0317
processedMeatIntake_cat 1.0518 2.9664 0.7836
GLOBAL 22.6896 22.3300 0.4391
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4635 0.9451 2.2663 0.0879
catFC 50-250 1.8746 1.1526 3.0489 0.0113
catFC > 250 3.0482 1.8153 5.1186 0.0000
IMD2 0.5950 0.2521 1.4045 0.2361
IMD3 0.7045 0.3069 1.6171 0.4087
IMD4 0.7851 0.3563 1.7301 0.5485
IMD5 0.8013 0.3821 1.6803 0.5576
dqi_tot 1.0028 0.9842 1.0217 0.7723
BMI 1.0138 0.9776 1.0512 0.4604
IBD Duration 0.9863 0.9664 1.0065 0.1824
TreatmentMono biologic 0.6630 0.3658 1.2017 0.1756
TreatmentCombo therapy 0.6432 0.3091 1.3387 0.2380
Treatment5-ASA 0.9546 0.2786 3.2705 0.9410
TreatmentNone reported 0.5717 0.3351 0.9753 0.0402
Age 0.9924 0.9768 1.0083 0.3493
processedPlantIntake_cat[ 1.1526 0.7140 1.8606 0.5611
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1035 0.9704 0.7362
cat 12.6390 1.9829 0.0018
IMD 0.8342 3.9264 0.9292
dqi_tot 2.7338 0.9919 0.0972
BMI 1.4522 0.9836 0.2239
IBD Duration 0.0166 0.9911 0.8954
Treatment 2.2804 3.9002 0.6694
Age 4.6844 0.9858 0.0298
processedPlantIntake_cat 0.0001 0.9910 0.9927
GLOBAL 22.3132 20.3953 0.3463
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Ulcerative colitis

Patient-reported flare

Total meat protein
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6687 1.2352 2.2542 0.0008
catFC 50-250 1.8234 1.3118 2.5346 0.0004
catFC > 250 2.1467 1.4824 3.1089 0.0001
IMD2 1.6309 0.8364 3.1801 0.1511
IMD3 1.1241 0.5912 2.1376 0.7212
IMD4 1.3652 0.7447 2.5027 0.3140
IMD5 1.1471 0.6255 2.1038 0.6573
dqi_tot 1.0053 0.9917 1.0191 0.4439
BMI 0.9831 0.9532 1.0140 0.2815
IBD Duration 0.9953 0.9793 1.0116 0.5695
TreatmentMono biologic 0.5944 0.3270 1.0803 0.0879
TreatmentCombo therapy 0.3237 0.1347 0.7779 0.0117
Treatment5-ASA 0.8803 0.5864 1.3217 0.5387
TreatmentNone reported 0.8029 0.5327 1.2101 0.2943
Age 0.9879 0.9773 0.9986 0.0266
Meat_sum_cat[24.9,35.8) 1.1634 0.7691 1.7598 0.4735
Meat_sum_cat[35.8,50.6) 1.3192 0.8695 2.0014 0.1928
Meat_sum_cat[50.6,331] 1.3211 0.8463 2.0623 0.2204
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0130 1.0000 0.9093
cat 3.0032 2.0000 0.2228
IMD 2.3584 4.0000 0.6702
dqi_tot 0.7726 1.0000 0.3794
BMI 0.9483 1.0000 0.3301
IBD Duration 3.7730 1.0000 0.0521
Treatment 0.7081 4.0000 0.9503
Age 0.3967 1.0000 0.5288
Meat_sum_cat 9.0306 3.0000 0.0289
GLOBAL 21.2683 18.0001 0.2661
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6503 1.2180 2.2361 0.0012
catFC 50-250 1.8423 1.3234 2.5647 0.0003
catFC > 250 2.1215 1.4655 3.0710 0.0001
IMD2 1.5567 0.8009 3.0259 0.1919
IMD3 1.1136 0.5862 2.1156 0.7423
IMD4 1.3348 0.7280 2.4473 0.3505
IMD5 1.1124 0.6072 2.0381 0.7302
dqi_tot 1.0056 0.9907 1.0208 0.4625
BMI 0.9816 0.9518 1.0123 0.2368
IBD Duration 0.9956 0.9796 1.0118 0.5897
TreatmentMono biologic 0.6428 0.3540 1.1672 0.1465
TreatmentCombo therapy 0.3432 0.1431 0.8229 0.0165
Treatment5-ASA 0.9083 0.6061 1.3611 0.6413
TreatmentNone reported 0.8338 0.5562 1.2499 0.3788
Age 0.9882 0.9776 0.9989 0.0315
meat_overall_cat[59.5,101 0.9430 0.6201 1.4339 0.7836
meat_overall_cat[101,153) 1.2675 0.8354 1.9231 0.2651
meat_overall_cat[153,927] 1.0959 0.6808 1.7642 0.7061
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0075 1.0000 0.9310
cat 2.9048 2.0000 0.2340
IMD 2.3155 4.0000 0.6779
dqi_tot 0.7813 1.0000 0.3768
BMI 0.9735 1.0000 0.3238
IBD Duration 3.6328 1.0000 0.0567
Treatment 0.6715 4.0000 0.9548
Age 0.4446 1.0000 0.5049
meat_overall_cat 7.1590 3.0000 0.0670
GLOBAL 21.5437 18.0001 0.2529
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6490 1.2220 2.2250 0.0011
catFC 50-250 1.7443 1.2467 2.4406 0.0012
catFC > 250 2.1011 1.4509 3.0426 0.0001
IMD2 1.6247 0.8358 3.1583 0.1524
IMD3 1.1151 0.5865 2.1200 0.7397
IMD4 1.3919 0.7558 2.5632 0.2885
IMD5 1.1822 0.6432 2.1729 0.5900
dqi_tot 0.9984 0.9849 1.0121 0.8176
BMI 0.9878 0.9574 1.0191 0.4402
IBD Duration 0.9953 0.9793 1.0117 0.5739
TreatmentMono biologic 0.5637 0.3094 1.0271 0.0611
TreatmentCombo therapy 0.3040 0.1267 0.7292 0.0076
Treatment5-ASA 0.8974 0.5980 1.3468 0.6013
TreatmentNone reported 0.8140 0.5433 1.2197 0.3186
Age 0.9860 0.9752 0.9968 0.0115
fish_overall_cat[16.4,36. 1.3033 0.8504 1.9975 0.2240
fish_overall_cat[36.5,65. 1.4322 0.9294 2.2068 0.1035
fish_overall_cat[65.8,647 1.6939 1.1157 2.5717 0.0134
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0080 1.0000 0.9287
cat 3.0146 2.0000 0.2215
IMD 2.3677 4.0000 0.6685
dqi_tot 0.7740 1.0000 0.3790
BMI 0.8820 1.0000 0.3476
IBD Duration 4.0562 1.0000 0.0440
Treatment 0.7427 4.0000 0.9460
Age 0.3624 1.0000 0.5472
fish_overall_cat 0.6304 3.0000 0.8894
GLOBAL 14.8077 18.0001 0.6751
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6276 1.2021 2.2038 0.0016
catFC 50-250 1.8278 1.3145 2.5415 0.0003
catFC > 250 2.1649 1.4918 3.1416 0.0000
IMD2 1.4667 0.7493 2.8706 0.2637
IMD3 1.0980 0.5754 2.0952 0.7768
IMD4 1.3294 0.7245 2.4394 0.3579
IMD5 1.1239 0.6122 2.0631 0.7063
dqi_tot 1.0038 0.9896 1.0182 0.6026
BMI 0.9830 0.9528 1.0142 0.2818
IBD Duration 0.9960 0.9801 1.0121 0.6246
TreatmentMono biologic 0.6174 0.3409 1.1182 0.1115
TreatmentCombo therapy 0.3339 0.1398 0.7979 0.0136
Treatment5-ASA 0.9147 0.6107 1.3698 0.6651
TreatmentNone reported 0.8424 0.5615 1.2638 0.4072
Age 0.9874 0.9769 0.9981 0.0212
fibre_cat[17,22.9) 0.8423 0.5596 1.2679 0.4108
fibre_cat[22.9,29.4) 0.9560 0.6161 1.4833 0.8409
fibre_cat[29.4,170] 0.8309 0.5272 1.3096 0.4249
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0046 1.0000 0.9459
cat 3.0864 2.0000 0.2137
IMD 2.3596 4.0000 0.6699
dqi_tot 0.7499 1.0000 0.3865
BMI 0.9634 1.0000 0.3263
IBD Duration 3.7769 1.0000 0.0520
Treatment 0.6869 4.0000 0.9529
Age 0.3875 1.0000 0.5336
fibre_cat 0.8273 3.0000 0.8429
GLOBAL 15.3576 18.0001 0.6373
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6248 1.2044 2.1919 0.0015
catFC 50-250 1.8542 1.3336 2.5781 0.0002
catFC > 250 2.1382 1.4760 3.0977 0.0001
IMD2 1.5188 0.7821 2.9495 0.2172
IMD3 1.0814 0.5683 2.0578 0.8115
IMD4 1.3154 0.7178 2.4104 0.3751
IMD5 1.1135 0.6070 2.0425 0.7284
dqi_tot 1.0026 0.9895 1.0160 0.6976
BMI 0.9854 0.9554 1.0164 0.3530
IBD Duration 0.9956 0.9798 1.0118 0.5941
TreatmentMono biologic 0.6261 0.3437 1.1405 0.1259
TreatmentCombo therapy 0.3432 0.1438 0.8192 0.0160
Treatment5-ASA 0.9036 0.6023 1.3556 0.6243
TreatmentNone reported 0.8590 0.5715 1.2913 0.4650
Age 0.9884 0.9777 0.9991 0.0345
PUFA_percEng_cat[4.54,5.1 0.9391 0.6308 1.3982 0.7571
PUFA_percEng_cat[5.17,5.9 0.8391 0.5577 1.2623 0.3998
PUFA_percEng_cat[5.92,12. 1.0807 0.7273 1.6058 0.7008
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0126 1.0000 0.9105
cat 3.0473 2.0000 0.2179
IMD 2.3768 4.0000 0.6668
dqi_tot 0.7430 1.0000 0.3887
BMI 0.9051 1.0000 0.3414
IBD Duration 3.7937 1.0000 0.0514
Treatment 0.7223 4.0000 0.9485
Age 0.3529 1.0000 0.5525
PUFA_percEng_cat 2.9070 3.0000 0.4062
GLOBAL 17.6047 18.0001 0.4820
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6163 1.1973 2.1821 0.0017
catFC 50-250 1.8269 1.3151 2.5378 0.0003
catFC > 250 2.0940 1.4464 3.0316 0.0001
IMD2 1.4919 0.7632 2.9161 0.2421
IMD3 1.0752 0.5642 2.0490 0.8255
IMD4 1.3065 0.7106 2.4022 0.3896
IMD5 1.1090 0.6045 2.0348 0.7382
dqi_tot 1.0027 0.9895 1.0160 0.6935
BMI 0.9823 0.9522 1.0133 0.2601
IBD Duration 0.9953 0.9794 1.0115 0.5707
TreatmentMono biologic 0.6076 0.3352 1.1013 0.1006
TreatmentCombo therapy 0.3365 0.1410 0.8033 0.0142
Treatment5-ASA 0.9006 0.6013 1.3490 0.6116
TreatmentNone reported 0.8391 0.5605 1.2562 0.3942
Age 0.9877 0.9771 0.9984 0.0239
NOVAScore_catProcessed cu 0.8179 0.5517 1.2124 0.3168
NOVAScore_catProcessed fo 0.9115 0.6186 1.3431 0.6394
NOVAScore_catUltra-proces 0.9405 0.6293 1.4056 0.7648
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0032 1.0000 0.9546
cat 3.1304 2.0000 0.2090
IMD 2.3725 4.0000 0.6676
dqi_tot 0.7594 1.0000 0.3835
BMI 0.9674 1.0000 0.3253
IBD Duration 3.7175 1.0000 0.0538
Treatment 0.7059 4.0000 0.9506
Age 0.4235 1.0000 0.5152
NOVAScore_cat 3.2381 3.0000 0.3564
GLOBAL 18.5498 18.0001 0.4200
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6321 1.2089 2.2036 0.0014
catFC 50-250 2.0751 1.4827 2.9041 0.0000
catFC > 250 2.3683 1.6261 3.4492 0.0000
IMD2 1.4433 0.7439 2.8004 0.2779
IMD3 1.0141 0.5319 1.9331 0.9662
IMD4 1.2412 0.6755 2.2805 0.4863
IMD5 1.0195 0.5524 1.8818 0.9507
dqi_tot 0.9965 0.9829 1.0102 0.6126
BMI 0.9835 0.9537 1.0142 0.2882
IBD Duration 0.9963 0.9804 1.0125 0.6538
TreatmentMono biologic 0.6116 0.3363 1.1123 0.1071
TreatmentCombo therapy 0.3241 0.1348 0.7793 0.0118
Treatment5-ASA 0.8484 0.5636 1.2772 0.4309
TreatmentNone reported 0.7564 0.4994 1.1457 0.1876
Age 0.9854 0.9750 0.9959 0.0066
UPF_perc_cat[36.8,44.3) 0.5422 0.3699 0.7948 0.0017
UPF_perc_cat[44.3,52.6) 0.5120 0.3413 0.7681 0.0012
UPF_perc_cat[52.6,92.5] 0.4784 0.3109 0.7361 0.0008
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0062 1.0000 0.9371
cat 2.6659 2.0000 0.2637
IMD 2.0797 4.0000 0.7211
dqi_tot 0.8588 1.0000 0.3541
BMI 0.8081 1.0000 0.3687
IBD Duration 3.8038 1.0000 0.0511
Treatment 0.8055 4.0000 0.9377
Age 0.3595 1.0000 0.5488
UPF_perc_cat 0.6803 3.0000 0.8778
GLOBAL 14.8850 18.0001 0.6699
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5516 1.1463 2.1003 0.0045
catFC 50-250 1.8684 1.3431 2.5991 0.0002
catFC > 250 2.1272 1.4664 3.0857 0.0001
IMD2 1.5630 0.8032 3.0413 0.1886
IMD3 1.1022 0.5760 2.1093 0.7688
IMD4 1.2923 0.7023 2.3779 0.4098
IMD5 1.0629 0.5755 1.9631 0.8455
dqi_tot 1.0020 0.9892 1.0150 0.7574
BMI 0.9811 0.9507 1.0124 0.2342
IBD Duration 0.9954 0.9795 1.0116 0.5785
TreatmentMono biologic 0.5148 0.2817 0.9406 0.0309
TreatmentCombo therapy 0.2930 0.1222 0.7026 0.0059
Treatment5-ASA 0.8290 0.5500 1.2495 0.3703
TreatmentNone reported 0.7928 0.5276 1.1913 0.2637
Age 0.9879 0.9772 0.9987 0.0277
breadIntake_cat[1.97,3.23 1.6003 1.0936 2.3417 0.0155
breadIntake_cat[3.23,4.84 1.0427 0.6876 1.5811 0.8440
breadIntake_cat[4.84,18.9 0.8514 0.5531 1.3105 0.4647
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0036 1.0000 0.9523
cat 2.9365 2.0000 0.2303
IMD 2.2096 4.0000 0.6973
dqi_tot 0.8262 1.0000 0.3634
BMI 1.1216 1.0000 0.2896
IBD Duration 3.4815 1.0000 0.0621
Treatment 0.7616 4.0000 0.9435
Age 0.3854 1.0000 0.5347
breadIntake_cat 6.5052 3.0000 0.0895
GLOBAL 21.6033 18.0001 0.2501
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6769 1.2390 2.2696 0.0008
catFC 50-250 1.9253 1.3770 2.6921 0.0001
catFC > 250 2.1157 1.4585 3.0691 0.0001
IMD2 1.5563 0.8020 3.0201 0.1910
IMD3 1.1301 0.5897 2.1659 0.7124
IMD4 1.3542 0.7379 2.4852 0.3276
IMD5 1.1293 0.6147 2.0747 0.6951
dqi_tot 1.0009 0.9878 1.0142 0.8932
BMI 0.9846 0.9547 1.0153 0.3215
IBD Duration 0.9953 0.9794 1.0115 0.5690
TreatmentMono biologic 0.6215 0.3423 1.1282 0.1179
TreatmentCombo therapy 0.3199 0.1329 0.7697 0.0110
Treatment5-ASA 0.8656 0.5746 1.3040 0.4900
TreatmentNone reported 0.8040 0.5334 1.2118 0.2972
Age 0.9880 0.9774 0.9987 0.0282
sweetIntake_cat[2.83,4.36 0.7592 0.5110 1.1281 0.1728
sweetIntake_cat[4.36,6.17 0.7699 0.5155 1.1499 0.2014
sweetIntake_cat[6.17,17.3 0.6755 0.4552 1.0023 0.0514
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0009 1.0000 0.9763
cat 2.8956 2.0000 0.2351
IMD 2.2706 4.0000 0.6861
dqi_tot 0.7872 1.0000 0.3749
BMI 0.8448 1.0000 0.3580
IBD Duration 3.9650 1.0000 0.0465
Treatment 0.6876 4.0000 0.9529
Age 0.4044 1.0000 0.5248
sweetIntake_cat 1.3462 3.0000 0.7182
GLOBAL 15.6703 18.0001 0.6155
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6299 1.2072 2.2005 0.0014
catFC 50-250 1.8535 1.3315 2.5801 0.0003
catFC > 250 2.1131 1.4605 3.0572 0.0001
IMD2 1.6387 0.8398 3.1976 0.1476
IMD3 1.1825 0.6197 2.2565 0.6111
IMD4 1.3996 0.7611 2.5738 0.2794
IMD5 1.1681 0.6358 2.1460 0.6166
dqi_tot 1.0021 0.9891 1.0154 0.7492
BMI 0.9840 0.9532 1.0158 0.3208
IBD Duration 0.9951 0.9792 1.0112 0.5481
TreatmentMono biologic 0.6110 0.3378 1.1054 0.1034
TreatmentCombo therapy 0.3355 0.1404 0.8020 0.0140
Treatment5-ASA 0.9087 0.6065 1.3615 0.6427
TreatmentNone reported 0.8599 0.5722 1.2922 0.4676
Age 0.9862 0.9754 0.9972 0.0140
drinkIntake_cat[0.301,4.2 0.7589 0.5150 1.1185 0.1633
drinkIntake_cat[4.21,14.4 0.9961 0.6628 1.4969 0.9850
drinkIntake_cat[14.4,120] 0.8345 0.5436 1.2810 0.4080
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0056 1.0000 0.9402
cat 3.1615 2.0000 0.2058
IMD 2.2694 4.0000 0.6863
dqi_tot 0.7714 1.0000 0.3798
BMI 0.9727 1.0000 0.3240
IBD Duration 3.5112 1.0000 0.0610
Treatment 0.7325 4.0000 0.9473
Age 0.4333 1.0000 0.5104
drinkIntake_cat 1.1374 3.0000 0.7681
GLOBAL 15.5559 18.0001 0.6235
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6089 1.1860 2.1827 0.0022
catFC 50-250 1.8684 1.3412 2.6030 0.0002
catFC > 250 2.1294 1.4698 3.0848 0.0001
IMD2 1.5031 0.7700 2.9343 0.2324
IMD3 1.0853 0.5682 2.0731 0.8041
IMD4 1.3166 0.7161 2.4208 0.3760
IMD5 1.1003 0.5968 2.0286 0.7595
dqi_tot 1.0004 0.9862 1.0149 0.9518
BMI 0.9844 0.9545 1.0153 0.3190
IBD Duration 0.9958 0.9799 1.0120 0.6098
TreatmentMono biologic 0.6269 0.3442 1.1418 0.1269
TreatmentCombo therapy 0.3353 0.1404 0.8010 0.0139
Treatment5-ASA 0.9100 0.6082 1.3615 0.6464
TreatmentNone reported 0.8382 0.5599 1.2546 0.3910
Age 0.9877 0.9772 0.9983 0.0234
processedMeatIntake_cat[0 0.8687 0.5806 1.2998 0.4936
processedMeatIntake_cat[1 0.8618 0.5723 1.2977 0.4763
processedMeatIntake_cat[2 0.8494 0.5438 1.3269 0.4734
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0022 1.0000 0.9630
cat 3.0987 2.0000 0.2124
IMD 2.3633 4.0000 0.6693
dqi_tot 0.7192 1.0000 0.3964
BMI 0.9622 1.0000 0.3266
IBD Duration 3.6656 1.0000 0.0555
Treatment 0.7135 4.0000 0.9497
Age 0.3978 1.0000 0.5282
processedMeatIntake_cat 2.4274 3.0000 0.4886
GLOBAL 18.0011 18.0001 0.4556
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6311 1.2095 2.1996 0.0013
catFC 50-250 1.8252 1.3126 2.5380 0.0003
catFC > 250 2.1248 1.4679 3.0757 0.0001
IMD2 1.5174 0.7817 2.9455 0.2179
IMD3 1.1249 0.5922 2.1369 0.7192
IMD4 1.3458 0.7348 2.4650 0.3361
IMD5 1.1385 0.6209 2.0875 0.6750
dqi_tot 1.0032 0.9900 1.0167 0.6357
BMI 0.9838 0.9540 1.0145 0.2978
IBD Duration 0.9953 0.9795 1.0115 0.5686
TreatmentMono biologic 0.6299 0.3480 1.1402 0.1269
TreatmentCombo therapy 0.3403 0.1426 0.8123 0.0152
Treatment5-ASA 0.9188 0.6134 1.3764 0.6814
TreatmentNone reported 0.8517 0.5686 1.2757 0.4361
Age 0.9870 0.9763 0.9979 0.0197
processedPlantIntake_cat[ 0.9074 0.6453 1.2760 0.5764
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0056 1.0000 0.9402
cat 3.0817 2.0000 0.2142
IMD 2.3835 4.0000 0.6656
dqi_tot 0.7567 1.0000 0.3844
BMI 0.9233 1.0000 0.3366
IBD Duration 3.7480 1.0000 0.0529
Treatment 0.6882 4.0000 0.9528
Age 0.3883 1.0000 0.5332
processedPlantIntake_cat 1.4338 1.0000 0.2312
GLOBAL 15.4224 16.0001 0.4940
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6083 1.1915 2.1710 0.0019
catFC 50-250 1.8480 1.3304 2.5669 0.0002
catFC > 250 2.1082 1.4571 3.0503 0.0001
IMD2 1.4958 0.7686 2.9111 0.2360
IMD3 1.0902 0.5719 2.0783 0.7929
IMD4 1.3212 0.7190 2.4279 0.3695
IMD5 1.1000 0.5972 2.0263 0.7597
dqi_tot 1.0006 0.9861 1.0153 0.9351
BMI 0.9832 0.9536 1.0138 0.2788
IBD Duration 0.9956 0.9797 1.0118 0.5948
TreatmentMono biologic 0.6320 0.3488 1.1454 0.1304
TreatmentCombo therapy 0.3443 0.1440 0.8229 0.0165
Treatment5-ASA 0.9070 0.6029 1.3645 0.6395
TreatmentNone reported 0.8510 0.5675 1.2761 0.4350
Age 0.9875 0.9769 0.9982 0.0222
fruitIntake_cat[2.1,5.64) 1.1542 0.7438 1.7909 0.5224
fruitIntake_cat[5.64,10.4 1.0826 0.6968 1.6819 0.7240
fruitIntake_cat[10.4,62.9 1.1674 0.7258 1.8777 0.5232
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0052 1.0000 0.9426
cat 3.0181 2.0000 0.2211
IMD 2.3499 4.0000 0.6717
dqi_tot 0.7382 1.0000 0.3902
BMI 0.9408 1.0000 0.3321
IBD Duration 3.7474 1.0000 0.0529
Treatment 0.6981 4.0000 0.9516
Age 0.3941 1.0000 0.5301
fruitIntake_cat 3.1104 3.0000 0.3749
GLOBAL 17.8409 18.0001 0.4662
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5989 1.1809 2.1648 0.0024
catFC 50-250 1.8458 1.3240 2.5733 0.0003
catFC > 250 2.0875 1.4422 3.0217 0.0001
IMD2 1.5768 0.8084 3.0756 0.1815
IMD3 1.1489 0.5999 2.2004 0.6754
IMD4 1.3833 0.7499 2.5517 0.2990
IMD5 1.1149 0.6067 2.0490 0.7261
dqi_tot 0.9999 0.9858 1.0143 0.9903
BMI 0.9845 0.9545 1.0154 0.3219
IBD Duration 0.9951 0.9792 1.0112 0.5454
TreatmentMono biologic 0.6059 0.3345 1.0973 0.0982
TreatmentCombo therapy 0.3380 0.1412 0.8088 0.0148
Treatment5-ASA 0.8786 0.5829 1.3243 0.5363
TreatmentNone reported 0.8280 0.5509 1.2446 0.3641
Age 0.9880 0.9773 0.9989 0.0304
vegIntake_cat[5.04,8.43) 1.1653 0.7656 1.7736 0.4753
vegIntake_cat[8.43,13.4) 1.3412 0.8778 2.0492 0.1747
vegIntake_cat[13.4,63.1] 1.1919 0.7543 1.8835 0.4520
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0036 1.0000 0.9521
cat 3.0506 2.0000 0.2176
IMD 2.3284 4.0000 0.6756
dqi_tot 0.7012 1.0000 0.4024
BMI 0.9063 1.0000 0.3411
IBD Duration 3.6576 1.0000 0.0558
Treatment 0.7098 4.0000 0.9501
Age 0.4159 1.0000 0.5190
vegIntake_cat 0.1758 3.0000 0.9814
GLOBAL 15.3583 18.0001 0.6372
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6504 1.2221 2.2287 0.0011
catFC 50-250 1.8078 1.2990 2.5158 0.0004
catFC > 250 2.0715 1.4295 3.0019 0.0001
IMD2 1.4806 0.7626 2.8748 0.2463
IMD3 1.1013 0.5798 2.0917 0.7682
IMD4 1.3225 0.7218 2.4230 0.3657
IMD5 1.1057 0.6028 2.0281 0.7456
dqi_tot 1.0014 0.9878 1.0151 0.8464
BMI 0.9846 0.9547 1.0155 0.3251
IBD Duration 0.9957 0.9798 1.0119 0.5995
TreatmentMono biologic 0.6108 0.3374 1.1055 0.1034
TreatmentCombo therapy 0.3289 0.1376 0.7859 0.0123
Treatment5-ASA 0.8767 0.5843 1.3154 0.5249
TreatmentNone reported 0.8343 0.5574 1.2489 0.3789
Age 0.9882 0.9775 0.9990 0.0325
redMeatIntake_cat[0.365,0 1.1775 0.8415 1.6476 0.3406
redMeatIntake_cat[0.861,9 0.8565 0.5895 1.2444 0.4163
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0005 1.0000 0.9829
cat 3.1896 2.0000 0.2030
IMD 2.4031 4.0000 0.6621
dqi_tot 0.7023 1.0000 0.4020
BMI 0.8941 1.0000 0.3444
IBD Duration 3.7874 1.0000 0.0516
Treatment 0.7302 4.0000 0.9476
Age 0.3770 1.0000 0.5392
redMeatIntake_cat 1.5874 2.0000 0.4522
GLOBAL 15.5571 17.0001 0.5554
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6088 1.1922 2.1708 0.0019
catFC 50-250 1.8552 1.3325 2.5829 0.0003
catFC > 250 2.1003 1.4486 3.0451 0.0001
IMD2 1.5350 0.7893 2.9851 0.2067
IMD3 1.1016 0.5803 2.0912 0.7673
IMD4 1.3593 0.7401 2.4966 0.3223
IMD5 1.1285 0.6145 2.0724 0.6966
dqi_tot 1.0032 0.9899 1.0167 0.6380
BMI 0.9851 0.9550 1.0161 0.3430
IBD Duration 0.9951 0.9791 1.0113 0.5482
TreatmentMono biologic 0.6152 0.3390 1.1165 0.1102
TreatmentCombo therapy 0.3317 0.1382 0.7964 0.0135
Treatment5-ASA 0.9002 0.5992 1.3523 0.6125
TreatmentNone reported 0.8425 0.5598 1.2679 0.4112
Age 0.9865 0.9757 0.9975 0.0160
whiteMeatIntake_cat[0.426 1.1520 0.7634 1.7384 0.5004
whiteMeatIntake_cat[1.06, 1.1349 0.7691 1.6747 0.5237
whiteMeatIntake_cat[1.88, 0.9573 0.6265 1.4626 0.8399
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0029 1.0000 0.9571
cat 3.0182 2.0000 0.2211
IMD 2.4289 4.0000 0.6574
dqi_tot 0.7406 1.0000 0.3895
BMI 0.9101 1.0000 0.3401
IBD Duration 3.7547 1.0000 0.0527
Treatment 0.7043 4.0000 0.9508
Age 0.3713 1.0000 0.5423
whiteMeatIntake_cat 2.4387 3.0000 0.4865
GLOBAL 16.9080 18.0001 0.5294
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Objective flare

Total meat protein
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3326 0.9020 1.9687 0.1493
catFC 50-250 2.0603 1.3263 3.2006 0.0013
catFC > 250 2.5318 1.5590 4.1118 0.0002
IMD2 1.6991 0.6415 4.5005 0.2861
IMD3 1.2934 0.5034 3.3235 0.5931
IMD4 2.2332 0.9278 5.3753 0.0730
IMD5 1.4550 0.5947 3.5598 0.4114
dqi_tot 1.0131 0.9941 1.0325 0.1778
BMI 0.9628 0.9214 1.0061 0.0913
IBD Duration 0.9994 0.9771 1.0221 0.9556
TreatmentMono biologic 1.0680 0.5335 2.1380 0.8527
TreatmentCombo therapy 0.7357 0.3054 1.7721 0.4938
Treatment5-ASA 0.9406 0.5520 1.6028 0.8218
TreatmentNone reported 0.5774 0.3276 1.0178 0.0576
Age 0.9854 0.9707 1.0003 0.0541
Meat_sum_cat[24.9,35.8) 1.4586 0.8042 2.6455 0.2140
Meat_sum_cat[35.8,50.6) 1.6994 0.9418 3.0663 0.0782
Meat_sum_cat[50.6,331] 2.1880 1.1896 4.0243 0.0118
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0883 1 0.7664
cat 5.8623 2 0.0533
IMD 1.8402 4 0.7651
dqi_tot 0.0000 1 0.9962
BMI 0.3398 1 0.5599
IBD Duration 0.1865 1 0.6658
Treatment 7.8096 4 0.0988
Age 0.0804 1 0.7767
Meat_sum_cat 1.2229 3 0.7475
GLOBAL 19.1539 18 0.3824
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3213 0.8897 1.9623 0.1673
catFC 50-250 2.1249 1.3624 3.3141 0.0009
catFC > 250 2.4369 1.4998 3.9595 0.0003
IMD2 1.6921 0.6410 4.4666 0.2882
IMD3 1.2443 0.4851 3.1921 0.6492
IMD4 2.1625 0.8992 5.2009 0.0850
IMD5 1.4057 0.5769 3.4252 0.4536
dqi_tot 1.0188 0.9977 1.0403 0.0817
BMI 0.9593 0.9183 1.0021 0.0619
IBD Duration 1.0005 0.9788 1.0226 0.9646
TreatmentMono biologic 1.2949 0.6489 2.5843 0.4635
TreatmentCombo therapy 0.7557 0.3146 1.8152 0.5310
Treatment5-ASA 0.9469 0.5562 1.6118 0.8405
TreatmentNone reported 0.5939 0.3384 1.0420 0.0693
Age 0.9860 0.9716 1.0007 0.0618
meat_overall_cat[59.5,101 0.6775 0.3646 1.2587 0.2180
meat_overall_cat[101,153) 1.5795 0.8991 2.7749 0.1118
meat_overall_cat[153,927] 1.7211 0.9250 3.2025 0.0866
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0982 1 0.7540
cat 5.5183 2 0.0633
IMD 1.8190 4 0.7690
dqi_tot 0.0006 1 0.9813
BMI 0.3187 1 0.5724
IBD Duration 0.2017 1 0.6534
Treatment 8.1845 4 0.0850
Age 0.0752 1 0.7839
meat_overall_cat 1.5082 3 0.6804
GLOBAL 19.7890 18 0.3448
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2411 0.8420 1.8294 0.2751
catFC 50-250 2.1036 1.3431 3.2948 0.0012
catFC > 250 2.4826 1.5285 4.0321 0.0002
IMD2 1.5964 0.6038 4.2204 0.3457
IMD3 1.2229 0.4767 3.1371 0.6755
IMD4 2.1977 0.9140 5.2839 0.0785
IMD5 1.4399 0.5887 3.5218 0.4243
dqi_tot 1.0032 0.9847 1.0219 0.7392
BMI 0.9674 0.9257 1.0111 0.1412
IBD Duration 0.9999 0.9779 1.0224 0.9934
TreatmentMono biologic 1.1022 0.5505 2.2067 0.7836
TreatmentCombo therapy 0.8318 0.3477 1.9903 0.6791
Treatment5-ASA 0.9989 0.5867 1.7006 0.9967
TreatmentNone reported 0.6432 0.3673 1.1263 0.1226
Age 0.9844 0.9696 0.9993 0.0402
fish_overall_cat[16.4,36. 0.8218 0.4683 1.4423 0.4941
fish_overall_cat[36.5,65. 0.9880 0.5710 1.7097 0.9657
fish_overall_cat[65.8,647 1.2043 0.7108 2.0404 0.4895
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0526 1 0.8186
cat 5.8748 2 0.0530
IMD 1.7812 4 0.7759
dqi_tot 0.0017 1 0.9675
BMI 0.4141 1 0.5199
IBD Duration 0.2245 1 0.6356
Treatment 7.8662 4 0.0966
Age 0.0649 1 0.7989
fish_overall_cat 2.0880 3 0.5543
GLOBAL 21.5835 18 0.2510
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2580 0.8500 1.8618 0.2511
catFC 50-250 2.1443 1.3815 3.3282 0.0007
catFC > 250 2.5216 1.5523 4.0963 0.0002
IMD2 1.6455 0.6150 4.4024 0.3212
IMD3 1.2558 0.4883 3.2296 0.6364
IMD4 2.1651 0.9002 5.2073 0.0845
IMD5 1.4364 0.5870 3.5148 0.4277
dqi_tot 1.0032 0.9841 1.0227 0.7412
BMI 0.9714 0.9301 1.0146 0.1908
IBD Duration 0.9993 0.9776 1.0216 0.9536
TreatmentMono biologic 1.1748 0.5896 2.3408 0.6469
TreatmentCombo therapy 0.8678 0.3641 2.0684 0.7489
Treatment5-ASA 0.9967 0.5857 1.6961 0.9903
TreatmentNone reported 0.6539 0.3731 1.1462 0.1380
Age 0.9843 0.9698 0.9990 0.0361
fibre_cat[17,22.9) 1.2156 0.6905 2.1401 0.4986
fibre_cat[22.9,29.4) 1.3143 0.7188 2.4033 0.3748
fibre_cat[29.4,170] 1.1429 0.6206 2.1047 0.6681
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0445 1 0.8329
cat 5.8448 2 0.0538
IMD 1.6960 4 0.7914
dqi_tot 0.0002 1 0.9897
BMI 0.4112 1 0.5213
IBD Duration 0.2214 1 0.6380
Treatment 7.8914 4 0.0956
Age 0.0621 1 0.8031
fibre_cat 5.3873 3 0.1455
GLOBAL 23.8912 18 0.1586
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2287 0.8323 1.8140 0.3000
catFC 50-250 2.2001 1.4158 3.4189 0.0005
catFC > 250 2.6013 1.5957 4.2407 0.0001
IMD2 1.4781 0.5598 3.9029 0.4303
IMD3 1.1816 0.4606 3.0312 0.7285
IMD4 2.0421 0.8504 4.9042 0.1102
IMD5 1.3845 0.5656 3.3890 0.4762
dqi_tot 1.0047 0.9867 1.0230 0.6096
BMI 0.9679 0.9265 1.0111 0.1427
IBD Duration 0.9998 0.9780 1.0220 0.9826
TreatmentMono biologic 1.2353 0.6150 2.4815 0.5526
TreatmentCombo therapy 0.8688 0.3652 2.0667 0.7504
Treatment5-ASA 1.0251 0.6018 1.7459 0.9274
TreatmentNone reported 0.6754 0.3842 1.1873 0.1728
Age 0.9834 0.9688 0.9982 0.0277
PUFA_percEng_cat[4.54,5.1 1.0299 0.6160 1.7220 0.9105
PUFA_percEng_cat[5.17,5.9 0.7956 0.4659 1.3589 0.4025
PUFA_percEng_cat[5.92,12. 0.8383 0.4883 1.4394 0.5225
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0466 1 0.8291
cat 5.6846 2 0.0583
IMD 1.7435 4 0.7828
dqi_tot 0.0000 1 0.9948
BMI 0.3885 1 0.5331
IBD Duration 0.2300 1 0.6315
Treatment 7.6892 4 0.1037
Age 0.0618 1 0.8037
PUFA_percEng_cat 3.1752 3 0.3654
GLOBAL 21.1351 18 0.2727
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2787 0.8673 1.8852 0.2145
catFC 50-250 2.1611 1.3912 3.3569 0.0006
catFC > 250 2.6173 1.6073 4.2619 0.0001
IMD2 1.7043 0.6423 4.5220 0.2842
IMD3 1.3195 0.5131 3.3935 0.5651
IMD4 2.2199 0.9218 5.3461 0.0754
IMD5 1.4958 0.6109 3.6628 0.3782
dqi_tot 1.0052 0.9873 1.0234 0.5727
BMI 0.9719 0.9305 1.0152 0.2001
IBD Duration 0.9990 0.9773 1.0213 0.9317
TreatmentMono biologic 1.2374 0.6214 2.4644 0.5444
TreatmentCombo therapy 0.8694 0.3654 2.0685 0.7517
Treatment5-ASA 1.0387 0.6098 1.7690 0.8890
TreatmentNone reported 0.6618 0.3780 1.1587 0.1486
Age 0.9840 0.9695 0.9986 0.0324
NOVAScore_catProcessed cu 1.5967 0.9230 2.7621 0.0943
NOVAScore_catProcessed fo 1.6177 0.9333 2.8042 0.0865
NOVAScore_catUltra-proces 1.4541 0.8267 2.5577 0.1938
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0397 1 0.8421
cat 5.6605 2 0.0590
IMD 1.6544 4 0.7990
dqi_tot 0.0002 1 0.9902
BMI 0.3727 1 0.5415
IBD Duration 0.1843 1 0.6677
Treatment 7.6350 4 0.1059
Age 0.0729 1 0.7871
NOVAScore_cat 5.1945 3 0.1581
GLOBAL 22.9009 18 0.1944
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2368 0.8380 1.8256 0.2846
catFC 50-250 2.3224 1.4962 3.6047 0.0002
catFC > 250 2.8790 1.7623 4.7034 0.0000
IMD2 1.3486 0.5068 3.5888 0.5493
IMD3 1.1442 0.4423 2.9597 0.7812
IMD4 1.9941 0.8279 4.8027 0.1238
IMD5 1.3519 0.5468 3.3426 0.5138
dqi_tot 0.9979 0.9795 1.0167 0.8284
BMI 0.9616 0.9206 1.0044 0.0782
IBD Duration 1.0009 0.9787 1.0236 0.9407
TreatmentMono biologic 1.2319 0.6156 2.4653 0.5557
TreatmentCombo therapy 0.9280 0.3853 2.2352 0.8677
Treatment5-ASA 1.0027 0.5862 1.7152 0.9921
TreatmentNone reported 0.6210 0.3488 1.1056 0.1055
Age 0.9813 0.9667 0.9960 0.0128
UPF_perc_cat[36.8,44.3) 0.5119 0.3088 0.8485 0.0094
UPF_perc_cat[44.3,52.6) 0.3599 0.2022 0.6407 0.0005
UPF_perc_cat[52.6,92.5] 0.6310 0.3767 1.0570 0.0802
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0575 1 0.8106
cat 5.5243 2 0.0632
IMD 1.9249 4 0.7496
dqi_tot 0.0037 1 0.9516
BMI 0.3438 1 0.5576
IBD Duration 0.1789 1 0.6723
Treatment 7.9587 4 0.0931
Age 0.1165 1 0.7329
UPF_perc_cat 6.5018 3 0.0896
GLOBAL 23.9042 18 0.1582
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1699 0.7902 1.7322 0.4331
catFC 50-250 2.1896 1.4124 3.3944 0.0005
catFC > 250 2.5806 1.5884 4.1924 0.0001
IMD2 1.5615 0.5916 4.1219 0.3682
IMD3 1.2227 0.4727 3.1632 0.6784
IMD4 2.0994 0.8685 5.0746 0.0996
IMD5 1.3883 0.5614 3.4331 0.4776
dqi_tot 1.0053 0.9874 1.0235 0.5650
BMI 0.9687 0.9270 1.0122 0.1557
IBD Duration 0.9994 0.9777 1.0216 0.9577
TreatmentMono biologic 1.0414 0.5151 2.1057 0.9100
TreatmentCombo therapy 0.8236 0.3448 1.9674 0.6623
Treatment5-ASA 0.9300 0.5438 1.5903 0.7908
TreatmentNone reported 0.6266 0.3576 1.0978 0.1023
Age 0.9860 0.9713 1.0009 0.0648
breadIntake_cat[1.97,3.23 1.3547 0.8122 2.2596 0.2448
breadIntake_cat[3.23,4.84 1.1944 0.7004 2.0368 0.5141
breadIntake_cat[4.84,18.9 0.7523 0.4178 1.3546 0.3428
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0759 1 0.7830
cat 5.5702 2 0.0617
IMD 1.8474 4 0.7638
dqi_tot 0.0041 1 0.9489
BMI 0.3882 1 0.5332
IBD Duration 0.2237 1 0.6363
Treatment 8.0147 4 0.0910
Age 0.1389 1 0.7093
breadIntake_cat 4.1309 3 0.2477
GLOBAL 22.3943 18 0.2150
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3139 0.8888 1.9422 0.1711
catFC 50-250 2.4806 1.5804 3.8934 0.0001
catFC > 250 2.7987 1.7131 4.5722 0.0000
IMD2 1.4568 0.5509 3.8522 0.4483
IMD3 1.1672 0.4519 3.0146 0.7495
IMD4 2.0593 0.8526 4.9735 0.1084
IMD5 1.4327 0.5832 3.5196 0.4330
dqi_tot 1.0045 0.9865 1.0228 0.6245
BMI 0.9627 0.9213 1.0060 0.0901
IBD Duration 0.9994 0.9777 1.0217 0.9588
TreatmentMono biologic 1.2655 0.6348 2.5230 0.5035
TreatmentCombo therapy 0.9954 0.4111 2.4102 0.9919
Treatment5-ASA 0.9949 0.5815 1.7023 0.9852
TreatmentNone reported 0.6482 0.3660 1.1483 0.1373
Age 0.9840 0.9696 0.9987 0.0333
sweetIntake_cat[2.83,4.36 0.7539 0.4480 1.2687 0.2875
sweetIntake_cat[4.36,6.17 0.4704 0.2627 0.8424 0.0112
sweetIntake_cat[6.17,17.3 0.9502 0.5806 1.5550 0.8390
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0169 1 0.8964
cat 5.4341 2 0.0661
IMD 1.8133 4 0.7700
dqi_tot 0.0001 1 0.9912
BMI 0.4754 1 0.4905
IBD Duration 0.1692 1 0.6808
Treatment 7.7924 4 0.0995
Age 0.0373 1 0.8469
sweetIntake_cat 1.5381 3 0.6735
GLOBAL 17.6347 18 0.4800
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2721 0.8609 1.8797 0.2270
catFC 50-250 2.2530 1.4491 3.5030 0.0003
catFC > 250 2.4808 1.5206 4.0473 0.0003
IMD2 1.7134 0.6444 4.5553 0.2805
IMD3 1.3249 0.5141 3.4147 0.5603
IMD4 2.1553 0.8958 5.1859 0.0865
IMD5 1.5097 0.6164 3.6975 0.3674
dqi_tot 1.0051 0.9871 1.0234 0.5840
BMI 0.9628 0.9207 1.0067 0.0955
IBD Duration 0.9974 0.9756 1.0197 0.8160
TreatmentMono biologic 1.1815 0.5923 2.3569 0.6360
TreatmentCombo therapy 0.8117 0.3405 1.9350 0.6379
Treatment5-ASA 1.0490 0.6150 1.7891 0.8606
TreatmentNone reported 0.7069 0.3999 1.2496 0.2328
Age 0.9847 0.9700 0.9998 0.0466
drinkIntake_cat[0.301,4.2 0.7210 0.4130 1.2588 0.2500
drinkIntake_cat[4.21,14.4 1.2273 0.7064 2.1323 0.4674
drinkIntake_cat[14.4,120] 1.0839 0.6093 1.9281 0.7840
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0348 1 0.8520
cat 5.7446 2 0.0566
IMD 1.8182 4 0.7692
dqi_tot 0.0000 1 0.9984
BMI 0.3760 1 0.5397
IBD Duration 0.2828 1 0.5949
Treatment 7.4668 4 0.1132
Age 0.0501 1 0.8229
drinkIntake_cat 0.8992 3 0.8256
GLOBAL 19.5263 18 0.3601
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2831 0.8614 1.9114 0.2202
catFC 50-250 2.1533 1.3852 3.3473 0.0007
catFC > 250 2.4952 1.5288 4.0725 0.0003
IMD2 1.6015 0.6049 4.2401 0.3431
IMD3 1.2605 0.4892 3.2480 0.6317
IMD4 2.1448 0.8895 5.1712 0.0893
IMD5 1.4668 0.5953 3.6139 0.4050
dqi_tot 1.0075 0.9881 1.0272 0.4522
BMI 0.9663 0.9249 1.0095 0.1247
IBD Duration 0.9986 0.9766 1.0211 0.9024
TreatmentMono biologic 1.1185 0.5539 2.2586 0.7547
TreatmentCombo therapy 0.8581 0.3601 2.0449 0.7299
Treatment5-ASA 0.9910 0.5831 1.6845 0.9735
TreatmentNone reported 0.6450 0.3687 1.1282 0.1243
Age 0.9843 0.9698 0.9991 0.0377
processedMeatIntake_cat[0 1.2578 0.7340 2.1553 0.4039
processedMeatIntake_cat[1 1.0527 0.5982 1.8525 0.8586
processedMeatIntake_cat[2 1.3172 0.7259 2.3904 0.3648
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0452 1 0.8316
cat 5.8276 2 0.0543
IMD 1.8411 4 0.7649
dqi_tot 0.0013 1 0.9713
BMI 0.3915 1 0.5315
IBD Duration 0.2394 1 0.6247
Treatment 7.7737 4 0.1002
Age 0.0651 1 0.7985
processedMeatIntake_cat 3.1875 3 0.3636
GLOBAL 19.9226 18 0.3372
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2747 0.8641 1.8803 0.2211
catFC 50-250 2.1415 1.3796 3.3243 0.0007
catFC > 250 2.5542 1.5713 4.1518 0.0002
IMD2 1.4558 0.5513 3.8447 0.4484
IMD3 1.2263 0.4787 3.1415 0.6708
IMD4 2.0960 0.8728 5.0335 0.0978
IMD5 1.4401 0.5885 3.5242 0.4244
dqi_tot 1.0073 0.9893 1.0257 0.4295
BMI 0.9676 0.9267 1.0103 0.1346
IBD Duration 0.9983 0.9766 1.0205 0.8807
TreatmentMono biologic 1.2181 0.6141 2.4161 0.5724
TreatmentCombo therapy 0.8577 0.3604 2.0415 0.7287
Treatment5-ASA 1.0234 0.6021 1.7395 0.9319
TreatmentNone reported 0.6503 0.3712 1.1390 0.1324
Age 0.9828 0.9683 0.9974 0.0213
processedPlantIntake_cat[ 0.6756 0.4247 1.0746 0.0977
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0334 1 0.8549
cat 5.8133 2 0.0547
IMD 1.8863 4 0.7567
dqi_tot 0.0002 1 0.9897
BMI 0.3768 1 0.5393
IBD Duration 0.2292 1 0.6321
Treatment 7.8673 4 0.0966
Age 0.0528 1 0.8182
processedPlantIntake_cat 2.7240 1 0.0989
GLOBAL 20.2915 16 0.2074
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2318 0.8344 1.8184 0.2942
catFC 50-250 2.1807 1.4070 3.3796 0.0005
catFC > 250 2.5221 1.5535 4.0946 0.0002
IMD2 1.4803 0.5546 3.9512 0.4336
IMD3 1.2097 0.4688 3.1217 0.6939
IMD4 2.0921 0.8651 5.0596 0.1014
IMD5 1.3922 0.5622 3.4475 0.4745
dqi_tot 1.0016 0.9817 1.0219 0.8785
BMI 0.9687 0.9278 1.0114 0.1485
IBD Duration 0.9996 0.9777 1.0219 0.9700
TreatmentMono biologic 1.1930 0.5974 2.3826 0.6170
TreatmentCombo therapy 0.8669 0.3629 2.0710 0.7479
Treatment5-ASA 0.9807 0.5731 1.6782 0.9433
TreatmentNone reported 0.6445 0.3671 1.1314 0.1260
Age 0.9836 0.9691 0.9984 0.0300
fruitIntake_cat[2.1,5.64) 1.1087 0.6232 1.9726 0.7255
fruitIntake_cat[5.64,10.4 0.9574 0.5301 1.7291 0.8853
fruitIntake_cat[10.4,62.9 1.2724 0.6846 2.3647 0.4462
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0416 1 0.8384
cat 5.7615 2 0.0561
IMD 1.7009 4 0.7906
dqi_tot 0.0025 1 0.9598
BMI 0.4207 1 0.5166
IBD Duration 0.2238 1 0.6362
Treatment 7.7663 4 0.1005
Age 0.0805 1 0.7766
fruitIntake_cat 1.5022 3 0.6818
GLOBAL 19.0298 18 0.3900
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1977 0.8073 1.7769 0.3700
catFC 50-250 2.2061 1.4200 3.4273 0.0004
catFC > 250 2.4785 1.5227 4.0342 0.0003
IMD2 1.5585 0.5880 4.1306 0.3722
IMD3 1.2155 0.4719 3.1308 0.6861
IMD4 2.1638 0.8930 5.2434 0.0874
IMD5 1.3433 0.5478 3.2944 0.5190
dqi_tot 0.9988 0.9796 1.0185 0.9059
BMI 0.9696 0.9284 1.0125 0.1625
IBD Duration 0.9991 0.9775 1.0212 0.9369
TreatmentMono biologic 1.0994 0.5496 2.1991 0.7889
TreatmentCombo therapy 0.8440 0.3538 2.0133 0.7022
Treatment5-ASA 0.9284 0.5429 1.5877 0.7861
TreatmentNone reported 0.6134 0.3494 1.0769 0.0888
Age 0.9856 0.9711 1.0003 0.0547
vegIntake_cat[5.04,8.43) 1.2340 0.6956 2.1892 0.4723
vegIntake_cat[8.43,13.4) 1.7505 0.9909 3.0926 0.0538
vegIntake_cat[13.4,63.1] 1.5314 0.8354 2.8072 0.1681
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0509 1 0.8215
cat 5.6620 2 0.0590
IMD 1.7780 4 0.7765
dqi_tot 0.0024 1 0.9606
BMI 0.3383 1 0.5608
IBD Duration 0.2258 1 0.6347
Treatment 8.1365 4 0.0867
Age 0.0458 1 0.8305
vegIntake_cat 4.5011 3 0.2122
GLOBAL 22.7453 18 0.2006
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2676 0.8565 1.8762 0.2358
catFC 50-250 2.1350 1.3781 3.3077 0.0007
catFC > 250 2.4979 1.5342 4.0670 0.0002
IMD2 1.5486 0.5853 4.0974 0.3783
IMD3 1.2801 0.4992 3.2829 0.6073
IMD4 2.1498 0.8942 5.1687 0.0873
IMD5 1.4560 0.5966 3.5531 0.4092
dqi_tot 1.0121 0.9936 1.0309 0.2027
BMI 0.9637 0.9232 1.0059 0.0907
IBD Duration 0.9968 0.9750 1.0190 0.7744
TreatmentMono biologic 1.1708 0.5888 2.3281 0.6529
TreatmentCombo therapy 0.9024 0.3802 2.1419 0.8159
Treatment5-ASA 1.0285 0.6053 1.7478 0.9172
TreatmentNone reported 0.6432 0.3674 1.1258 0.1223
Age 0.9825 0.9681 0.9970 0.0180
redMeatIntake_cat[0.365,0 1.3028 0.8150 2.0825 0.2690
redMeatIntake_cat[0.861,9 2.0291 1.2784 3.2208 0.0027
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0548 1 0.8148
cat 6.0445 2 0.0487
IMD 1.8201 4 0.7688
dqi_tot 0.0046 1 0.9457
BMI 0.2900 1 0.5902
IBD Duration 0.2897 1 0.5904
Treatment 8.2691 4 0.0822
Age 0.0270 1 0.8694
redMeatIntake_cat 0.0419 2 0.9792
GLOBAL 18.6526 17 0.3488
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2562 0.8525 1.8509 0.2488
catFC 50-250 2.1396 1.3783 3.3214 0.0007
catFC > 250 2.6274 1.6120 4.2824 0.0001
IMD2 1.5762 0.5968 4.1627 0.3585
IMD3 1.2037 0.4692 3.0876 0.6997
IMD4 2.1052 0.8771 5.0530 0.0956
IMD5 1.4090 0.5772 3.4396 0.4514
dqi_tot 1.0078 0.9895 1.0265 0.4036
BMI 0.9669 0.9254 1.0103 0.1331
IBD Duration 0.9981 0.9764 1.0203 0.8661
TreatmentMono biologic 1.1104 0.5548 2.2221 0.7674
TreatmentCombo therapy 0.7483 0.3112 1.7993 0.5171
Treatment5-ASA 0.9565 0.5614 1.6299 0.8702
TreatmentNone reported 0.6150 0.3494 1.0827 0.0920
Age 0.9852 0.9703 1.0004 0.0556
whiteMeatIntake_cat[0.426 1.5428 0.8790 2.7079 0.1309
whiteMeatIntake_cat[1.06, 1.3772 0.8002 2.3703 0.2479
whiteMeatIntake_cat[1.88, 1.7240 0.9847 3.0183 0.0567
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0510 1 0.8213
cat 5.9098 2 0.0521
IMD 1.8600 4 0.7615
dqi_tot 0.0001 1 0.9918
BMI 0.3475 1 0.5555
IBD Duration 0.2351 1 0.6278
Treatment 7.7523 4 0.1011
Age 0.0740 1 0.7857
whiteMeatIntake_cat 2.9702 3 0.3962
GLOBAL 21.0080 18 0.2790
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Save tables with p-values and hazard ratios

Code
pvalues <- hrs |>
  select(diagnosis, flare, term, p.value)

# Replace term names with human-readable labels (dynamic approach)
pvalues <- pvalues |>
  mutate(
    clean_term = term,
    clean_term = case_when(
      grepl("Meat_sum_cat", term) ~ paste("Meat protein", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("meat_overall_cat", term) ~ paste("Overall meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fish_overall_cat", term) ~ paste("Overall fish intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fibre_cat", term) ~ paste("Dietary fibre", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("PUFA_percEng_cat", term) ~ paste("PUFA", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("NOVA_Score", term) ~ paste("NOVA Score", gsub(".*?(\\d+)", "\\1", term)),
      grepl("UPF_perc_cat", term) ~ paste("%UPF", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("breadIntake_cat", term) ~ paste("Bread intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("sweetIntake_cat", term) ~ paste("Sweet intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("drinkIntake_cat", term) ~ paste("Drink intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("processedMeatIntake_cat", term) ~ paste("Processed meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("processedPlantIntake_cat", term) ~ paste("Processed plant intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("fruitIntake_cat", term) ~ paste("Fruit intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("vegIntake_cat", term) ~ paste("Vegetable intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("redMeatIntake_cat", term) ~ paste("Red meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("whiteMeatIntake_cat", term) ~ paste("White meat intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      grepl("whiteFishIntake_cat", term) ~ paste("White fish intake", gsub(".*\\[(.*?)\\].*|.*\\((.*?)\\).*", "\\1\\2", term)),
      TRUE ~ term
    )
  ) |>
  select(-term) |>
  rename(term = clean_term)

pvalues <- pvalues |>
  mutate(
    adjusted.p.value = ifelse(
      grepl(
        "^Meat|^%UP|^PUFA|^Dietary", term
      ),
      NA,
      p.value * 216
    )
  )
pvalues$adjusted.p.value <- ifelse(
  !is.na(pvalues$adjusted.p.value) & pvalues$adjusted.p.value > 1,
  1,
  pvalues$adjusted.p.value
)
Control for additional covariates

Crohn’s disease

Patient-reported flare

Total meat protein
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9570 1.3827 2.7699 0.0002
catFC 50-250 1.2352 0.8572 1.7799 0.2572
catFC > 250 1.9290 1.2994 2.8637 0.0011
IMD2 0.7057 0.3668 1.3576 0.2964
IMD3 0.8581 0.4637 1.5880 0.6260
IMD4 0.7910 0.4274 1.4638 0.4553
IMD5 0.9895 0.5633 1.7380 0.9706
dqi_tot 1.0057 0.9914 1.0201 0.4359
BMI 1.0033 0.9750 1.0324 0.8218
IBD Duration 0.9893 0.9750 1.0038 0.1485
TreatmentMono biologic 0.9935 0.6254 1.5781 0.9778
TreatmentCombo therapy 0.8739 0.4891 1.5613 0.6490
Treatment5-ASA 0.9445 0.3906 2.2840 0.8992
TreatmentNone reported 0.9506 0.6209 1.4554 0.8157
Age 1.0065 0.9943 1.0188 0.3007
Meat_sum_cat[24.9,35.8) 1.0892 0.6965 1.7031 0.7081
Meat_sum_cat[35.8,50.6) 1.0009 0.6404 1.5645 0.9968
Meat_sum_cat[50.6,331] 1.1092 0.6934 1.7741 0.6655
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0654 1.0000 0.7981
cat 1.4378 2.0000 0.4873
IMD 3.6591 4.0000 0.4541
dqi_tot 0.2315 1.0000 0.6304
BMI 1.0619 1.0000 0.3028
IBD Duration 2.5185 1.0000 0.1125
Treatment 7.4605 4.0000 0.1135
Age 1.1251 1.0000 0.2888
Meat_sum_cat 1.5786 3.0000 0.6643
GLOBAL 18.9635 18.0001 0.3941
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9653 1.3897 2.7792 0.0001
catFC 50-250 1.2371 0.8577 1.7844 0.2549
catFC > 250 1.9500 1.3106 2.9013 0.0010
IMD2 0.7196 0.3726 1.3896 0.3270
IMD3 0.8757 0.4714 1.6268 0.6745
IMD4 0.8098 0.4384 1.4957 0.5004
IMD5 0.9971 0.5680 1.7504 0.9919
dqi_tot 1.0070 0.9918 1.0225 0.3690
BMI 1.0023 0.9736 1.0319 0.8763
IBD Duration 0.9888 0.9745 1.0033 0.1290
TreatmentMono biologic 0.9885 0.6232 1.5679 0.9607
TreatmentCombo therapy 0.8638 0.4808 1.5518 0.6242
Treatment5-ASA 0.9521 0.3942 2.2994 0.9132
TreatmentNone reported 0.9453 0.6175 1.4471 0.7957
Age 1.0069 0.9946 1.0194 0.2735
meat_overall_cat[59.5,101 0.9466 0.6002 1.4931 0.8135
meat_overall_cat[101,153) 1.0421 0.6568 1.6532 0.8611
meat_overall_cat[153,927] 1.1154 0.6730 1.8488 0.6717
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0619 1.0000 0.8034
cat 1.4423 2.0000 0.4862
IMD 3.6451 4.0000 0.4562
dqi_tot 0.2423 1.0000 0.6225
BMI 1.1105 1.0000 0.2920
IBD Duration 2.4924 1.0000 0.1144
Treatment 7.4505 4.0000 0.1139
Age 1.1057 1.0000 0.2930
meat_overall_cat 2.0715 3.0000 0.5577
GLOBAL 19.7035 18.0001 0.3498
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9151 1.3541 2.7083 0.0002
catFC 50-250 1.2353 0.8562 1.7821 0.2585
catFC > 250 2.0225 1.3582 3.0116 0.0005
IMD2 0.7346 0.3817 1.4136 0.3557
IMD3 0.8591 0.4633 1.5930 0.6297
IMD4 0.7808 0.4230 1.4412 0.4287
IMD5 1.0268 0.5835 1.8069 0.9270
dqi_tot 1.0055 0.9909 1.0203 0.4642
BMI 1.0017 0.9734 1.0307 0.9099
IBD Duration 0.9893 0.9750 1.0038 0.1456
TreatmentMono biologic 0.9756 0.6158 1.5458 0.9163
TreatmentCombo therapy 0.7972 0.4443 1.4304 0.4474
Treatment5-ASA 0.9817 0.4052 2.3786 0.9675
TreatmentNone reported 0.9324 0.6114 1.4220 0.7451
Age 1.0069 0.9947 1.0192 0.2717
fish_overall_cat[16.4,36. 0.5796 0.3609 0.9308 0.0240
fish_overall_cat[36.5,65. 0.7297 0.4672 1.1395 0.1658
fish_overall_cat[65.8,647 0.8782 0.5612 1.3742 0.5697
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0381 1.0000 0.8452
cat 1.6089 2.0000 0.4473
IMD 3.5455 4.0000 0.4710
dqi_tot 0.1948 1.0000 0.6589
BMI 0.9832 1.0000 0.3214
IBD Duration 2.5987 1.0000 0.1069
Treatment 7.5191 4.0000 0.1109
Age 1.2334 1.0000 0.2667
fish_overall_cat 2.6878 3.0000 0.4423
GLOBAL 19.4658 18.0001 0.3637
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9653 1.3852 2.7884 0.0002
catFC 50-250 1.2221 0.8469 1.7634 0.2837
catFC > 250 1.9653 1.3213 2.9233 0.0009
IMD2 0.7015 0.3652 1.3473 0.2870
IMD3 0.8623 0.4660 1.5957 0.6371
IMD4 0.7909 0.4299 1.4548 0.4505
IMD5 0.9752 0.5559 1.7108 0.9304
dqi_tot 1.0037 0.9877 1.0199 0.6524
BMI 1.0033 0.9749 1.0326 0.8206
IBD Duration 0.9897 0.9754 1.0042 0.1635
TreatmentMono biologic 0.9949 0.6275 1.5775 0.9827
TreatmentCombo therapy 0.8711 0.4879 1.5554 0.6409
Treatment5-ASA 0.9590 0.3977 2.3125 0.9258
TreatmentNone reported 0.9425 0.6175 1.4386 0.7837
Age 1.0063 0.9942 1.0186 0.3083
fibre_cat[17,22.9) 0.8219 0.5264 1.2832 0.3882
fibre_cat[22.9,29.4) 1.0066 0.6446 1.5718 0.9770
fibre_cat[29.4,170] 1.0739 0.6592 1.7495 0.7746
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0602 1.0000 0.8062
cat 1.4716 2.0000 0.4791
IMD 3.6196 4.0000 0.4599
dqi_tot 0.2179 1.0000 0.6406
BMI 1.1122 1.0000 0.2916
IBD Duration 2.4585 1.0000 0.1169
Treatment 7.5461 4.0000 0.1097
Age 1.0993 1.0000 0.2944
fibre_cat 6.6767 3.0000 0.0829
GLOBAL 25.4124 18.0001 0.1140
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9051 1.3481 2.6922 0.0003
catFC 50-250 1.2360 0.8549 1.7870 0.2601
catFC > 250 1.9133 1.2889 2.8400 0.0013
IMD2 0.6946 0.3610 1.3368 0.2753
IMD3 0.8834 0.4763 1.6385 0.6941
IMD4 0.8319 0.4497 1.5387 0.5574
IMD5 0.9861 0.5597 1.7371 0.9612
dqi_tot 1.0037 0.9897 1.0179 0.6079
BMI 1.0055 0.9773 1.0344 0.7073
IBD Duration 0.9885 0.9742 1.0030 0.1191
TreatmentMono biologic 0.9804 0.6187 1.5535 0.9327
TreatmentCombo therapy 0.8094 0.4514 1.4513 0.4779
Treatment5-ASA 0.9582 0.3952 2.3229 0.9247
TreatmentNone reported 0.9106 0.5967 1.3896 0.6639
Age 1.0061 0.9940 1.0185 0.3233
PUFA_percEng_cat[4.54,5.1 0.8250 0.5338 1.2748 0.3862
PUFA_percEng_cat[5.17,5.9 0.6177 0.3896 0.9793 0.0405
PUFA_percEng_cat[5.92,12. 1.0421 0.6918 1.5698 0.8436
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0566 1.0000 0.8120
cat 1.4446 2.0000 0.4856
IMD 3.8316 4.0000 0.4293
dqi_tot 0.1937 1.0000 0.6599
BMI 0.9606 1.0000 0.3270
IBD Duration 2.5807 1.0000 0.1082
Treatment 7.7022 4.0000 0.1031
Age 1.1186 1.0000 0.2902
PUFA_percEng_cat 1.8214 3.0000 0.6103
GLOBAL 19.6056 18.0001 0.3555
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9515 1.3790 2.7616 0.0002
catFC 50-250 1.2178 0.8433 1.7587 0.2932
catFC > 250 1.9436 1.3080 2.8882 0.0010
IMD2 0.7269 0.3760 1.4049 0.3427
IMD3 0.8825 0.4742 1.6421 0.6931
IMD4 0.8185 0.4420 1.5156 0.5240
IMD5 1.0046 0.5692 1.7732 0.9873
dqi_tot 1.0047 0.9907 1.0190 0.5100
BMI 1.0037 0.9749 1.0334 0.8040
IBD Duration 0.9895 0.9751 1.0041 0.1564
TreatmentMono biologic 0.9768 0.6141 1.5536 0.9210
TreatmentCombo therapy 0.8636 0.4829 1.5442 0.6208
Treatment5-ASA 0.9459 0.3900 2.2942 0.9021
TreatmentNone reported 0.9428 0.6175 1.4395 0.7850
Age 1.0061 0.9940 1.0184 0.3238
NOVAScore_catProcessed cu 0.9412 0.6025 1.4702 0.7899
NOVAScore_catProcessed fo 1.0857 0.7027 1.6775 0.7110
NOVAScore_catUltra-proces 1.0917 0.7048 1.6911 0.6944
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0576 1.0000 0.8103
cat 1.4000 2.0000 0.4966
IMD 3.6346 4.0000 0.4577
dqi_tot 0.2283 1.0000 0.6328
BMI 1.0924 1.0000 0.2960
IBD Duration 2.4679 1.0000 0.1162
Treatment 7.5344 4.0000 0.1102
Age 1.0642 1.0000 0.3023
NOVAScore_cat 4.0425 3.0000 0.2569
GLOBAL 20.8430 18.0001 0.2874
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9608 1.3816 2.7829 0.0002
catFC 50-250 1.2583 0.8713 1.8172 0.2204
catFC > 250 1.9652 1.3220 2.9211 0.0008
IMD2 0.7015 0.3651 1.3477 0.2872
IMD3 0.8634 0.4667 1.5975 0.6399
IMD4 0.8184 0.4441 1.5082 0.5206
IMD5 0.9649 0.5487 1.6966 0.9012
dqi_tot 1.0041 0.9898 1.0186 0.5782
BMI 1.0026 0.9743 1.0318 0.8567
IBD Duration 0.9888 0.9743 1.0034 0.1319
TreatmentMono biologic 1.0168 0.6408 1.6133 0.9437
TreatmentCombo therapy 0.8888 0.4965 1.5912 0.6916
Treatment5-ASA 0.9364 0.3863 2.2703 0.8844
TreatmentNone reported 0.9852 0.6437 1.5079 0.9454
Age 1.0057 0.9933 1.0183 0.3679
UPF_perc_cat[36.8,44.3) 1.2539 0.7899 1.9905 0.3372
UPF_perc_cat[44.3,52.6) 1.1011 0.7009 1.7299 0.6760
UPF_perc_cat[52.6,92.5] 0.9772 0.6048 1.5791 0.9251
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0602 1.0000 0.8062
cat 1.4635 2.0000 0.4811
IMD 3.7560 4.0000 0.4400
dqi_tot 0.2222 1.0000 0.6373
BMI 1.0235 1.0000 0.3117
IBD Duration 2.5048 1.0000 0.1135
Treatment 7.6648 4.0000 0.1047
Age 1.1857 1.0000 0.2762
UPF_perc_cat 4.6596 3.0000 0.1985
GLOBAL 23.5957 18.0001 0.1687
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.8921 1.3345 2.6828 0.0003
catFC 50-250 1.2730 0.8817 1.8380 0.1977
catFC > 250 1.9866 1.3372 2.9514 0.0007
IMD2 0.7183 0.3718 1.3876 0.3247
IMD3 0.9281 0.4981 1.7294 0.8143
IMD4 0.7952 0.4311 1.4667 0.4631
IMD5 1.0324 0.5845 1.8238 0.9124
dqi_tot 1.0042 0.9902 1.0184 0.5557
BMI 1.0044 0.9754 1.0342 0.7713
IBD Duration 0.9889 0.9747 1.0033 0.1299
TreatmentMono biologic 0.9527 0.5964 1.5219 0.8394
TreatmentCombo therapy 0.8535 0.4773 1.5263 0.5933
Treatment5-ASA 0.8888 0.3664 2.1560 0.7942
TreatmentNone reported 0.8899 0.5799 1.3656 0.5934
Age 1.0072 0.9949 1.0197 0.2522
breadIntake_cat[1.97,3.23 0.6206 0.3960 0.9724 0.0373
breadIntake_cat[3.23,4.84 0.7324 0.4699 1.1417 0.1692
breadIntake_cat[4.84,18.9 0.7283 0.4660 1.1382 0.1640
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0725 1.0000 0.7877
cat 1.4486 2.0000 0.4847
IMD 3.5587 4.0000 0.4690
dqi_tot 0.2565 1.0000 0.6125
BMI 1.0871 1.0000 0.2971
IBD Duration 2.4699 1.0000 0.1160
Treatment 7.4476 4.0000 0.1140
Age 1.2251 1.0000 0.2684
breadIntake_cat 1.3716 3.0000 0.7122
GLOBAL 18.2237 18.0001 0.4410
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9473 1.3742 2.7595 0.0002
catFC 50-250 1.2620 0.8739 1.8225 0.2146
catFC > 250 1.9560 1.3179 2.9029 0.0009
IMD2 0.7094 0.3681 1.3668 0.3048
IMD3 0.9011 0.4837 1.6787 0.7429
IMD4 0.8185 0.4424 1.5146 0.5236
IMD5 1.0046 0.5684 1.7758 0.9873
dqi_tot 1.0049 0.9907 1.0194 0.4998
BMI 1.0023 0.9733 1.0321 0.8793
IBD Duration 0.9902 0.9759 1.0048 0.1859
TreatmentMono biologic 0.9704 0.6118 1.5394 0.8986
TreatmentCombo therapy 0.8573 0.4790 1.5343 0.6041
Treatment5-ASA 0.8814 0.3613 2.1502 0.7815
TreatmentNone reported 0.9249 0.6063 1.4111 0.7173
Age 1.0059 0.9937 1.0181 0.3449
sweetIntake_cat[2.83,4.36 1.1380 0.7437 1.7413 0.5515
sweetIntake_cat[4.36,6.17 0.7808 0.4905 1.2431 0.2971
sweetIntake_cat[6.17,17.3 1.0628 0.6690 1.6885 0.7966
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0691 1.0000 0.7927
cat 1.5510 2.0000 0.4605
IMD 3.6042 4.0000 0.4622
dqi_tot 0.2218 1.0000 0.6377
BMI 1.1385 1.0000 0.2860
IBD Duration 2.5470 1.0000 0.1105
Treatment 7.6849 4.0000 0.1038
Age 1.1645 1.0000 0.2805
sweetIntake_cat 9.5066 3.0000 0.0233
GLOBAL 29.8986 18.0001 0.0384
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9813 1.4011 2.8015 0.0001
catFC 50-250 1.2453 0.8638 1.7952 0.2398
catFC > 250 1.9500 1.3135 2.8949 0.0009
IMD2 0.6937 0.3583 1.3429 0.2778
IMD3 0.8615 0.4661 1.5923 0.6343
IMD4 0.8049 0.4372 1.4819 0.4859
IMD5 0.9637 0.5487 1.6925 0.8976
dqi_tot 1.0045 0.9905 1.0187 0.5303
BMI 1.0083 0.9800 1.0373 0.5704
IBD Duration 0.9895 0.9753 1.0040 0.1553
TreatmentMono biologic 1.0154 0.6405 1.6098 0.9482
TreatmentCombo therapy 0.8676 0.4851 1.5515 0.6319
Treatment5-ASA 0.9654 0.3981 2.3412 0.9379
TreatmentNone reported 0.9623 0.6317 1.4659 0.8580
Age 1.0038 0.9910 1.0167 0.5647
drinkIntake_cat[0.301,4.2 0.9923 0.6285 1.5665 0.9735
drinkIntake_cat[4.21,14.4 0.8854 0.5662 1.3846 0.5937
drinkIntake_cat[14.4,120] 0.7623 0.4876 1.1920 0.2341
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0554 1.0000 0.8139
cat 1.4686 2.0000 0.4798
IMD 3.6744 4.0000 0.4519
dqi_tot 0.2362 1.0000 0.6269
BMI 1.0309 1.0000 0.3099
IBD Duration 2.4889 1.0000 0.1147
Treatment 7.6599 4.0000 0.1049
Age 1.1162 1.0000 0.2907
drinkIntake_cat 5.5068 3.0000 0.1382
GLOBAL 22.5760 18.0001 0.2074
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9956 1.4076 2.8292 0.0001
catFC 50-250 1.1897 0.8219 1.7221 0.3572
catFC > 250 1.8761 1.2601 2.7932 0.0019
IMD2 0.7301 0.3796 1.4044 0.3460
IMD3 0.8575 0.4613 1.5942 0.6271
IMD4 0.7937 0.4307 1.4629 0.4590
IMD5 0.9828 0.5577 1.7317 0.9521
dqi_tot 1.0083 0.9933 1.0235 0.2812
BMI 1.0008 0.9720 1.0305 0.9556
IBD Duration 0.9882 0.9738 1.0029 0.1155
TreatmentMono biologic 1.0186 0.6406 1.6195 0.9380
TreatmentCombo therapy 0.9176 0.5107 1.6488 0.7737
Treatment5-ASA 0.9981 0.4127 2.4138 0.9966
TreatmentNone reported 0.9929 0.6472 1.5232 0.9740
Age 1.0070 0.9948 1.0193 0.2640
processedMeatIntake_cat[0 1.0911 0.6812 1.7476 0.7169
processedMeatIntake_cat[1 1.3214 0.8285 2.1077 0.2420
processedMeatIntake_cat[2 1.2832 0.7677 2.1451 0.3414
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0645 1.0000 0.7995
cat 1.3432 2.0000 0.5109
IMD 3.6261 4.0000 0.4590
dqi_tot 0.2220 1.0000 0.6375
BMI 1.1178 1.0000 0.2904
IBD Duration 2.5166 1.0000 0.1127
Treatment 7.3618 4.0000 0.1180
Age 1.0939 1.0000 0.2956
processedMeatIntake_cat 0.7529 3.0000 0.8607
GLOBAL 17.5875 18.0001 0.4831
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9610 1.3873 2.7719 0.0001
catFC 50-250 1.2236 0.8489 1.7636 0.2793
catFC > 250 1.9500 1.3146 2.8927 0.0009
IMD2 0.6931 0.3605 1.3327 0.2718
IMD3 0.8574 0.4639 1.5846 0.6234
IMD4 0.7984 0.4347 1.4666 0.4681
IMD5 0.9718 0.5538 1.7051 0.9206
dqi_tot 1.0038 0.9896 1.0182 0.6031
BMI 1.0032 0.9748 1.0323 0.8286
IBD Duration 0.9885 0.9742 1.0031 0.1227
TreatmentMono biologic 0.9793 0.6172 1.5540 0.9294
TreatmentCombo therapy 0.8528 0.4766 1.5261 0.5918
Treatment5-ASA 0.9871 0.4084 2.3856 0.9770
TreatmentNone reported 0.9332 0.6104 1.4268 0.7497
Age 1.0073 0.9949 1.0199 0.2486
processedPlantIntake_cat[ 1.1873 0.8222 1.7147 0.3599
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0567 1.0000 0.8118
cat 1.3927 2.0000 0.4984
IMD 3.6695 4.0000 0.4526
dqi_tot 0.2438 1.0000 0.6214
BMI 1.0408 1.0000 0.3076
IBD Duration 2.5261 1.0000 0.1120
Treatment 7.5248 4.0000 0.1106
Age 1.1113 1.0000 0.2918
processedPlantIntake_cat 0.2318 1.0000 0.6302
GLOBAL 17.8866 16.0001 0.3306
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9361 1.3643 2.7477 0.0002
catFC 50-250 1.2389 0.8592 1.7863 0.2513
catFC > 250 1.9368 1.3046 2.8753 0.0010
IMD2 0.7114 0.3698 1.3686 0.3077
IMD3 0.8623 0.4635 1.6043 0.6400
IMD4 0.8019 0.4353 1.4773 0.4788
IMD5 0.9819 0.5585 1.7263 0.9494
dqi_tot 1.0044 0.9884 1.0207 0.5899
BMI 1.0040 0.9758 1.0330 0.7856
IBD Duration 0.9892 0.9749 1.0038 0.1467
TreatmentMono biologic 0.9969 0.6256 1.5885 0.9895
TreatmentCombo therapy 0.8734 0.4880 1.5632 0.6486
Treatment5-ASA 0.9705 0.4013 2.3469 0.9470
TreatmentNone reported 0.9578 0.6260 1.4655 0.8424
Age 1.0061 0.9939 1.0184 0.3274
fruitIntake_cat[2.1,5.64) 1.0927 0.6943 1.7197 0.7016
fruitIntake_cat[5.64,10.4 1.0442 0.6564 1.6612 0.8552
fruitIntake_cat[10.4,62.9 1.0492 0.6237 1.7648 0.8564
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0566 1.0000 0.8119
cat 1.4553 2.0000 0.4830
IMD 3.6766 4.0000 0.4515
dqi_tot 0.2280 1.0000 0.6330
BMI 1.0767 1.0000 0.2994
IBD Duration 2.5032 1.0000 0.1136
Treatment 7.5826 4.0000 0.1081
Age 1.1254 1.0000 0.2888
fruitIntake_cat 0.6626 3.0000 0.8820
GLOBAL 18.5584 18.0001 0.4195
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 2.0103 1.4089 2.8683 0.0001
catFC 50-250 1.2396 0.8601 1.7865 0.2494
catFC > 250 1.9257 1.2994 2.8539 0.0011
IMD2 0.7162 0.3730 1.3753 0.3160
IMD3 0.9028 0.4853 1.6795 0.7469
IMD4 0.7925 0.4298 1.4613 0.4563
IMD5 1.0134 0.5766 1.7813 0.9630
dqi_tot 1.0055 0.9900 1.0214 0.4872
BMI 1.0017 0.9735 1.0308 0.9060
IBD Duration 0.9887 0.9744 1.0031 0.1245
TreatmentMono biologic 0.9680 0.6103 1.5353 0.8902
TreatmentCombo therapy 0.8383 0.4685 1.4998 0.5523
Treatment5-ASA 0.9218 0.3809 2.2308 0.8568
TreatmentNone reported 0.9233 0.6022 1.4154 0.7141
Age 1.0066 0.9945 1.0188 0.2851
vegIntake_cat[5.04,8.43) 1.0292 0.6561 1.6145 0.9003
vegIntake_cat[8.43,13.4) 0.7980 0.4965 1.2826 0.3514
vegIntake_cat[13.4,63.1] 1.0394 0.6367 1.6970 0.8771
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0634 1.0000 0.8012
cat 1.4090 2.0000 0.4944
IMD 3.7773 4.0000 0.4370
dqi_tot 0.2365 1.0000 0.6267
BMI 1.0392 1.0000 0.3080
IBD Duration 2.5189 1.0000 0.1125
Treatment 7.5080 4.0000 0.1114
Age 1.0773 1.0000 0.2993
vegIntake_cat 7.1241 3.0000 0.0680
GLOBAL 25.6502 18.0001 0.1080
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9346 1.3677 2.7364 0.0002
catFC 50-250 1.2353 0.8575 1.7795 0.2567
catFC > 250 1.9180 1.2922 2.8469 0.0012
IMD2 0.7150 0.3720 1.3740 0.3141
IMD3 0.8784 0.4744 1.6265 0.6801
IMD4 0.8051 0.4379 1.4802 0.4853
IMD5 0.9955 0.5666 1.7489 0.9874
dqi_tot 1.0048 0.9908 1.0190 0.5012
BMI 1.0034 0.9752 1.0325 0.8133
IBD Duration 0.9892 0.9749 1.0037 0.1433
TreatmentMono biologic 0.9909 0.6255 1.5695 0.9688
TreatmentCombo therapy 0.8739 0.4893 1.5607 0.6488
Treatment5-ASA 0.9815 0.4059 2.3729 0.9669
TreatmentNone reported 0.9535 0.6256 1.4533 0.8248
Age 1.0066 0.9942 1.0191 0.3001
redMeatIntake_cat[0.365,0 0.8827 0.6001 1.2983 0.5261
redMeatIntake_cat[0.861,9 0.9352 0.6261 1.3970 0.7435
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0547 1.0000 0.8150
cat 1.4139 2.0000 0.4931
IMD 3.6365 4.0000 0.4574
dqi_tot 0.2314 1.0000 0.6305
BMI 1.0468 1.0000 0.3062
IBD Duration 2.4833 1.0000 0.1151
Treatment 7.5169 4.0000 0.1110
Age 1.1419 1.0000 0.2853
redMeatIntake_cat 0.9282 2.0000 0.6287
GLOBAL 17.6252 17.0001 0.4128
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.9179 1.3522 2.7203 0.0003
catFC 50-250 1.2413 0.8604 1.7908 0.2477
catFC > 250 1.9306 1.2982 2.8712 0.0012
IMD2 0.7100 0.3687 1.3671 0.3056
IMD3 0.8793 0.4746 1.6289 0.6826
IMD4 0.7984 0.4343 1.4679 0.4687
IMD5 0.9899 0.5639 1.7378 0.9718
dqi_tot 1.0049 0.9909 1.0192 0.4921
BMI 1.0021 0.9737 1.0314 0.8839
IBD Duration 0.9898 0.9755 1.0044 0.1699
TreatmentMono biologic 1.0056 0.6343 1.5943 0.9810
TreatmentCombo therapy 0.8885 0.4950 1.5949 0.6921
Treatment5-ASA 0.9313 0.3846 2.2551 0.8746
TreatmentNone reported 0.9554 0.6251 1.4601 0.8330
Age 1.0067 0.9945 1.0191 0.2810
whiteMeatIntake_cat[0.426 0.9603 0.6025 1.5308 0.8649
whiteMeatIntake_cat[1.06, 0.8564 0.5242 1.3989 0.5357
whiteMeatIntake_cat[1.88, 1.0897 0.6918 1.7162 0.7111
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0542 1.0000 0.8160
cat 1.4999 2.0000 0.4724
IMD 3.7154 4.0000 0.4459
dqi_tot 0.2110 1.0000 0.6460
BMI 1.0535 1.0000 0.3047
IBD Duration 2.4871 1.0000 0.1148
Treatment 7.5884 4.0000 0.1079
Age 1.1587 1.0000 0.2817
whiteMeatIntake_cat 6.6175 3.0000 0.0851
GLOBAL 21.8440 18.0001 0.2390
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Objective flare

Total meat protein
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4258 0.9181 2.2141 0.1142
catFC 50-250 1.9044 1.1702 3.0992 0.0095
catFC > 250 3.0685 1.8239 5.1624 0.0000
IMD2 0.6264 0.2638 1.4877 0.2892
IMD3 0.7053 0.3066 1.6223 0.4113
IMD4 0.7980 0.3579 1.7794 0.5813
IMD5 0.7685 0.3628 1.6277 0.4916
dqi_tot 1.0051 0.9868 1.0238 0.5860
BMI 1.0129 0.9767 1.0505 0.4900
IBD Duration 0.9872 0.9675 1.0074 0.2128
TreatmentMono biologic 0.6623 0.3616 1.2130 0.1820
TreatmentCombo therapy 0.6341 0.3030 1.3267 0.2265
Treatment5-ASA 0.9051 0.2625 3.1203 0.8745
TreatmentNone reported 0.5871 0.3415 1.0091 0.0540
Age 0.9917 0.9764 1.0073 0.2974
Meat_sum_cat[24.9,35.8) 1.3188 0.7173 2.4244 0.3731
Meat_sum_cat[35.8,50.6) 1.4450 0.7971 2.6194 0.2252
Meat_sum_cat[50.6,331] 1.1721 0.6239 2.2020 0.6216
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0902 0.9707 0.7528
cat 12.8570 1.9803 0.0016
IMD 0.9454 3.9132 0.9116
dqi_tot 2.6824 0.9923 0.1004
BMI 1.5160 0.9815 0.2136
IBD Duration 0.0070 0.9887 0.9314
Treatment 2.3777 3.8853 0.6492
Age 4.7404 0.9816 0.0286
Meat_sum_cat 1.4170 2.9705 0.6964
GLOBAL 25.0449 23.3607 0.3677
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4743 0.9492 2.2899 0.0840
catFC 50-250 1.9208 1.1799 3.1268 0.0087
catFC > 250 3.1272 1.8567 5.2670 0.0000
IMD2 0.5976 0.2509 1.4237 0.2451
IMD3 0.7195 0.3123 1.6574 0.4394
IMD4 0.8005 0.3608 1.7760 0.5842
IMD5 0.8175 0.3890 1.7178 0.5948
dqi_tot 1.0038 0.9840 1.0240 0.7091
BMI 1.0153 0.9785 1.0535 0.4208
IBD Duration 0.9862 0.9664 1.0064 0.1782
TreatmentMono biologic 0.6776 0.3743 1.2269 0.1988
TreatmentCombo therapy 0.6364 0.3040 1.3325 0.2307
Treatment5-ASA 0.9275 0.2706 3.1792 0.9047
TreatmentNone reported 0.5624 0.3293 0.9607 0.0351
Age 0.9915 0.9759 1.0074 0.2919
meat_overall_cat[59.5,101 0.7251 0.3997 1.3152 0.2900
meat_overall_cat[101,153) 0.9222 0.5112 1.6635 0.7878
meat_overall_cat[153,927] 0.8652 0.4530 1.6526 0.6610
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1222 0.9722 0.7156
cat 12.4811 1.9815 0.0019
IMD 0.8460 3.9294 0.9277
dqi_tot 2.6621 0.9926 0.1017
BMI 1.4864 0.9861 0.2192
IBD Duration 0.0161 0.9907 0.8966
Treatment 2.3461 3.9054 0.6581
Age 4.6377 0.9835 0.0305
meat_overall_cat 1.5121 2.9746 0.6749
GLOBAL 22.0805 22.3445 0.4759
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4078 0.9090 2.1804 0.1254
catFC 50-250 1.8461 1.1308 3.0137 0.0142
catFC > 250 3.3715 1.9819 5.7354 0.0000
IMD2 0.7344 0.3068 1.7579 0.4882
IMD3 0.7459 0.3212 1.7321 0.4952
IMD4 0.8331 0.3703 1.8742 0.6589
IMD5 0.9165 0.4297 1.9552 0.8216
dqi_tot 1.0028 0.9836 1.0223 0.7761
BMI 1.0130 0.9770 1.0504 0.4830
IBD Duration 0.9853 0.9653 1.0058 0.1584
TreatmentMono biologic 0.6332 0.3471 1.1548 0.1361
TreatmentCombo therapy 0.5187 0.2454 1.0962 0.0856
Treatment5-ASA 1.0853 0.3115 3.7817 0.8977
TreatmentNone reported 0.5389 0.3161 0.9187 0.0231
Age 0.9911 0.9757 1.0067 0.2620
fish_overall_cat[16.4,36. 0.3895 0.2027 0.7486 0.0047
fish_overall_cat[36.5,65. 0.6436 0.3547 1.1677 0.1471
fish_overall_cat[65.8,647 1.0137 0.5703 1.8017 0.9631
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1378 0.9699 0.6983
cat 11.9756 1.9862 0.0025
IMD 0.8975 3.9217 0.9195
dqi_tot 2.4691 0.9938 0.1152
BMI 1.5991 0.9835 0.2021
IBD Duration 0.0003 0.9899 0.9858
Treatment 2.3097 3.8933 0.6630
Age 4.3097 0.9794 0.0367
fish_overall_cat 8.7595 2.9617 0.0316
GLOBAL 28.2603 22.3308 0.1796
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5104 0.9697 2.3525 0.0681
catFC 50-250 1.8547 1.1379 3.0231 0.0132
catFC > 250 3.2737 1.9347 5.5391 0.0000
IMD2 0.6188 0.2616 1.4635 0.2745
IMD3 0.6905 0.2996 1.5914 0.3847
IMD4 0.7931 0.3571 1.7615 0.5691
IMD5 0.8124 0.3843 1.7172 0.5864
dqi_tot 0.9968 0.9763 1.0177 0.7591
BMI 1.0131 0.9765 1.0512 0.4877
IBD Duration 0.9865 0.9666 1.0069 0.1945
TreatmentMono biologic 0.6681 0.3680 1.2128 0.1849
TreatmentCombo therapy 0.6415 0.3081 1.3353 0.2352
Treatment5-ASA 0.9400 0.2727 3.2399 0.9219
TreatmentNone reported 0.5830 0.3424 0.9925 0.0468
Age 0.9914 0.9759 1.0072 0.2839
fibre_cat[17,22.9) 1.0862 0.5909 1.9970 0.7900
fibre_cat[22.9,29.4) 1.5840 0.8746 2.8687 0.1291
fibre_cat[29.4,170] 1.5219 0.7930 2.9207 0.2067
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1402 0.9661 0.6943
cat 12.2248 1.9829 0.0022
IMD 0.7664 3.9192 0.9383
dqi_tot 2.7798 0.9907 0.0943
BMI 1.5050 0.9849 0.2161
IBD Duration 0.0196 0.9887 0.8857
Treatment 2.3763 3.8865 0.6497
Age 4.7345 0.9817 0.0287
fibre_cat 9.8540 2.9584 0.0191
GLOBAL 29.8237 22.9615 0.1532
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4532 0.9347 2.2591 0.0969
catFC 50-250 1.8967 1.1633 3.0924 0.0103
catFC > 250 2.9729 1.7607 5.0198 0.0000
IMD2 0.6480 0.2725 1.5411 0.3263
IMD3 0.7826 0.3357 1.8243 0.5702
IMD4 0.8936 0.3974 2.0092 0.7855
IMD5 0.8718 0.4095 1.8560 0.7219
dqi_tot 1.0027 0.9843 1.0214 0.7777
BMI 1.0145 0.9781 1.0522 0.4407
IBD Duration 0.9846 0.9647 1.0048 0.1339
TreatmentMono biologic 0.6404 0.3523 1.1643 0.1440
TreatmentCombo therapy 0.6000 0.2851 1.2628 0.1785
Treatment5-ASA 1.0267 0.2983 3.5342 0.9667
TreatmentNone reported 0.5510 0.3214 0.9447 0.0302
Age 0.9929 0.9773 1.0088 0.3810
PUFA_percEng_cat[4.54,5.1 1.2071 0.6639 2.1948 0.5373
PUFA_percEng_cat[5.17,5.9 1.1643 0.6403 2.1171 0.6180
PUFA_percEng_cat[5.92,12. 1.6861 0.9400 3.0246 0.0797
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0699 0.9686 0.7801
cat 12.6142 1.9807 0.0018
IMD 0.8460 3.9244 0.9273
dqi_tot 2.9517 0.9920 0.0848
BMI 1.5739 0.9771 0.2041
IBD Duration 0.0161 0.9901 0.8967
Treatment 2.4068 3.8956 0.6455
Age 4.9206 0.9822 0.0258
PUFA_percEng_cat 5.6180 2.9449 0.1271
GLOBAL 29.5319 23.1511 0.1687
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4972 0.9623 2.3296 0.0735
catFC 50-250 1.9442 1.1891 3.1788 0.0080
catFC > 250 3.1859 1.8829 5.3909 0.0000
IMD2 0.5659 0.2361 1.3561 0.2017
IMD3 0.6884 0.2972 1.5948 0.3837
IMD4 0.7634 0.3421 1.7040 0.5100
IMD5 0.7565 0.3566 1.6048 0.4670
dqi_tot 1.0042 0.9859 1.0228 0.6582
BMI 1.0163 0.9797 1.0542 0.3878
IBD Duration 0.9875 0.9676 1.0078 0.2265
TreatmentMono biologic 0.6723 0.3672 1.2311 0.1984
TreatmentCombo therapy 0.6639 0.3180 1.3861 0.2754
Treatment5-ASA 0.9018 0.2611 3.1150 0.8702
TreatmentNone reported 0.5856 0.3420 1.0026 0.0511
Age 0.9913 0.9758 1.0070 0.2766
NOVAScore_catProcessed cu 1.4672 0.8296 2.5949 0.1876
NOVAScore_catProcessed fo 1.3647 0.7487 2.4873 0.3100
NOVAScore_catUltra-proces 1.0972 0.5944 2.0251 0.7668
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1029 0.9630 0.7339
cat 12.4024 1.9803 0.0020
IMD 0.8203 3.9154 0.9305
dqi_tot 2.6810 0.9917 0.1004
BMI 1.7043 0.9796 0.1871
IBD Duration 0.0296 0.9879 0.8599
Treatment 2.3508 3.8824 0.6537
Age 4.8338 0.9823 0.0271
NOVAScore_cat 4.5958 2.9453 0.1975
GLOBAL 24.2642 23.4801 0.4167
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3762 0.8865 2.1362 0.1547
catFC 50-250 1.8108 1.1090 2.9567 0.0176
catFC > 250 2.9081 1.7217 4.9120 0.0001
IMD2 0.6260 0.2654 1.4765 0.2846
IMD3 0.7432 0.3231 1.7096 0.4850
IMD4 0.8348 0.3776 1.8458 0.6557
IMD5 0.8438 0.4006 1.7775 0.6551
dqi_tot 0.9988 0.9797 1.0182 0.8992
BMI 1.0170 0.9810 1.0544 0.3584
IBD Duration 0.9864 0.9663 1.0069 0.1915
TreatmentMono biologic 0.6629 0.3681 1.1940 0.1709
TreatmentCombo therapy 0.6323 0.3036 1.3172 0.2209
Treatment5-ASA 0.9592 0.2792 3.2948 0.9472
TreatmentNone reported 0.5591 0.3262 0.9581 0.0344
Age 0.9905 0.9748 1.0065 0.2423
UPF_perc_cat[36.8,44.3) 0.9553 0.5332 1.7116 0.8778
UPF_perc_cat[44.3,52.6) 0.5647 0.3072 1.0383 0.0659
UPF_perc_cat[52.6,92.5] 0.6696 0.3624 1.2370 0.2003
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0804 0.9734 0.7669
cat 12.7852 1.9816 0.0016
IMD 0.7226 3.9212 0.9443
dqi_tot 2.5822 0.9939 0.1072
BMI 1.5675 0.9837 0.2066
IBD Duration 0.0247 0.9897 0.8723
Treatment 2.2330 3.9124 0.6800
Age 4.9515 0.9850 0.0255
UPF_perc_cat 1.6450 2.9776 0.6451
GLOBAL 24.5636 21.8347 0.3096
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3896 0.8927 2.1631 0.1451
catFC 50-250 1.9313 1.1847 3.1483 0.0083
catFC > 250 3.0204 1.7945 5.0840 0.0000
IMD2 0.6122 0.2565 1.4613 0.2690
IMD3 0.7623 0.3273 1.7755 0.5293
IMD4 0.8362 0.3737 1.8710 0.6633
IMD5 0.8466 0.3965 1.8078 0.6671
dqi_tot 1.0016 0.9830 1.0205 0.8683
BMI 1.0142 0.9772 1.0525 0.4579
IBD Duration 0.9875 0.9679 1.0076 0.2212
TreatmentMono biologic 0.5802 0.3157 1.0665 0.0796
TreatmentCombo therapy 0.6149 0.2939 1.2862 0.1965
Treatment5-ASA 0.8696 0.2523 2.9979 0.8249
TreatmentNone reported 0.4986 0.2872 0.8657 0.0134
Age 0.9945 0.9789 1.0104 0.4963
breadIntake_cat[1.97,3.23 0.6424 0.3652 1.1299 0.1245
breadIntake_cat[3.23,4.84 0.6160 0.3426 1.1075 0.1055
breadIntake_cat[4.84,18.9 0.4781 0.2571 0.8888 0.0197
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0677 0.9667 0.7827
cat 12.6001 1.9784 0.0018
IMD 0.9141 3.9152 0.9166
dqi_tot 2.7101 0.9921 0.0987
BMI 1.6617 0.9813 0.1930
IBD Duration 0.0264 0.9882 0.8677
Treatment 2.3075 3.8921 0.6632
Age 4.8571 0.9819 0.0268
breadIntake_cat 0.8728 2.9658 0.8273
GLOBAL 23.4941 23.6374 0.4696
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5019 0.9663 2.3344 0.0706
catFC 50-250 1.8832 1.1558 3.0683 0.0110
catFC > 250 3.0074 1.7918 5.0475 0.0000
IMD2 0.6296 0.2664 1.4875 0.2915
IMD3 0.7317 0.3172 1.6878 0.4638
IMD4 0.8344 0.3767 1.8483 0.6555
IMD5 0.8489 0.4035 1.7859 0.6660
dqi_tot 1.0028 0.9842 1.0218 0.7693
BMI 1.0154 0.9789 1.0533 0.4138
IBD Duration 0.9863 0.9664 1.0067 0.1868
TreatmentMono biologic 0.6837 0.3778 1.2376 0.2092
TreatmentCombo therapy 0.6829 0.3272 1.4251 0.3095
Treatment5-ASA 0.9830 0.2828 3.4165 0.9784
TreatmentNone reported 0.5916 0.3445 1.0160 0.0571
Age 0.9909 0.9755 1.0066 0.2530
sweetIntake_cat[2.83,4.36 0.7547 0.4258 1.3375 0.3351
sweetIntake_cat[4.36,6.17 0.7649 0.4331 1.3506 0.3555
sweetIntake_cat[6.17,17.3 0.9197 0.5106 1.6566 0.7804
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1175 0.9709 0.7203
cat 12.6257 1.9830 0.0018
IMD 0.7718 3.9287 0.9381
dqi_tot 2.7080 0.9942 0.0991
BMI 1.3626 0.9847 0.2389
IBD Duration 0.0166 0.9890 0.8947
Treatment 2.2690 3.9054 0.6723
Age 4.7375 0.9837 0.0288
sweetIntake_cat 0.7682 2.9682 0.8531
GLOBAL 22.6525 21.9764 0.4202
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4830 0.9537 2.3061 0.0802
catFC 50-250 1.8965 1.1649 3.0877 0.0101
catFC > 250 3.0495 1.8080 5.1434 0.0000
IMD2 0.6044 0.2548 1.4336 0.2532
IMD3 0.6728 0.2923 1.5486 0.3515
IMD4 0.7718 0.3493 1.7053 0.5219
IMD5 0.7601 0.3616 1.5978 0.4693
dqi_tot 1.0011 0.9827 1.0198 0.9074
BMI 1.0214 0.9867 1.0574 0.2296
IBD Duration 0.9876 0.9682 1.0075 0.2216
TreatmentMono biologic 0.6787 0.3733 1.2339 0.2037
TreatmentCombo therapy 0.6459 0.3072 1.3581 0.2490
Treatment5-ASA 0.9574 0.2769 3.3107 0.9452
TreatmentNone reported 0.5676 0.3313 0.9722 0.0392
Age 0.9861 0.9700 1.0025 0.0953
drinkIntake_cat[0.301,4.2 0.7030 0.3921 1.2605 0.2369
drinkIntake_cat[4.21,14.4 0.5929 0.3299 1.0655 0.0805
drinkIntake_cat[14.4,120] 0.5114 0.2869 0.9116 0.0230
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1040 0.9706 0.7356
cat 12.3701 1.9818 0.0020
IMD 0.9965 3.9229 0.9044
dqi_tot 2.9561 0.9940 0.0848
BMI 1.4734 0.9757 0.2186
IBD Duration 0.0106 0.9902 0.9160
Treatment 2.3378 3.8852 0.6565
Age 4.7131 0.9857 0.0293
drinkIntake_cat 1.4753 2.9732 0.6832
GLOBAL 24.7881 22.4537 0.3315
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4411 0.9270 2.2402 0.1045
catFC 50-250 1.8487 1.1330 3.0164 0.0139
catFC > 250 2.9601 1.7561 4.9896 0.0000
IMD2 0.6165 0.2582 1.4721 0.2761
IMD3 0.6967 0.3007 1.6144 0.3993
IMD4 0.7901 0.3566 1.7503 0.5615
IMD5 0.8093 0.3809 1.7197 0.5822
dqi_tot 1.0037 0.9838 1.0240 0.7192
BMI 1.0140 0.9775 1.0520 0.4567
IBD Duration 0.9875 0.9675 1.0079 0.2283
TreatmentMono biologic 0.6872 0.3797 1.2438 0.2153
TreatmentCombo therapy 0.6793 0.3252 1.4187 0.3034
Treatment5-ASA 0.9641 0.2809 3.3092 0.9537
TreatmentNone reported 0.5834 0.3417 0.9960 0.0483
Age 0.9914 0.9759 1.0072 0.2850
processedMeatIntake_cat[0 0.9817 0.5291 1.8214 0.9534
processedMeatIntake_cat[1 1.1865 0.6548 2.1500 0.5729
processedMeatIntake_cat[2 0.9168 0.4589 1.8313 0.8055
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1082 0.9720 0.7313
cat 12.5552 1.9819 0.0018
IMD 0.8467 3.9268 0.9274
dqi_tot 2.7855 0.9924 0.0941
BMI 1.4152 0.9855 0.2304
IBD Duration 0.0170 0.9887 0.8933
Treatment 2.2942 3.8984 0.6666
Age 4.5695 0.9831 0.0317
processedMeatIntake_cat 1.0518 2.9664 0.7836
GLOBAL 22.6896 22.3300 0.4391
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.cd.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.4635 0.9451 2.2663 0.0879
catFC 50-250 1.8746 1.1526 3.0489 0.0113
catFC > 250 3.0482 1.8153 5.1186 0.0000
IMD2 0.5950 0.2521 1.4045 0.2361
IMD3 0.7045 0.3069 1.6171 0.4087
IMD4 0.7851 0.3563 1.7301 0.5485
IMD5 0.8013 0.3821 1.6803 0.5576
dqi_tot 1.0028 0.9842 1.0217 0.7723
BMI 1.0138 0.9776 1.0512 0.4604
IBD Duration 0.9863 0.9664 1.0065 0.1824
TreatmentMono biologic 0.6630 0.3658 1.2017 0.1756
TreatmentCombo therapy 0.6432 0.3091 1.3387 0.2380
Treatment5-ASA 0.9546 0.2786 3.2705 0.9410
TreatmentNone reported 0.5717 0.3351 0.9753 0.0402
Age 0.9924 0.9768 1.0083 0.3493
processedPlantIntake_cat[ 1.1526 0.7140 1.8606 0.5611
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.1035 0.9704 0.7362
cat 12.6390 1.9829 0.0018
IMD 0.8342 3.9264 0.9292
dqi_tot 2.7338 0.9919 0.0972
BMI 1.4522 0.9836 0.2239
IBD Duration 0.0166 0.9911 0.8954
Treatment 2.2804 3.9002 0.6694
Age 4.6844 0.9858 0.0298
processedPlantIntake_cat 0.0001 0.9910 0.9927
GLOBAL 22.3132 20.3953 0.3463
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Ulcerative colitis

Patient-reported flare

Total meat protein
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6687 1.2352 2.2542 0.0008
catFC 50-250 1.8234 1.3118 2.5346 0.0004
catFC > 250 2.1467 1.4824 3.1089 0.0001
IMD2 1.6309 0.8364 3.1801 0.1511
IMD3 1.1241 0.5912 2.1376 0.7212
IMD4 1.3652 0.7447 2.5027 0.3140
IMD5 1.1471 0.6255 2.1038 0.6573
dqi_tot 1.0053 0.9917 1.0191 0.4439
BMI 0.9831 0.9532 1.0140 0.2815
IBD Duration 0.9953 0.9793 1.0116 0.5695
TreatmentMono biologic 0.5944 0.3270 1.0803 0.0879
TreatmentCombo therapy 0.3237 0.1347 0.7779 0.0117
Treatment5-ASA 0.8803 0.5864 1.3217 0.5387
TreatmentNone reported 0.8029 0.5327 1.2101 0.2943
Age 0.9879 0.9773 0.9986 0.0266
Meat_sum_cat[24.9,35.8) 1.1634 0.7691 1.7598 0.4735
Meat_sum_cat[35.8,50.6) 1.3192 0.8695 2.0014 0.1928
Meat_sum_cat[50.6,331] 1.3211 0.8463 2.0623 0.2204
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0130 1.0000 0.9093
cat 3.0032 2.0000 0.2228
IMD 2.3584 4.0000 0.6702
dqi_tot 0.7726 1.0000 0.3794
BMI 0.9483 1.0000 0.3301
IBD Duration 3.7730 1.0000 0.0521
Treatment 0.7081 4.0000 0.9503
Age 0.3967 1.0000 0.5288
Meat_sum_cat 9.0306 3.0000 0.0289
GLOBAL 21.2683 18.0001 0.2661
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6503 1.2180 2.2361 0.0012
catFC 50-250 1.8423 1.3234 2.5647 0.0003
catFC > 250 2.1215 1.4655 3.0710 0.0001
IMD2 1.5567 0.8009 3.0259 0.1919
IMD3 1.1136 0.5862 2.1156 0.7423
IMD4 1.3348 0.7280 2.4473 0.3505
IMD5 1.1124 0.6072 2.0381 0.7302
dqi_tot 1.0056 0.9907 1.0208 0.4625
BMI 0.9816 0.9518 1.0123 0.2368
IBD Duration 0.9956 0.9796 1.0118 0.5897
TreatmentMono biologic 0.6428 0.3540 1.1672 0.1465
TreatmentCombo therapy 0.3432 0.1431 0.8229 0.0165
Treatment5-ASA 0.9083 0.6061 1.3611 0.6413
TreatmentNone reported 0.8338 0.5562 1.2499 0.3788
Age 0.9882 0.9776 0.9989 0.0315
meat_overall_cat[59.5,101 0.9430 0.6201 1.4339 0.7836
meat_overall_cat[101,153) 1.2675 0.8354 1.9231 0.2651
meat_overall_cat[153,927] 1.0959 0.6808 1.7642 0.7061
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0075 1.0000 0.9310
cat 2.9048 2.0000 0.2340
IMD 2.3155 4.0000 0.6779
dqi_tot 0.7813 1.0000 0.3768
BMI 0.9735 1.0000 0.3238
IBD Duration 3.6328 1.0000 0.0567
Treatment 0.6715 4.0000 0.9548
Age 0.4446 1.0000 0.5049
meat_overall_cat 7.1590 3.0000 0.0670
GLOBAL 21.5437 18.0001 0.2529
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6490 1.2220 2.2250 0.0011
catFC 50-250 1.7443 1.2467 2.4406 0.0012
catFC > 250 2.1011 1.4509 3.0426 0.0001
IMD2 1.6247 0.8358 3.1583 0.1524
IMD3 1.1151 0.5865 2.1200 0.7397
IMD4 1.3919 0.7558 2.5632 0.2885
IMD5 1.1822 0.6432 2.1729 0.5900
dqi_tot 0.9984 0.9849 1.0121 0.8176
BMI 0.9878 0.9574 1.0191 0.4402
IBD Duration 0.9953 0.9793 1.0117 0.5739
TreatmentMono biologic 0.5637 0.3094 1.0271 0.0611
TreatmentCombo therapy 0.3040 0.1267 0.7292 0.0076
Treatment5-ASA 0.8974 0.5980 1.3468 0.6013
TreatmentNone reported 0.8140 0.5433 1.2197 0.3186
Age 0.9860 0.9752 0.9968 0.0115
fish_overall_cat[16.4,36. 1.3033 0.8504 1.9975 0.2240
fish_overall_cat[36.5,65. 1.4322 0.9294 2.2068 0.1035
fish_overall_cat[65.8,647 1.6939 1.1157 2.5717 0.0134
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0080 1.0000 0.9287
cat 3.0146 2.0000 0.2215
IMD 2.3677 4.0000 0.6685
dqi_tot 0.7740 1.0000 0.3790
BMI 0.8820 1.0000 0.3476
IBD Duration 4.0562 1.0000 0.0440
Treatment 0.7427 4.0000 0.9460
Age 0.3624 1.0000 0.5472
fish_overall_cat 0.6304 3.0000 0.8894
GLOBAL 14.8077 18.0001 0.6751
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6276 1.2021 2.2038 0.0016
catFC 50-250 1.8278 1.3145 2.5415 0.0003
catFC > 250 2.1649 1.4918 3.1416 0.0000
IMD2 1.4667 0.7493 2.8706 0.2637
IMD3 1.0980 0.5754 2.0952 0.7768
IMD4 1.3294 0.7245 2.4394 0.3579
IMD5 1.1239 0.6122 2.0631 0.7063
dqi_tot 1.0038 0.9896 1.0182 0.6026
BMI 0.9830 0.9528 1.0142 0.2818
IBD Duration 0.9960 0.9801 1.0121 0.6246
TreatmentMono biologic 0.6174 0.3409 1.1182 0.1115
TreatmentCombo therapy 0.3339 0.1398 0.7979 0.0136
Treatment5-ASA 0.9147 0.6107 1.3698 0.6651
TreatmentNone reported 0.8424 0.5615 1.2638 0.4072
Age 0.9874 0.9769 0.9981 0.0212
fibre_cat[17,22.9) 0.8423 0.5596 1.2679 0.4108
fibre_cat[22.9,29.4) 0.9560 0.6161 1.4833 0.8409
fibre_cat[29.4,170] 0.8309 0.5272 1.3096 0.4249
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0046 1.0000 0.9459
cat 3.0864 2.0000 0.2137
IMD 2.3596 4.0000 0.6699
dqi_tot 0.7499 1.0000 0.3865
BMI 0.9634 1.0000 0.3263
IBD Duration 3.7769 1.0000 0.0520
Treatment 0.6869 4.0000 0.9529
Age 0.3875 1.0000 0.5336
fibre_cat 0.8273 3.0000 0.8429
GLOBAL 15.3576 18.0001 0.6373
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6248 1.2044 2.1919 0.0015
catFC 50-250 1.8542 1.3336 2.5781 0.0002
catFC > 250 2.1382 1.4760 3.0977 0.0001
IMD2 1.5188 0.7821 2.9495 0.2172
IMD3 1.0814 0.5683 2.0578 0.8115
IMD4 1.3154 0.7178 2.4104 0.3751
IMD5 1.1135 0.6070 2.0425 0.7284
dqi_tot 1.0026 0.9895 1.0160 0.6976
BMI 0.9854 0.9554 1.0164 0.3530
IBD Duration 0.9956 0.9798 1.0118 0.5941
TreatmentMono biologic 0.6261 0.3437 1.1405 0.1259
TreatmentCombo therapy 0.3432 0.1438 0.8192 0.0160
Treatment5-ASA 0.9036 0.6023 1.3556 0.6243
TreatmentNone reported 0.8590 0.5715 1.2913 0.4650
Age 0.9884 0.9777 0.9991 0.0345
PUFA_percEng_cat[4.54,5.1 0.9391 0.6308 1.3982 0.7571
PUFA_percEng_cat[5.17,5.9 0.8391 0.5577 1.2623 0.3998
PUFA_percEng_cat[5.92,12. 1.0807 0.7273 1.6058 0.7008
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0126 1.0000 0.9105
cat 3.0473 2.0000 0.2179
IMD 2.3768 4.0000 0.6668
dqi_tot 0.7430 1.0000 0.3887
BMI 0.9051 1.0000 0.3414
IBD Duration 3.7937 1.0000 0.0514
Treatment 0.7223 4.0000 0.9485
Age 0.3529 1.0000 0.5525
PUFA_percEng_cat 2.9070 3.0000 0.4062
GLOBAL 17.6047 18.0001 0.4820
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6163 1.1973 2.1821 0.0017
catFC 50-250 1.8269 1.3151 2.5378 0.0003
catFC > 250 2.0940 1.4464 3.0316 0.0001
IMD2 1.4919 0.7632 2.9161 0.2421
IMD3 1.0752 0.5642 2.0490 0.8255
IMD4 1.3065 0.7106 2.4022 0.3896
IMD5 1.1090 0.6045 2.0348 0.7382
dqi_tot 1.0027 0.9895 1.0160 0.6935
BMI 0.9823 0.9522 1.0133 0.2601
IBD Duration 0.9953 0.9794 1.0115 0.5707
TreatmentMono biologic 0.6076 0.3352 1.1013 0.1006
TreatmentCombo therapy 0.3365 0.1410 0.8033 0.0142
Treatment5-ASA 0.9006 0.6013 1.3490 0.6116
TreatmentNone reported 0.8391 0.5605 1.2562 0.3942
Age 0.9877 0.9771 0.9984 0.0239
NOVAScore_catProcessed cu 0.8179 0.5517 1.2124 0.3168
NOVAScore_catProcessed fo 0.9115 0.6186 1.3431 0.6394
NOVAScore_catUltra-proces 0.9405 0.6293 1.4056 0.7648
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0032 1.0000 0.9546
cat 3.1304 2.0000 0.2090
IMD 2.3725 4.0000 0.6676
dqi_tot 0.7594 1.0000 0.3835
BMI 0.9674 1.0000 0.3253
IBD Duration 3.7175 1.0000 0.0538
Treatment 0.7059 4.0000 0.9506
Age 0.4235 1.0000 0.5152
NOVAScore_cat 3.2381 3.0000 0.3564
GLOBAL 18.5498 18.0001 0.4200
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6321 1.2089 2.2036 0.0014
catFC 50-250 2.0751 1.4827 2.9041 0.0000
catFC > 250 2.3683 1.6261 3.4492 0.0000
IMD2 1.4433 0.7439 2.8004 0.2779
IMD3 1.0141 0.5319 1.9331 0.9662
IMD4 1.2412 0.6755 2.2805 0.4863
IMD5 1.0195 0.5524 1.8818 0.9507
dqi_tot 0.9965 0.9829 1.0102 0.6126
BMI 0.9835 0.9537 1.0142 0.2882
IBD Duration 0.9963 0.9804 1.0125 0.6538
TreatmentMono biologic 0.6116 0.3363 1.1123 0.1071
TreatmentCombo therapy 0.3241 0.1348 0.7793 0.0118
Treatment5-ASA 0.8484 0.5636 1.2772 0.4309
TreatmentNone reported 0.7564 0.4994 1.1457 0.1876
Age 0.9854 0.9750 0.9959 0.0066
UPF_perc_cat[36.8,44.3) 0.5422 0.3699 0.7948 0.0017
UPF_perc_cat[44.3,52.6) 0.5120 0.3413 0.7681 0.0012
UPF_perc_cat[52.6,92.5] 0.4784 0.3109 0.7361 0.0008
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0062 1.0000 0.9371
cat 2.6659 2.0000 0.2637
IMD 2.0797 4.0000 0.7211
dqi_tot 0.8588 1.0000 0.3541
BMI 0.8081 1.0000 0.3687
IBD Duration 3.8038 1.0000 0.0511
Treatment 0.8055 4.0000 0.9377
Age 0.3595 1.0000 0.5488
UPF_perc_cat 0.6803 3.0000 0.8778
GLOBAL 14.8850 18.0001 0.6699
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5516 1.1463 2.1003 0.0045
catFC 50-250 1.8684 1.3431 2.5991 0.0002
catFC > 250 2.1272 1.4664 3.0857 0.0001
IMD2 1.5630 0.8032 3.0413 0.1886
IMD3 1.1022 0.5760 2.1093 0.7688
IMD4 1.2923 0.7023 2.3779 0.4098
IMD5 1.0629 0.5755 1.9631 0.8455
dqi_tot 1.0020 0.9892 1.0150 0.7574
BMI 0.9811 0.9507 1.0124 0.2342
IBD Duration 0.9954 0.9795 1.0116 0.5785
TreatmentMono biologic 0.5148 0.2817 0.9406 0.0309
TreatmentCombo therapy 0.2930 0.1222 0.7026 0.0059
Treatment5-ASA 0.8290 0.5500 1.2495 0.3703
TreatmentNone reported 0.7928 0.5276 1.1913 0.2637
Age 0.9879 0.9772 0.9987 0.0277
breadIntake_cat[1.97,3.23 1.6003 1.0936 2.3417 0.0155
breadIntake_cat[3.23,4.84 1.0427 0.6876 1.5811 0.8440
breadIntake_cat[4.84,18.9 0.8514 0.5531 1.3105 0.4647
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0036 1.0000 0.9523
cat 2.9365 2.0000 0.2303
IMD 2.2096 4.0000 0.6973
dqi_tot 0.8262 1.0000 0.3634
BMI 1.1216 1.0000 0.2896
IBD Duration 3.4815 1.0000 0.0621
Treatment 0.7616 4.0000 0.9435
Age 0.3854 1.0000 0.5347
breadIntake_cat 6.5052 3.0000 0.0895
GLOBAL 21.6033 18.0001 0.2501
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6769 1.2390 2.2696 0.0008
catFC 50-250 1.9253 1.3770 2.6921 0.0001
catFC > 250 2.1157 1.4585 3.0691 0.0001
IMD2 1.5563 0.8020 3.0201 0.1910
IMD3 1.1301 0.5897 2.1659 0.7124
IMD4 1.3542 0.7379 2.4852 0.3276
IMD5 1.1293 0.6147 2.0747 0.6951
dqi_tot 1.0009 0.9878 1.0142 0.8932
BMI 0.9846 0.9547 1.0153 0.3215
IBD Duration 0.9953 0.9794 1.0115 0.5690
TreatmentMono biologic 0.6215 0.3423 1.1282 0.1179
TreatmentCombo therapy 0.3199 0.1329 0.7697 0.0110
Treatment5-ASA 0.8656 0.5746 1.3040 0.4900
TreatmentNone reported 0.8040 0.5334 1.2118 0.2972
Age 0.9880 0.9774 0.9987 0.0282
sweetIntake_cat[2.83,4.36 0.7592 0.5110 1.1281 0.1728
sweetIntake_cat[4.36,6.17 0.7699 0.5155 1.1499 0.2014
sweetIntake_cat[6.17,17.3 0.6755 0.4552 1.0023 0.0514
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0009 1.0000 0.9763
cat 2.8956 2.0000 0.2351
IMD 2.2706 4.0000 0.6861
dqi_tot 0.7872 1.0000 0.3749
BMI 0.8448 1.0000 0.3580
IBD Duration 3.9650 1.0000 0.0465
Treatment 0.6876 4.0000 0.9529
Age 0.4044 1.0000 0.5248
sweetIntake_cat 1.3462 3.0000 0.7182
GLOBAL 15.6703 18.0001 0.6155
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6299 1.2072 2.2005 0.0014
catFC 50-250 1.8535 1.3315 2.5801 0.0003
catFC > 250 2.1131 1.4605 3.0572 0.0001
IMD2 1.6387 0.8398 3.1976 0.1476
IMD3 1.1825 0.6197 2.2565 0.6111
IMD4 1.3996 0.7611 2.5738 0.2794
IMD5 1.1681 0.6358 2.1460 0.6166
dqi_tot 1.0021 0.9891 1.0154 0.7492
BMI 0.9840 0.9532 1.0158 0.3208
IBD Duration 0.9951 0.9792 1.0112 0.5481
TreatmentMono biologic 0.6110 0.3378 1.1054 0.1034
TreatmentCombo therapy 0.3355 0.1404 0.8020 0.0140
Treatment5-ASA 0.9087 0.6065 1.3615 0.6427
TreatmentNone reported 0.8599 0.5722 1.2922 0.4676
Age 0.9862 0.9754 0.9972 0.0140
drinkIntake_cat[0.301,4.2 0.7589 0.5150 1.1185 0.1633
drinkIntake_cat[4.21,14.4 0.9961 0.6628 1.4969 0.9850
drinkIntake_cat[14.4,120] 0.8345 0.5436 1.2810 0.4080
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0056 1.0000 0.9402
cat 3.1615 2.0000 0.2058
IMD 2.2694 4.0000 0.6863
dqi_tot 0.7714 1.0000 0.3798
BMI 0.9727 1.0000 0.3240
IBD Duration 3.5112 1.0000 0.0610
Treatment 0.7325 4.0000 0.9473
Age 0.4333 1.0000 0.5104
drinkIntake_cat 1.1374 3.0000 0.7681
GLOBAL 15.5559 18.0001 0.6235
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6089 1.1860 2.1827 0.0022
catFC 50-250 1.8684 1.3412 2.6030 0.0002
catFC > 250 2.1294 1.4698 3.0848 0.0001
IMD2 1.5031 0.7700 2.9343 0.2324
IMD3 1.0853 0.5682 2.0731 0.8041
IMD4 1.3166 0.7161 2.4208 0.3760
IMD5 1.1003 0.5968 2.0286 0.7595
dqi_tot 1.0004 0.9862 1.0149 0.9518
BMI 0.9844 0.9545 1.0153 0.3190
IBD Duration 0.9958 0.9799 1.0120 0.6098
TreatmentMono biologic 0.6269 0.3442 1.1418 0.1269
TreatmentCombo therapy 0.3353 0.1404 0.8010 0.0139
Treatment5-ASA 0.9100 0.6082 1.3615 0.6464
TreatmentNone reported 0.8382 0.5599 1.2546 0.3910
Age 0.9877 0.9772 0.9983 0.0234
processedMeatIntake_cat[0 0.8687 0.5806 1.2998 0.4936
processedMeatIntake_cat[1 0.8618 0.5723 1.2977 0.4763
processedMeatIntake_cat[2 0.8494 0.5438 1.3269 0.4734
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0022 1.0000 0.9630
cat 3.0987 2.0000 0.2124
IMD 2.3633 4.0000 0.6693
dqi_tot 0.7192 1.0000 0.3964
BMI 0.9622 1.0000 0.3266
IBD Duration 3.6656 1.0000 0.0555
Treatment 0.7135 4.0000 0.9497
Age 0.3978 1.0000 0.5282
processedMeatIntake_cat 2.4274 3.0000 0.4886
GLOBAL 18.0011 18.0001 0.4556
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6311 1.2095 2.1996 0.0013
catFC 50-250 1.8252 1.3126 2.5380 0.0003
catFC > 250 2.1248 1.4679 3.0757 0.0001
IMD2 1.5174 0.7817 2.9455 0.2179
IMD3 1.1249 0.5922 2.1369 0.7192
IMD4 1.3458 0.7348 2.4650 0.3361
IMD5 1.1385 0.6209 2.0875 0.6750
dqi_tot 1.0032 0.9900 1.0167 0.6357
BMI 0.9838 0.9540 1.0145 0.2978
IBD Duration 0.9953 0.9795 1.0115 0.5686
TreatmentMono biologic 0.6299 0.3480 1.1402 0.1269
TreatmentCombo therapy 0.3403 0.1426 0.8123 0.0152
Treatment5-ASA 0.9188 0.6134 1.3764 0.6814
TreatmentNone reported 0.8517 0.5686 1.2757 0.4361
Age 0.9870 0.9763 0.9979 0.0197
processedPlantIntake_cat[ 0.9074 0.6453 1.2760 0.5764
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0056 1.0000 0.9402
cat 3.0817 2.0000 0.2142
IMD 2.3835 4.0000 0.6656
dqi_tot 0.7567 1.0000 0.3844
BMI 0.9233 1.0000 0.3366
IBD Duration 3.7480 1.0000 0.0529
Treatment 0.6882 4.0000 0.9528
Age 0.3883 1.0000 0.5332
processedPlantIntake_cat 1.4338 1.0000 0.2312
GLOBAL 15.4224 16.0001 0.4940
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6083 1.1915 2.1710 0.0019
catFC 50-250 1.8480 1.3304 2.5669 0.0002
catFC > 250 2.1082 1.4571 3.0503 0.0001
IMD2 1.4958 0.7686 2.9111 0.2360
IMD3 1.0902 0.5719 2.0783 0.7929
IMD4 1.3212 0.7190 2.4279 0.3695
IMD5 1.1000 0.5972 2.0263 0.7597
dqi_tot 1.0006 0.9861 1.0153 0.9351
BMI 0.9832 0.9536 1.0138 0.2788
IBD Duration 0.9956 0.9797 1.0118 0.5948
TreatmentMono biologic 0.6320 0.3488 1.1454 0.1304
TreatmentCombo therapy 0.3443 0.1440 0.8229 0.0165
Treatment5-ASA 0.9070 0.6029 1.3645 0.6395
TreatmentNone reported 0.8510 0.5675 1.2761 0.4350
Age 0.9875 0.9769 0.9982 0.0222
fruitIntake_cat[2.1,5.64) 1.1542 0.7438 1.7909 0.5224
fruitIntake_cat[5.64,10.4 1.0826 0.6968 1.6819 0.7240
fruitIntake_cat[10.4,62.9 1.1674 0.7258 1.8777 0.5232
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0052 1.0000 0.9426
cat 3.0181 2.0000 0.2211
IMD 2.3499 4.0000 0.6717
dqi_tot 0.7382 1.0000 0.3902
BMI 0.9408 1.0000 0.3321
IBD Duration 3.7474 1.0000 0.0529
Treatment 0.6981 4.0000 0.9516
Age 0.3941 1.0000 0.5301
fruitIntake_cat 3.1104 3.0000 0.3749
GLOBAL 17.8409 18.0001 0.4662
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.5989 1.1809 2.1648 0.0024
catFC 50-250 1.8458 1.3240 2.5733 0.0003
catFC > 250 2.0875 1.4422 3.0217 0.0001
IMD2 1.5768 0.8084 3.0756 0.1815
IMD3 1.1489 0.5999 2.2004 0.6754
IMD4 1.3833 0.7499 2.5517 0.2990
IMD5 1.1149 0.6067 2.0490 0.7261
dqi_tot 0.9999 0.9858 1.0143 0.9903
BMI 0.9845 0.9545 1.0154 0.3219
IBD Duration 0.9951 0.9792 1.0112 0.5454
TreatmentMono biologic 0.6059 0.3345 1.0973 0.0982
TreatmentCombo therapy 0.3380 0.1412 0.8088 0.0148
Treatment5-ASA 0.8786 0.5829 1.3243 0.5363
TreatmentNone reported 0.8280 0.5509 1.2446 0.3641
Age 0.9880 0.9773 0.9989 0.0304
vegIntake_cat[5.04,8.43) 1.1653 0.7656 1.7736 0.4753
vegIntake_cat[8.43,13.4) 1.3412 0.8778 2.0492 0.1747
vegIntake_cat[13.4,63.1] 1.1919 0.7543 1.8835 0.4520
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0036 1.0000 0.9521
cat 3.0506 2.0000 0.2176
IMD 2.3284 4.0000 0.6756
dqi_tot 0.7012 1.0000 0.4024
BMI 0.9063 1.0000 0.3411
IBD Duration 3.6576 1.0000 0.0558
Treatment 0.7098 4.0000 0.9501
Age 0.4159 1.0000 0.5190
vegIntake_cat 0.1758 3.0000 0.9814
GLOBAL 15.3583 18.0001 0.6372
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6504 1.2221 2.2287 0.0011
catFC 50-250 1.8078 1.2990 2.5158 0.0004
catFC > 250 2.0715 1.4295 3.0019 0.0001
IMD2 1.4806 0.7626 2.8748 0.2463
IMD3 1.1013 0.5798 2.0917 0.7682
IMD4 1.3225 0.7218 2.4230 0.3657
IMD5 1.1057 0.6028 2.0281 0.7456
dqi_tot 1.0014 0.9878 1.0151 0.8464
BMI 0.9846 0.9547 1.0155 0.3251
IBD Duration 0.9957 0.9798 1.0119 0.5995
TreatmentMono biologic 0.6108 0.3374 1.1055 0.1034
TreatmentCombo therapy 0.3289 0.1376 0.7859 0.0123
Treatment5-ASA 0.8767 0.5843 1.3154 0.5249
TreatmentNone reported 0.8343 0.5574 1.2489 0.3789
Age 0.9882 0.9775 0.9990 0.0325
redMeatIntake_cat[0.365,0 1.1775 0.8415 1.6476 0.3406
redMeatIntake_cat[0.861,9 0.8565 0.5895 1.2444 0.4163
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0005 1.0000 0.9829
cat 3.1896 2.0000 0.2030
IMD 2.4031 4.0000 0.6621
dqi_tot 0.7023 1.0000 0.4020
BMI 0.8941 1.0000 0.3444
IBD Duration 3.7874 1.0000 0.0516
Treatment 0.7302 4.0000 0.9476
Age 0.3770 1.0000 0.5392
redMeatIntake_cat 1.5874 2.0000 0.4522
GLOBAL 15.5571 17.0001 0.5554
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(softflare_time, softflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.6088 1.1922 2.1708 0.0019
catFC 50-250 1.8552 1.3325 2.5829 0.0003
catFC > 250 2.1003 1.4486 3.0451 0.0001
IMD2 1.5350 0.7893 2.9851 0.2067
IMD3 1.1016 0.5803 2.0912 0.7673
IMD4 1.3593 0.7401 2.4966 0.3223
IMD5 1.1285 0.6145 2.0724 0.6966
dqi_tot 1.0032 0.9899 1.0167 0.6380
BMI 0.9851 0.9550 1.0161 0.3430
IBD Duration 0.9951 0.9791 1.0113 0.5482
TreatmentMono biologic 0.6152 0.3390 1.1165 0.1102
TreatmentCombo therapy 0.3317 0.1382 0.7964 0.0135
Treatment5-ASA 0.9002 0.5992 1.3523 0.6125
TreatmentNone reported 0.8425 0.5598 1.2679 0.4112
Age 0.9865 0.9757 0.9975 0.0160
whiteMeatIntake_cat[0.426 1.1520 0.7634 1.7384 0.5004
whiteMeatIntake_cat[1.06, 1.1349 0.7691 1.6747 0.5237
whiteMeatIntake_cat[1.88, 0.9573 0.6265 1.4626 0.8399
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0029 1.0000 0.9571
cat 3.0182 2.0000 0.2211
IMD 2.4289 4.0000 0.6574
dqi_tot 0.7406 1.0000 0.3895
BMI 0.9101 1.0000 0.3401
IBD Duration 3.7547 1.0000 0.0527
Treatment 0.7043 4.0000 0.9508
Age 0.3713 1.0000 0.5423
whiteMeatIntake_cat 2.4387 3.0000 0.4865
GLOBAL 16.9080 18.0001 0.5294
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Objective flare

Total meat protein
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    Meat_sum_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3326 0.9020 1.9687 0.1493
catFC 50-250 2.0603 1.3263 3.2006 0.0013
catFC > 250 2.5318 1.5590 4.1118 0.0002
IMD2 1.6991 0.6415 4.5005 0.2861
IMD3 1.2934 0.5034 3.3235 0.5931
IMD4 2.2332 0.9278 5.3753 0.0730
IMD5 1.4550 0.5947 3.5598 0.4114
dqi_tot 1.0131 0.9941 1.0325 0.1778
BMI 0.9628 0.9214 1.0061 0.0913
IBD Duration 0.9994 0.9771 1.0221 0.9556
TreatmentMono biologic 1.0680 0.5335 2.1380 0.8527
TreatmentCombo therapy 0.7357 0.3054 1.7721 0.4938
Treatment5-ASA 0.9406 0.5520 1.6028 0.8218
TreatmentNone reported 0.5774 0.3276 1.0178 0.0576
Age 0.9854 0.9707 1.0003 0.0541
Meat_sum_cat[24.9,35.8) 1.4586 0.8042 2.6455 0.2140
Meat_sum_cat[35.8,50.6) 1.6994 0.9418 3.0663 0.0782
Meat_sum_cat[50.6,331] 2.1880 1.1896 4.0243 0.0118
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0883 1 0.7664
cat 5.8623 2 0.0533
IMD 1.8402 4 0.7651
dqi_tot 0.0000 1 0.9962
BMI 0.3398 1 0.5599
IBD Duration 0.1865 1 0.6658
Treatment 7.8096 4 0.0988
Age 0.0804 1 0.7767
Meat_sum_cat 1.2229 3 0.7475
GLOBAL 19.1539 18 0.3824
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    meat_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3213 0.8897 1.9623 0.1673
catFC 50-250 2.1249 1.3624 3.3141 0.0009
catFC > 250 2.4369 1.4998 3.9595 0.0003
IMD2 1.6921 0.6410 4.4666 0.2882
IMD3 1.2443 0.4851 3.1921 0.6492
IMD4 2.1625 0.8992 5.2009 0.0850
IMD5 1.4057 0.5769 3.4252 0.4536
dqi_tot 1.0188 0.9977 1.0403 0.0817
BMI 0.9593 0.9183 1.0021 0.0619
IBD Duration 1.0005 0.9788 1.0226 0.9646
TreatmentMono biologic 1.2949 0.6489 2.5843 0.4635
TreatmentCombo therapy 0.7557 0.3146 1.8152 0.5310
Treatment5-ASA 0.9469 0.5562 1.6118 0.8405
TreatmentNone reported 0.5939 0.3384 1.0420 0.0693
Age 0.9860 0.9716 1.0007 0.0618
meat_overall_cat[59.5,101 0.6775 0.3646 1.2587 0.2180
meat_overall_cat[101,153) 1.5795 0.8991 2.7749 0.1118
meat_overall_cat[153,927] 1.7211 0.9250 3.2025 0.0866
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0982 1 0.7540
cat 5.5183 2 0.0633
IMD 1.8190 4 0.7690
dqi_tot 0.0006 1 0.9813
BMI 0.3187 1 0.5724
IBD Duration 0.2017 1 0.6534
Treatment 8.1845 4 0.0850
Age 0.0752 1 0.7839
meat_overall_cat 1.5082 3 0.6804
GLOBAL 19.7890 18 0.3448
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Overall fish intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fish_overall_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2411 0.8420 1.8294 0.2751
catFC 50-250 2.1036 1.3431 3.2948 0.0012
catFC > 250 2.4826 1.5285 4.0321 0.0002
IMD2 1.5964 0.6038 4.2204 0.3457
IMD3 1.2229 0.4767 3.1371 0.6755
IMD4 2.1977 0.9140 5.2839 0.0785
IMD5 1.4399 0.5887 3.5218 0.4243
dqi_tot 1.0032 0.9847 1.0219 0.7392
BMI 0.9674 0.9257 1.0111 0.1412
IBD Duration 0.9999 0.9779 1.0224 0.9934
TreatmentMono biologic 1.1022 0.5505 2.2067 0.7836
TreatmentCombo therapy 0.8318 0.3477 1.9903 0.6791
Treatment5-ASA 0.9989 0.5867 1.7006 0.9967
TreatmentNone reported 0.6432 0.3673 1.1263 0.1226
Age 0.9844 0.9696 0.9993 0.0402
fish_overall_cat[16.4,36. 0.8218 0.4683 1.4423 0.4941
fish_overall_cat[36.5,65. 0.9880 0.5710 1.7097 0.9657
fish_overall_cat[65.8,647 1.2043 0.7108 2.0404 0.4895
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0526 1 0.8186
cat 5.8748 2 0.0530
IMD 1.7812 4 0.7759
dqi_tot 0.0017 1 0.9675
BMI 0.4141 1 0.5199
IBD Duration 0.2245 1 0.6356
Treatment 7.8662 4 0.0966
Age 0.0649 1 0.7989
fish_overall_cat 2.0880 3 0.5543
GLOBAL 21.5835 18 0.2510
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Dietary fibre
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fibre_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2580 0.8500 1.8618 0.2511
catFC 50-250 2.1443 1.3815 3.3282 0.0007
catFC > 250 2.5216 1.5523 4.0963 0.0002
IMD2 1.6455 0.6150 4.4024 0.3212
IMD3 1.2558 0.4883 3.2296 0.6364
IMD4 2.1651 0.9002 5.2073 0.0845
IMD5 1.4364 0.5870 3.5148 0.4277
dqi_tot 1.0032 0.9841 1.0227 0.7412
BMI 0.9714 0.9301 1.0146 0.1908
IBD Duration 0.9993 0.9776 1.0216 0.9536
TreatmentMono biologic 1.1748 0.5896 2.3408 0.6469
TreatmentCombo therapy 0.8678 0.3641 2.0684 0.7489
Treatment5-ASA 0.9967 0.5857 1.6961 0.9903
TreatmentNone reported 0.6539 0.3731 1.1462 0.1380
Age 0.9843 0.9698 0.9990 0.0361
fibre_cat[17,22.9) 1.2156 0.6905 2.1401 0.4986
fibre_cat[22.9,29.4) 1.3143 0.7188 2.4033 0.3748
fibre_cat[29.4,170] 1.1429 0.6206 2.1047 0.6681
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0445 1 0.8329
cat 5.8448 2 0.0538
IMD 1.6960 4 0.7914
dqi_tot 0.0002 1 0.9897
BMI 0.4112 1 0.5213
IBD Duration 0.2214 1 0.6380
Treatment 7.8914 4 0.0956
Age 0.0621 1 0.8031
fibre_cat 5.3873 3 0.1455
GLOBAL 23.8912 18 0.1586
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Polyunsaturated fatty acids
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    PUFA_percEng_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2287 0.8323 1.8140 0.3000
catFC 50-250 2.2001 1.4158 3.4189 0.0005
catFC > 250 2.6013 1.5957 4.2407 0.0001
IMD2 1.4781 0.5598 3.9029 0.4303
IMD3 1.1816 0.4606 3.0312 0.7285
IMD4 2.0421 0.8504 4.9042 0.1102
IMD5 1.3845 0.5656 3.3890 0.4762
dqi_tot 1.0047 0.9867 1.0230 0.6096
BMI 0.9679 0.9265 1.0111 0.1427
IBD Duration 0.9998 0.9780 1.0220 0.9826
TreatmentMono biologic 1.2353 0.6150 2.4815 0.5526
TreatmentCombo therapy 0.8688 0.3652 2.0667 0.7504
Treatment5-ASA 1.0251 0.6018 1.7459 0.9274
TreatmentNone reported 0.6754 0.3842 1.1873 0.1728
Age 0.9834 0.9688 0.9982 0.0277
PUFA_percEng_cat[4.54,5.1 1.0299 0.6160 1.7220 0.9105
PUFA_percEng_cat[5.17,5.9 0.7956 0.4659 1.3589 0.4025
PUFA_percEng_cat[5.92,12. 0.8383 0.4883 1.4394 0.5225
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0466 1 0.8291
cat 5.6846 2 0.0583
IMD 1.7435 4 0.7828
dqi_tot 0.0000 1 0.9948
BMI 0.3885 1 0.5331
IBD Duration 0.2300 1 0.6315
Treatment 7.6892 4 0.1037
Age 0.0618 1 0.8037
PUFA_percEng_cat 3.1752 3 0.3654
GLOBAL 21.1351 18 0.2727
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

NOVA score
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    NOVAScore_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2787 0.8673 1.8852 0.2145
catFC 50-250 2.1611 1.3912 3.3569 0.0006
catFC > 250 2.6173 1.6073 4.2619 0.0001
IMD2 1.7043 0.6423 4.5220 0.2842
IMD3 1.3195 0.5131 3.3935 0.5651
IMD4 2.2199 0.9218 5.3461 0.0754
IMD5 1.4958 0.6109 3.6628 0.3782
dqi_tot 1.0052 0.9873 1.0234 0.5727
BMI 0.9719 0.9305 1.0152 0.2001
IBD Duration 0.9990 0.9773 1.0213 0.9317
TreatmentMono biologic 1.2374 0.6214 2.4644 0.5444
TreatmentCombo therapy 0.8694 0.3654 2.0685 0.7517
Treatment5-ASA 1.0387 0.6098 1.7690 0.8890
TreatmentNone reported 0.6618 0.3780 1.1587 0.1486
Age 0.9840 0.9695 0.9986 0.0324
NOVAScore_catProcessed cu 1.5967 0.9230 2.7621 0.0943
NOVAScore_catProcessed fo 1.6177 0.9333 2.8042 0.0865
NOVAScore_catUltra-proces 1.4541 0.8267 2.5577 0.1938
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0397 1 0.8421
cat 5.6605 2 0.0590
IMD 1.6544 4 0.7990
dqi_tot 0.0002 1 0.9902
BMI 0.3727 1 0.5415
IBD Duration 0.1843 1 0.6677
Treatment 7.6350 4 0.1059
Age 0.0729 1 0.7871
NOVAScore_cat 5.1945 3 0.1581
GLOBAL 22.9009 18 0.1944
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

UPF intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    UPF_perc_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2368 0.8380 1.8256 0.2846
catFC 50-250 2.3224 1.4962 3.6047 0.0002
catFC > 250 2.8790 1.7623 4.7034 0.0000
IMD2 1.3486 0.5068 3.5888 0.5493
IMD3 1.1442 0.4423 2.9597 0.7812
IMD4 1.9941 0.8279 4.8027 0.1238
IMD5 1.3519 0.5468 3.3426 0.5138
dqi_tot 0.9979 0.9795 1.0167 0.8284
BMI 0.9616 0.9206 1.0044 0.0782
IBD Duration 1.0009 0.9787 1.0236 0.9407
TreatmentMono biologic 1.2319 0.6156 2.4653 0.5557
TreatmentCombo therapy 0.9280 0.3853 2.2352 0.8677
Treatment5-ASA 1.0027 0.5862 1.7152 0.9921
TreatmentNone reported 0.6210 0.3488 1.1056 0.1055
Age 0.9813 0.9667 0.9960 0.0128
UPF_perc_cat[36.8,44.3) 0.5119 0.3088 0.8485 0.0094
UPF_perc_cat[44.3,52.6) 0.3599 0.2022 0.6407 0.0005
UPF_perc_cat[52.6,92.5] 0.6310 0.3767 1.0570 0.0802
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0575 1 0.8106
cat 5.5243 2 0.0632
IMD 1.9249 4 0.7496
dqi_tot 0.0037 1 0.9516
BMI 0.3438 1 0.5576
IBD Duration 0.1789 1 0.6723
Treatment 7.9587 4 0.0931
Age 0.1165 1 0.7329
UPF_perc_cat 6.5018 3 0.0896
GLOBAL 23.9042 18 0.1582
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Bread intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    breadIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1699 0.7902 1.7322 0.4331
catFC 50-250 2.1896 1.4124 3.3944 0.0005
catFC > 250 2.5806 1.5884 4.1924 0.0001
IMD2 1.5615 0.5916 4.1219 0.3682
IMD3 1.2227 0.4727 3.1632 0.6784
IMD4 2.0994 0.8685 5.0746 0.0996
IMD5 1.3883 0.5614 3.4331 0.4776
dqi_tot 1.0053 0.9874 1.0235 0.5650
BMI 0.9687 0.9270 1.0122 0.1557
IBD Duration 0.9994 0.9777 1.0216 0.9577
TreatmentMono biologic 1.0414 0.5151 2.1057 0.9100
TreatmentCombo therapy 0.8236 0.3448 1.9674 0.6623
Treatment5-ASA 0.9300 0.5438 1.5903 0.7908
TreatmentNone reported 0.6266 0.3576 1.0978 0.1023
Age 0.9860 0.9713 1.0009 0.0648
breadIntake_cat[1.97,3.23 1.3547 0.8122 2.2596 0.2448
breadIntake_cat[3.23,4.84 1.1944 0.7004 2.0368 0.5141
breadIntake_cat[4.84,18.9 0.7523 0.4178 1.3546 0.3428
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0759 1 0.7830
cat 5.5702 2 0.0617
IMD 1.8474 4 0.7638
dqi_tot 0.0041 1 0.9489
BMI 0.3882 1 0.5332
IBD Duration 0.2237 1 0.6363
Treatment 8.0147 4 0.0910
Age 0.1389 1 0.7093
breadIntake_cat 4.1309 3 0.2477
GLOBAL 22.3943 18 0.2150
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Sweet intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    sweetIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.3139 0.8888 1.9422 0.1711
catFC 50-250 2.4806 1.5804 3.8934 0.0001
catFC > 250 2.7987 1.7131 4.5722 0.0000
IMD2 1.4568 0.5509 3.8522 0.4483
IMD3 1.1672 0.4519 3.0146 0.7495
IMD4 2.0593 0.8526 4.9735 0.1084
IMD5 1.4327 0.5832 3.5196 0.4330
dqi_tot 1.0045 0.9865 1.0228 0.6245
BMI 0.9627 0.9213 1.0060 0.0901
IBD Duration 0.9994 0.9777 1.0217 0.9588
TreatmentMono biologic 1.2655 0.6348 2.5230 0.5035
TreatmentCombo therapy 0.9954 0.4111 2.4102 0.9919
Treatment5-ASA 0.9949 0.5815 1.7023 0.9852
TreatmentNone reported 0.6482 0.3660 1.1483 0.1373
Age 0.9840 0.9696 0.9987 0.0333
sweetIntake_cat[2.83,4.36 0.7539 0.4480 1.2687 0.2875
sweetIntake_cat[4.36,6.17 0.4704 0.2627 0.8424 0.0112
sweetIntake_cat[6.17,17.3 0.9502 0.5806 1.5550 0.8390
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0169 1 0.8964
cat 5.4341 2 0.0661
IMD 1.8133 4 0.7700
dqi_tot 0.0001 1 0.9912
BMI 0.4754 1 0.4905
IBD Duration 0.1692 1 0.6808
Treatment 7.7924 4 0.0995
Age 0.0373 1 0.8469
sweetIntake_cat 1.5381 3 0.6735
GLOBAL 17.6347 18 0.4800
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Drink intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    drinkIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2721 0.8609 1.8797 0.2270
catFC 50-250 2.2530 1.4491 3.5030 0.0003
catFC > 250 2.4808 1.5206 4.0473 0.0003
IMD2 1.7134 0.6444 4.5553 0.2805
IMD3 1.3249 0.5141 3.4147 0.5603
IMD4 2.1553 0.8958 5.1859 0.0865
IMD5 1.5097 0.6164 3.6975 0.3674
dqi_tot 1.0051 0.9871 1.0234 0.5840
BMI 0.9628 0.9207 1.0067 0.0955
IBD Duration 0.9974 0.9756 1.0197 0.8160
TreatmentMono biologic 1.1815 0.5923 2.3569 0.6360
TreatmentCombo therapy 0.8117 0.3405 1.9350 0.6379
Treatment5-ASA 1.0490 0.6150 1.7891 0.8606
TreatmentNone reported 0.7069 0.3999 1.2496 0.2328
Age 0.9847 0.9700 0.9998 0.0466
drinkIntake_cat[0.301,4.2 0.7210 0.4130 1.2588 0.2500
drinkIntake_cat[4.21,14.4 1.2273 0.7064 2.1323 0.4674
drinkIntake_cat[14.4,120] 1.0839 0.6093 1.9281 0.7840
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0348 1 0.8520
cat 5.7446 2 0.0566
IMD 1.8182 4 0.7692
dqi_tot 0.0000 1 0.9984
BMI 0.3760 1 0.5397
IBD Duration 0.2828 1 0.5949
Treatment 7.4668 4 0.1132
Age 0.0501 1 0.8229
drinkIntake_cat 0.8992 3 0.8256
GLOBAL 19.5263 18 0.3601
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2831 0.8614 1.9114 0.2202
catFC 50-250 2.1533 1.3852 3.3473 0.0007
catFC > 250 2.4952 1.5288 4.0725 0.0003
IMD2 1.6015 0.6049 4.2401 0.3431
IMD3 1.2605 0.4892 3.2480 0.6317
IMD4 2.1448 0.8895 5.1712 0.0893
IMD5 1.4668 0.5953 3.6139 0.4050
dqi_tot 1.0075 0.9881 1.0272 0.4522
BMI 0.9663 0.9249 1.0095 0.1247
IBD Duration 0.9986 0.9766 1.0211 0.9024
TreatmentMono biologic 1.1185 0.5539 2.2586 0.7547
TreatmentCombo therapy 0.8581 0.3601 2.0449 0.7299
Treatment5-ASA 0.9910 0.5831 1.6845 0.9735
TreatmentNone reported 0.6450 0.3687 1.1282 0.1243
Age 0.9843 0.9698 0.9991 0.0377
processedMeatIntake_cat[0 1.2578 0.7340 2.1553 0.4039
processedMeatIntake_cat[1 1.0527 0.5982 1.8525 0.8586
processedMeatIntake_cat[2 1.3172 0.7259 2.3904 0.3648
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0452 1 0.8316
cat 5.8276 2 0.0543
IMD 1.8411 4 0.7649
dqi_tot 0.0013 1 0.9713
BMI 0.3915 1 0.5315
IBD Duration 0.2394 1 0.6247
Treatment 7.7737 4 0.1002
Age 0.0651 1 0.7985
processedMeatIntake_cat 3.1875 3 0.3636
GLOBAL 19.9226 18 0.3372
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Processed plant intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    processedPlantIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2747 0.8641 1.8803 0.2211
catFC 50-250 2.1415 1.3796 3.3243 0.0007
catFC > 250 2.5542 1.5713 4.1518 0.0002
IMD2 1.4558 0.5513 3.8447 0.4484
IMD3 1.2263 0.4787 3.1415 0.6708
IMD4 2.0960 0.8728 5.0335 0.0978
IMD5 1.4401 0.5885 3.5242 0.4244
dqi_tot 1.0073 0.9893 1.0257 0.4295
BMI 0.9676 0.9267 1.0103 0.1346
IBD Duration 0.9983 0.9766 1.0205 0.8807
TreatmentMono biologic 1.2181 0.6141 2.4161 0.5724
TreatmentCombo therapy 0.8577 0.3604 2.0415 0.7287
Treatment5-ASA 1.0234 0.6021 1.7395 0.9319
TreatmentNone reported 0.6503 0.3712 1.1390 0.1324
Age 0.9828 0.9683 0.9974 0.0213
processedPlantIntake_cat[ 0.6756 0.4247 1.0746 0.0977
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0334 1 0.8549
cat 5.8133 2 0.0547
IMD 1.8863 4 0.7567
dqi_tot 0.0002 1 0.9897
BMI 0.3768 1 0.5393
IBD Duration 0.2292 1 0.6321
Treatment 7.8673 4 0.0966
Age 0.0528 1 0.8182
processedPlantIntake_cat 2.7240 1 0.0989
GLOBAL 20.2915 16 0.2074
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Fruit intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    fruitIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2318 0.8344 1.8184 0.2942
catFC 50-250 2.1807 1.4070 3.3796 0.0005
catFC > 250 2.5221 1.5535 4.0946 0.0002
IMD2 1.4803 0.5546 3.9512 0.4336
IMD3 1.2097 0.4688 3.1217 0.6939
IMD4 2.0921 0.8651 5.0596 0.1014
IMD5 1.3922 0.5622 3.4475 0.4745
dqi_tot 1.0016 0.9817 1.0219 0.8785
BMI 0.9687 0.9278 1.0114 0.1485
IBD Duration 0.9996 0.9777 1.0219 0.9700
TreatmentMono biologic 1.1930 0.5974 2.3826 0.6170
TreatmentCombo therapy 0.8669 0.3629 2.0710 0.7479
Treatment5-ASA 0.9807 0.5731 1.6782 0.9433
TreatmentNone reported 0.6445 0.3671 1.1314 0.1260
Age 0.9836 0.9691 0.9984 0.0300
fruitIntake_cat[2.1,5.64) 1.1087 0.6232 1.9726 0.7255
fruitIntake_cat[5.64,10.4 0.9574 0.5301 1.7291 0.8853
fruitIntake_cat[10.4,62.9 1.2724 0.6846 2.3647 0.4462
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0416 1 0.8384
cat 5.7615 2 0.0561
IMD 1.7009 4 0.7906
dqi_tot 0.0025 1 0.9598
BMI 0.4207 1 0.5166
IBD Duration 0.2238 1 0.6362
Treatment 7.7663 4 0.1005
Age 0.0805 1 0.7766
fruitIntake_cat 1.5022 3 0.6818
GLOBAL 19.0298 18 0.3900
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Vegetable and legumes intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    vegIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.1977 0.8073 1.7769 0.3700
catFC 50-250 2.2061 1.4200 3.4273 0.0004
catFC > 250 2.4785 1.5227 4.0342 0.0003
IMD2 1.5585 0.5880 4.1306 0.3722
IMD3 1.2155 0.4719 3.1308 0.6861
IMD4 2.1638 0.8930 5.2434 0.0874
IMD5 1.3433 0.5478 3.2944 0.5190
dqi_tot 0.9988 0.9796 1.0185 0.9059
BMI 0.9696 0.9284 1.0125 0.1625
IBD Duration 0.9991 0.9775 1.0212 0.9369
TreatmentMono biologic 1.0994 0.5496 2.1991 0.7889
TreatmentCombo therapy 0.8440 0.3538 2.0133 0.7022
Treatment5-ASA 0.9284 0.5429 1.5877 0.7861
TreatmentNone reported 0.6134 0.3494 1.0769 0.0888
Age 0.9856 0.9711 1.0003 0.0547
vegIntake_cat[5.04,8.43) 1.2340 0.6956 2.1892 0.4723
vegIntake_cat[8.43,13.4) 1.7505 0.9909 3.0926 0.0538
vegIntake_cat[13.4,63.1] 1.5314 0.8354 2.8072 0.1681
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0509 1 0.8215
cat 5.6620 2 0.0590
IMD 1.7780 4 0.7765
dqi_tot 0.0024 1 0.9606
BMI 0.3383 1 0.5608
IBD Duration 0.2258 1 0.6347
Treatment 8.1365 4 0.0867
Age 0.0458 1 0.8305
vegIntake_cat 4.5011 3 0.2122
GLOBAL 22.7453 18 0.2006
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Red meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    redMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2676 0.8565 1.8762 0.2358
catFC 50-250 2.1350 1.3781 3.3077 0.0007
catFC > 250 2.4979 1.5342 4.0670 0.0002
IMD2 1.5486 0.5853 4.0974 0.3783
IMD3 1.2801 0.4992 3.2829 0.6073
IMD4 2.1498 0.8942 5.1687 0.0873
IMD5 1.4560 0.5966 3.5531 0.4092
dqi_tot 1.0121 0.9936 1.0309 0.2027
BMI 0.9637 0.9232 1.0059 0.0907
IBD Duration 0.9968 0.9750 1.0190 0.7744
TreatmentMono biologic 1.1708 0.5888 2.3281 0.6529
TreatmentCombo therapy 0.9024 0.3802 2.1419 0.8159
Treatment5-ASA 1.0285 0.6053 1.7478 0.9172
TreatmentNone reported 0.6432 0.3674 1.1258 0.1223
Age 0.9825 0.9681 0.9970 0.0180
redMeatIntake_cat[0.365,0 1.3028 0.8150 2.0825 0.2690
redMeatIntake_cat[0.861,9 2.0291 1.2784 3.2208 0.0027
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0548 1 0.8148
cat 6.0445 2 0.0487
IMD 1.8201 4 0.7688
dqi_tot 0.0046 1 0.9457
BMI 0.2900 1 0.5902
IBD Duration 0.2897 1 0.5904
Treatment 8.2691 4 0.0822
Age 0.0270 1 0.8694
redMeatIntake_cat 0.0419 2 0.9792
GLOBAL 18.6526 17 0.3488
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

White meat intake
Code
fit.me <- coxph(
  Surv(hardflare_time, hardflare) ~
    Sex +
    cat +
    IMD +
    dqi_tot +
    BMI +
    `IBD Duration` +
    Treatment +
    Age +
    whiteMeatIntake_cat +
    frailty(SiteNo),
  control = coxph.control(outer.max = 20),
  data = flare.uc.df
)

invisible(cox_summary(fit.me))

Cox model summary:

Variable HR Lower 95% Upper 95% P-value
SexFemale 1.2562 0.8525 1.8509 0.2488
catFC 50-250 2.1396 1.3783 3.3214 0.0007
catFC > 250 2.6274 1.6120 4.2824 0.0001
IMD2 1.5762 0.5968 4.1627 0.3585
IMD3 1.2037 0.4692 3.0876 0.6997
IMD4 2.1052 0.8771 5.0530 0.0956
IMD5 1.4090 0.5772 3.4396 0.4514
dqi_tot 1.0078 0.9895 1.0265 0.4036
BMI 0.9669 0.9254 1.0103 0.1331
IBD Duration 0.9981 0.9764 1.0203 0.8661
TreatmentMono biologic 1.1104 0.5548 2.2221 0.7674
TreatmentCombo therapy 0.7483 0.3112 1.7993 0.5171
Treatment5-ASA 0.9565 0.5614 1.6299 0.8702
TreatmentNone reported 0.6150 0.3494 1.0827 0.0920
Age 0.9852 0.9703 1.0004 0.0556
whiteMeatIntake_cat[0.426 1.5428 0.8790 2.7079 0.1309
whiteMeatIntake_cat[1.06, 1.3772 0.8002 2.3703 0.2479
whiteMeatIntake_cat[1.88, 1.7240 0.9847 3.0183 0.0567
Proportional hazards assumption test
Chi-squared statistic DF P-value
Sex 0.0510 1 0.8213
cat 5.9098 2 0.0521
IMD 1.8600 4 0.7615
dqi_tot 0.0001 1 0.9918
BMI 0.3475 1 0.5555
IBD Duration 0.2351 1 0.6278
Treatment 7.7523 4 0.1011
Age 0.0740 1 0.7857
whiteMeatIntake_cat 2.9702 3 0.3962
GLOBAL 21.0080 18 0.2790
`geom_smooth()` using formula = 'y ~ x'

`geom_smooth()` using formula = 'y ~ x'

Reproduction and reproducibility

Session info

R version 4.4.0 (2024-04-24)

Platform: aarch64-unknown-linux-gnu

locale: LC_CTYPE=en_US.UTF-8, LC_NUMERIC=C, LC_TIME=en_US.UTF-8, LC_COLLATE=en_US.UTF-8, LC_MONETARY=en_US.UTF-8, LC_MESSAGES=en_US.UTF-8, LC_PAPER=en_US.UTF-8, LC_NAME=C, LC_ADDRESS=C, LC_TELEPHONE=C, LC_MEASUREMENT=en_US.UTF-8 and LC_IDENTIFICATION=C

attached base packages: stats, graphics, grDevices, utils, datasets, methods and base

other attached packages: gtsummary(v.1.7.2), DescTools(v.0.99.54), finalfit(v.1.0.7), coxme(v.2.2-20), bdsmatrix(v.1.3-7), pander(v.0.6.5), survminer(v.0.4.9), ggpubr(v.0.6.0), survival(v.3.5-8), datefixR(v.1.6.1), lubridate(v.1.9.3), forcats(v.1.0.0), stringr(v.1.5.1), dplyr(v.1.1.4), purrr(v.1.0.2), readr(v.2.1.5), tidyr(v.1.3.1), tibble(v.3.2.1), ggplot2(v.3.5.1), tidyverse(v.2.0.0) and readxl(v.1.4.3)

loaded via a namespace (and not attached): gridExtra(v.2.3), gld(v.2.6.6), rlang(v.1.1.3), magrittr(v.2.0.3), e1071(v.1.7-14), compiler(v.4.4.0), mgcv(v.1.9-1), systemfonts(v.1.3.1), vctrs(v.0.6.5), pkgconfig(v.2.0.3), shape(v.1.4.6.1), fastmap(v.1.2.0), backports(v.1.5.0), labeling(v.0.4.3), KMsurv(v.0.1-5), utf8(v.1.2.4), rmarkdown(v.2.27), markdown(v.1.12), tzdb(v.0.4.0), nloptr(v.2.0.3), ragg(v.1.3.2), xfun(v.0.44), glmnet(v.4.1-8), jomo(v.2.7-6), jsonlite(v.1.8.8), pan(v.1.9), broom(v.1.0.6), R6(v.2.5.1), stringi(v.1.8.4), car(v.3.1-2), boot(v.1.3-30), rpart(v.4.1.23), cellranger(v.1.1.0), Rcpp(v.1.0.12), iterators(v.1.0.14), knitr(v.1.47), zoo(v.1.8-12), Matrix(v.1.7-0), splines(v.4.4.0), nnet(v.7.3-19), timechange(v.0.3.0), tidyselect(v.1.2.1), rstudioapi(v.0.16.0), abind(v.1.4-5), yaml(v.2.3.8), ggtext(v.0.1.2), codetools(v.0.2-20), lattice(v.0.22-6), withr(v.3.0.0), evaluate(v.0.23), proxy(v.0.4-27), xml2(v.1.3.6), survMisc(v.0.5.6), pillar(v.1.9.0), carData(v.3.0-5), mice(v.3.16.0), foreach(v.1.5.2), generics(v.0.1.3), hms(v.1.1.3), commonmark(v.1.9.1), munsell(v.0.5.1), scales(v.1.3.0), rootSolve(v.1.8.2.4), minqa(v.1.2.7), xtable(v.1.8-4), class(v.7.3-22), glue(v.1.7.0), lmom(v.3.0), tools(v.4.4.0), data.table(v.1.15.4), lme4(v.1.1-35.3), ggsignif(v.0.6.4), Exact(v.3.2), mvtnorm(v.1.2-5), grid(v.4.4.0), colorspace(v.2.1-0), nlme(v.3.1-164), cli(v.3.6.2), km.ci(v.0.5-6), textshaping(v.0.4.0), fansi(v.1.0.6), expm(v.0.999-9), broom.helpers(v.1.15.0), gt(v.0.10.1), gtable(v.0.3.5), rstatix(v.0.7.2), digest(v.0.6.35), farver(v.2.1.2), htmlwidgets(v.1.6.4), htmltools(v.0.5.8.1), lifecycle(v.1.0.4), httr(v.1.4.7), mitml(v.0.4-5), gridtext(v.0.1.5) and MASS(v.7.3-60.2)

Licensed by CC BY unless otherwise stated.

References

Monteiro, Carlos Augusto, Geoffrey Cannon, Jean-Claude Moubarac, Renata Bertazzi Levy, Maria Laura C Louzada, and Patrícia Constante Jaime. 2017. “The UN Decade of Nutrition, the NOVA Food Classification and the Trouble with Ultra-Processing.” Public Health Nutrition 21 (1): 5–17. https://doi.org/10.1017/s1368980017000234.