Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to reproduce a paper on two stage randomized clinical trials. In these clinical trials, a patient is randomized to either of the maintenance therapies $B_1$ or $B_2$ upon their remission after getting the induction therapy $A_1$. The remission probability is taken to be 0.80 and the 2nd stage randomization probability (to treatment $B$) is taken to be 0.50. They have generated survival times $(t)$ for patients getting induction therapy $A_1$ by calculating the following quantities.

#Generating remission status:

#Generating t0 from exponential with mean 182.5 days:
for(i in 1:n){

#Generating tr from exponential with mean 365 days:
for(i in 1:n){

#Generating B treatment indicator:

#Generating t1 from exponential with mean 365 days:
for(i in 1:n){

#Generating t2 from exponential with mean 547.5 days:
for(i in 1:n){

#Generating survival time t(i):
for(i in 1:n){

Now, I can't understand how do I calculate the population survival probability for treatment policy $A_1B_1$. Say, the assessing time is 700. I think I need to calculate the mean/rate from the sum of two Exponentials $tr$ and $t1$ by incorporating the probability of remission and the probability of second randomization. But I am not getting properly how to do it. For your convenience you can see this link.

share|improve this question
up vote 1 down vote accepted

Just to make sure that I have (at last!) myself got the answer, I am writing it down.

For policy $A_1B_1$ the survival time can be obtained as:


We find $t(i)$ for a large number of times, say, 100,000 times or even more to get the population survival probability as follows:

$\frac{\sum I(t(i)>\text{assessing time})}{100,000}$

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.