Skip to contents

Generate JPS sampling on the provided population.

Usage

jps_sample(pop, n, H, tau, K, replace = FALSE)

Arguments

pop

Population that will be sampled with an auxiliary parameter in the second column.

n

Sample size.

H

Set size for each raking group.

tau

A parameter which controls ranking quality.

K

Number of rankers.

replace

A boolean which specifies whether to sample with replacement or not.

Value

A matrix with ranks from each ranker.

Examples

set.seed(112)
population_size <- 600
# the number of samples to be ranked in each set
H <- 3

with_replacement <- FALSE
sigma <- 4
mu <- 10
n_rankers <- 3
# sample size
n <- 10

rhos <- rep(0.75, n_rankers)
taus <- sigma * sqrt(1 / rhos^2 - 1)

population <- qnorm((1:population_size) / (population_size + 1), mu, sigma)
jps_sample(population, n, H, taus, n_rankers, with_replacement)
#>               Y R1 R2 R3
#>  [1,]  6.384461  1  2  2
#>  [2,]  1.485141  1  1  1
#>  [3,] 13.640711  2  3  2
#>  [4,] 15.809136  3  3  2
#>  [5,]  6.769463  2  2  1
#>  [6,] 14.355524  3  3  3
#>  [7,] 10.729740  2  1  3
#>  [8,]  6.152453  1  1  1
#>  [9,]  8.701285  2  1  2
#> [10,] 13.323884  3  3  3
#>               Y R1 R2 R3
#>  [1,]  6.384461  1  2  2
#>  [2,]  1.485141  1  1  1
#>  [3,] 13.640711  2  3  2
#>  [4,] 15.809136  3  3  2
#>  [5,]  6.769463  2  2  1
#>  [6,] 14.355524  3  3  3
#>  [7,] 10.729740  2  1  3
#>  [8,]  6.152453  1  1  1
#>  [9,]  8.701285  2  1  2
#> [10,] 13.323884  3  3  3