IkRS: Sample Membership Indicator for Random Size sampling designs

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

View source: R/IkRS.r

Description

Creates a matrix of values (0, if the unit belongs to a specified sample and 1, otherwise) for every possible sample under random sample size designs without replacement

Usage

1
IkRS(N)

Arguments

N

Population size

Value

The function returns a matrix of 2^N rows and N columns. The kth column corresponds to the sample membership indicator, of the kth unit, to a possible sample.

Author(s)

Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com

References

Sarndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer.
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros. Editorial Universidad Santo Tomas.

See Also

SupportRS, Pik

Examples

1
2
3
4
5
6
7
# Vector U contains the label of a population of size N=5
U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
N <- length(U)
n <- 3
# The sample membership matrix for fixed size without replacement sampling designs
IkRS(N)
# The first sample is a null one and the last sample is a census

Example output

Loading required package: dplyr

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

Loading required package: magrittr
      [,1] [,2] [,3] [,4] [,5]
 [1,]    0    0    0    0    0
 [2,]    1    0    0    0    0
 [3,]    0    1    0    0    0
 [4,]    0    0    1    0    0
 [5,]    0    0    0    1    0
 [6,]    0    0    0    0    1
 [7,]    1    1    0    0    0
 [8,]    1    0    1    0    0
 [9,]    1    0    0    1    0
[10,]    1    0    0    0    1
[11,]    0    1    1    0    0
[12,]    0    1    0    1    0
[13,]    0    1    0    0    1
[14,]    0    0    1    1    0
[15,]    0    0    1    0    1
[16,]    0    0    0    1    1
[17,]    1    1    1    0    0
[18,]    1    1    0    1    0
[19,]    1    1    0    0    1
[20,]    1    0    1    1    0
[21,]    1    0    1    0    1
[22,]    1    0    0    1    1
[23,]    0    1    1    1    0
[24,]    0    1    1    0    1
[25,]    0    1    0    1    1
[26,]    0    0    1    1    1
[27,]    1    1    1    1    0
[28,]    1    1    1    0    1
[29,]    1    1    0    1    1
[30,]    1    0    1    1    1
[31,]    0    1    1    1    1
[32,]    1    1    1    1    1

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