when simulating survival data, you need to know or assume the distribution of the survival time. For example, in the following code, i assume t~exp(1), and the right censored at end of follow-up by 2 years.
I may develop more dists in my blog later on.
JingJu