You are on page 1of 12

19

(survival analysis)
.

.
, ,
,
.

(reliability theory).
,
(cencored) .
.

.

:
.

19.1

T , (survival fu-
nction) S(t)

207
t :

S(t) = P (T > t) = 1 F (t)

t
S(0) = 1 S() = 0. S(t) t

.

19.2

, h(t), (
) t,
t. ,

P (t T t + s | T t)
h(t) = lim
s0 s
-
,
.

19.3


. -

. ,
:

ln h(t) = 0 + 1 x1 + 2 x2 + . . . + p xp


.
,
(Cox 1972).

ln h(t) = (t) + 1 x1 + 2 x2 + . . . + p xp

c
. 208
.
(t) . -
-
, .
(t) ,
.
Cox
. -

.

19.4
,
, 51 -
.
,
.
:

1. , Age,

2. , Smear,

3.
, Infil,

4. , Index,

5. , Blasts,

6. , Temp.

, , Time, -
, Resp. , Status -
.

.
.
R
survival. -
coxph. coxph

c
. 209
.

lm,
Surv. -
-, Surv Surv(time,event),
time , event
1
0 . -
6
:

> library(survival)
> cancer.dat <- read.table("cancer.dat", col.names=c("Age","Smear",
+ "Infil","Index","Blasts","Temp","Resp","Time","Status"))
> time<-cancer.dat[,"Time"]
> status<-1-cancer.dat[,"Status"]
> attach(cancer.dat)
> cancer.cox<-coxph(Surv(time,status)~Age+Smear+Infil+Index+Blasts)
> summary(cancer.cox)
Call:
coxph(formula = Surv(time, status) ~ Age + Smear + Infil + Index +
Blasts)

n= 51
coef exp(coef) se(coef) z p
Age 0.03536 1.036 0.01018 3.473 0.00052
Smear 0.00915 1.009 0.01451 0.631 0.53000
Infil -0.01835 0.982 0.01247 -1.472 0.14000
Index -0.08955 0.914 0.04482 -1.998 0.04600
Blasts 0.00285 1.003 0.00973 0.293 0.77000

exp(coef) exp(-coef) lower .95 upper .95


Age 1.036 0.965 1.016 1.057
Smear 1.009 0.991 0.981 1.038
Infil 0.982 1.019 0.958 1.006
Index 0.914 1.094 0.837 0.998
Blasts 1.003 0.997 0.984 1.022

c
. 210
.
Rsquare= 0.312 (max possible= 0.996 )
Likelihood ratio test= 19.1 on 5 df, p=0.00188
Wald test = 17.6 on 5 df, p=0.00351
Score (logrank) test = 18.9 on 5 df, p=0.00197

, Age,
, p-value 0.

:

> cancer.cox1<-coxph(Surv(time,status)~Age)
> cancer.cox1
Call:
coxph(formula = Surv(time, status) ~ Age)

coef exp(coef) se(coef) z p


Age 0.0324 1.03 0.00952 3.4 0.00067

Likelihood ratio test=11.8 on 1 df, p=0.000577 n= 51

-
0.0324.

.
,
.

100(exp(coef f icient) 1)

-
. ,
3% .

-
, ..
:

martingale:
,

c
. 211
.
deviance: -
,

Schoenfeld: -
.

martingale
,

> cancer.cox1.mart<-residuals(cancer.cox1,type="martingale")
> plot(Age,cancer.cox1.mart,ylab="Martingale residual")
> abline(h=0)
> lines(lowess(Age,cancer.cox1.mart))

19.1.
lowess,
, ,
45.
1.0
0.5
0.0
Martingale residual

0.5
1.0
1.5
2.0

20 30 40 50 60 70 80

Age

19.1: martingale
lowess.

,
deviance 19.2.

c
. 212
.
22
. .

> cancer.cox1.dev<-residuals(cancer.cox1,type="deviance")
> plot(Age,cancer.cox1.dev,ylab="Deviance residual")
> abline(h=0)
> lines(lowess(Age,cancer.cox1.dev))
> identify(Age,cancer.cox1.dev,n=1)
[1] 22

22
2
1
Deviance residual

0
1
2

20 30 40 50 60 70 80

Age

19.2: deviance
lowess.

, Schoenfeld
lowess ( 19.3).

> cancer.cox1.shoen<-residuals(cancer.cox1,type="schoenfeld")
> plot(Age[status==1],cancer.cox1.shoen,xlab="Survival time",
+ ylab="Schoenfeld residual")
> abline(h=0)
> lines(lowess(Age[status==1],cancer.cox1.shoen))

