Re: [R] survival analysis question

2018-10-31 Thread rsubscribe . via R-help
Thank You,Eric. I run this code without id="id" and it worked! Eric Berger :    Medic via  R - help  < r - help @ r -project.org > wrote: addicts.cp=survSplit(addicts, cut=addicts$survt[addicts$status==1], > end="survt", event="status",start="start", id="id") >ERROR in survSplit(addicts, cut

Re: [R] survival analysis question

2018-10-31 Thread Eric Berger
You need to read the Help page for the function survSplit ?survSplit states that the id argument is a "character string with the name of new id variable to create (optional). This can be useful if the data set does not already contain an identifier" The addicts data.frame has as its first column

[R] survival analysis question

2018-10-31 Thread Medic via R-help
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 su