Displaying 1 result from an estimated 1 matches for "resamples10".
Did you mean:
resamples
2013 Jan 18
0
repeat resampling with different subsample sizes
...t;- c("counts", "depths")
dat <- as.data.frame(dat)
### Easy code to resample 999 times 10 "counts" from dat
require(MASS)
# Makes sums and var based on 999 resampled counts and stores results in a
matrix
# with sums and vars in 999 rows and 2 columns - THIS WORKS
resamples10 <- lapply(1:999, function(i) sample(dat$counts, 10, replace=T))
r10.stat <- cbind(sapply(resamples10, sum), sapply(resamples10, var),
sapply(resamples10, mean))
colnames(r10.stat) <- c("r10.sum", "r10.var", "r10.mean")
### NEED to generalize this for differen...