[R] Survr error

Juan Ramon Gonzalez jrgonzalez at ico.scs.es
Fri Jan 17 20:47:02 CET 2003


Dear Jonathan,

This error appear when the number of censored time is not equal to different
identifier numbers. E.g. It is possible you have not censored times for all
subjects. In this case you have to add another data with the same identitier
time equal to 0 and censored 0. For example:

If you have

r1d[, 1]  r1d[, 5]  r1d[, 6]
1         23         1
1         34         1
1         2          0
2         67         1
2         23         0
3         17         1

and you execute:

Survr(r1d[, 1], r1d[, 5], r1d[, 6]) : 

It will to appear the error message: 
  "data doesn't match"
       

You have to modifie your data adding the line:

3     0     0


and you will have:

r1d[, 1]  r1d[, 5]  r1d[, 6]
1         23         1
1         34         1
1         2          0
2         67         1
2         23         0
3         17         1
3         0          0

then if you execute 

Survr(r1d[, 1], r1d[, 5], r1d[, 6]) 

with these data it works fine. 


I wrote the Survr in this way because the estimators (PSH, Wang-Chang, FRMLE)
take in to account the censored times and I wanted to force all subjects
(identifiers) had censored time.


Juan R Gonzalez




> I am trying to analyse recurrent failure times using survfitr
> from the survrec package. To do this, I need to "Create a survival 
> recurrent object" using Survr. But, when I do this, I get an error
> "Error in Survr(r1d[, 1], r1d[, 5], r1d[, 6]) : data doesn't match".
> 
> Here, r1d[,1] is the identifier for each case, r1d[,5] is the time
> of recurrence, r1d[,6] is the status indicator (1=event, 0=censored).
> All columns of of r1d are numeric.
> 
> I can create a Surv object using Surv(r1d[,5],r1d[,6]), which looks
> OK (censored values are followed by a '+'). So, the difficulty would
> seem to be with the 'id' argument of Survr. In my program, r1d[,1]
> is a simple numeric vector, which I have put into the data frame
> r1d.
> 
> I would be grateful fi anyone could let me know how to use Survr
> so that I can run survfitr.
> 
> Thanks,
> 
> Jonathan Williams
> 
> OPTIMA
> Radcliffe Infirmary
> Woodstock Road
> OXFORD OX2 6HE
> Tel +1865 (2)24356
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
>




More information about the R-help mailing list