Professional Documents
Culture Documents
Survival
Survival
Setting
• The time to an event is frequently an
important outcome (or endpoint)
• E. g.,
– Dosing studies designed to determine an LC50 allow you to
determine “the concentration that kills 50% of the individuals
within a specific time frame (frequently 48h)”
Approach
– Time as a dependent variable is tricky!
• Non-normal
• Censoring Start Study End Study
TIME
Individual 1
Individual 2
“Right” Censored
Individual 3
Individual 4
Individual 5
Censored observations
Comparing Survival
• Log-Rank Test
– Based on each curves’ PL estimator
– Semi-parametric approach
– aka Cox-Mantel Test or Mantel-Haenszel Test
> survdiff(Surv(time,cens)~treat, data=gehan)
Call:
survdiff(formula = Surv(time, cens) ~ treat, data = gehan)
main='Exponential')
0.6
> lines(sfit)
0.5
0.4
0 2 4 6 8
time
> curve(pweibull(x,scale=exp(coef(sregwei)),
shape=1/sregwei$scale,lower=F),from=0,
to=8, xlab = "time", ylab ="S(t)",
S(t)
col='red', main='Weibull')
0.6
> lines(sfit)
0.4
0 2 4 6 8
time
Coefficients:
(Intercept) treatcontrol
3.515687 -1.267335
Scale= 0.7321944
> summary(gehanreg)
Call:
survreg(formula = Surv(time, cens) ~ treat, data = gehan, dist = "weibull")
Value Std. Error z p
(Intercept) 3.516 0.252 13.96 2.61e-44
treatcontrol -1.267 0.311 -4.08 4.51e-05
Log(scale) -0.312 0.147 -2.12 3.43e-02
Scale= 0.732
Weibull distribution
Loglik(model)= -106.6 Loglik(intercept only)= -116.4
Chisq= 19.65 on 1 degrees of freedom, p= 9.3e-06
Number of Newton-Raphson Iterations: 5
n= 42
> anova(gehanreg)
Df Deviance Resid. Df -2*LL P(>|Chi|)
NULL NA NA 40 232.8108 NA
treat -1 19.65183 39 213.1590 9.291424e-06
Weibull Distribution
Assessing the adequacy of the weibull distribution …
These should be
approximately
linear!
> plot(gehan.surv,lty=2:3,lwd=2,cex=2,
fun="cloglog",xlim=c(1,40),
xlab = "time of remission(weeks)",
ylab="log H(t)")
> legend(2,0.5,c("control","6MP"),
lty=3:2)
> library(MASS)
> data(leuk)
> leukfit = survfit(Surv(time)~ag, data=leuk)
> plot(leukfit,lty=3:2,lwd=2,cex=2,
xlab = "time",ylab="survival")
> legend(115,1,c("ag present","agabsent"),
lty=2:3,lwd=2)
Call:
glm(formula = time ~ ag * log(wbc), family = Gamma(link = log), NOTE: the exponential
data = leuk)
distribution is a special
Deviance Residuals: case of the Gamma
Min 1Q Median 3Q Max distribution with
-1.9921 -1.2116 -0.3269 0.2159 1.5647
dispersion=1
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.3435 1.9662 2.209 0.0272 *
agpresent 4.1347 2.5703 1.609 0.1077
log(wbc) -0.1540 0.2027 -0.760 0.4472
agpresent:log(wbc) -0.3278 0.2669 -1.228 0.2194
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Coefficients:
(Intercept) agpresent log(wbc) agpresent:log(wbc)
4.3432709 4.1349385 -0.1540179 -0.3278114
Scale fixed at 1
Call:
survreg(formula = Surv(time) ~ ag * log(wbc), data = leuk, dist =
"exponential")
Value Std. Error z p
(Intercept) 4.343 1.638 2.651 0.00802
agpresent 4.135 2.370 1.745 0.08097 NOTE: the interaction term
log(wbc) -0.154 0.168 -0.915 0.36000 is not significant,
agpresent:log(wbc) -0.328 0.246 -1.332 0.18298 indicating consistent
effects of log(wbc) across
Scale fixed at 1 groups.
Exponential distribution
Loglik(model)= -145.7 Loglik(intercept only)= -155.5
Chisq= 19.58 on 3 degrees of freedom, p= 0.00021
Number of Newton-Raphson Iterations: 5
n= 33
Call:
survreg(formula = Surv(time) ~ ag + log(wbc), data = leuk, dist =
"exponential")
Value Std. Error z p
(Intercept) 5.815 1.263 4.60 4.15e-06
agpresent 1.018 0.364 2.80 5.14e-03
log(wbc) -0.304 0.124 -2.45 1.44e-02
Scale fixed at 1
Exponential distribution
Loglik(model)= -146.5 Loglik(intercept only)= -155.5
Chisq= 17.82 on 2 degrees of freedom, p= 0.00014
Number of Newton-Raphson Iterations: 5
n= 33
n= 33
coef exp(coef) se(coef) z p
agpresent -1.069 0.343 0.429 -2.49 0.0130
log(wbc) 0.368 1.444 0.136 2.70 0.0069
> attach(leuk)
> plot(survfit(Surv(time)~ag), lty=2:3, log=T,
lwd=3, col='red')
> leuk_coxs = coxph(Surv(time)~strata(ag)+log(wbc),
data=leuk)
> lines(survfit(leuk_coxs),lty=2:3, lwd=3)
> legend(80,.8,c("ag absent", "ag present"),
lty=2:3, lwd=3)