#ANALYSES STATISTIQUES données du 09 JUILLET 2024
##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 DONNEES DE DERMATO

data_guillaume_dermato_ddi_240709 <- read_excel("Y:/fp/FAC/2023-2024/Memoires DES/Guillaume Flandin/20240709/data_guillaume_dermato_ddi_240709.xlsx")
## New names:
## • `Détail` -> `Détail...56`
## • `Détail` -> `Détail...63`
## • `Détail` -> `Détail...87`
## • `Détail` -> `Détail...89`
##filtre bases de données dermato

dermato_g<-filter(data_guillaume_dermato_ddi_240709, c(eligible_etude=="1" ))

##recodage de données le cas échéant----
dermato_g$charlson_2<-ifelse(dermato_g$charlson>=2, 1, 0)
dermato_g$charlson_3<-ifelse(dermato_g$charlson>=3, 1, 0)
dermato_g$charlson_4<-ifelse(dermato_g$charlson>=4, 1, 0)
dermato_g$charlson_5<-ifelse(dermato_g$charlson>=5, 1, 0)
dermato_g$adjuvant<-ifelse(dermato_g$stade=="ADJUVANT", 1, 0)
dermato_g$raf_mek<-ifelse(dermato_g$classe_medt=="raf_mek", 1, 0)
dermato_g$mek<-ifelse(dermato_g$classe_medt=="mek", 1, 0)
dermato_g$hedgehog<-ifelse(dermato_g$classe_medt=="hedgehog", 1, 0)
dermato_g$cytotox<-ifelse(dermato_g$classe_medt=="cytotox", 1, 0)
dermato_g$tox3mois<-ifelse(dermato_g$pftox<3 & dermato_g$evt_tox==1, 1, 0)
dermato_g$pftox_mediane<-dermato_g$pftox/3.7
dermato_g$old75<-ifelse(dermato_g$age>=75,1, 0)

##renommer des variables pour présentation dans les tableaux de résultats
library(labelled)
var_label(dermato_g$type_evt) <- "evenement lié au médicament"
var_label(dermato_g$consequence_evt) <- "conséquence des evenements liés au médicament"
var_label(dermato_g$meta_snc) <- "presence de métastase cérébrale"
var_label(dermato_g$polymedique) <- "patient polymediqué"         
var_label(dermato_g$comprehension) <- "patient avec difficulté de comprehension"
var_label(dermato_g$pb_social) <- "patient avec difficulté sociale"
var_label(dermato_g$actif_pro) <- "patient avec activité professionnelle"
var_label(dermato_g$ddi) <- "patient avec interaction médicamenteuse"
var_label(dermato_g$prise_discontinue) <- "traitement en prise discontinue"
var_label(dermato_g$evt_tox) <- "patient avec evenement lié au médicament"
var_label(dermato_g$charlson_2) <- "score de charlson >=2 (hors tumeur)" 
var_label(dermato_g$patient_seul) <- "patient vivant seul"
var_label(dermato_g$risque_observance) <- "patient avec risque de mauvaise observance"
var_label(dermato_g$raf_mek) <- "patient traité par inhibiteurs de Raf et Mek"
var_label(dermato_g$mek) <- "patient traité par inhibiteurs de Mek seul"
var_label(dermato_g$hedgehog) <- "patient traité par inhibiteurs hedgehog"
var_label(dermato_g$cytotox) <- "patient traité par cytotoxique"
var_label(dermato_g$ddi_sousdosage) <- "patient avec interaction à risque de sous-dosage"
var_label(dermato_g$ddi_surdosage) <- "patient avec interaction à risque de sur-dosage"
var_label(dermato_g$ddi_qt) <- "patient avec interaction à risque d'allongement du QT"
var_label(dermato_g$ddi_ph) <- "patient avec interaction avec IPP et pH"
var_label(dermato_g$ipp_mdt) <- "patient sous IPP"
var_label(dermato_g$tox3mois) <- "patient avec toxicité précoce"
var_label(dermato_g$rque_pharma) <- "patient pour lequel l'analyse d'interaction a conclu à un suivi de ei"
var_label(dermato_g$old75) <- "patient de 75 ans et +"

##réation de variables à plusieurs catégorie selon valeurs variable continue



