setLevels_cpp function

Define Swap-Levels

Define Swap-Levels

Define hierarchy levels over which record needs to be swapped according to risk variables.

NOTE: This is an internal function used for testing the C++-function setLevels() which is applied inside recordSwap().

setLevels_cpp(risk, risk_threshold)

Arguments

  • risk: vector of vectors containing risks of each individual in each hierarchy level. risk[0] returns the vector of risks for the first unit over all hierarchy levels. risk[1] the vector if risks for all hierarchy level of unit 2, and so on.
  • risk_threshold: double defining the risk threshold beyond which a record/household needs to be swapped. This is understood as risk>=risk_threshhold.

Returns

Integer vector with hierarchy level over which record needs to be swapped with.