Sunteți pe pagina 1din 10

SJGS6367 Survival Data Analysis

Session 2012/13
Assignment 2
Group 1
Members:
1. Choy Yim Yeng
2. Mohd Faizal Bin Mohd Hamzah
3. Nurhaelisa Izyan Ramli
Submission Date: 2nd April 2013
Presentation Date: 4th April 2013

Assignment 2 Group 1
Data (Anderson)
survival

status

sex

35
34
32
32
25
23
22
20
19
17
16
13
11
10
10
9
7
6
6
6
6
23
22
17
15
12
12
11
11
8
8
8
8
5
5
4
4
3
2
2
1
1
1

0
0
0
0
0
1
1
0
0
0
1
1
0
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

1
1
1
1
1
1
1
1
0
0
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
1
1
0
1
1
1
1
1
1
1
1

logWBC
original
1.45
1.47
2.2
2.53
1.78
2.57
2.32
2.01
2.05
2.16
3.6
2.88
2.6
2.7
2.96
2.8
4.43
3.2
2.31
4.06
3.28
1.97
2.73
2.95
2.3
1.5
3.06
3.49
2.12
3.52
3.05
2.32
3.26
3.49
3.97
4.36
2.42
4.01
4.91
4.48
2.8
5
5

logWBC

RX

0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
2
1
2
2
2
1
2
2

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

Data type
Survival:

Integer

Status:
Integer
0 censored
1 not censored
Sex:

Factor

logWBC:
[0,2)
[2,4)
[4,+)

Factor
0
1
2

RX:

Factor

Question (1) Obtain the 95% confidence interval of the survival estimate using Kaplan Meier with the Greenwood Formula
i.e. the plots and the values for each death times.
*** Nonparametric Survival ***
Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,
data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "kaplan-meier", error = "greenwood", conf.type = "log",
conf.lower = "usual")
sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=2,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0
RX=1
RX=0
RX=1

n.obs n.max n.first events mean se(mean) median


1
1
1
1 12.00
0.000
12.0
10
10
10
4 13.87
1.860
13.0
10
10
10
10 11.70
1.523
11.0
1
1
1
1 7.00
0.000
7.0
3
3
3
0 35.00
0.000
NA
1
1
1
1 23.00
0.000
23.0
6
6
6
3 25.38
2.621
23.0
4
4
4
4 4.50
1.250
4.5
1
1
1
1 6.00
0.000
6.0
6
6
6
6 2.17
0.436
2.0

sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=2,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0
RX=1
RX=0
RX=1

0.95LCL 0.95UCL
NA
NA
10
NA
8
NA
NA
NA
NA
NA
NA
NA
22
NA
1
NA
NA
NA
1
NA

Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,


data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "kaplan-meier", error = "greenwood", conf.type = "log",
conf.lower = "usual")
sex=0, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
12
1
1
0
NA
NA
NA
sex=0, logWBC=1, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
10
2
0.800
0.126
0.587
1
9
7
0
0.800
0.126
0.587
1
10
6
1
0.667
0.161
0.415
1
11
4
0
0.667
0.161
0.415
1
13
3
1
0.444
0.211
0.175
1
17
2
0
0.444
0.211
0.175
1
19
1
0
0.444
0.211
0.175
1
sex=0, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
5
10
1
0.9 0.0949
0.7320
1.000
8
9
3
0.6 0.1549
0.3617
0.995
11
6
2
0.4 0.1549
0.1872
0.855
12
4
1
0.3 0.1449
0.1164
0.773
15
3
1
0.2 0.1265
0.0579
0.691
17
2
1
0.1 0.0949
0.0156
0.642
22
1
1
0.0
NA
NA
NA
sex=0, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
7
1
1
0
NA
NA
NA

sex=1, logWBC=0, RX=0


