
A few months ago, I posted a query regarding code for a sample size
estimate for a one arm survival trial.  Below is some code I created to
calculate such an estimate - perhaps it may be of some use.



#cox.pow computes sample size for a one arm survival trial.  med.0 is
the null median

#survival, med.a is the alternative median survival, a.time is the
accrual time, and

#f.time is the follow up (assumes constant accrual and two sided test).
Approach taken

#from Lawless 1982, p. 108



cox.pow<-function(med.0,med.a,a.time,f.time,alpha,beta) {

   #initialize number of events to 0

   r<-0

   #find necessary number of events

   while (qchisq((1-alpha/2),(2*r+1))*(med.0/med.a) >=
qchisq(beta,(2*r+1)) ) {r<-r+1}

   #find proportion of patients that will experience event for given
median survivals,

   #accrual and follow up times (formula from Cox 1983)

   p <- 1 - (exp(-0.69*f.time/med.a)*(1 -
exp(-0.69*a.time/med.a))/(0.69*a.time/med.a))

   #sample size is r/p

   n<-round(r/p,0)

   return(n)

}



#compute necessary sample size for alternative median 9.3 vs. null
median 6.3 with 20

#months accrual and 4 months follow up

cox.pow(6.3,9.3,20,4,.05,.2)



Regards,

   -Cody



Cody Hamilton, Ph.D

Institute for Health Care Research and Improvement

Baylor Health Care System





This e-mail, facsimile, or letter and any files or attachmen...{{dropped}}