c
. 213
.

. -
,
.

20
10
Schoenfeld residual

0
10
20
30

20 30 40 50 60 70 80

Survival time

19.3: Schoenfeld
lowess.

, -

, ,
45 .
(
19.4).

> agroup<-cancer.dat[,"Age"]-45
> agroup[agroup>=0]<-1
> agroup[agroup<0]<-0
> plot(survfit(Surv(time,status)~agroup),xlab="Survival Time in months",
+ ylab="Proportion surviving",lty=1:2)
> legend("topright",c("Under 45","45 and over"),lty=1:2)

c
. 214
.
1.0
Under 45
45 and over

0.8
Proportion surviving

0.6
0.4
0.2
0.0

0 10 20 30 40

Survival Time in months

19.4:
45 .

, -
. -
log-rank, X 2 R
survdiff.

> survdiff(Surv(time,status)~agroup)
Call:
survdiff(formula = Surv(time, status) ~ agroup)

N Observed Expected (O-E)^2/E (O-E)^2/V


agroup=0 18 14 23.8 4.05 11.0
agroup=1 33 31 21.2 4.55 11.0

Chisq= 11 on 1 degrees of freedom, p= 0.000926

11 1 -
. p-value 0
.

c
. 215
.

-
.

> cancer.dat
Age Smear Infil Index Blasts Temp Resp Time Status
1 20 78 39 7 0.6 990 1 18 0
2 25 64 61 16 35.0 1030 1 31 1
3 26 61 55 12 7.5 982 1 31 0
4 26 64 64 16 21.0 1000 1 31 0
5 27 95 95 6 7.5 980 1 36 0
6 27 80 64 8 0.6 1010 0 1 0
7 28 88 88 10 4.8 986 1 9 0
8 28 70 70 14 10.0 1010 1 39 1
9 31 72 72 5 2.3 988 1 20 1
10 33 58 58 7 5.7 986 0 4 0
11 33 92 92 5 2.6 980 1 45 1
12 33 42 38 12 2.5 984 1 36 0
13 34 26 26 7 7.0 982 0 12 0
14 36 55 55 14 4.5 986 1 8 0
15 37 71 71 15 4.4 1020 0 1 0
16 40 91 91 9 35.0 986 1 15 0
17 40 52 49 12 2.1 988 1 24 0
18 43 74 63 4 0.1 986 0 2 0
19 45 78 47 14 4.2 980 1 33 0
20 45 60 36 10 0.6 992 1 29 1
21 45 82 32 10 28.1 1016 0 7 0
22 45 79 79 4 1.1 1030 0 0 0
23 47 56 28 2 0.9 990 0 1 0
24 48 60 54 10 2.2 1002 0 2 0
25 50 83 66 19 11.6 996 1 12 0
26 50 36 32 14 4.5 992 1 9 0
27 51 88 70 8 0.5 982 0 1 0
28 52 87 87 7 10.3 986 0 1 0
29 53 75 68 13 2.3 980 1 9 0
30 53 65 65 6 2.3 982 0 5 0

c
. 216
.
31 56 97 92 10 16.0 992 1 27 1
32 57 87 83 19 21.6 1020 0 1 0
33 59 45 45 8 1.1 999 0 13 0
34 59 36 34 5 0.0 1038 0 1 0
35 60 39 33 7 0.9 988 0 5 0
36 60 76 53 12 0.4 982 0 1 0
37 61 46 37 4 1.4 1006 0 3 0
38 61 39 8 8 0.3 990 0 4 0
39 61 90 90 1 9.9 990 0 1 0
40 62 84 84 19 115.0 1020 1 18 0
41 63 42 27 5 0.3 1014 0 1 0
42 65 75 75 10 20.0 1004 0 2 0
43 71 44 22 6 0.3 990 0 1 0
44 71 63 63 11 10.0 986 1 8 0
45 73 33 33 4 0.5 1010 0 3 0
46 73 93 84 6 38.0 1020 0 4 0
47 74 58 58 10 2.4 1002 1 14 0
48 74 32 30 16 6.7 988 0 3 0
49 75 60 60 17 8.2 990 1 13 0
50 77 69 69 9 1.5 986 1 13 0
51 80 73 73 7 1.5 986 0 1 0

c
. 217
.
c
. 218
.

You might also like