OrderWR {TeachingSampling}R Documentation

Pseudo-Support for Fixed Size With Replacement Sampling Designs

Description

Creates a matrix containing every possible sample under fixed sample size with relacement designs

Usage

OrderWR(N,m,ID=FALSE)

Arguments

N Population size
m Sample size
ID By default FALSE, a vector of values (numeric or string) identifying each unit in the population

Details

A pseudo-support is defined as the set of samples such that for any sample in the pseudo-support, all the permutations of the coordinates of the sample are also in the support.

Value

The function returns a matrix of N^m rows and m columns. Each row of this matrix corresponds to a possible sample

Author(s)

Hugo Andrés Gutiérrez Rojas hugogutierrez@usantotomas.edu.co. The author acknowledges to Hanwen Zhang hanwenzhang@usantotomas.edu.co for valuable suggestions.

References

Tillé, Y. (2006), Sampling Algorithms. Springer
Gutiérrez, H. A. (2009), Estrategias de muestreo: Diseñono de encuestas y estimación de parámetros. Editorial Universidad Santo Tomás

See Also

Support

Examples

# Vector U contains the label of a population
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
N <- length(U)
# The support for fixed size with replacement sampling designs
# Under this context, there are five (5) possibles samples
OrderWR(N,1)
# The same support, but labeled
OrderWR(N,1,ID=U)
# y is the variable of interest
y<-c(32,34,46,89,35)
# The following output is very useful when checking
# the design-unbiasedness of an estimator
OrderWR(N,1,ID=y)

# If the smaple size is m=2, then there are (25) possibles samples
OrderWR(N,2)
# The same support, but labeled
OrderWR(N,2,ID=U)
# y is the variable of interest
y<-c(32,34,46,89,35)
# The following output is very useful when checking
# the design-unbiasedness of an estimator
OrderWR(N,2,ID=y)

# Note that the sample size is not always less than the population size
# if m=4 and N=4
OrderWR(4,4)
# if m=4 and N=2
OrderWR(4,2)
# if m=10 and N=2
OrderWR(2,10)

[Package TeachingSampling version 1.1.9 Index]