##chargement des packages----
library(questionr)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.1     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(tableone)
library(labelled)
library(gtsummary)
library(GGally)
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
library(readxl)
library(effects)
## Le chargement a nécessité le package : carData
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
library(survival)
library(survminer)
## Le chargement a nécessité le package : ggpubr
## 
## Attachement du package : 'survminer'
## 
## L'objet suivant est masqué depuis 'package:survival':
## 
##     myeloma
library(ggplot2)
library(dplyr)
library(knitr)
library(cowplot)
## 
## Attachement du package : 'cowplot'
## 
## L'objet suivant est masqué depuis 'package:ggpubr':
## 
##     get_legend
## 
## L'objet suivant est masqué depuis 'package:lubridate':
## 
##     stamp
##chargement des données 

recap_survies_v20260424 <- read_excel("C:/datar/recap_survies_v20260424.xlsx")
## New names:
## • `nom jeune fille` -> `nom jeune fille...19`
## • `date_os` -> `date_os...55`
## • `nom jeune fille` -> `nom jeune fille...59`
## • `date_os` -> `date_os...81`
## • `` -> `...99`
##recodage des variables et bases de données le cas échéant----

cbnpc<-filter(recap_survies_v20260424, c(eligible_v2=="oui" ))


##motif exclusions##

exclus<-filter(recap_survies_v20260424, c(eligible_v2=="non" ))

