[R] controling the size of vectors in a matrix

From: raymond chiruka <rtchiruka_at_yahoo.com>
Date: Thu, 17 May 2007 02:22:04 -0700 (PDT)


hie R users    

  l have the following matrix

      n=20
      m<-matrix(nrow=n,ncol=4)
      colnames(m)=c("treatmentgrp","strata","survivalTime")                  
          for(i in 1:n) m[i,]<-c(sample(c(1,2),1,replace=TRUE),sample(c(1:2),1,replace=TRUE),rexp(1,0.07),rexp(1,0.02))                                                                  
   
      print(m)

    1.l would like to control the size of the treatment variable eg treatment 1=size 5 treatment 2=size 15.   

  2. l would also want to control the size of the strata ie in treatment 1 divide the strata in to 2 etc.   

  3. For the survival time l would like to have treatment 1-strata 1 using a different rate from treatment 2 -strata 2 etc to generate the survival time.   

  the program l used above does nt do this so if you can help   

  thanks           



Building a website is a piece of cake.

        [[alternative HTML version deleted]]



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 17 May 2007 - 09:29:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 May 2007 - 11:30:52 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.