Learn R Programming

ptable (version 1.0.0)

modify_cnt_ptable: Modify a ptable suitable for frequency count variables

Description

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.

Usage

modify_cnt_ptable(input, threshold = 0.2, seed = NULL)

Value

Returns an object of class ptable or a data.table.

Arguments

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

Author

Tobias Enderle, tobias.enderle@destatis.de

Details

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.

See Also

create_ptable()

Examples

Run this code
# Original ptable
ptab <- create_cnt_ptable(3, 1)

# modified ptable
ptab_mod <- modify_cnt_ptable(ptab, 0.3, seed = 5467)
ptab_mod@pTable

Run the code above in your browser using DataLab