powered by
Computes first-order inclusion probabilities from a vector of positive numbers.
inclprob(x, n)
A vector of inclusion probabilities proportional to x and such that the sum is equal to the value n.
x
n
vector of positive numbers.
sample size (could be a positive real value).
Raphael Jauslin raphael.jauslin@unine.ch
The function is implemented in C++ so that it can be used in the code of other C++ functions. The implementation is based on the function inclusionprobabilities of the package sampling.
inclusionprobabilities
x <- runif(100) pik <- inclprob(x,70) sum(pik)
Run the code above in your browser using DataLab