Re: [R] How to create strata out of the data.frame table

From: hadley wickham <>
Date: Wed, 18 Jun 2008 09:50:15 -0500

On Wed, Jun 18, 2008 at 9:20 AM, Ana Kolar <> wrote:
> My data.frame table consist of 3 variables (x,y and z) where each variable
> has 1000 units. I need to create 5 equal size strata according to one of the
> variable (let's say x) whereas units of x variable with a higher value have
> higher probability to be selected in a strata with a higher number (max
> strata number is 5).

Could you be a little more precise about the desired distribution within the slices? For example, one way to solve your problem as specified would be to sort the data frame by x, and chop the data frame into five equal pieces. Would that be a valid solution to your problem?



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 18 Jun 2008 - 18:10:38 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 Wed 18 Jun 2008 - 18:30:50 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive