Skip to contents

Generate vector of selection or inclusion probabilities

Usage

generateProbs(x, probType, verbose = FALSE)

Arguments

x

RDBES data object

probType

"selection" or "inclusion" for selection and inclusion probabilities respectively

verbose

(Optional) Set to TRUE if you want informative text printed out, or FALSE if you don't. The default is FALSE.

Value

A vector or probabilities

Details

When the selection method is SRSWR selection probabilities are calculated as \(1 / N\) and inclusion probabilities as \(1 - (1 - 1 / N)^n\). When the selection method is SRSWOR selection probabilities are not currently implemented. Inclusion probabilities are calculated as \(n/N\). When the selection method is CENSUS both types of probabilities are set to 1. Probabilities for selection methods UPSWR and UPSWOR are not calculated (they need to be supplied by the user). The same happens with regards to non-probabilistic methods

Examples

if (FALSE) { # \dontrun{
generateProbs(x = Pckg_SDAResources_agstrat_H1[["VS"]], probType = ("inclusion"))
# population size
a<-generateProbs(x = Pckg_SDAResources_agstrat_H1[["VS"]], probType = ("inclusion"))
sum(1/a$VSincProb)
# returns error
generateProbs(x = Pckg_SDAResources_agstrat_H1[["VS"]], probType = ("selection"))

} # }