time n.risk n.event survival std.err lower 95% CI upper 95% CI
25
3
0
1
0
1
1
34
2
0
1
0
1
1
35
1
0
1
0
1
1
sex=1, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
23
1
1
0
NA
NA
NA
sex=1, logWBC=1, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
16
6
1
0.833
0.152
0.583
1
20
5
0
0.833
0.152
0.583
1
22
4
1
0.625
0.213
0.320
1
23
3
1
0.417
0.222
0.147
1
32
2
0
0.417
0.222
0.147
1
sex=1, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
4
1
0.75
0.217
0.4259
1
4
3
1
0.50
0.250
0.1877
1
5
2
1
0.25
0.217
0.0458
1
8
1
1
0.00
NA
NA
NA
sex=1, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
1
1
0
NA
NA
NA
sex=1, logWBC=2, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
6
2
0.667
0.192
0.3786
1.000
2
4
2
0.333
0.192
0.1075
1.000
3
2
1
0.167
0.152
0.0278
0.997
4
1
1
0.000
NA
NA
NA

Question (2) State the command line used to obtain (1) using the command window
> attach(Anderson)
> ABCD<-survfit(Surv(survival,status,type='right')~sex+logWBC+RX,data=Anderson)
> summary(ABCD)
> mAm<survfit(Surv(survival,status,type='right')~sex+logWBC+RX,data=Anderson,conf.type="log")
> summary(mAm)
> plot(ABCD)

Question (3) Repeat (1) but using other methods of finding the standard error. From the window options, state the other
estimates of the confidence interval.

*** Nonparametric Survival ***


Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,
data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "kaplan-meier", error = "greenwood", conf.type =
"log-log", conf.lower = "usual")
sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0

n.obs n.max n.first events mean se(mean) median


1
1
1
1 12.00
0.000
12.0
10
10
10
4 13.87
1.860
13.0
10
10
10
10 11.70
1.523
11.0
1
1
1
1 7.00
0.000
7.0
3
3
3
0 35.00
0.000
NA
1
1
1
1 23.00
0.000
23.0
6
6
6
3 25.38
2.621
23.0

sex=1, logWBC=1, RX=1


sex=1, logWBC=2, RX=0
sex=1, logWBC=2, RX=1
sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=2,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0
RX=1
RX=0
RX=1

4
1
6

4
1
6

4
1
6

4
1
6

4.50
6.00
2.17

1.250
0.000
0.436

4.5
6.0
2.0

0.95LCL 0.95UCL
NA
NA
6
NA
5
15
NA
NA
NA
NA
NA
NA
16
NA
1
NA
NA
NA
1
NA

Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,


data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "kaplan-meier", error = "greenwood", conf.type =
"log-log", conf.lower = "usual")
sex=0, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
12
1
1
0
NA
NA
NA

sex=0, logWBC=1, RX=0


time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
10
2
0.800
0.126
0.4087
0.946
9
7
0
0.800
0.126
0.4087
0.946
10
6
1
0.667
0.161
0.2717
0.881
11
4
0
0.667
0.161
0.2717
0.881
13
3
1
0.444
0.211
0.0779
0.773
17
2
0
0.444
0.211
0.0779
0.773
19
1
0
0.444
0.211
0.0779
0.773
sex=0, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
5
10
1
0.9 0.0949
0.47301
0.985
8
9
3
0.6 0.1549
0.25267
0.827
11
6
2
0.4 0.1549
0.12269
0.670
12
4
1
0.3 0.1449
0.07113
0.578
15
3
1
0.2 0.1265
0.03091
0.475
17
2
1
0.1 0.0949
0.00572
0.358
22
1
1
0.0
NA
NA
NA
sex=0, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
7
1
1
0
NA
NA
NA
sex=1, logWBC=0, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
25
3
0
1
0
1
1
34
2
0
1
0
1
1
35
1
0
1
0
1
1
sex=1, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
23
1
1
0
NA
NA
NA
sex=1, logWBC=1, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
16
6
1
0.833
0.152
0.273
0.975
20
5
0
0.833
0.152
0.273
0.975
22
4
1
0.625
0.213
0.142
0.893
23
3
1
0.417
0.222
0.056
0.767
32
2
0
0.417
0.222
0.056
0.767
sex=1, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
4
1
0.75
0.217
0.12795
0.961
4
3
1
0.50
0.250
0.05785
0.845
5
2
1
0.25
0.217
0.00895
0.665
8
1
1
0.00
NA
NA
NA
sex=1, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
1
1
0
NA
NA
NA
sex=1, logWBC=2, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
6
2
0.667
0.192
0.19462
0.904
2
4
2
0.333
0.192
0.04608
0.676
3
2
1
0.167
0.152
0.00772
0.517
4
1
1
0.000
NA
NA
NA