##tableau descriptif population globales ----
tbl_summary(
  dermato_g, include = c("age","old75", "pathologie", "dci", "raf_mek", "mek", "hedgehog", "cytotox", "polymedique","stade", "ligne", "evt_tox","tox3mois", "charlson", "charlson_2", "meta_snc", "comprehension", "pb_social", "actif_pro", "patient_seul", "ddi","ddi_surdosage","ddi_sousdosage","ipp_mdt","ddi_ph","ddi_qt","rque_pharma" ,"prise_discontinue", "risque_observance"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
age 66 (52, 75)
patient de 75 ans et + 20 (25.6%)
pathologie
    CANCER DE LA THYROIDE 1 (1.3%)
    CARCINOME BASOCELLUALIRE INOPERABLE 15 (19.2%)
    CARCINOME DE MERKEL 1 (1.3%)
    carcinome trichoblastique NON OPERABLE 2 (2.6%)
    MELANOME 59 (75.6%)
dci
    Dabrafenib / Trametinib 37 (47.4%)
    Encorafenib binimetinib 17 (21.8%)
    Etoposide 1 (1.3%)
    Sonidegib 9 (11.5%)
    Trametinib 6 (7.7%)
    Vismodegib 8 (10.3%)
patient traité par inhibiteurs de Raf et Mek 54 (69.2%)
patient traité par inhibiteurs de Mek seul 6 (7.7%)
patient traité par inhibiteurs hedgehog 17 (21.8%)
patient traité par cytotoxique 1 (1.3%)
patient polymediqué 42 (53.8%)
stade
    ADJUVANT 18 (23.1%)
    AVANCE INOPERABLE 23 (29.5%)
    METASTATIQUE 37 (47.4%)
ligne
    1ère ligne 41 (52.6%)
    2ème ligne 28 (35.9%)
    3ème ligne 5 (6.4%)
    4ème ligne 2 (2.6%)
    5ème ligne 2 (2.6%)
patient avec evenement lié au médicament 46 (59.0%)
patient avec toxicité précoce 26 (33.3%)
charlson
    0 12 (15.4%)
    1 19 (24.4%)
    2 10 (12.8%)
    3 12 (15.4%)
    4 9 (11.5%)
    5 10 (12.8%)
    6 5 (6.4%)
    8 1 (1.3%)
score de charlson >=2 (hors tumeur) 47 (60.3%)
presence de métastase cérébrale 11 (14.1%)
patient avec difficulté de comprehension 9 (11.5%)
patient avec difficulté sociale 14 (17.9%)
patient avec activité professionnelle 17 (21.8%)
patient vivant seul 10 (12.8%)
patient avec interaction médicamenteuse 37 (47.4%)
patient avec interaction à risque de sur-dosage 24 (30.8%)
patient avec interaction à risque de sous-dosage 5 (6.4%)
patient sous IPP 20 (25.6%)
patient avec interaction avec IPP et pH 10 (12.8%)
patient avec interaction à risque d'allongement du QT 8 (10.3%)
patient pour lequel l'analyse d'interaction a conclu à un suivi de ei 34 (43.6%)
traitement en prise discontinue 9 (11.5%)
patient avec risque de mauvaise observance 17 (21.8%)
1 Median (IQR); n (%)
##Description des evènements liés aux traitement 
tbl_summary(
  dermato_g, include = c("tox_aeg","tox_digestive","tox_hepatique","tox_musculaire","tox_cutanee","tox_pneumo","tox_cardiovasculaire","tox_neuro","tox_cephalee_hyperthermie","tox_uro_nephro","tox_occulaire","tox_hemato"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
tox_aeg 11 (14.1%)
tox_digestive 11 (14.1%)
tox_hepatique 3 (3.8%)
tox_musculaire 8 (10.3%)
tox_cutanee 7 (9.0%)
tox_pneumo 0 (0.0%)
tox_cardiovasculaire 9 (11.5%)
tox_neuro 1 (1.3%)
tox_cephalee_hyperthermie 6 (7.7%)
tox_uro_nephro 7 (9.0%)
tox_occulaire 3 (3.8%)
tox_hemato 3 (3.8%)
1 n (%)
##Conséquences des évènements liés aux traitement
tbl_summary(
  dermato_g, include = c("evt_arret_definitif","evt_arret_temporaire","evt_concession_poso","evt_concession_temporelle"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
evt_arret_definitif 12 (15.4%)
evt_arret_temporaire 19 (24.4%)
evt_concession_poso 20 (25.6%)
evt_concession_temporelle 2 (2.6%)
1 n (%)
###Description durée de traitement
km_duree_tt<-survfit(Surv(dermato_g$duree_tt, dermato_g$evt_tt)~1)
km_duree_tt
## Call: survfit(formula = Surv(dermato_g$duree_tt, dermato_g$evt_tt) ~ 
##     1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 78     73    5.8    4.77    11.3
ggsurvplot(km_duree_tt, data = dermato_g,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

##Description motifs d'arrêts de traitement
tbl_summary(
  dermato_g, include = c("motif_arret"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
motif_arret
    DECES 3 (4.1%)
    Fin de traitement / Surveillance 21 (28.8%)
    FIN DE VIE 1 (1.4%)
    PAUSE THERAPEUTIQUE 2 (2.7%)
    progression 2 (2.7%)
    PROGRESSION 16 (21.9%)
    PROGRESSION + TOX 1 (1.4%)
    PROGRESSION ET DIFFILCULTE D'OBSERVANCE 1 (1.4%)
    ROTATION VERS DABRA / TRAME 1 (1.4%)
    TOXICITE 22 (30.1%)
    TOXICITE / FIN DE TTT (RADIOTHERAPIE CLOTURE) 1 (1.4%)
    TOXICITE / SOINS PAL 1 (1.4%)
    TOXICITE + SOUHAIT DE LA PATIENTE 1 (1.4%)
    Unknown 5
1 n (%)
###Description PFS
km_pfs<-survfit(Surv(dermato_g$pfs, dermato_g$evt_pfs)~1)
km_pfs
## Call: survfit(formula = Surv(dermato_g$pfs, dermato_g$evt_pfs) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 78     36   21.9    17.6    30.7
ggsurvplot(km_pfs, data = dermato_g,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

###Description OS
km_os<-survfit(Surv(dermato_g$os, dermato_g$evt_os)~1)
km_os
## Call: survfit(formula = Surv(dermato_g$os, dermato_g$evt_os) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 78     31   36.1    31.2      NA
ggsurvplot(km_os, data = dermato_g,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

#Courbe de Kaplan Meier survie sans événement toxique lié au médicament----

km_pftox<-survfit(Surv(dermato_g$pftox, dermato_g$evt_tox)~1)
km_pftox
## Call: survfit(formula = Surv(dermato_g$pftox, dermato_g$evt_tox) ~ 
##     1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 78     46    4.9    3.53     8.4
ggsurvplot(km_pftox, data = dermato_g,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=2,
           surv.median.line = "hv"
)

#CHARGEMENT DES DONNEES DE PNEUMO

data_guillaume_cbnpc_ddi_240709 <- read_excel("Y:/fp/FAC/2023-2024/Memoires DES/Guillaume Flandin/20240709/data_guillaume_cbnpc_ddi_240709.xlsx")
## New names:
## • `Détail` -> `Détail...60`
## • `Détail` -> `Détail...67`
## • `Détail` -> `Détail...90`
## • `Détail` -> `Détail...92`
##recodage bases de données le cas échéant----

cbnpc<-filter(data_guillaume_cbnpc_ddi_240709, c(eligible_etude=="1" ))

##recodage de données le cas échéant----
cbnpc$charlson_2<-ifelse(cbnpc$charlson>=2, 1, 0)
cbnpc$charlson_3<-ifelse(cbnpc$charlson>=3, 1, 0)
cbnpc$charlson_4<-ifelse(cbnpc$charlson>=4, 1, 0)
cbnpc$charlson_5<-ifelse(cbnpc$charlson>=5, 1, 0)
cbnpc$adjuvant<-ifelse(cbnpc$metastatique==0, 1, 0)
cbnpc$raf_mek<-ifelse(cbnpc$classe_medt=="raf_mek", 1, 0)
cbnpc$egfr<-ifelse(cbnpc$classe_medt=="egfr", 1, 0)
cbnpc$alk<-ifelse(cbnpc$classe_medt=="alk", 1, 0)
cbnpc$cytotox<-ifelse(cbnpc$classe_medt=="cytotox", 1, 0)
cbnpc$kras<-ifelse(cbnpc$classe_medt=="kras", 1, 0)
cbnpc$ret<-ifelse(cbnpc$classe_medt=="ret", 1, 0)
cbnpc$vegfr<-ifelse(cbnpc$classe_medt=="vegfr", 1, 0)
cbnpc$pftox_mediane<-cbnpc$pftox/7.23
cbnpc$tox3mois<-ifelse(cbnpc$pftox<3 & cbnpc$evt_tox==1, 1, 0)
cbnpc$old75<-ifelse(cbnpc$age>=75, 1, 0)

##renommer des variables pour présentation dans les tableaux de résultats
library(labelled)
var_label(cbnpc$type_evt) <- "evenement lié au médicament"
var_label(cbnpc$consequence_evt) <- "conséquence des evenements liés au médicament"
var_label(cbnpc$meta_snc) <- "presence de métastase cérébrale"
var_label(cbnpc$polymedique) <- "patient polymediqué"         
var_label(cbnpc$comprehension) <- "patient avec difficulté de comprehension"
var_label(cbnpc$pb_social) <- "patient avec difficulté sociale"
var_label(cbnpc$actif_pro) <- "patient avec activité professionnelle"
var_label(cbnpc$ddi) <- "patient avec interaction médicamenteuse"
var_label(cbnpc$evt_tox) <- "patient avec evenement lié au médicament"
var_label(cbnpc$charlson_2) <- "score de charlson >=2 (hors tumeur)" 
var_label(cbnpc$patient_seul) <- "patient vivant seul"
var_label(cbnpc$risque_observance) <- "patient avec risque de mauvaise observance"
var_label(cbnpc$raf_mek) <- "patient traité par inhibiteurs de Raf et Mek"
var_label(cbnpc$egfr) <- "patient traité par inhibiteurs de egfrl"
var_label(cbnpc$alk) <- "patient traité par inhibiteurs alk"
var_label(cbnpc$cytotox) <- "patient traité par cytotoxique"
var_label(cbnpc$ret) <- "patient traité par inhibiteur de ret"
var_label(cbnpc$vegfr) <- "patient traité par inhibiteur de vegfr"
var_label(cbnpc$kras) <- "patient traité par inhibiteur de RAS"
var_label(cbnpc$ipp_mdt) <- "patient traité par IPP"
var_label(cbnpc$ddi_surdosage) <- "patient avec interaction à risque de surdosage"
var_label(cbnpc$ddi_sousdosage) <- "patient avec interaction à risque de sousdosage"
var_label(cbnpc$ddi_ph) <- "patient avec interaction IPP et pH"
var_label(cbnpc$ddi_ph) <- "patient avec interaction IPP et pH"
var_label(cbnpc$ddi_qt) <- "patient avec interaction et risque allongement QT"
var_label(cbnpc$rque_pharma) <- "patient avec conclusion analyse pharmaceutique"
var_label(cbnpc$rque_pharma_ei) <- "Analyse interaction avec conclusion risque EI"
var_label(cbnpc$tox3mois) <- "Patient avec évènement toxique précoce"
var_label(cbnpc$old75) <- "Patient de 75 ans et +"


##tableau descriptif population globales ----

tbl_summary(
  cbnpc, include = c("age", "old75", "pathologie", "dci", "raf_mek", "egfr", "alk", "cytotox", "vegfr", "kras", "ret", "polymedique","stade", "ligne", "evt_tox","tox3mois", "charlson", "charlson_2", "meta_snc", "comprehension", "pb_social", "actif_pro", "patient_seul", "ddi","ddi_surdosage","ddi_sousdosage","ipp_mdt","ddi_ph","ddi_qt","rque_pharma","rque_pharma_ei", "risque_observance"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 941
age 67 (58, 75)
Patient de 75 ans et + 24 (25.5%)
pathologie
    ADK Bronchique 82 (87.2%)
    ADK Thymique 2 (2.1%)
    Carcinome épidermoïde 4 (4.3%)
    Thymome 1 (1.1%)
    THYMOME 1 (1.1%)
    Tumeur carcinoïde 3 (3.2%)
    Tumeur neuro endocrine 1 (1.1%)
dci
    Afatinib 5 (5.3%)
    ALECTINIB 4 (4.3%)
    BRIGATINIB 7 (7.4%)
    CABOZANTINIB 1 (1.1%)
    CRIZOTINIB 2 (2.1%)
    Dabrafénib / Tramétinib 7 (7.4%)
    Erlotinib 1 (1.1%)
    Everolimus 7 (7.4%)
    Géfitinib 1 (1.1%)
    Lorlatinib 1 (1.1%)
    LORLATINIB 8 (8.5%)
    MOBOCERTINIB 2 (2.1%)
    Osimertinib 36 (38.3%)
    Osimertinib + Crizotinib 1 (1.1%)
    PRALSETINIB 1 (1.1%)
    SOTORASIB 8 (8.5%)
    Sunitinib 1 (1.1%)
    XELODA+TEMODAL 1 (1.1%)
patient traité par inhibiteurs de Raf et Mek 7 (7.4%)
patient traité par inhibiteurs de egfrl 45 (47.9%)
patient traité par inhibiteurs alk 22 (23.4%)
patient traité par cytotoxique 1 (1.1%)
patient traité par inhibiteur de vegfr 2 (2.1%)
patient traité par inhibiteur de RAS 8 (8.5%)
patient traité par inhibiteur de ret 1 (1.1%)
patient polymediqué 44 (46.8%)
stade
    ADJUVANT 1 (1.1%)
    AVANCE INOPERABLE 2 (2.1%)
    METASTATIQUE 91 (96.8%)
ligne
    1ère ligne 39 (41.5%)
    2ème ligne 18 (19.1%)
    3ème ligne 21 (22.3%)
    4ème ligne 6 (6.4%)
    5ème ligne 6 (6.4%)
    6ème ligne 2 (2.1%)
    8ème ligne 1 (1.1%)
    Récidive 1 (1.1%)
patient avec evenement lié au médicament 30 (31.9%)
Patient avec évènement toxique précoce 21 (22.3%)
charlson
    0 4 (4.3%)
    1 13 (13.8%)
    2 20 (21.3%)
    3 26 (27.7%)
    4 17 (18.1%)
    5 7 (7.4%)
    6 4 (4.3%)
    7 1 (1.1%)
    8 2 (2.1%)
score de charlson >=2 (hors tumeur) 77 (81.9%)
presence de métastase cérébrale 29 (30.9%)
patient avec difficulté de comprehension 6 (6.4%)
patient avec difficulté sociale 5 (5.3%)
patient avec activité professionnelle 28 (29.8%)
patient vivant seul 11 (11.7%)
patient avec interaction médicamenteuse 64 (68.1%)
patient avec interaction à risque de surdosage 37 (39.4%)
patient avec interaction à risque de sousdosage 2 (2.1%)
patient traité par IPP 19 (20.2%)
patient avec interaction IPP et pH 5 (5.3%)
patient avec interaction et risque allongement QT 20 (21.3%)
patient avec conclusion analyse pharmaceutique 49 (52.1%)
Analyse interaction avec conclusion risque EI 44 (46.8%)
patient avec risque de mauvaise observance 11 (11.7%)
1 Median (IQR); n (%)
##Description des evènements liés aux traitement 
tbl_summary(
  cbnpc, include = c("tox_aeg","tox_digestive","tox_hepatique","tox_musculaire","tox_cutanee","tox_pneumo","tox_cardiovasculaire","tox_neuro","tox_cephalee_hyperthermie","tox_uro_nephro","tox_occulaire","tox_hemato"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 941
tox_aeg 11 (11.7%)
tox_digestive 11 (11.7%)
tox_hepatique 3 (3.2%)
tox_musculaire 2 (2.1%)
tox_cutanee 4 (4.3%)
tox_pneumo 2 (2.1%)
tox_cardiovasculaire 5 (5.3%)
tox_neuro 3 (3.2%)
tox_cephalee_hyperthermie 0 (0.0%)
tox_uro_nephro 0 (0.0%)
tox_occulaire 1 (1.1%)
tox_hemato 0 (0.0%)
1 n (%)
##Conséquences des évènements liés aux traitement
tbl_summary(
  cbnpc, include = c("evt_arret_definitif","evt_arret_temporaire","evt_concession_poso","evt_concession_temporelle"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 941
evt_arret_definitif 9 (9.6%)
evt_arret_temporaire 5 (5.3%)
evt_concession_poso 18 (19.1%)
evt_concession_temporelle 0 (0.0%)
1 n (%)
###Description durée de traitement
km_duree_tt<-survfit(Surv(cbnpc$duree_tt, cbnpc$evt_tt)~1)
km_duree_tt
## Call: survfit(formula = Surv(cbnpc$duree_tt, cbnpc$evt_tt) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 94     79     11    7.43    14.5
ggsurvplot(km_duree_tt, data = cbnpc,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

##Description motifs d'arrêts de traitement
tbl_summary(
  cbnpc, include = c("motif_arret"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 941
motif_arret
    ARRET Par Patiente / Occlusion intestinale non liée au ttt 1 (1.3%)
    ARRET par patiente / TOXICITE 1 (1.3%)
    DECES 14 (17.7%)
    progression 1 (1.3%)
    PROGRESSION 38 (48.1%)
    PROGRESSION / Toxicite 4 (5.1%)
    PROGRESSION + NON Observance 1 (1.3%)
    Soins palliatifs 8 (10.1%)
    TOXICITE 9 (11.4%)
    TOXICITE / REANIMATION 1 (1.3%)
    TOXICITE / SOINS PAL 1 (1.3%)
    Unknown 15
1 n (%)
###Description PFS
km_pfs<-survfit(Surv(cbnpc$pfs, cbnpc$evt_pfs)~1)
km_pfs
## Call: survfit(formula = Surv(cbnpc$pfs, cbnpc$evt_pfs) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 94     62   13.8    8.17    20.1
ggsurvplot(km_pfs, data = cbnpc,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

###Description OS
km_os<-survfit(Surv(cbnpc$os, cbnpc$evt_os)~1)
km_os
## Call: survfit(formula = Surv(cbnpc$os, cbnpc$evt_os) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 94     67   22.8    17.3    26.5
ggsurvplot(km_os, data = cbnpc,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=3,
           surv.median.line = "hv"
)

#Courbe de Kaplan Meier survie sans événement toxique lié au médicament----

km_pftox<-survfit(Surv(cbnpc$pftox, cbnpc$evt_tox)~1)
km_pftox
## Call: survfit(formula = Surv(cbnpc$pftox, cbnpc$evt_tox) ~ 1)
## 
##       n events median 0.95LCL 0.95UCL
## [1,] 94     30     NA      NA      NA
ggsurvplot(km_pftox, data = cbnpc,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=2,
           surv.median.line = "hv"
)
## Warning in .add_surv_median(p, fit, type = surv.median.line, fun = fun, :
## Median survival not reached.

#REGROUPEMENT DES DONNEES PNEUMO ET DERMATO

dermato<-subset(dermato_g, select =c(id, pftox, evt_tox, charlson, comprehension, patient_seul, actif_pro, ddi, ddi_surdosage, ddi_sousdosage, ipp_mdt, rque_pharma, rque_pharma_ei, polymedique, age,pftox_mediane, origine, classe_medt, prise_discontinue, tox_aeg, tox_digestive, tox_hepatique, tox_musculaire, tox_cutanee, 
                                     tox_pneumo, tox_cardiovasculaire, tox_neuro, tox_cephalee_hyperthermie, tox_uro_nephro, tox_occulaire, 
                                     tox_hemato, evt_arret_definitif, evt_arret_temporaire, evt_concession_poso, evt_concession_temporelle, 
                                     pb_social, risque_observance, tox3mois, stade, ligne, old75, ddi_qt, ddi_ph, meta_snc))

pneumo<-subset(cbnpc, select =c(id, pftox, evt_tox, charlson, comprehension, patient_seul, actif_pro, ddi, ddi_surdosage, ddi_sousdosage, ipp_mdt, rque_pharma, rque_pharma_ei, polymedique, age,pftox_mediane, origine, classe_medt, prise_discontinue, tox_aeg, tox_digestive, tox_hepatique, tox_musculaire, tox_cutanee, 
                                tox_pneumo, tox_cardiovasculaire, tox_neuro, tox_cephalee_hyperthermie, tox_uro_nephro, tox_occulaire, 
                                tox_hemato, evt_arret_definitif, evt_arret_temporaire, evt_concession_poso, evt_concession_temporelle, 
                                pb_social, risque_observance, tox3mois, stade, ligne, old75, ddi_qt, ddi_ph, meta_snc))
               
   
##regroupement en un seul tableau 
datpoolees<-bind_rows(dermato, pneumo)
datpoolees
## # A tibble: 172 × 44
##       id  pftox evt_tox charlson comprehension patient_seul actif_pro   ddi
##    <dbl>  <dbl>   <dbl>    <dbl>         <dbl>        <dbl>     <dbl> <dbl>
##  1  1001 10.1         1        4             0            1         0     0
##  2  1002  0.933       0        3             0            0         0     0
##  3  1003  3.9         0        3             0            0         0     1
##  4  1004  0.5         0        1             0            0         0     0
##  5  1005  0.467       1        3             0            0         0     0
##  6  1006  4.37        1        1             0            1         1     0
##  7  1007  4.77        0        1             0            0         0     0
##  8  1008  4.67        0        0             1            0         0     1
##  9  1009 36.2         0        0             0            0         1     1
## 10  1010  5.83        1        6             0            0         0     0
## # ℹ 162 more rows
## # ℹ 36 more variables: ddi_surdosage <dbl>, ddi_sousdosage <dbl>,
## #   ipp_mdt <dbl>, rque_pharma <dbl>, rque_pharma_ei <dbl>, polymedique <dbl>,
## #   age <dbl>, pftox_mediane <dbl>, origine <chr>, classe_medt <chr>,
## #   prise_discontinue <dbl>, tox_aeg <dbl>, tox_digestive <dbl>,
## #   tox_hepatique <dbl>, tox_musculaire <dbl>, tox_cutanee <dbl>,
## #   tox_pneumo <dbl>, tox_cardiovasculaire <dbl>, tox_neuro <dbl>, …
##recodage de données le cas échéant----
datpoolees$charlson_2<-ifelse(datpoolees$charlson>=2, 1, 0)
datpoolees$charlson_3<-ifelse(datpoolees$charlson>=3, 1, 0)
datpoolees$charlson_4<-ifelse(datpoolees$charlson>=4, 1, 0)
datpoolees$charlson_5<-ifelse(datpoolees$charlson>=5, 1, 0)
datpoolees$charlson_6<-ifelse(datpoolees$charlson>=6, 1, 0)
datpoolees$charlson_7<-ifelse(datpoolees$charlson>=7, 1, 0)
datpoolees$charlson_8<-ifelse(datpoolees$charlson>=8, 1, 0)
datpoolees$origine.cat<-ifelse(datpoolees$origine =="dermato", 1, 0)

##renommer les variables 

var_label(datpoolees$meta_snc) <- "presence de métastase cérébrale"
var_label(datpoolees$polymedique) <- "patient polymediqué"         
var_label(datpoolees$comprehension) <- "patient avec difficulté de comprehension"
var_label(datpoolees$pb_social) <- "patient avec difficulté sociale"
var_label(datpoolees$actif_pro) <- "patient avec activité professionnelle"
var_label(datpoolees$ddi) <- "patient avec interaction médicamenteuse"
var_label(datpoolees$evt_tox) <- "patient avec evenement lié au médicament"
var_label(datpoolees$charlson_2) <- "score de charlson >=2 (hors tumeur)" 
var_label(datpoolees$charlson_3) <- "score de charlson >=3 (hors tumeur)" 
var_label(datpoolees$charlson_4) <- "score de charlson >=4 (hors tumeur)" 
var_label(datpoolees$charlson_5) <- "score de charlson >=5 (hors tumeur)" 
var_label(datpoolees$charlson_6) <- "score de charlson >=6 (hors tumeur)" 
var_label(datpoolees$charlson_7) <- "score de charlson >=7 (hors tumeur)" 
var_label(datpoolees$charlson_8) <- "score de charlson >=8 (hors tumeur)" 
var_label(datpoolees$patient_seul) <- "patient vivant seul"
var_label(datpoolees$ipp_mdt) <- "patient traité par IPP"
var_label(datpoolees$ddi_surdosage) <- "patient avec interaction à risque de surdosage"
var_label(datpoolees$ddi_sousdosage) <- "patient avec interaction à risque de sousdosage"
var_label(datpoolees$ddi_ph) <- "patient avec interaction IPP et pH"
var_label(datpoolees$ddi_ph) <- "patient avec interaction IPP et pH"
var_label(datpoolees$ddi_qt) <- "patient avec interaction et risque allongement QT"
var_label(datpoolees$rque_pharma) <- "patient avec conclusion analyse pharmaceutique"
var_label(datpoolees$rque_pharma_ei) <- "Analyse interaction avec conclusion risque EI"
var_label(datpoolees$tox3mois) <- "Patient avec évènement toxique précoce"
var_label(datpoolees$old75) <- "Patient de 75 ans et +"
var_label(datpoolees$origine.cat) <- "Patient de dermatologie vs pneumologie"

##tableau descriptif population globales ----

tbl_summary(
  datpoolees, include = c("age","old75", "classe_medt","polymedique","stade", 
                          "ligne", "evt_tox","tox3mois", "charlson", "charlson_2", 
                          "charlson_3","charlson_4","charlson_5","charlson_6","charlson_7",
                          "charlson_8","meta_snc", "comprehension", "pb_social", "actif_pro",
                          "patient_seul", "ddi","ddi_surdosage","ddi_sousdosage","ipp_mdt",
                          "ddi_ph","ddi_qt","rque_pharma_ei" ,"prise_discontinue", 
                          "risque_observance"),
  by="origine",
  digits=all_categorical()~ c(0,1)
)%>%  add_overall(last=TRUE)%>%
  add_p()
## There was an error in 'add_p()/add_difference()' for variable 'classe_medt', p-value omitted:
## Error in stats::fisher.test(c("hedgehog", "mek", "raf_mek", "raf_mek", : FEXACT erreur 7(location). LDSTP=18630 est trop petit pour ce problème,
##   (pastp=15.5257, ipn_0:=ipoin[itp=520]=9647, stp[ipn_0]=13.1172).
## Augmentez la taille de l’environnement de travail ou considérez l’utilisation de ‘simulate.p.value=TRUE’.
## There was an error in 'add_p()/add_difference()' for variable 'charlson', p-value omitted:
## Error in stats::fisher.test(c(4, 3, 3, 1, 3, 1, 1, 0, 0, 6, 5, 5, 1, 3, : FEXACT erreur 7(location). LDSTP=18630 est trop petit pour ce problème,
##   (pastp=34.0332, ipn_0:=ipoin[itp=274]=1577, stp[ipn_0]=35.369).
## Augmentez la taille de l’environnement de travail ou considérez l’utilisation de ‘simulate.p.value=TRUE’.
Characteristic dermato, N = 781 pneumo, N = 941 Overall, N = 1721 p-value2
age 66 (52, 75) 67 (58, 75) 66 (56, 75) 0.3
Patient de 75 ans et + 20 (25.6%) 24 (25.5%) 44 (25.6%) >0.9
classe_medt
    alk 0 (0.0%) 22 (23.4%) 22 (12.8%)
    cytotox 1 (1.3%) 1 (1.1%) 2 (1.2%)
    egfr 0 (0.0%) 45 (47.9%) 45 (26.2%)
    egfr_alk 0 (0.0%) 1 (1.1%) 1 (0.6%)
    hedgehog 17 (21.8%) 0 (0.0%) 17 (9.9%)
    kras 0 (0.0%) 8 (8.5%) 8 (4.7%)
    mek 6 (7.7%) 0 (0.0%) 6 (3.5%)
    mtor 0 (0.0%) 7 (7.4%) 7 (4.1%)
    raf_mek 54 (69.2%) 7 (7.4%) 61 (35.5%)
    ret 0 (0.0%) 1 (1.1%) 1 (0.6%)
    vegfr 0 (0.0%) 2 (2.1%) 2 (1.2%)
patient polymediqué 42 (53.8%) 44 (46.8%) 86 (50.0%) 0.4
stade <0.001
    ADJUVANT 18 (23.1%) 1 (1.1%) 19 (11.0%)
    AVANCE INOPERABLE 23 (29.5%) 2 (2.1%) 25 (14.5%)
    METASTATIQUE 37 (47.4%) 91 (96.8%) 128 (74.4%)
ligne 0.003
    1ère ligne 41 (52.6%) 39 (41.5%) 80 (46.5%)
    2ème ligne 28 (35.9%) 18 (19.1%) 46 (26.7%)
    3ème ligne 5 (6.4%) 21 (22.3%) 26 (15.1%)
    4ème ligne 2 (2.6%) 6 (6.4%) 8 (4.7%)
    5ème ligne 2 (2.6%) 6 (6.4%) 8 (4.7%)
    6ème ligne 0 (0.0%) 2 (2.1%) 2 (1.2%)
    8ème ligne 0 (0.0%) 1 (1.1%) 1 (0.6%)
    Récidive 0 (0.0%) 1 (1.1%) 1 (0.6%)
patient avec evenement lié au médicament 46 (59.0%) 30 (31.9%) 76 (44.2%) <0.001
Patient avec évènement toxique précoce 26 (33.3%) 21 (22.3%) 47 (27.3%) 0.11
charlson
    0 12 (15.4%) 4 (4.3%) 16 (9.3%)
    1 19 (24.4%) 13 (13.8%) 32 (18.6%)
    2 10 (12.8%) 20 (21.3%) 30 (17.4%)
    3 12 (15.4%) 26 (27.7%) 38 (22.1%)
    4 9 (11.5%) 17 (18.1%) 26 (15.1%)
    5 10 (12.8%) 7 (7.4%) 17 (9.9%)
    6 5 (6.4%) 4 (4.3%) 9 (5.2%)
    7 0 (0.0%) 1 (1.1%) 1 (0.6%)
    8 1 (1.3%) 2 (2.1%) 3 (1.7%)
score de charlson >=2 (hors tumeur) 47 (60.3%) 77 (81.9%) 124 (72.1%) 0.002
score de charlson >=3 (hors tumeur) 37 (47.4%) 57 (60.6%) 94 (54.7%) 0.083
score de charlson >=4 (hors tumeur) 25 (32.1%) 31 (33.0%) 56 (32.6%) 0.9
score de charlson >=5 (hors tumeur) 16 (20.5%) 14 (14.9%) 30 (17.4%) 0.3
score de charlson >=6 (hors tumeur) 6 (7.7%) 7 (7.4%) 13 (7.6%) >0.9
score de charlson >=7 (hors tumeur) 1 (1.3%) 3 (3.2%) 4 (2.3%) 0.6
score de charlson >=8 (hors tumeur) 1 (1.3%) 2 (2.1%) 3 (1.7%) >0.9
presence de métastase cérébrale 11 (14.1%) 29 (30.9%) 40 (23.3%) 0.010
patient avec difficulté de comprehension 9 (11.5%) 6 (6.4%) 15 (8.7%) 0.2
patient avec difficulté sociale 14 (17.9%) 5 (5.3%) 19 (11.0%) 0.009
patient avec activité professionnelle 17 (21.8%) 28 (29.8%) 45 (26.2%) 0.2
patient vivant seul 10 (12.8%) 11 (11.7%) 21 (12.2%) 0.8
patient avec interaction médicamenteuse 37 (47.4%) 64 (68.1%) 101 (58.7%) 0.006
patient avec interaction à risque de surdosage 24 (30.8%) 37 (39.4%) 61 (35.5%) 0.2
patient avec interaction à risque de sousdosage 5 (6.4%) 2 (2.1%) 7 (4.1%) 0.2
patient traité par IPP 20 (25.6%) 19 (20.2%) 39 (22.7%) 0.4
patient avec interaction IPP et pH 10 (12.8%) 5 (5.3%) 15 (8.7%) 0.083
patient avec interaction et risque allongement QT 8 (10.3%) 20 (21.3%) 28 (16.3%) 0.051
Analyse interaction avec conclusion risque EI 23 (29.5%) 44 (46.8%) 67 (39.0%) 0.020
prise_discontinue 9 (11.5%) 0 (NA%) 9 (11.5%) >0.9
    Unknown 0 94 94
risque_observance 17 (21.8%) 11 (11.7%) 28 (16.3%) 0.074
1 Median (IQR); n (%)
2 Wilcoxon rank sum test; Pearson’s Chi-squared test; Fisher’s exact test
#ANALYSE SUR CRITERE DE TOXICITE PRECOCE

##Analyses univariées 

##courbe ROC sur score de charlson
library(pROC)
## Type 'citation("pROC")' for a citation.
## 
## Attachement du package : 'pROC'
## 
## Les objets suivants sont masqués depuis 'package:stats':
## 
##     cov, smooth, var
roc1<-roc(tox3mois~charlson, datpoolees)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
coords(roc1, "best", ret=c("threshold", "specificity", "1-npv"))
##           threshold specificity     1-npv
## threshold       2.5       0.488 0.2179487
##courbe ROC sur age
library(pROC)
roc1<-roc(tox3mois~age, datpoolees)
## Setting levels: control = 0, case = 1
## Setting direction: controls < cases
coords(roc1, "best", ret=c("threshold", "specificity", "1-npv"))
##           threshold specificity    1-npv
## threshold      58.5         0.4 0.137931
datpoolees$old_58<-ifelse(datpoolees$age>58, 1, 0)
var_label(datpoolees$old_58) <- "Patient de + de 58 ans"
##analyses univariée avec tableau de résultat,
datpoolees |>
  tbl_uvregression(
    y = tox3mois,
    include = c(age, old_58, charlson, charlson_2, charlson_3, ddi, ddi_surdosage, rque_pharma_ei, polymedique, patient_seul, actif_pro, comprehension, pb_social, risque_observance, meta_snc, origine.cat),
    method = glm,
    method.args = list(family = binomial),
    exponentiate = TRUE
  ) |> 
  bold_labels()
Characteristic N OR1 95% CI1 p-value
charlson 172 1.13 0.94, 1.36 0.2
patient avec difficulté de comprehension 172 1.37 0.41, 4.09 0.6
patient vivant seul 172 1.07 0.36, 2.84 0.9
patient avec activité professionnelle 172 0.59 0.24, 1.29 0.2
patient avec interaction médicamenteuse 172 0.93 0.47, 1.85 0.8
patient avec interaction à risque de surdosage 172 0.70 0.33, 1.43 0.3
Analyse interaction avec conclusion risque EI 172 1.23 0.62, 2.43 0.6
patient polymediqué 172 1.34 0.69, 2.65 0.4
age 172 1.03 1.00, 1.05 0.049
patient avec difficulté sociale 172 0.94 0.29, 2.64 >0.9
risque_observance 172 0.69 0.24, 1.72 0.4
presence de métastase cérébrale 172 0.49 0.19, 1.14 0.12
score de charlson >=2 (hors tumeur) 172 1.91 0.87, 4.57 0.12
score de charlson >=3 (hors tumeur) 172 1.68 0.85, 3.41 0.14
Patient de dermatologie vs pneumologie 172 1.74 0.89, 3.44 0.11
Patient de + de 58 ans 172 3.25 1.46, 8.02 0.006
1 OR = Odds Ratio, CI = Confidence Interval
##modele multivarié avec charlson >=2 
mod<-glm(  tox3mois ~ old_58+charlson_2+actif_pro+meta_snc+origine.cat, data=datpoolees, family="binomial")
summary(mod)
## 
## Call:
## glm(formula = tox3mois ~ old_58 + charlson_2 + actif_pro + meta_snc + 
##     origine.cat, family = "binomial", data = datpoolees)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0649  -0.8266  -0.6739   1.2942   2.6646  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.2494     0.6529  -3.445  0.00057 ***
## old_58        2.5902     1.1780   2.199  0.02788 *  
## charlson_2   -1.2392     1.1410  -1.086  0.27744    
## actif_pro     0.4363     0.5478   0.796  0.42583    
## meta_snc     -0.4684     0.4811  -0.974  0.33023    
## origine.cat   0.6278     0.3845   1.633  0.10249    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 185.57  on 166  degrees of freedom
## AIC: 197.57
## 
## Number of Fisher Scoring iterations: 5
exp(coefficients(mod))
## (Intercept)      old_58  charlson_2   actif_pro    meta_snc origine.cat 
##   0.1054643  13.3329442   0.2896181   1.5469027   0.6259726   1.8735717
exp(confint(mod, level=0.95))
## Attente de la réalisation du profilage...
##                  2.5 %      97.5 %
## (Intercept) 0.02689088   0.3528902
## old_58      1.87419678 282.1943710
## charlson_2  0.01437903   1.9714762
## actif_pro   0.52249549   4.5849084
## meta_snc    0.22898019   1.5475511
## origine.cat 0.88695427   4.0270937
mod%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.11 0.03, 0.35 <0.001
Patient de + de 58 ans 13.3 1.87, 282 0.028
score de charlson >=2 (hors tumeur) 0.29 0.01, 1.97 0.3
patient avec activité professionnelle 1.55 0.52, 4.58 0.4
presence de métastase cérébrale 0.63 0.23, 1.55 0.3
Patient de dermatologie vs pneumologie 1.87 0.89, 4.03 0.10
1 OR = Odds Ratio, CI = Confidence Interval
step(mod)
## Start:  AIC=197.57
## tox3mois ~ old_58 + charlson_2 + actif_pro + meta_snc + origine.cat
## 
##               Df Deviance    AIC
## - actif_pro    1   186.21 196.21
## - meta_snc     1   186.57 196.57
## - charlson_2   1   187.04 197.04
## <none>             185.57 197.57
## - origine.cat  1   188.28 198.28
## - old_58       1   192.88 202.88
## 
## Step:  AIC=196.21
## tox3mois ~ old_58 + charlson_2 + meta_snc + origine.cat
## 
##               Df Deviance    AIC
## - meta_snc     1   187.29 195.29
## - charlson_2   1   187.64 195.64
## <none>             186.21 196.21
## - origine.cat  1   188.49 196.49
## - old_58       1   192.96 200.96
## 
## Step:  AIC=195.29
## tox3mois ~ old_58 + charlson_2 + origine.cat
## 
##               Df Deviance    AIC
## - charlson_2   1   188.99 194.99
## <none>             187.29 195.29
## - origine.cat  1   190.14 196.14
## - old_58       1   194.90 200.90
## 
## Step:  AIC=194.99
## tox3mois ~ old_58 + origine.cat
## 
##               Df Deviance    AIC
## <none>             188.99 194.99
## - origine.cat  1   193.01 197.01
## - old_58       1   199.16 203.16
## 
## Call:  glm(formula = tox3mois ~ old_58 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Coefficients:
## (Intercept)       old_58  origine.cat  
##     -2.2603       1.2928       0.7152  
## 
## Degrees of Freedom: 171 Total (i.e. Null);  169 Residual
## Null Deviance:       201.7 
## Residual Deviance: 189   AIC: 195
#modele final 
mod1<-glm(  tox3mois ~ old_58+origine.cat, data=datpoolees, family="binomial")
summary(mod1)
## 
## Call:
## glm(formula = tox3mois ~ old_58 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0723  -0.8026  -0.6218   1.2863   2.1723  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.2603     0.4511  -5.011 5.42e-07 ***
## old_58        1.2928     0.4383   2.949  0.00319 ** 
## origine.cat   0.7152     0.3598   1.988  0.04681 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 188.99  on 169  degrees of freedom
## AIC: 194.99
## 
## Number of Fisher Scoring iterations: 4
exp(coefficients(mod1))
## (Intercept)      old_58 origine.cat 
##   0.1043155   3.6428651   2.0446155
exp(confint(mod1, level=0.95))
## Attente de la réalisation du profilage...
##                  2.5 %    97.5 %
## (Intercept) 0.04007023 0.2380475
## old_58      1.61219254 9.1510472
## origine.cat 1.01608936 4.1856558
mod1%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.10 0.04, 0.24 <0.001
Patient de + de 58 ans 3.64 1.61, 9.15 0.003
Patient de dermatologie vs pneumologie 2.04 1.02, 4.19 0.047
1 OR = Odds Ratio, CI = Confidence Interval
#modèle alternatif avec charlson à la place de l'age
mod2<-glm(  tox3mois ~ charlson_2+origine.cat, data=datpoolees, family="binomial")
summary(mod2)
## 
## Call:
## glm(formula = tox3mois ~ charlson_2 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0199  -0.7514  -0.7317   1.3435   2.0544  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.9811     0.4604  -4.303 1.68e-05 ***
## charlson_2    0.8609     0.4361   1.974   0.0484 *  
## origine.cat   0.7378     0.3610   2.044   0.0410 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 194.90  on 169  degrees of freedom
## AIC: 200.9
## 
## Number of Fisher Scoring iterations: 4
exp(coefficients(mod2))
## (Intercept)  charlson_2 origine.cat 
##   0.1379149   2.3652639   2.0913210
exp(confint(mod, level=0.95))
## Attente de la réalisation du profilage...
##                  2.5 %      97.5 %
## (Intercept) 0.02689088   0.3528902
## old_58      1.87419678 282.1943710
## charlson_2  0.01437903   1.9714762
## actif_pro   0.52249549   4.5849084
## meta_snc    0.22898019   1.5475511
## origine.cat 0.88695427   4.0270937
mod2%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.14 0.05, 0.32 <0.001
score de charlson >=2 (hors tumeur) 2.37 1.04, 5.84 0.048
Patient de dermatologie vs pneumologie 2.09 1.04, 4.29 0.041
1 OR = Odds Ratio, CI = Confidence Interval
##modele multivarié avec charlson >=3 
mod<-glm(  tox3mois ~ old_58+charlson_3+actif_pro+meta_snc+origine.cat, data=datpoolees, family="binomial")
summary(mod)
## 
## Call:
## glm(formula = tox3mois ~ old_58 + charlson_3 + actif_pro + meta_snc + 
##     origine.cat, family = "binomial", data = datpoolees)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.1657  -0.8113  -0.6448   1.1892   2.4373  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.3946     0.6450  -3.712 0.000205 ***
## old_58        1.6656     0.6423   2.593 0.009511 ** 
## charlson_3   -0.2133     0.4749  -0.449 0.653362    
## actif_pro     0.4039     0.5521   0.732 0.464348    
## meta_snc     -0.5228     0.4792  -1.091 0.275272    
## origine.cat   0.7013     0.3783   1.854 0.063782 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 186.84  on 166  degrees of freedom
## AIC: 198.84
## 
## Number of Fisher Scoring iterations: 4
exp(coefficients(mod))
## (Intercept)      old_58  charlson_3   actif_pro    meta_snc origine.cat 
##  0.09120631  5.28883092  0.80791628  1.49772836  0.59283873  2.01641655
exp(confint(mod, level=0.95))
## Attente de la réalisation du profilage...
##                 2.5 %    97.5 %
## (Intercept) 0.0236075  0.300233
## old_58      1.5664105 19.804642
## charlson_3  0.3197534  2.086951
## actif_pro   0.5020623  4.477368
## meta_snc    0.2174498  1.458880
## origine.cat 0.9668147  4.285239
mod%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.09 0.02, 0.30 <0.001
Patient de + de 58 ans 5.29 1.57, 19.8 0.010
score de charlson >=3 (hors tumeur) 0.81 0.32, 2.09 0.7
patient avec activité professionnelle 1.50 0.50, 4.48 0.5
presence de métastase cérébrale 0.59 0.22, 1.46 0.3
Patient de dermatologie vs pneumologie 2.02 0.97, 4.29 0.064
1 OR = Odds Ratio, CI = Confidence Interval
step(mod)
## Start:  AIC=198.84
## tox3mois ~ old_58 + charlson_3 + actif_pro + meta_snc + origine.cat
## 
##               Df Deviance    AIC
## - charlson_3   1   187.04 197.04
## - actif_pro    1   187.37 197.37
## - meta_snc     1   188.09 198.09
## <none>             186.84 198.84
## - origine.cat  1   190.33 200.33
## - old_58       1   194.16 204.16
## 
## Step:  AIC=197.04
## tox3mois ~ old_58 + actif_pro + meta_snc + origine.cat
## 
##               Df Deviance    AIC
## - actif_pro    1   187.64 195.64
## - meta_snc     1   188.27 196.27
## <none>             187.04 197.04
## - origine.cat  1   190.69 198.69
## - old_58       1   195.72 203.72
## 
## Step:  AIC=195.64
## tox3mois ~ old_58 + meta_snc + origine.cat
## 
##               Df Deviance    AIC
## - meta_snc     1   188.99 194.99
## <none>             187.64 195.64
## - origine.cat  1   190.82 196.82
## - old_58       1   197.29 203.29
## 
## Step:  AIC=194.99
## tox3mois ~ old_58 + origine.cat
## 
##               Df Deviance    AIC
## <none>             188.99 194.99
## - origine.cat  1   193.01 197.01
## - old_58       1   199.16 203.16
## 
## Call:  glm(formula = tox3mois ~ old_58 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Coefficients:
## (Intercept)       old_58  origine.cat  
##     -2.2603       1.2928       0.7152  
## 
## Degrees of Freedom: 171 Total (i.e. Null);  169 Residual
## Null Deviance:       201.7 
## Residual Deviance: 189   AIC: 195
##modele final 
mod<-glm(  tox3mois ~ old_58+origine.cat, data=datpoolees, family="binomial")
summary(mod)
## 
## Call:
## glm(formula = tox3mois ~ old_58 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0723  -0.8026  -0.6218   1.2863   2.1723  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.2603     0.4511  -5.011 5.42e-07 ***
## old_58        1.2928     0.4383   2.949  0.00319 ** 
## origine.cat   0.7152     0.3598   1.988  0.04681 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 188.99  on 169  degrees of freedom
## AIC: 194.99
## 
## Number of Fisher Scoring iterations: 4
exp(coefficients(mod))
## (Intercept)      old_58 origine.cat 
##   0.1043155   3.6428651   2.0446155
exp(confint(mod, level=0.95))
## Attente de la réalisation du profilage...
##                  2.5 %    97.5 %
## (Intercept) 0.04007023 0.2380475
## old_58      1.61219254 9.1510472
## origine.cat 1.01608936 4.1856558
mod%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.10 0.04, 0.24 <0.001
Patient de + de 58 ans 3.64 1.61, 9.15 0.003
Patient de dermatologie vs pneumologie 2.04 1.02, 4.19 0.047
1 OR = Odds Ratio, CI = Confidence Interval
##modèle alternatif avec charlson à la place de l'age
mod<-glm(  tox3mois ~ charlson_3+origine.cat, data=datpoolees, family="binomial")
summary(mod)
## 
## Call:
## glm(formula = tox3mois ~ charlson_3 + origine.cat, family = "binomial", 
##     data = datpoolees)
## 
## Deviance Residuals: 
##    Min      1Q  Median      3Q     Max  
## -1.019  -0.791  -0.782   1.345   1.909  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -1.6451     0.3518  -4.676 2.93e-06 ***
## charlson_3    0.6168     0.3608   1.710   0.0873 .  
## origine.cat   0.6437     0.3529   1.824   0.0682 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 201.75  on 171  degrees of freedom
## Residual deviance: 196.15  on 169  degrees of freedom
## AIC: 202.15
## 
## Number of Fisher Scoring iterations: 4
exp(coefficients(mod))
## (Intercept)  charlson_3 origine.cat 
##   0.1929848   1.8530796   1.9034354
exp(confint(mod, level=0.95))
## Attente de la réalisation du profilage...
##                  2.5 %    97.5 %
## (Intercept) 0.09313384 0.3724043
## charlson_3  0.92389017 3.8246760
## origine.cat 0.95766966 3.8411906
mod%>%tbl_regression(intercept = TRUE, exponentiate = TRUE)
Characteristic OR1 95% CI1 p-value
(Intercept) 0.19 0.09, 0.37 <0.001
score de charlson >=3 (hors tumeur) 1.85 0.92, 3.82 0.087
Patient de dermatologie vs pneumologie 1.90 0.96, 3.84 0.068
1 OR = Odds Ratio, CI = Confidence Interval
##tableaux récapitulatifs 

##nommer l'analyse univariée


tblunivarie<-
  datpoolees |>
  tbl_uvregression(
    y = tox3mois,
    include = c(age, old_58, charlson, charlson_2, charlson_3, ddi, ddi_surdosage, rque_pharma_ei, polymedique, patient_seul, actif_pro, comprehension, pb_social, risque_observance, meta_snc, origine.cat),
    method = glm,
    method.args = list(family = binomial),
    exponentiate = TRUE
  ) |> 
  modify_column_hide("stat_n")

###nommer les modèles multivairés
tblmulti1 <-
  mod1 |> 
  tbl_regression(exponentiate = TRUE)

tblmulti2 <-
  mod2 |> 
  tbl_regression(exponentiate = TRUE)
##regrouper les 2 tableaux

list(tblunivarie, tblmulti1, tblmulti2) |> 
  tbl_merge(
    tab_spanner = c(
      "**Régressions univariées**",
      "Régression multivariée modèle avec age ",
      "**Régression multivariée modèle avec charlson**"
    )
  ) |> 
  bold_labels()
Characteristic Régressions univariées Régression multivariée modèle avec age Régression multivariée modèle avec charlson
OR1 95% CI1 p-value OR1 95% CI1 p-value OR1 95% CI1 p-value
charlson 1.13 0.94, 1.36 0.2
patient avec difficulté de comprehension 1.37 0.41, 4.09 0.6
patient vivant seul 1.07 0.36, 2.84 0.9
patient avec activité professionnelle 0.59 0.24, 1.29 0.2
patient avec interaction médicamenteuse 0.93 0.47, 1.85 0.8
patient avec interaction à risque de surdosage 0.70 0.33, 1.43 0.3
Analyse interaction avec conclusion risque EI 1.23 0.62, 2.43 0.6
patient polymediqué 1.34 0.69, 2.65 0.4
age 1.03 1.00, 1.05 0.049
patient avec difficulté sociale 0.94 0.29, 2.64 >0.9
risque_observance 0.69 0.24, 1.72 0.4
presence de métastase cérébrale 0.49 0.19, 1.14 0.12
score de charlson >=2 (hors tumeur) 1.91 0.87, 4.57 0.12 2.37 1.04, 5.84 0.048
score de charlson >=3 (hors tumeur) 1.68 0.85, 3.41 0.14
Patient de dermatologie vs pneumologie 1.74 0.89, 3.44 0.11 2.04 1.02, 4.19 0.047 2.09 1.04, 4.29 0.041
Patient de + de 58 ans 3.25 1.46, 8.02 0.006 3.64 1.61, 9.15 0.003
1 OR = Odds Ratio, CI = Confidence Interval
###illustrations des effets de chaque covariable des 2 modèles mutlivariés
mod1%>%allEffects()%>%plot()

mod2%>%allEffects()%>%plot()

ggcoef_model(mod1, exponentiate = TRUE)

ggcoef_model(mod2, exponentiate = TRUE)