tbl_summary(
  exclus, include = c("motif_ineligibilite_2"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 3,3411
motif_ineligibilite_2
    alk 29 (0.9%)
    chit 33 (1.0%)
    cpc 557 (16.7%)
    egfr 99 (3.0%)
    essais_clinique 338 (10.1%)
    her2 20 (0.6%)
    hors_onco 19 (0.6%)
    hors_oncothoracique 78 (2.3%)
    maladie_M0 681 (20.4%)
    mesotheliome 184 (5.5%)
    pas de donnee 25 (0.7%)
    patient_hors_chu 515 (15.4%)
    pediatrie 1 (0.0%)
    raf_mek 9 (0.3%)
    suite_traitement_1ere_ligne_ailleurs_ou_avant_2010 748 (22.4%)
    traitement_non_administré 4 (0.1%)
    vegfr 1 (0.0%)
1 n (%)
##création de variables à plusieurs catégorie selon valeurs variable continue

cbnpc$old70<-ifelse(cbnpc$age_initiation>70, 1, 0)
cbnpc$old65<-ifelse(cbnpc$age_initiation>65, 1, 0)
cbnpc$maigres<-ifelse(cbnpc$imc<18.5, 1, 0)
cbnpc$surpoids<-ifelse(cbnpc$imc>25, 1, 0)
cbnpc$obeses<-ifelse(cbnpc$imc>30, 1, 0)
cbnpc$young57<-ifelse(cbnpc$age_initiation<57, 1, 0)
cbnpc$ir60<-ifelse(cbnpc$dfg_ml_min<60, 1, 0)
cbnpc$ir30<-ifelse(cbnpc$dfg_ml_min<30, 1, 0)
cbnpc$ere <- cut(cbnpc$annee, c(2010, 2015, 2018, 2024))
cbnpc$initiation_period<-factor(cbnpc$periode, levels=c(1, 2, 3, 4),
                          labels=c("immunotherapy not available",
                                   "immunotherapy avilable as 2nd line",
                                   "immunotherapy available as 1st line monotherapy",
                                   "chemo_immunotherapy available as 1st line"))


##renommer des variables pour présentation dans les tableaux de résultats
library(labelled)
var_label(cbnpc$old65) <- "Patients older than 65 years"
var_label(cbnpc$old70) <- "Patients older than 70 years"
var_label(cbnpc$maigres) <- "Patients with BMI <18.5"
var_label(cbnpc$surpoids) <- "Patients with BMI >25"
var_label(cbnpc$obeses) <- "Patients witgh BMI >30"
var_label(cbnpc$initiation_period) <- "period according to immunotherapy availability"
var_label(cbnpc$ir30) <- "Patients with GFR<30 ml/min"
var_label(cbnpc$ir60) <- "Patients with GFR<60 ml/min"
var_label(cbnpc$immuno) <- "Patients treated with immunotherapy at any line"
var_label(cbnpc$avastin) <- "Patients treated with bevacizumab at any line"
var_label(cbnpc$histologie) <- "Histologic category"
var_label(cbnpc$protocole_generique_initiation) <- "First line treatment"
var_label(cbnpc$age_initiation) <- "Age at the start of first line"
var_label(cbnpc$tt_initial) <- "First line treatment category"
var_label(cbnpc$imc) <- "Body Mass Index at the start of first line"
var_label(cbnpc$bsa) <- "Body Surface Area"
var_label(cbnpc$poids) <- "Body weight at the start of first line"
var_label(cbnpc$dfg_ml_min) <- "Glomerular filtration Rate at the start of first line"
var_label(cbnpc$sexe.cat) <- "Sex"

##tableau descriptif population globales ----

tbl_summary(
  cbnpc, include = c("age_initiation", "old65","sexe.cat","poids",
                     "imc","maigres","obeses","dfg_ml_min", 
                     "tt_initial","histologie",
                     "imc","immuno", "avastin"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 2,2131
Age at the start of first line 63 (57, 70)
Patients older than 65 years 941 (42.5%)
Sex
    F 790 (35.7%)
    H 1,423 (64.3%)
Body weight at the start of first line 66 (56, 76)
Body Mass Index at the start of first line 22.9 (20.0, 25.8)
Patients with BMI <18.5 290 (13.1%)
Patients witgh BMI >30 176 (8.0%)
Glomerular filtration Rate at the start of first line 91 (76, 104)
    Unknown 27
First line treatment category
    chimio 1,611 (72.8%)
    chimio_immuno 435 (19.7%)
    immuno 167 (7.5%)
Histologic category
    epidermoide 817 (36.9%)
    non_epidermoide 1,395 (63.1%)
    Unknown 1
Patients treated with immunotherapy at any line 1,106 (50.0%)
Patients treated with bevacizumab at any line 282 (12.7%)
1 Median (IQR); n (%)
##détail traitements 1er ligne---
tbl_summary(
  cbnpc, include = c("protocole_generique_initiation"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 2,2131
First line treatment
    cemiplimab 8 (0.4%)
    pembro_abemaciclib 2 (0.1%)
    pembrolizumab 157 (7.1%)
    platine_alimta 773 (34.9%)
    platine_alimta_atezo 2 (0.1%)
    platine_alimta_avastin 129 (5.8%)
    platine_alimta_avastin_atezo 8 (0.4%)
    platine_alimta_nivolumab 6 (0.3%)
    platine_alimta_pembro 346 (15.6%)
    platine_docetaxel 56 (2.5%)
    platine_gemcitabine 77 (3.5%)
    platine_gemcitabine_avastin 6 (0.3%)
    platine_gemcitabine_nivolumab 2 (0.1%)
    platine_taxol 247 (11.2%)
    platine_taxol_atezo 8 (0.4%)
    platine_taxol_avastin 12 (0.5%)
    platine_taxol_nivolumab 2 (0.1%)
    platine_taxol_pembro 60 (2.7%)
    platine_vinorelbine 311 (14.1%)
    taxol_avastin_atezo 1 (0.0%)
1 n (%)
##tableau descriptif population selon période d'initiation de tt----
tbl_summary(
  cbnpc, include = c("age_initiation", "old65","sexe.cat","poids",
                     "imc","maigres","obeses","dfg_ml_min", 
                     "tt_initial","histologie",
                     "imc","immuno", "avastin"),
    by="initiation_period", 
  digits=all_categorical()~ c(0,1)
)%>%
  add_p()
Characteristic immunotherapy not available, N = 6351 immunotherapy avilable as 2nd line, N = 3861 immunotherapy available as 1st line monotherapy, N = 4041 chemo_immunotherapy available as 1st line, N = 7881 p-value2
Age at the start of first line 62 (55, 68) 63 (56, 69) 65 (58, 71) 64 (58, 71) <0.001
Patients older than 65 years 230 (36.2%) 147 (38.1%) 191 (47.3%) 373 (47.3%) <0.001
Sex 0.004
    F 197 (31.0%) 131 (33.9%) 168 (41.6%) 294 (37.3%)
    H 438 (69.0%) 255 (66.1%) 236 (58.4%) 494 (62.7%)
Body weight at the start of first line 66 (57, 76) 66 (56, 76) 66 (56, 77) 65 (56, 76) >0.9
Body Mass Index at the start of first line 23.0 (20.0, 25.6) 22.7 (19.9, 25.8) 23.2 (20.1, 26.4) 22.8 (20.0, 25.7) 0.6
Patients with BMI <18.5 78 (12.3%) 60 (15.5%) 48 (11.9%) 104 (13.2%) 0.4
Patients witgh BMI >30 51 (8.0%) 36 (9.3%) 27 (6.7%) 62 (7.9%) 0.6
Glomerular filtration Rate at the start of first line 89 (74, 102) 92 (77, 104) 91 (74, 103) 92 (78, 106) 0.011
    Unknown 14 5 2 6
First line treatment category <0.001
    chimio 635 (100.0%) 386 (100.0%) 320 (79.2%) 270 (34.3%)
    chimio_immuno 0 (0.0%) 0 (0.0%) 2 (0.5%) 433 (54.9%)
    immuno 0 (0.0%) 0 (0.0%) 82 (20.3%) 85 (10.8%)
Histologic category <0.001
    epidermoide 303 (47.7%) 143 (37.0%) 124 (30.7%) 247 (31.4%)
    non_epidermoide 332 (52.3%) 243 (63.0%) 280 (69.3%) 540 (68.6%)
    Unknown 0 0 0 1
Patients treated with immunotherapy at any line 58 (9.1%) 194 (50.3%) 246 (60.9%) 608 (77.2%) <0.001
Patients treated with bevacizumab at any line 83 (13.1%) 49 (12.7%) 53 (13.1%) 97 (12.3%) >0.9
1 Median (IQR); n (%)
2 Kruskal-Wallis rank sum test; Pearson’s Chi-squared test
##Courbe kaplan Meier Population globale
km_os<-survfit(Surv(cbnpc$os, cbnpc$evt_os)~1)

ggsurvplot(
  km_os,                     # survfit object with calculated statistics.
  data = cbnpc,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = FALSE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#2E9FDF"),
  xlim = c(0,84),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)

##Courbe kaplan Meier selon période d'intitation de tt

km_os_periode<-survfit(Surv(os, evt_os)~initiation_period, data=cbnpc)
km_os_periode
## Call: survfit(formula = Surv(os, evt_os) ~ initiation_period, data = cbnpc)
## 
##                                                                     n events
## initiation_period=immunotherapy not available                     635    604
## initiation_period=immunotherapy avilable as 2nd line              386    349
## initiation_period=immunotherapy available as 1st line monotherapy 404    344
## initiation_period=chemo_immunotherapy available as 1st line       788    573
##                                                                   median
## initiation_period=immunotherapy not available                       10.2
## initiation_period=immunotherapy avilable as 2nd line                12.1
## initiation_period=immunotherapy available as 1st line monotherapy   12.3
## initiation_period=chemo_immunotherapy available as 1st line         14.9
##                                                                   0.95LCL
## initiation_period=immunotherapy not available                        9.37
## initiation_period=immunotherapy avilable as 2nd line                 9.63
## initiation_period=immunotherapy available as 1st line monotherapy   10.27
## initiation_period=chemo_immunotherapy available as 1st line         13.43
##                                                                   0.95UCL
## initiation_period=immunotherapy not available                        11.4
## initiation_period=immunotherapy avilable as 2nd line                 14.3
## initiation_period=immunotherapy available as 1st line monotherapy    14.7
## initiation_period=chemo_immunotherapy available as 1st line          17.7
ggsurvplot(
  km_os_periode,                     # survfit object with calculated statistics.
  data = cbnpc,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = TRUE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#E7B800", "#2E9FDF", "green4", "red"),
  xlim = c(0,66),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)

##modèle de cox os 


##analyses univariée

tbl_uvregression(
  cbnpc,
  method = coxph,
  y = Surv(os, evt_os),
  exponentiate = TRUE,
  include = c(old70, old65, initiation_period, young57, maigres, surpoids, obeses, sexe.cat, imc, immuno, avastin, tt_initial, ir30, ir60, histologie),
  pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic N HR1 95% CI1 p-value
Patients treated with immunotherapy at any line 2,213 0.63 0.57, 0.69 <0.001
Patients treated with bevacizumab at any line 2,213 0.79 0.69, 0.90 <0.001
Sex 2,213
    F — —
    H 1.13 1.02, 1.24 0.014
Body Mass Index at the start of first line 2,213 0.97 0.95, 0.98 <0.001
First line treatment category 2,213
    chimio — —
    chimio_immuno 0.69 0.61, 0.78 <0.001
    immuno 0.83 0.70, 1.00 0.047
Histologic category 2,212
    epidermoide — —
    non_epidermoide 0.87 0.79, 0.96 0.004
Patients older than 70 years 2,213 1.03 0.93, 1.15 0.521
Patients older than 65 years 2,213 1.04 0.95, 1.14 0.381
Patients with BMI <18.5 2,213 1.59 1.40, 1.82 <0.001
Patients with BMI >25 2,213 0.78 0.71, 0.86 <0.001
Patients witgh BMI >30 2,213 0.76 0.64, 0.90 0.002
young57 2,213 0.93 0.83, 1.03 0.153
Patients with GFR<60 ml/min 2,186 0.99 0.85, 1.15 0.921
Patients with GFR<30 ml/min 2,186 1.81 1.19, 2.76 0.006
period according to immunotherapy availability 2,213
    immunotherapy not available — —
    immunotherapy avilable as 2nd line 0.92 0.80, 1.05 0.207
    immunotherapy available as 1st line monotherapy 0.82 0.72, 0.94 0.005
    chemo_immunotherapy available as 1st line 0.73 0.65, 0.81 <0.001
1 HR = Hazard Ratio, CI = Confidence Interval
##analyses Mutlivariée 

modsurv<-coxph(Surv(os, evt_os)~avastin+tt_initial+
                 sexe.cat+histologie+maigres+surpoids+
                 ir30+initiation_period, data=cbnpc)
modsurv%>%tbl_regression(
  exponentiate = TRUE,pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 0.80 0.70, 0.92 0.002
First line treatment category
    chimio — —
    chimio_immuno 0.71 0.60, 0.85 <0.001
    immuno 0.82 0.67, 1.01 0.058
Sex
    F — —
    H 1.18 1.07, 1.30 0.001
Histologic category
    epidermoide — —
    non_epidermoide 0.98 0.89, 1.08 0.694
Patients with BMI <18.5 1.56 1.36, 1.79 <0.001
Patients with BMI >25 0.80 0.72, 0.89 <0.001
Patients with GFR<30 ml/min 1.64 1.07, 2.50 0.022
period according to immunotherapy availability
    immunotherapy not available — —
    immunotherapy avilable as 2nd line 0.92 0.80, 1.05 0.196
    immunotherapy available as 1st line monotherapy 0.88 0.77, 1.02 0.080
    chemo_immunotherapy available as 1st line 0.90 0.77, 1.05 0.172
1 HR = Hazard Ratio, CI = Confidence Interval
##analyses Mutlivariée sans la période

modsurv<-coxph(Surv(os, evt_os)~avastin+tt_initial+
                 sexe.cat+histologie+maigres+surpoids+
                 ir30, data=cbnpc)
modsurv%>%tbl_regression(
  exponentiate = TRUE,pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 0.80 0.70, 0.92 0.002
First line treatment category
    chimio — —
    chimio_immuno 0.68 0.60, 0.78 <0.001
    immuno 0.78 0.65, 0.94 0.010
Sex
    F — —
    H 1.18 1.07, 1.31 <0.001
Histologic category
    epidermoide — —
    non_epidermoide 0.98 0.88, 1.08 0.623
Patients with BMI <18.5 1.56 1.36, 1.79 <0.001
Patients with BMI >25 0.80 0.72, 0.88 <0.001
Patients with GFR<30 ml/min 1.67 1.10, 2.55 0.017
1 HR = Hazard Ratio, CI = Confidence Interval
##analyses Mutlivariée sans l'histologie = modèle final

modsurv<-coxph(Surv(os, evt_os)~avastin+tt_initial+
                 sexe.cat+maigres+surpoids+
                 ir30, data=cbnpc)
modsurv%>%tbl_regression(
  exponentiate = TRUE,pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 0.80 0.69, 0.91 <0.001
First line treatment category
    chimio — —
    chimio_immuno 0.68 0.60, 0.77 <0.001
    immuno 0.78 0.65, 0.94 0.010
Sex
    F — —
    H 1.19 1.08, 1.31 <0.001
Patients with BMI <18.5 1.55 1.35, 1.78 <0.001
Patients with BMI >25 0.80 0.72, 0.88 <0.001
Patients with GFR<30 ml/min 1.68 1.10, 2.56 0.016
1 HR = Hazard Ratio, CI = Confidence Interval
##Analyse en sous groupes 
###patients traités par immuno 1st line
immunofirst<-filter(cbnpc, c(tt_initial=="immuno" ))

####Description population immuno 1ere ligne 
tbl_summary(
  immunofirst, include = c("age_initiation", "old65","sexe.cat","poids",
                     "imc","maigres","obeses","dfg_ml_min","ir30" ,
                     "protocole_generique_initiation","histologie",
                     "avastin"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 1671
Age at the start of first line 67 (61, 75)
Patients older than 65 years 95 (56.9%)
Sex
    F 59 (35.3%)
    H 108 (64.7%)
Body weight at the start of first line 65 (55, 75)
Body Mass Index at the start of first line 22.6 (20.1, 25.2)
Patients with BMI <18.5 24 (14.4%)
Patients witgh BMI >30 8 (4.8%)
Glomerular filtration Rate at the start of first line 90 (71, 106)
    Unknown 8
Patients with GFR<30 ml/min 5 (3.1%)
    Unknown 8
First line treatment
    cemiplimab 8 (4.8%)
    pembro_abemaciclib 2 (1.2%)
    pembrolizumab 157 (94.0%)
Histologic category
    epidermoide 35 (21.1%)
    non_epidermoide 131 (78.9%)
    Unknown 1
Patients treated with bevacizumab at any line 2 (1.2%)
1 Median (IQR); n (%)
##Courbe kaplan Meier Population immuno mono 1ere ligne
km_os_immunofirst<-survfit(Surv(immunofirst$os, immunofirst$evt_os)~1)
km_os_immunofirst
## Call: survfit(formula = Surv(immunofirst$os, immunofirst$evt_os) ~ 
##     1)
## 
##        n events median 0.95LCL 0.95UCL
## [1,] 167    130   11.4     8.9    17.3
ggsurvplot(
  km_os_immunofirst,                     # survfit object with calculated statistics.
  data = immunofirst,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = FALSE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#2E9FDF"),
  xlim = c(0,66),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)

##modèle de cox os population immuno mono 1ere ligne


##analyses univariée

tbl_uvregression(
  immunofirst,
  method = coxph,
  y = Surv(os, evt_os),
  exponentiate = TRUE,
  include = c(old70, old65,young57, maigres, surpoids, obeses, sexe.cat,avastin, ir30, histologie),
  pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic N HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 167 0.37 0.05, 2.65 0.322
Sex 167
    F — —
    H 1.35 0.93, 1.94 0.112
Histologic category 166
    epidermoide — —
    non_epidermoide 0.86 0.57, 1.30 0.472
Patients older than 70 years 167 1.06 0.74, 1.52 0.762
Patients older than 65 years 167 1.10 0.78, 1.56 0.588
Patients with BMI <18.5 167 1.12 0.69, 1.83 0.642
Patients with BMI >25 167 0.83 0.56, 1.23 0.349
Patients witgh BMI >30 167 0.74 0.33, 1.68 0.471
young57 167 1.06 0.66, 1.68 0.822
Patients with GFR<30 ml/min 159 3.09 1.25, 7.63 0.014
1 HR = Hazard Ratio, CI = Confidence Interval
##patients traités par chimio-immuno 1st line
chimioimmunofirst<-filter(cbnpc, c(tt_initial=="chimio_immuno" ))

####Description population chimio immuno 1ere ligne
tbl_summary(
  chimioimmunofirst, include = c("age_initiation", "old65","sexe.cat","poids",
                           "imc","maigres","obeses","dfg_ml_min","ir30", 
                           "protocole_generique_initiation","histologie",
                           "avastin"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 4351
Age at the start of first line 62 (56, 69)
Patients older than 65 years 168 (38.6%)
Sex
    F 166 (38.2%)
    H 269 (61.8%)
Body weight at the start of first line 66 (56, 76)
Body Mass Index at the start of first line 22.8 (20.1, 25.6)
Patients with BMI <18.5 57 (13.1%)
Patients witgh BMI >30 39 (9.0%)
Glomerular filtration Rate at the start of first line 96 (83, 107)
Patients with GFR<30 ml/min 0 (0.0%)
First line treatment
    platine_alimta_atezo 2 (0.5%)
    platine_alimta_avastin_atezo 8 (1.8%)
    platine_alimta_nivolumab 6 (1.4%)
    platine_alimta_pembro 346 (79.5%)
    platine_gemcitabine_nivolumab 2 (0.5%)
    platine_taxol_atezo 8 (1.8%)
    platine_taxol_nivolumab 2 (0.5%)
    platine_taxol_pembro 60 (13.8%)
    taxol_avastin_atezo 1 (0.2%)
Histologic category
    epidermoide 73 (16.8%)
    non_epidermoide 362 (83.2%)
Patients treated with bevacizumab at any line 71 (16.3%)
1 Median (IQR); n (%)
##Courbe kaplan Meier Population chimio immuno mono 1ere ligne
km_os_chimioimmunofirst<-survfit(Surv(chimioimmunofirst$os, chimioimmunofirst$evt_os)~1)
km_os_chimioimmunofirst
## Call: survfit(formula = Surv(chimioimmunofirst$os, chimioimmunofirst$evt_os) ~ 
##     1)
## 
##        n events median 0.95LCL 0.95UCL
## [1,] 435    295   18.3    15.5    20.4
ggsurvplot(
  km_os_chimioimmunofirst,                     # survfit object with calculated statistics.
  data = chimioimmunofirst,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = FALSE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#2E9FDF"),
  xlim = c(0,66),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)

##modèle de cox os population chimio immuno 1ere ligne


##analyses univariée

tbl_uvregression(
  chimioimmunofirst,
  method = coxph,
  y = Surv(os, evt_os),
  exponentiate = TRUE,
  include = c(old70, old65,young57, maigres, surpoids, obeses, sexe.cat,avastin, ir30, histologie),
  pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic N HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 435 0.96 0.71, 1.28 0.766
Sex 435
    F — —
    H 1.08 0.86, 1.37 0.505
Histologic category 435
    epidermoide — —
    non_epidermoide 0.86 0.63, 1.16 0.328
Patients older than 70 years 435 0.97 0.73, 1.30 0.854
Patients older than 65 years 435 1.03 0.81, 1.30 0.815
Patients with BMI <18.5 435 1.27 0.91, 1.76 0.159
Patients with BMI >25 435 1.00 0.78, 1.28 0.992
Patients witgh BMI >30 435 1.10 0.74, 1.62 0.642
young57 435 1.02 0.79, 1.31 0.904
Patients with GFR<30 ml/min 435
1 HR = Hazard Ratio, CI = Confidence Interval
#patients traités par chimio 1st line
chimio<-filter(cbnpc, c(tt_initial=="chimio" ))

####Description population chimio immuno 1ere ligne
tbl_summary(
  chimio, include = c("age_initiation", "old65","sexe.cat","poids",
                                 "imc","maigres","obeses","dfg_ml_min","ir30", 
                                 "protocole_generique_initiation","histologie",
                                 "avastin"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 1,6111
Age at the start of first line 63 (56, 70)
Patients older than 65 years 678 (42.1%)
Sex
    F 565 (35.1%)
    H 1,046 (64.9%)
Body weight at the start of first line 66 (57, 76)
Body Mass Index at the start of first line 23.0 (20.0, 25.9)
Patients with BMI <18.5 209 (13.0%)
Patients witgh BMI >30 129 (8.0%)
Glomerular filtration Rate at the start of first line 90 (75, 103)
    Unknown 19
Patients with GFR<30 ml/min 17 (1.1%)
    Unknown 19
First line treatment
    platine_alimta 773 (48.0%)
    platine_alimta_avastin 129 (8.0%)
    platine_docetaxel 56 (3.5%)
    platine_gemcitabine 77 (4.8%)
    platine_gemcitabine_avastin 6 (0.4%)
    platine_taxol 247 (15.3%)
    platine_taxol_avastin 12 (0.7%)
    platine_vinorelbine 311 (19.3%)
Histologic category
    epidermoide 709 (44.0%)
    non_epidermoide 902 (56.0%)
Patients treated with bevacizumab at any line 209 (13.0%)
1 Median (IQR); n (%)
##Courbe kaplan Meier Population chimio immuno mono 1ere ligne
km_os_chimio<-survfit(Surv(chimio$os, chimio$evt_os)~1)
km_os_chimio
## Call: survfit(formula = Surv(chimio$os, chimio$evt_os) ~ 1)
## 
##         n events median 0.95LCL 0.95UCL
## [1,] 1611   1445     11    10.1    12.2
ggsurvplot(
  km_os_chimio,                     # survfit object with calculated statistics.
  data = chimio,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = FALSE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#2E9FDF"),
  xlim = c(0,66),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)

##modèle de cox os population chimio  1ere ligne


##analyses univariée

tbl_uvregression(
  chimio,
  method = coxph,
  y = Surv(os, evt_os),
  exponentiate = TRUE,
  include = c(old70, old65,young57, maigres, surpoids, obeses, sexe.cat,avastin, ir30, histologie),
  pvalue_fun = scales::label_pvalue(accuracy = .001)
)
Characteristic N HR1 95% CI1 p-value
Patients treated with bevacizumab at any line 1,611 0.76 0.65, 0.88 <0.001
Sex 1,611
    F — —
    H 1.11 0.99, 1.23 0.065
Histologic category 1,611
    epidermoide — —
    non_epidermoide 0.94 0.85, 1.05 0.281
Patients older than 70 years 1,611 1.03 0.91, 1.16 0.663
Patients older than 65 years 1,611 1.03 0.93, 1.15 0.554
Patients with BMI <18.5 1,611 1.82 1.57, 2.12 <0.001
Patients with BMI >25 1,611 0.72 0.64, 0.80 <0.001
Patients witgh BMI >30 1,611 0.70 0.57, 0.85 <0.001
young57 1,611 0.90 0.80, 1.01 0.077
Patients with GFR<30 ml/min 1,592 1.48 0.92, 2.38 0.110
1 HR = Hazard Ratio, CI = Confidence Interval
#Courbe de Kaplan Meier selon tt initial


##Courbe kaplan Meier selon période d'intitation de tt

km_os_tt_initial<-survfit(Surv(os, evt_os)~tt_initial, data=cbnpc)
km_os_tt_initial
## Call: survfit(formula = Surv(os, evt_os) ~ tt_initial, data = cbnpc)
## 
##                             n events median 0.95LCL 0.95UCL
## tt_initial=chimio        1611   1445   11.0    10.1    12.2
## tt_initial=chimio_immuno  435    295   18.3    15.5    20.4
## tt_initial=immuno         167    130   11.4     8.9    17.3
ggsurvplot(
  km_os_tt_initial,                     # survfit object with calculated statistics.
  data = cbnpc,             # data used to fit survival curves.
  risk.table = TRUE,       # show risk table.
  pval = TRUE,             # show p-value of log-rank test.
  conf.int = TRUE,         # show confidence intervals for 
  # point estimates of survival curves.
  palette = c("#E7B800", "#2E9FDF", "green4"),
  xlim = c(0,66),         # present narrower X axis, but not affect
  # survival estimates.
  xlab = "Time in months",   # customize X axis label.
  break.time.by = 6,     # break X axis in time intervals by 500.
  ggtheme = theme_light(), # customize plot and risk table with a theme.
  risk.table.y.text.col = T,# colour risk table text annotations.
  risk.table.height = 0.25, # the height of the risk table
  risk.table.y.text = FALSE,# show bars instead of names in text annotations
  # in legend of risk table.
  ncensor.plot = FALSE,      # plot the number of censored subjects at time t
  ncensor.plot.height = 0.25,
  conf.int.style = "step",  # customize style of confidence intervals
  surv.median.line = "hv",  # add the median survival pointer.
  #legend.labs =
  #c("no", "yes")    # change legend labels.
)