Dear R users.
I am trying to program the comp() routine in package survMisc.
I am reading the data below with d=read.table( "C:\\. .
.",fill=TRUE,header=TRUE)
Then I load the packages 'survival' and 'survMisc',
library(survival),
library(survMisc)
and I run the commands
s=survfit(Surv(d[,2], d[,3])~d[,1],
data=d)
comp(s)
and I am getting the error
Error in get(t1, loc1) : object 'd[,
2]' not found
If instead I use the commands
s=survfit(Surv(T, Status)~Group,
data=d)
comp(s)
routine comp() runs perfectly. However when I am programing I can't see a
way to know
in advance the variable names in order to use them.
Can anybody give me a suggestion?
Thanks in advance
Endy
NB. The data must be stacked in three (3) columns before red.
They are repeated in nine (9) columns for space saving.
Group T Status Group T Status Group T Status
1 2081 0 1 55 1 2 414 1
1 1602 0 1 1 1 2 2204 1
1 1496 0 1 107 1 2 1063 1
1 1462 0 1 110 1 2 481 1
1 1433 0 1 332 1 2 105 1
1 1377 0 2 2569 0 2 641 1
1 1330 0 2 2506 0 2 390 1
1 996 0 2 2409 0 2 288 1
1 226 0 2 2218 0 2 421 1
1 1199 0 2 1857 0 2 79 1
1 1111 0 2 1829 0 2 748 1
1 530 0 2 1562 0 2 486 1
1 1182 0 2 1470 0 2 48 1
1 1167 0 2 1363 0 2 272 1
1 418 1 2 1030 0 2 1074 1
1 383 1 2 860 0 2 381 1
1 276 1 2 1258 0 2 10 1
1 104 1 2 2246 0 2 53 1
1 609 1 2 1870 0 2 80 1
1 172 1 2 1799 0 2 35 1
1 487 1 2 1709 0 2 248 1
1 662 1 2 1674 0 2 704 1
1 194 1 2 1568 0 2 211 1
1 230 1 2 1527 0 2 219 1
1 526 1 2 1324 0 2 606 1
1 122 1 2 957 0
1 129 1 2 932 0
1 74 1 2 847 0
1 122 1 2 848 0
1 86 1 2 1850 0
1 466 1 2 1843 0
1 192 1 2 1535 0
1 109 1 2 1447 0
1 55 1 2 1384 0
[[alternative HTML version deleted]]