inclprob {StratifiedSampling} | R Documentation |
Inclusion Probabilities
Description
Computes first-order inclusion probabilities from a vector of positive numbers.
Usage
inclprob(x, n)
Arguments
x |
vector of positive numbers. |
n |
sample size (could be a positive real value). |
Details
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.
Value
A vector of inclusion probabilities proportional to x
and such that the sum is equal to the value n
.
See Also
Examples
x <- runif(100)
pik <- inclprob(x,70)
sum(pik)
[Package StratifiedSampling version 0.4.2 Index]