View source: R/modify_cnt_ptable.R
modify_cnt_ptable | R Documentation |
modify_cnt_ptable()
is a function to modify the standard
ptable for count variables that is generated by create_cnt_ptable()
or
within the 'cellKey'-package. The noise intervals in
the standard ptable are ordered from -D to D. A modified ptable still has
the same properties as the standard ptable but can ensure a higher
protection of perturbed frequency tables since the noise probabilities are
split and the intervals are rearranged.
modify_cnt_ptable(input, threshold = 0.2, seed = NULL)
input |
The ptable-object of class 'ptable', 'ck_params' or data.table |
threshold |
The maximum width of the intervals after modification |
seed |
A seed for the rearrangement of the split intervals |
In a first step, the noise probabilities larger than a threshold value will be split. Then, the split noise probabilities are randomly rearranged using a seed (the modifications is replicable). Finally, the intervals of the ptable will be adjusted.
Returns an object of class ptable or a data.table.
Tobias Enderle, tobias.enderle@destatis.de
create_ptable()
# Original ptable ptab <- create_cnt_ptable(3, 1) # modified ptable ptab_mod <- modify_cnt_ptable(ptab, 0.3, seed = 5467) ptab_mod@pTable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.