Skip to content
Back to formatted view

Raw Message

Message-ID: <BC5C08B7.19C71%greenberg@ucdavis.edu>
Date: 2004-02-21T02:55:51Z
From: Jonathan Greenberg
Subject: Stratified random sampling in R?

Is there an easy way to do a stratified random sampling based on a factor
column in R?  E.g. I want to extract a random 10% of the data from dataset
for each class (so each class may have a different number of entries,
depending on its size).  On a related note, if this is easily doable, is
there an easy way to extract TWO non-overlapping strat. random samples
datasets (e.g. If I want to have a training and test dataset).  Thanks!

--j

-- 
Jonathan Greenberg
Graduate Group in Ecology, U.C. Davis
http://www.cstars.ucdavis.edu/~jongreen
http://www.cstars.ucdavis.edu
AIM: jgrn307 or jgrn3007
MSN: jgrn307 at msn.com or jgrn3007 at msn.com