[R] R error using Survr function with gcmrec

Emily lia.bedelia at gmail.com
Thu Nov 11 20:09:00 CET 2010


I'm having the same problem and was wondering whether you ever found a
solution? It gives me the error "Error in Survr(id, time, event) : Data
doesn't match. Every subject must have a censored time" even though all my
subjects are right-censored, and to be sure, I've even used the addCenTime
function. Any input appreciated!

Here's my sample data:

id=c(rep(1,4),rep(2,4),rep(3,4),rep(4,5))

start=c("1996-01-01","1997-01-01","1998-01-01","1998-03-15","1996-01-01","1996-04-15","1997-01-01","1998-01-01","1996-01-01","1997-01-01","1998-01-01","1998-09-30","1996-01-01","1997-01-01","1997-12-15","1998-01-01","1998-06-14")

stop=c("1997-01-01","1998-01-01","1998-03-15","1999-01-01","1996-04-15","1997-01-01","1998-01-01","1999-01-01","1997-01-01","1998-01-01","1998-09-30","1999-01-01","1997-01-01","1997-12-15","1998-01-01","1998-06-14","1999-01-01")

time=c(366,365,73,292,105,261,365,365,366,365,272,93,366,348,17,164,201)

event=c(0,0,1,0,1,0,0,0,0,0,1,0,0,1,0,1,0)

enum=c(rep(seq(1,4,1),4),5)

var=c(21312,21869,22441,22441,3105,3105,3086,3075,130610,133147,135692,135692,11686,11976,11976,12251,12251)

data=data.frame(id,start,stop,time,event,enum,var)

dataOK=addCenTime(data)
m<-gcmrec(Survr(id,time,event)~var, data=dataOK)
-- 
View this message in context: http://r.789695.n4.nabble.com/R-error-using-Survr-function-with-gcmrec-tp858931p3038374.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list