This question appears to be off-topic because it focuses on programming, debugging, or performing routine operations, or it asks about obtaining datasets. You could try the support links we maintain or the Open Data site instead.
If you are asking about how to debug some code or carry out a task in a programming language, this is not an on-topic question. If you’re asking about how to obtain data, that is not an on-topic question. If you feel your question is truly about statistics as described in the help center, please [edit] to clarify.
Closed yesterday.
I have a dataset with both right and left censored data. I want to parameterize it with survival models in R statistical software. Specifically, I want to use is NADA package especially developed for correct processing censored data. When I try to create a survival object with a command Cen, the main parameters are vector obj of numerical values and vector censored of logical values (censored or not). This is not enough if I want to distinguish between left and right censoring.
I tried to make vector censored of values -1, 0, +1 but with no success. Also there is a single type parameter which specifies type of censoring (“right”, “left”, “counting”, “interval”, or “interval2”). Probably, I need to use type = interval (or interval2), but cannot figure out how to use it together with other parameters. By logic, in this the input vectors should be interval limits, but this doesn’t work for me.
With the Surv object of the survival package it is possible to do. I can create it with two vectors (left and right interval limits) and type = interval2: Surv.Obj <- Surv(My.DF$dist1, My.DF$dist2, type = ‘interval2’). For the left censored data the left limit should be NA, for the right censored data – the right limit should be NA, for the exact data (we know the moment of an event) the limits coincide. But this approach doesn’t work with NADA (every time I get error message).
Alternatively, I’d like to being able to use Surv object (created bu survival package) in NADA package, but when I try to fit a model (cenfit command), I also get an error.
Please help me to understand how to create a Cen object in NADA package with both left and reght censored data.