modify_cnt_ptable: Modify a ptable suitable for frequency count variables

View source: R/modify_cnt_ptable.R

modify_cnt_ptableR Documentation

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)

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

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.

Value

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

Author(s)

Tobias Enderle, tobias.enderle@destatis.de

See Also

create_ptable()

Examples

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

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


tenderle/ptable documentation built on March 5, 2023, 3:35 a.m.