sampleDonor_cpp {sdcMicro} | R Documentation |
Random sample for donor records
Description
Randomly select donor records given a probability weight vector. This sampling procedure is implemented differently than randSample_cpp
to speed up performance of C++-function recordSwap()
.
NOTE: This is an internal function used for testing the C++-function sampleDonor
which is used inside the C++-function recordSwap()
.
Usage
sampleDonor_cpp(
data,
similar_cpp,
hid,
IDswap,
IDswap_pool_vec,
prob,
seed = 123456L
)
Arguments
data |
micro data containing the hierarchy levels and household ID |
similar_cpp |
List where each entry corresponds to column indices of variables in |
hid |
column index in |
IDswap |
vector containing records for which a donor needs to be sampled |
IDswap_pool_vec |
set from which 'IDswap' was drawn |
prob |
a vector of probability weights for obtaining the elements of the vector being sampled. |
seed |
integer setting the sampling seed |