OrderWR {TeachingSampling}R Documentation

Pseudo-Support for Fixed Size With Replacement Sampling Designs

Description

Creates a matrix containing every possible ordered sample under fixed sample size with replacement 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

The number of samples in a with replacement support is not equal to the number of ordered samples induced by a with replacement sampling design.

Value

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

Author(s)

Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com. The author acknowledges to Hanwen Zhang for valuable suggestions.

References

Tille, Y. (2006), Sampling Algorithms. Springer
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas

See Also

SupportWR, Support

Examples

# Vector U contains the label of a population
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
N <- length(U)
# Under this context, there are five (5) possible ordered samples
OrderWR(N,1)
# The same output, but labeled
OrderWR(N,1,ID=U)
# y is the variable of interest
y<-c(32,34,46,89,35)
OrderWR(N,1,ID=y)

# If the smaple size is m=2, there are (25) possible ordered samples
OrderWR(N,2)
# The same output, but labeled
OrderWR(N,2,ID=U)
# y is the variable of interest
y<-c(32,34,46,89,35)
OrderWR(N,2,ID=y)

# Note that the number of ordered samples is not equal to the number of 
# samples in a well defined with-replacement support 
OrderWR(N,2)
SupportWR(N,2)

OrderWR(N,4)
SupportWR(N,4)

[Package TeachingSampling version 4.1.1 Index]