Re: [R] create stratified splits

2012-12-19 Thread David Winsemius
On Dec 19, 2012, at 12:23 PM, Martin Batholdy wrote: > Hi, > > > I have a vector like: > > r <- runif(100) > > Now I would like to split r into 10 pieces (each with 10 elements) – > but the 'pieces' should be roughly similar with regard to mean and sd. > > what is an efficient way to do this

Re: [R] create stratified splits

2012-12-19 Thread Ista Zahn
Hi Martin, Interesting question. This is not efficient, but I thought I would post a brute force method that might be good enough. Surely someone will have a better approach... Well we'll see. Here is a dumb, inefficient (but workable) way: # create the vector to be split r <- runif(100) # write

[R] create stratified splits

2012-12-19 Thread Martin Batholdy
Hi, I have a vector like: r <- runif(100) Now I would like to split r into 10 pieces (each with 10 elements) – but the 'pieces' should be roughly similar with regard to mean and sd. what is an efficient way to do this in R? thanks! __ R-help@r-pro