SupportWR: Sampling Support for Fixed Size With Replacement Sampling...

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

View source: R/SupportWR.r

Description

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

Usage

1
SupportWR(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 support is defined as the set of samples such that, for any sample in the support, all the permutations of the coordinates of the sample are also in the support

Value

The function returns a matrix of binom(N+m-1)(m) rows and m columns. Each row of this matrix corresponds to a possible sample

Author(s)

Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com

References

Ortiz, J. E. (2009), Simulacion y metodos estadisticos. Editorial Universidad Santo Tomas.
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

Support

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Vector U contains the label of a population
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
N <- length(U)
m <- 2
# The support for fixed size without replacement sampling designs
# Under this context, there are ten (10) possibles samples
SupportWR(N, m)
# The same support, but labeled
SupportWR(N, m, 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
SupportWR(N, m, ID=y)

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