1 | getSampleDesign(sampleWeights, sampleStrata)
|
sampleWeights |
|
sampleStrata |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (sampleWeights, sampleStrata)
{
minmax <- sapply(split(sampleWeights, sampleStrata), range)
constantWeights <- all(minmax[1, ] == minmax[2, ])
nStrata <- length(levels(sampleStrata[, drop = TRUE]))
if (constantWeights) {
type <- ifelse(nStrata == 1, "SI", "STSI")
getVarTotal <- getSampleVarTotalSTSI
}
else {
type <- ""
getVarTotal <- getSampleVarTotalPPS
}
sampleDesign <- list(type = type, weights = sampleWeights,
strata = sampleStrata, getVarTotal = getVarTotal)
return(sampleDesign)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.