OrderWR: Pseudo-Support for Fixed Size With Replacement Sampling...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/OrderWR.r

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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)

TeachingSampling documentation built on April 22, 2020, 1:05 a.m.