Learn R Programming

BalancedSampling (version 2.0.6)

getPips: Inclusion probabilities proportional-to-size

Description

Computes the first-order inclusion probabilties from a vector of positive numbers, for a probabilitiy proportional-to-size design.

Usage

getPips(x, n)

Value

A vector of inclusion probabilities proportional-to-size

Arguments

x

A vector of positive numbers

n

The wanted sample size

Examples

Run this code
if (FALSE) {
set.seed(12345);
N = 1000;
n = 100;
x = matrix(runif(N * 2), ncol = 2);
prob = getPips(x[, 1], n);
s = lpm2(prob, x);
plot(x[, 1], x[, 2]);
points(x[s, 1], x[s, 2], pch = 19);
}

Run the code above in your browser using DataLab