I would like to program a for-loop to calculate a set of survdiff objects
and store these results in another Splus object, like a
vector/matrix/dataframe.
For example:
survdiff.collection <- rep(NA,20)
rho.value <- rep(NA,20)
for(i in 1:21){
rho.value[i] <- 1-.1*(i-1)
survdiff.collection[i] <- survdiff(Surv(Time.of.Death,Event.Status)
~Dose.Group,data=Data.Frame,rho=rho.value[i])
}
This naive approach doesn't work because the members of the vector
survdiff.collection
cannot handle the structured objects that survdiff( ) generates.
Is there a way to create a vector/matrix/dataframe capable of storing
objects of
class="survdiff"?
David Paul, Ph.D.
Battelle Memorial Institute
505 King Avenue
Columbus, OH 43201
614.424.3176
|