##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 

data_guillaume_dermato <- read_excel("Y:/fp/FAC/2023-2024/Memoires DES/Guillaume Flandin/20240322/data_guillaume_dermato.xlsx")
## New names:
## • `Détail` -> `Détail...39`
## • `Détail` -> `Détail...46`
## • `Détail` -> `Détail...56`
## • `Détail` -> `Détail...58`
##recodage bases de données le cas échéant----

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

##recodage bases de données le cas échéant----
dermato_g$charlson_2<-ifelse(dermato_g$charlson>=2, 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"
##réation de variables à plusieurs catégorie selon valeurs variable continue



##tableau descriptif population globales ----
tbl_summary(
  dermato_g, include = c("age", "pathologie", "dci", "polymedique","stade", "ligne", "evt_tox", "charlson", "charlson_2", "meta_snc", "comprehension", "pb_social", "actif_pro", "patient_seul", "ddi", "prise_discontinue"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
age 66 (52, 75)
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 5 (6.4%)
    Sonidegib 4 (5.1%)
    Trametinib 6 (7.7%)
    Vismodegib 8 (10.3%)
patient polymediqué 42 (53.8%)
stade
    ADJUVANT 18 (24.3%)
    AVANCE 8 (10.8%)
    AVANCE, NON OPERABLE 4 (5.4%)
    INOPERABLE 1 (1.4%)
    LOCALEMENT AVANCE 5 (6.8%)
    METASTATIQUE 37 (50.0%)
    RECIDIVE 1 (1.4%)
    Unknown 4
ligne
    1ere ligne 41 (53.9%)
    2eme ligne 24 (31.6%)
    2ème ligne 2 (2.6%)
    3eme ligne 4 (5.3%)
    3ème ligne 1 (1.3%)
    4eme ligne 1 (1.3%)
    4ème récidive 1 (1.3%)
    5eme ligne 2 (2.6%)
    Unknown 2
patient avec evenement lié au médicament 63 (80.8%)
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 (23.0%)
    Unknown 4
patient vivant seul 10 (13.7%)
    Unknown 5
patient avec interaction médicamenteuse 34 (54.8%)
    Unknown 16
traitement en prise discontinue 9 (11.5%)
1 Median (IQR); n (%)
##Description des evènements liés aux traitement 
tbl_summary(
  dermato_g, include = c("type_evt"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
evenement lié au médicament
    0 32 (41.0%)
    AEG (fatigue, perte d'appétit) 1 (1.3%)
    AEG, HYPERTHERMIE, INCONTINENCE URINAIRE 1 (1.3%)
    AEG, IRA, diarrhées grade II, déshydratation grade IV 1 (1.3%)
    AEG,PERTE DE POIDS 1 (1.3%)
    ALOPECIE / MYALGIES 1 (1.3%)
    ANEMIE GRADE III 1 (1.3%)
    ANEMIE, IRC 1 (1.3%)
    ASTHENIE / NAUSEES 1 (1.3%)
    ASTHENIE GRADE 2, DIARRHEES GRADE 2, MODIF BILAN HEPATIQUE,FRISSON 1 (1.3%)
    CEPHALEES GRADE 2 1 (1.3%)
    CONTRACTURES MUSCULAIRES GRADE 1, DYSGUEUSIE GRADE II, FOLLICULITE GRADE I 1 (1.3%)
    crampes musculaires grade 1 1 (1.3%)
    CRAMPES / Déséquilibre du ttt parkinson 1 (1.3%)
    CRAMPES MUSCULAIRES 1 (1.3%)
    Cytolyse grade II/fonction cardiaque 1 (1.3%)
    CYTOLYSE HEPATIQUE, INSUFFISANCE RENALE, DECOMPENSATION DIABETIQUE 1 (1.3%)
    dégradation fonction rénale 1 (1.3%)
    DEGRADATION INSUFFISANCE RENALE 1 (1.3%)
    DIARRHEES GRADE 2, AEG 1 (1.3%)
    DOULEURS MUSCULAIRES 1 (1.3%)
    Fièvre grade III 1 (1.3%)
    Frissons, fievre 1 (1.3%)
    GASTRITE 1 (1.3%)
    HYPERTHERMIE 1 (1.3%)
    PERTE DE POIDS, DYSGUESIE GRADE2, CRAMPES MUSCULAIRES GRADE 2 1 (1.3%)
    PHOTO TOXICITE 1 (1.3%)
    RHABDOMYOLYSE, TOXICITE CARDIAQUE 1 (1.3%)
    SYMPTOMES DIGESTIFS ET URINAIRES 1 (1.3%)
    TOXICITE CARDIAQUE 4 (5.1%)
    TOXICITE CARDIAQUE / DEGLOBULISATION 1 (1.3%)
    TOXICITE CARDIAQUE / Diminution FEVG 1 (1.3%)
    TOXICITE CARDIAQUE, AEG,ERUPTION CUTANEE 1 (1.3%)
    TOXICITE CUTANEE 2 (2.6%)
    TOXICITE DIGESTIVE 1 (1.3%)
    Toxicité digestive 1 (1.3%)
    TOXICITE DIGESTIVE / ANOREXIE 1 (1.3%)
    Toxicité digestive grade II 1 (1.3%)
    Toxicité oculaire 1 (1.3%)
    TOXICITE OCULAIRE ET CUTANEE 1 (1.3%)
    TREMBLEMENTS 1 (1.3%)
    TROUBLES DIGESTIFS / VOMISSEMENTS 1 (1.3%)
    TROUBLES VISUELS 1 (1.3%)
1 n (%)
##Conséquences des évènements liés aux traitement
tbl_summary(
  dermato_g, include = c("consequence_evt"),
  digits=all_categorical()~ c(0,1)
)
Characteristic N = 781
conséquence des evenements liés au médicament
    ARRET DEFINITIF 12 (27.3%)
    ARRET TEMPORAIRE 8 (18.2%)
    ARRET TEMPORAIRE / CONCESSION 5 (11.4%)
    ARRET TEMPORAIRE / CONCESSION TEMPORELLE 1 (2.3%)
    ARRET TEMPORAIRE / HOSPIT EN REA 1 (2.3%)
    ARRET TEMPORAIRE MEKINIST 1 (2.3%)
    ARRET TEMPORAIRE MEKINIST / CONCESSION POSOLOGIQUE 1 (2.3%)
    Concession Posologique 14 (31.8%)
    CONCESSION TEMPORELLE 1 (2.3%)
    Unknown 34
1 n (%)
#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     63   4.27    3.37    6.37
ggsurvplot(km_pftox, data = dermato_g,
           risk.table=TRUE,
           surv.scale="percent",
           break.time.by=2,
           surv.median.line = "hv"
)

##modèle de cox----
### modèle univarié avec tableau de résultat----
####charslon
modsurv<-coxph(Surv(pftox, evt_tox)~charlson, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
charlson 1.18 1.04, 1.34 0.009
1 HR = Hazard Ratio, CI = Confidence Interval
####présence de méta cérébrale
modsurv<-coxph(Surv(pftox, evt_tox)~meta_snc, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
presence de métastase cérébrale 1.10 0.52, 2.35 0.8
1 HR = Hazard Ratio, CI = Confidence Interval
####problème de compréhension
modsurv<-coxph(Surv(pftox, evt_tox)~comprehension, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient avec difficulté de comprehension 2.08 0.97, 4.46 0.061
1 HR = Hazard Ratio, CI = Confidence Interval
####problème social
modsurv<-coxph(Surv(pftox, evt_tox)~pb_social, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient avec difficulté sociale 0.79 0.39, 1.60 0.5
1 HR = Hazard Ratio, CI = Confidence Interval
####patient vivant seul
modsurv<-coxph(Surv(pftox, evt_tox)~patient_seul, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient vivant seul 0.80 0.39, 1.63 0.5
1 HR = Hazard Ratio, CI = Confidence Interval
####activité professionnelle
modsurv<-coxph(Surv(pftox, evt_tox)~actif_pro, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient avec activité professionnelle 0.61 0.33, 1.11 0.11
1 HR = Hazard Ratio, CI = Confidence Interval
####interaction médicamenteuse
modsurv<-coxph(Surv(pftox, evt_tox)~ddi, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient avec interaction médicamenteuse 1.41 0.80, 2.50 0.2
1 HR = Hazard Ratio, CI = Confidence Interval
####Schéma de prise discontinue
modsurv<-coxph(Surv(pftox, evt_tox)~prise_discontinue, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
traitement en prise discontinue 1.26 0.59, 2.69 0.5
1 HR = Hazard Ratio, CI = Confidence Interval
####patient polymédiqué
modsurv<-coxph(Surv(pftox, evt_tox)~polymedique, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
patient polymediqué 1.37 0.83, 2.26 0.2
1 HR = Hazard Ratio, CI = Confidence Interval
##Analyse multivariée
modsurv<-coxph(Surv(pftox, evt_tox)~charlson_2+comprehension+actif_pro+ddi+polymedique, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
score de charlson >=2 (hors tumeur) 1.75 0.81, 3.76 0.2
patient avec difficulté de comprehension 1.65 0.70, 3.89 0.3
patient avec activité professionnelle 0.81 0.34, 1.94 0.6
patient avec interaction médicamenteuse 1.31 0.64, 2.69 0.5
patient polymediqué 0.78 0.38, 1.61 0.5
1 HR = Hazard Ratio, CI = Confidence Interval
###sans polymedication
modsurv<-coxph(Surv(pftox, evt_tox)~charlson_2+comprehension+actif_pro+ddi, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
score de charlson >=2 (hors tumeur) 1.64 0.78, 3.45 0.2
patient avec difficulté de comprehension 1.72 0.73, 4.05 0.2
patient avec activité professionnelle 0.82 0.34, 1.96 0.7
patient avec interaction médicamenteuse 1.16 0.62, 2.15 0.6
1 HR = Hazard Ratio, CI = Confidence Interval
###sans activité professionnelle
modsurv<-coxph(Surv(pftox, evt_tox)~charlson_2+comprehension+ddi, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
score de charlson >=2 (hors tumeur) 1.88 1.02, 3.46 0.043
patient avec difficulté de comprehension 1.66 0.72, 3.84 0.2
patient avec interaction médicamenteuse 1.21 0.68, 2.17 0.5
1 HR = Hazard Ratio, CI = Confidence Interval
###sans interaction
modsurv<-coxph(Surv(pftox, evt_tox)~charlson_2+comprehension, data=dermato_g)
modsurv%>%tbl_regression(exponentiate = TRUE)
Characteristic HR1 95% CI1 p-value
score de charlson >=2 (hors tumeur) 1.49 0.88, 2.52 0.14
patient avec difficulté de comprehension 1.84 0.85, 4.01 0.12
1 HR = Hazard Ratio, CI = Confidence Interval