getSampleDesign:

Usage Arguments Examples

Usage

1
getSampleDesign(sampleWeights, sampleStrata)

Arguments

sampleWeights
sampleStrata

Examples

 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)
  }

BERENZ/RISQ documentation built on May 5, 2019, 10:25 a.m.