distributeDraws_cpp | R Documentation |
Distribute number of swaps across lowest hierarchy level according to a predefined swaprate
. The swaprate is applied such that a single swap counts as swapping 2 households.
Number of swaps are randomly rounded up or down, if needed, such that the total number of swaps is in coherence with the swaprate.
NOTE: This is an internal function used for testing the C++-function distributeDraws
which is used inside the C++-function recordSwap()
.
distributeDraws_cpp(data, hierarchy, hid, swaprate, seed = 123456L)
data |
micro data containing the hierarchy levels and household ID |
hierarchy |
column indices of variables in |
hid |
column index in |
swaprate |
double between 0 and 1 defining the proportion of households which should be swapped, see details for more explanations |
seed |
integer setting the sampling seed |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.