Hi everyone,
I am currently attempting to simulate some survival data, based on a Weibull
model. I basically need to simulate some survival data
so that I can then test out a program I'm writing, before applying it to
some real data.
I've managed to create failure time data, using the rweibull function. I.e.
Y[i] <- rweibull(1, shape, scale)
For a variety of shape and scale parameters etc.
I wish to add in right censoring. If I am considering my failure times as
deaths, and the censoring time
as a study cut-off date (for example, 5 years from baseline), would it be
correct to do something like,
for(i in 1:nSubjects){
if (Y[i] > 5){
Y[i] <- 5}
else
{Y[i] <- Y[i]
}}
I guess my question is, is it statistically sound to impose the right censoring
after estimating the distribution with no censoring?
I am leaning towards yes, because in an ideal world where we followed all
participants until they died, the
distribution would be as estimated by the rweibull above....and assuming that
the right censoring is independent,
then cutting of the measurements at a pre-specified time wouldn't affect the
outcome at all. But I guess I am
just looking for a second opinion?
Thanks in advance, this list has been immensely helpful with some previous
questions I have had about
the survival package.
Lucy
[[alternative HTML version deleted]]