Re: [R] randomly sample within clustered data?

2008-09-15 Thread Brown, Tony Nicholas
Thierry, Thanks so much. Your solution works perfectly. Tony -Original Message- From: ONKELINX, Thierry [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2008 2:56 AM To: Brown, Tony Nicholas; r-help@r-project.org Subject: RE: [R] randomly sample within clustered data? Something

Re: [R] randomly sample within clustered data?

2008-09-15 Thread ONKELINX, Thierry
:40 Aan: r-help@r-project.org Onderwerp: [R] randomly sample within clustered data? Dear useRs, What is an efficient way to randomly sample from clustered data such that I get equal representation from each cluster? For example, let's say I want to randomly sample two cases from each cluster

[R] randomly sample within clustered data?

2008-09-15 Thread Brown, Tony Nicholas
Dear useRs, What is an efficient way to randomly sample from clustered data such that I get equal representation from each cluster? For example, let's say I want to randomly sample two cases from each cluster created by the "id" variable in the following data frame: > id<-c(rep("100", 4),re