Displaying 2 results from an estimated 2 matches for "strata_num".
2011 Feb 10
1
Conditional sampling
R experts,
I need to sample two rows without replacement from the following data frame such that
neither row contains the same 'DOW'. For example, I cannot select both a Monday morning
and a Monday afternoon. I am using STRATA_NUM as an index to randomly select rows from,
since this variable indexes all unique permutations of DOW, SITE, and TOD. I know how to
use the sample function to select rows, I just don't know how to sample with a constraint.
This seems simple, but I can't seem to find a simple solution. Any...
2011 Feb 17
0
Data frame sampling
...ne the rows
into a new smaller data frame while meeting several criteria. I would greatly appreciate any advice
that could help me get started down the right path. What I want to do is to extract two rows WEEK
(26 weeks total) from the data frame by sampling without replacement from the variable STRATA_NUM (1:40)
and using this output to index the data frame and extract rows, moving from one week to the next. I
created STRATA_NUM to use as an index to identify unique sampling frame strata (e.g. unique DOW, SITE,
and TOD permutations---40 total). This would result in the entire STRATA_NUM vector be...