Question (4) Obtain the formulation used in S+


Surv(survival,status,type='right')~sex+logWBC+RX

Question (5) Obtain the Nelson-Aalen estimates of the survivor function and hence the 95% confidence interval. Describe
how it is done in S+.

*** Nonparametric Survival ***


Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,
data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "fleming-harrington", error = "greenwood", conf.type =
"log", conf.lower = "usual")

sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=2,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0
RX=1
RX=0
RX=1

n.obs n.max n.first events mean se(mean) median


1
1
1
1 12.00
0.000
12
10
10
10
4 14.33
2.017
13
10
10
10
10 12.51
1.912
11
1
1
1
1 7.00
0.000
7
3
3
3
0 35.00
0.000
NA
1
1
1
1 23.00
0.000
23
6
6
6
3 25.99
2.889
23
4
4
4
4 4.91
1.484
5
1
1
1
1 6.00
0.000
6
6
6
6
6 2.41
0.569
2

sex=0,
sex=0,
sex=0,
sex=0,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,
sex=1,

logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=0,
logWBC=0,
logWBC=1,
logWBC=1,
logWBC=2,
logWBC=2,

RX=1
RX=0
RX=1
RX=0
RX=0
RX=1
RX=0
RX=1
RX=0
RX=1

0.95LCL 0.95UCL
12
NA
10
NA
8
NA
7
NA
NA
NA
23
NA
22
NA
1
NA
6
NA
1
NA

Call: survfit(formula = Surv(survival, status, type = "right") ~ sex + logWBC + RX,


data = Anderson, na.action = na.exclude, conf.int = 0.95, se.fit =
TRUE, type = "fleming-harrington", error = "greenwood", conf.type =
"log", conf.lower = "usual")
sex=0, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
12
1
1
0.368
NA
0
1
sex=0, logWBC=1, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
10
2
0.819
0.129
0.601
1
9
7
0
0.819
0.129
0.601
1
10
6
1
0.693
0.167
0.432
1
11
4
0
0.693
0.167
0.432
1
13
3
1
0.497
0.236
0.196
1
17
2
0
0.497
0.236
0.196
1
19
1
0
0.497
0.236
0.196
1
sex=0, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
5
10
1
0.9048 0.0954
0.7359
1.000
8
9
3
0.6483 0.1674
0.3909
1.000
11
6
2
0.4646 0.1799
0.2175
0.992
12
4
1
0.3618 0.1748
0.1404
0.932
15
3
1
0.2592 0.1640
0.0751
0.895
17
2
1
0.1572 0.1492
0.0245
1.000
22
1
1
0.0578
NA
0.0000
1.000
sex=0, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
7
1
1
0.368
NA
0
1
sex=1, logWBC=0, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
25
3
0
1
0
1
1
34
2
0
1
0
1
1
35
1
0
1
0
1
1
sex=1, logWBC=0, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
23
1
1
0.368
NA
0
1

sex=1, logWBC=1, RX=0


time n.risk n.event survival std.err lower 95% CI upper 95% CI
16
6
1
0.846
0.155
0.592
1
20
5
0
0.846
0.155
0.592
1
22
4
1
0.659
0.225
0.338
1
23
3
1
0.472
0.251
0.166
1
32
2
0
0.472
0.251
0.166
1
sex=1, logWBC=1, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
4
1
0.779
0.225
0.442
1
4
3
1
0.558
0.279
0.209
1
5
2
1
0.338
0.293
0.062
1
8
1
1
0.125
NA
0.000
1
sex=1, logWBC=2, RX=0
time n.risk n.event survival std.err lower 95% CI upper 95% CI
6
1
1
0.368
NA
0
1
sex=1, logWBC=2, RX=1
time n.risk n.event survival std.err lower 95% CI upper 95% CI
1
6
2
0.717
0.207
0.407
1
2
4
2
0.435
0.251
0.140
1
3
2
1
0.264
0.241
0.044
1
4
1
1
0.097
NA
0.000
1