[R] creating columns

2007-05-17 Thread raymond chiruka
l would like to create the following matrice
  
  treatmentgrpstrata
   11  11  11  12   
   12  12  21  21  21   
   22  22  22   l should be able to choose the 
size of the treatment grps and stratas the method l used intially creates the 
matrice randomly
  
n=20
  
m - cbind( treatmentgrp  = sample( 1:2,n, replace=T ),
  
  strata= sample( 1:2, n, replace=T ),
  
  survivalTime  = rexp( n, rate=0.07 ),
  
  somethingElse = rexp( n, rate=0.02 ) 
   
thanks
  
  
   
-
Give spam the boot. Take control with tough spam protection

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] creating columns

2007-05-17 Thread Adaikalavan Ramasamy
See my response to your thread  controling the size of vectors in a 
matrix. Please do not create multiple threads on the same day asking 
basically the same question, especially if you cannot substantially 
improve the clarity and quality of the post.

Multiple threads asking the same question badly within the span of few 
hours leads to people missing out on other people's response and thereby 
essentially wasting their time.



raymond chiruka wrote:
 l would like to create the following matrice
   
   treatmentgrpstrata
11  11  11  12 
  12  12  21  21  21   
22  22  22   l should be able to 
 choose the size of the treatment grps and stratas the method l used intially 
 creates the matrice randomly
   
 n=20
   
 m - cbind( treatmentgrp  = sample( 1:2,n, replace=T ),
   
   strata= sample( 1:2, n, replace=T ),
   
   survivalTime  = rexp( n, rate=0.07 ),
   
   somethingElse = rexp( n, rate=0.02 ) 

 thanks
   
   

 -
 Give spam the boot. Take control with tough spam protection
 
   [[alternative HTML version deleted]]
 
 __
 R-help@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.
 
 


__
R-help@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.