search for: weekday_strata1

Displaying 1 result from an estimated 1 matches for "weekday_strata1".

2011 Feb 17
0
Data frame sampling
...en coverage of all 40 unique spatiotemporal strata in my final data frame. Thank you, Mike ### The following code extracts two rows per week randomly without replacement and ensures that no two ### DOW are duplicated per week, but fails to incorporate even coverage of strata. set.seed(3000) WEEKDAY_STRATA1 <- do.call("rbind", lapply(split(WEEKDAY_STRATA, WEEKDAY_STRATA$WEEK), function(x) x[sample(nrow(x), 10, replace=FALSE),])) l <- do.call("rbind", lapply(split(WEEKDAY_STRATA1,WEEKDAY_STRATA1$WEEK),function(y)!duplicated(y[,1]))) M <- as.matrix(l,byrow = FALSE) WEEKDAY_...