Displaying 1 result from an estimated 1 matches for "weekday_strata2".
Did you mean:
weekday_strata1
2011 Feb 17
0
Data frame sampling
..._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_STRATA2 <- WEEKDAY_STRATA1[as.vector(t(M)),]
WEEKDAY_STRATA3 <- do.call("rbind", lapply(split(WEEKDAY_STRATA2, WEEKDAY_STRATA2$WEEK), function(x) x[sample(nrow(x), 2, replace=FALSE),]))
WEEKDAY_STRATA3
### I only included the first three weeks for obvious reasons
WEEKDAY_STRATA <-
st...