[R] survival analysis question

Medic r-@ub@cribe @ending from m@il@ru
Wed Oct 31 16:34:40 CET 2018


When I run the code from the book Kleinbaum "Survival analysis" (7. Running an extended cox model. Page 646) I got an ERROR. What do you think is the reason? I attach a file with few lines of dataset "addicts-dput.r".
> library(cmprsk)
> addicts = read.csv ("addicts.csv") 
   id clinic status survt prison dose
1  1      1      1   428      0   50
2  2      1      1   275      1   55
3  3      1      1   262      0   55
4  4      1      1   183      0   30
5  5      1      1   259      1   65
6  6      1      1   714      0   55
7  7      1      1   438      1   65
8  8      1      0   796      1   60
9  9      1      1   892      0   50
> addicts.cp=survSplit(addicts, cut=addicts$survt[addicts$status==1], end="survt", event="status",start="start", id="id")
ERROR in survSplit(addicts, cut = addicts$survt[addicts$status == 1],: the suggested id name is already present.





More information about the R-help mailing list