[R] when i create data.frame is time variable and Censor variable should be equal?

Marc Schwartz marc_schwartz at me.com
Tue Sep 21 18:02:22 CEST 2010


On Sep 21, 2010, at 10:50 AM, Halabi, Anan wrote:

> Error in data.frame(times = NonCensored.data, censor = Censored.data) : 
>  arguments imply differing number of rows: 14, 6


Yes.

There should be one row for each observation, with a time and an event status flag for each.

For typical right censored data, 'times' should be the time to the event of interest or the time to censoring.  The 'censor' column should be the event status indicator (normally called 'event' by default). Your use of 'censor' as a variable name may result in some confusion relative to how to code the variable.

See:

  require(survival)
  ?Surv

for more information.

HTH,

Marc Schwartz



More information about the R-help mailing list