data(eusilcP)
pop <- eusilcP
colnames(pop)[3] <- "hhsize"
system.time(x1 <- sampHH(pop, strata="region", hsize="hhsize"))
dim(x1)
if (FALSE) {
## approx. 10 second computation time ...
system.time(x1 <- sampHH(pop, sizefactor=4, strata="region", hsize="hhsize"))
dim(x1)
system.time(x2 <- sampHH(pop, strata=NULL, hsize="hhsize"))
pop <- pop[,-which(colnames(pop)=="hhsize")]
system.time(y1 <- sampHH(pop, strata="region", hsize=NULL))
system.time(y2 <- sampHH(pop, strata=NULL, hsize=NULL))
}
Run the code above in your browser using DataLab