library(rmarkdown)
library(markdown)
library(tidyverse)
library(finalfit)
library(survival)
library(survminer)
library(survminer,quietly=True)
La courbe de survie de Kaplan-Meier s’obtient avec la fonction survfit de l’extension survival.
PFS_s_Br<-survfit(Surv(delais_diag_prog,prog_Brigatinib)~1,data=t_survie_1)
PFS_s_Br
## Call: survfit(formula = Surv(delais_diag_prog, prog_Brigatinib) ~ 1,
## data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## 20.00 17.00 3.30 2.28 15.96
Jean , tu me donneras les titres des graphes pour que je puisse les rajouter dedans si tu veux
ggsurvplot(PFS_s_Br,xlab="Time(month)")
Ici le meme graphe mais avec la ligne de la médiane
plot(PFS_s_Br,,xlab="Time(month)",ylab="Survie")
abline(v=3.30,col="blue")
On peut facilement représenter à la place la courbe cumulée des évènements (l’inverse de la courbe de survie) et la table des effectifs en fonction du temps.
{r, echo=TRUE}
ggsurvplot(PFS_s_Br, fun = "event", risk.table = TRUE, surv.scale = "percent",xlab="Time(month)")
PFS_B_SNC<-survfit(Surv(delais_diag_prog,prog_Brigatinib)~prog_cerebrale_pdtB,data=t_survie_1)
PFS_B_SNC
## Call: survfit(formula = Surv(delais_diag_prog, prog_Brigatinib) ~ prog_cerebrale_pdtB,
## data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## prog_cerebrale_pdtB=Non 12 9 3.84 1.68 NA
## prog_cerebrale_pdtB=Oui 8 8 2.82 2.28 NA
ggsurvplot(PFS_B_SNC,xlab="Time(month)")
Courbe avec mediane
plot(PFS_B_SNC,xlab="Time(month)",ylab="Survie")
abline(v=c(3.84,2.82), col=c("blue","red"))
survdiff(Surv(delais_diag_prog,prog_Brigatinib)~prog_cerebrale_pdtB,data=t_survie_1)
## Call:
## survdiff(formula = Surv(delais_diag_prog, prog_Brigatinib) ~
## prog_cerebrale_pdtB, data = t_survie_1)
##
## N Observed Expected (O-E)^2/E (O-E)^2/V
## prog_cerebrale_pdtB=Non 12 9 10.38 0.185 0.493
## prog_cerebrale_pdtB=Oui 8 8 6.62 0.290 0.493
##
## Chisq= 0.5 on 1 degrees of freedom, p= 0.5
ggsurvplot(PFS_B_SNC, data = t_survie_1,xlab="Time(month)")
ggsurvplot(PFS_B_SNC, conf.int = TRUE, risk.table = TRUE, pval = TRUE, data = t_survie_1,xlab="Time(month)")
la courbe montre qu’il y’a une tendence à diminuer le risque de meta cerebrale avec le temps pour les patients sous Brigatinib
S_globale<-survfit(Surv(delais_diag_dernieres_nouvelles,statut_patient)~1,data=t_survie_1)
S_globale
## Call: survfit(formula = Surv(delais_diag_dernieres_nouvelles, statut_patient) ~
## 1, data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## 20.0 7.0 91.2 63.0 NA
ggsurvplot(S_globale,xlab="Time(month)")
NB: les petites croix sur le graphique sont les observations censurée
schema avec médiane
plot(S_globale,xlab="Time(month)",ylab="Survie")
abline(v=91.2,col="red")
ggsurvplot(S_globale, fun = "event", risk.table = TRUE, surv.scale = "percent",xlab="Time(month)")
Fin=0 sont qui n’ont pas fini l’étude /ne sont plus sous brigatinib Fin=1 sont ceux qui sont toujours sous brigatinib
S_glb_Briga<-survfit(Surv(delais_diag_dernieres_nouvelles,statut_patient)~Fin,data=t_survie_1)
S_glb_Briga
## Call: survfit(formula = Surv(delais_diag_dernieres_nouvelles, statut_patient) ~
## Fin, data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## Fin=0 14 6 73.7 36.4 NA
## Fin=1 6 1 NA 63.0 NA
ggsurvplot(S_glb_Briga,xlab="Time(month)")
plot(S_glb_Briga,xlab="Time(month)")
abline(v=73.7,col="red")
S_glb_rec_Briga<-survfit(Surv(delais_diag_dernieres_nouvelles,statut_patient)~prog_Brigatinib,data=t_survie_1)
S_glb_rec_Briga
## Call: survfit(formula = Surv(delais_diag_dernieres_nouvelles, statut_patient) ~
## prog_Brigatinib, data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## prog_Brigatinib=0 3 0 NA NA NA
## prog_Brigatinib=1 17 7 73.7 63 NA
ggsurvplot(S_glb_rec_Briga,xlab="Time(month)")
avec médiane des patients ayant fini le traitement par Brigatinib, la médiane des patients encore sous Brigatinib ne peut pas se calculer car c’est une inconnue
plot(S_glb_rec_Briga,xlab="Time(month)",ylab="Survie")
abline(v=73.7,col="red")
S_globale_SNC<-survfit(Surv(delais_diag_dernieres_nouvelles,statut_patient)~prog_cerebrale_pdtB,data=t_survie_1)
S_globale_SNC
## Call: survfit(formula = Surv(delais_diag_dernieres_nouvelles, statut_patient) ~
## prog_cerebrale_pdtB, data = t_survie_1)
##
## n events median 0.95LCL 0.95UCL
## prog_cerebrale_pdtB=Non 12 5 91.2 63.0 NA
## prog_cerebrale_pdtB=Oui 8 2 NA 36.4 NA
ggsurvplot(S_globale_SNC,xlab="Time(month)")
plot(S_globale_SNC,xlab="Time(month)",ylab="Survie")
abline(v=91.2,col="red")
### Calcul du test du logrank afin de comparer des courbes de survie avec ou sans meta cérebrale
survdiff(Surv(delais_diag_prog,prog_Brigatinib)~prog_cerebrale_pdtB,data=t_survie_1)
## Call:
## survdiff(formula = Surv(delais_diag_prog, prog_Brigatinib) ~
## prog_cerebrale_pdtB, data = t_survie_1)
##
## N Observed Expected (O-E)^2/E (O-E)^2/V
## prog_cerebrale_pdtB=Non 12 9 10.38 0.185 0.493
## prog_cerebrale_pdtB=Oui 8 8 6.62 0.290 0.493
##
## Chisq= 0.5 on 1 degrees of freedom, p= 0.5
ggsurvplot(S_globale_SNC, conf.int = TRUE, risk.table = TRUE, pval = TRUE, data = t_survie_1,xlab="Time(month)")
S_globale_brigatinib<-survfit(Surv(delais_Brigatinib_dernieres_nouvelles,statut_patient)~1,data=t_survie_1)
ggsurvplot(S_globale_brigatinib,xlab="Time(month)")
t_survie_2 <- read.csv2("C:/Users/mallah.s/Desktop/StatsTheses/Theses_finies/these_Jean/t_survie_2.csv", stringsAsFactors=TRUE)
PFS_SNC_avB<-survfit(Surv(delais_diag_prog,prog_Brigatinib)~1,data=t_survie_2)
PFS_SNC_avB
## Call: survfit(formula = Surv(delais_diag_prog, prog_Brigatinib) ~ 1,
## data = t_survie_2)
##
## n events median 0.95LCL 0.95UCL
## 16.00 14.00 2.82 1.92 NA
ggsurvplot(PFS_SNC_avB,xlab="Time(month)")
meme courbe sans couleurs
plot(PFS_SNC_avB,xlab="Time(month)")
Courbe avec mediane
plot(PFS_SNC_avB,xlab="Time(month)",ylab="Survie sans progression")
abline(v=2.8,col="red")
un petit plus où cas ou tu te poses la question de la survie globale des patients qui ont commencé Brigatinib en ayant une meta cérébrale
S_globale_SNC_avB<-survfit(Surv(delais_Brigatinib_dernieres_nouvelles,statut_patient)~1,data=t_survie_2)
S_globale_SNC_avB
## Call: survfit(formula = Surv(delais_Brigatinib_dernieres_nouvelles,
## statut_patient) ~ 1, data = t_survie_2)
##
## n events median 0.95LCL 0.95UCL
## 16.00 6.00 NA 4.56 NA
ggsurvplot(S_globale_SNC_avB,xlab="Time(month)")