Académique Documents
Professionnel Documents
Culture Documents
TP ModelDeDuree KOUASSI-DOMINICK HILARY
TP ModelDeDuree KOUASSI-DOMINICK HILARY
heroine=read.table("~/Junior/Modele_de_duree/heroine.txt", header=TRUE)
heroine
#estimation de s(t)
library(survival) #importation de la librarie survival
KM=survfit(Surv(Time, Status)~1, data=heroine)
KM
## Call: survfit(formula = Surv(Time, Status) ~ 1, data = heroine)
##
## n events median 0.95LCL 0.95UCL
## [1,] 238 150 504 399 560
#Traçons l'estimateur
plot(KM)
##
## Call:
## survreg(formula = Surv(Time, Status) ~ 1, data = heroine, dist =
"weibull")
## Value Std. Error z p
## (Intercept) 6.4251 0.0671 95.77 <2e-16
## Log(scale) -0.2041 0.0691 -2.95 0.0031
##
## Scale= 0.815
##
## Weibull distribution
## Loglik(model)= -1114.9 Loglik(intercept only)= -1114.9
## Number of Newton-Raphson Iterations: 6
## n= 238
# 3_a
#estimation
KM_clinic=survfit(Surv(Time, Status)~Clinic, data=heroine)
KM_clinic
# traçons l'estimateur
plot(KM_clinic)
# 3_b
lg_test=survdiff(Surv(Time, Status)~Clinic, data=heroine)
lg_test
## Call:
## survdiff(formula = Surv(Time, Status) ~ Clinic, data = heroine)
##
## N Observed Expected (O-E)^2/E (O-E)^2/V
## Clinic=1 163 122 90.9 10.6 27.9
## Clinic=2 75 28 59.1 16.4 27.9
##
## Chisq= 27.9 on 1 degrees of freedom, p= 1e-07
# 4_c
weibull_T=survreg(Surv(Time, Status)~Clinic+Dose+Prison, data=heroine,
dist="weibull")
summary(weibull_T)
##
## Call:
## survreg(formula = Surv(Time, Status) ~ Clinic + Dose + Prison,
## data = heroine, dist = "weibull")
## Value Std. Error z p
## (Intercept) 4.10485 0.32806 12.51 < 2e-16
## Clinic 0.70904 0.15722 4.51 6.5e-06
## Dose 0.02443 0.00459 5.32 1.0e-07
## Prison -0.22947 0.12079 -1.90 0.057
## Log(scale) -0.31495 0.06756 -4.66 3.1e-06
##
## Scale= 0.73
##
## Weibull distribution
## Loglik(model)= -1084.5 Loglik(intercept only)= -1114.9
## Chisq= 60.89 on 3 degrees of freedom, p= 3.8e-13
## Number of Newton-Raphson Iterations: 7
## n= 238
## Call:
## coxph(formula = Surv(Time, Status) ~ Clinic + Dose + Prison,
## data = heroine)
##
## n= 238, number of events= 150
##
## coef exp(coef) se(coef) z Pr(>|z|)
## Clinic -1.009896 0.364257 0.214889 -4.700 2.61e-06 ***
## Dose -0.035369 0.965249 0.006379 -5.545 2.94e-08 ***
## Prison 0.326555 1.386184 0.167225 1.953 0.0508 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## exp(coef) exp(-coef) lower .95 upper .95
## Clinic 0.3643 2.7453 0.2391 0.5550
## Dose 0.9652 1.0360 0.9533 0.9774
## Prison 1.3862 0.7214 0.9988 1.9238
##
## Concordance= 0.665 (se = 0.025 )
## Likelihood ratio test= 64.56 on 3 df, p=6e-14
## Wald test = 54.12 on 3 df, p=1e-11
## Score (logrank) test = 56.32 on 3 df, p=4e-12
# Q6
AIC(weibull_mod,coxph_mod)
## df AIC
## weibull_mod 2 2233.839
## coxph_mod 3 1352.518