- Rのpackage は "survival"
- 解説PDFはこちら
- このページの末尾のようなテキストファイル"survivalData.txt"(WeeksToOnset(発病までの期間、もしくは、censoring time(打ち切り時間)と、1個のSNPのディプロタイプと別の0/1変数)
- こう実行
library(survival)
data<-read.table(file="survivalData.txt")
coxout<-coxph(Surv(WeeksToOnset, Disease) ~ varX+SNP,data=data)
summary(coxout)
plot(survfit(coxout), xlab="Onset", ylab="Proportion Not Developed TC")
Call:
coxph(formula = Surv(WeeksToOnset, Disease) ~ varX + SNP, data = data)
n= 68
coef exp(coef) se(coef) z Pr(>|z|)
varX 0.2952 1.3434 0.3229 0.914 0.361
SNP 3.5372 34.3709 0.6046 5.851 4.9e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
exp(coef) exp(-coef) lower .95 upper .95
varX 1.343 0.74437 0.7134 2.53
SNP 34.371 0.02909 10.5091 112.41
Rsquare= 0.564 (max possible= 0.982 )
Likelihood ratio test= 56.5 on 2 df, p=5.392e-13
Wald test = 34.29 on 2 df, p=3.590e-08
Score (logrank) test = 48.87 on 2 df, p=2.448e-11
WeeksToOnset Disease varX SNP
1 9 0 1 1
2 3 0 1 1
3 7 0 0 0
4 5 0 1 1
5 3 0 1 1
6 12 0 1 1
7 11 0 0 2
8 10 0 0 0
9 8 0 1 0
10 11 0 0 1
11 7 0 1 2
12 9 0 1 1
13 9 0 0 1
14 3 0 1 1
15 8 0 1 1
16 7 0 1 1
17 4 0 1 1
18 8 0 1 1
19 7 0 1 0
20 11 0 0 0
21 11 0 1 1
22 11 0 1 0
23 4 0 1 0
24 5 0 1 1
25 7 1 1 2
26 12 1 1 1
27 14 1 1 1
28 7 1 1 2
29 1 1 0 2
30 14 1 0 1
31 5 1 1 2
32 12 1 0 1
33 18 1 1 1
34 12 1 1 1
35 10 1 1 1
36 2 1 0 2
37 13 1 1 1
38 18 1 1 1
39 4 1 1 2
40 0 1 0 2
41 4 1 1 2
42 1 1 1 2
43 18 1 1 1
44 6 1 0 2
45 8 1 1 2
46 11 1 1 1
47 8 1 0 2
48 15 1 0 1
49 1 1 1 2
50 6 1 1 2
51 11 1 1 1
52 5 1 1 2
53 7 1 0 2
54 11 1 0 1
55 2 1 1 2
56 14 1 0 1
57 15 1 1 1
58 18 1 0 1
59 15 1 0 1
60 2 1 0 2
61 7 1 0 2
62 16 1 0 1
63 17 1 1 1
64 14 1 1 1
65 18 1 1 1
66 6 1 0 2
67 19 1 0 1
68 6 1 0 2