Skip to contents

Generate individual keys in microdata

A function to create the key associated with each individual

build_individual_keys()
Generate individual record keys

Build a counting table and apply the CKM

Functions to build and apply the Cell Key Method, on a single table or a list of tables.

tabulate_cnt_micro_data()
Build contingency table with margins from microdata
apply_ckm()
Apply Cell Key Method to a contingency table
tabulate_and_apply_ckm()
Build table and apply Cell Key Method
tabulate_and_apply_ckm_list()
Build tables and apply Cell Key Method on a list

Risk-utility trade-off

A set of functions to help choose the parameters

assess_RU()
Measure risk and utility for a single scenario
assess_RUs()
Compare risk and utility across multiple scenarios
simulate_RUs()
Compare risk and utility across multiple scenarios with multiple simulations
assess_risk()
Measure risk by estimating inverse transition probabilities
get_deviation_set()
Calculate deviation set for a given original value
get_possibles_set()
Calculate possible set for a given perturbed value
compute_frequencies()
Calculate empirical frequencies from aggregated table
distance_hellinger()
Hellinger distance
mean_absolute_deviation()
Mean absolute deviations
mean_relative_absolute_deviation()
Mean relative absolute deviations in percentage

Compute confidence intervals

Functions providing confidence intervals for statistics built from perturbed counts.

estimate_beta()
Estimate minimal precision threshold \(\beta\) for given error level \(\alpha\)
estimate_beta_df()
Estimate Confidence Intervals for Ratios Using Beta Distribution

Build the transition matrix and prepare the perturbation table

Functions to retrieve the transition matrix and compare scenarios by visualizing the theoretical noise distribution.

create_transition_matrix()
Create Cell Key Method transition matrix
prepare_perturbation_table()
Create perturbation table from transition matrix
test_matrices()
Test transition matrix construction for different variance values
visualize_distribution()
Visualize probability distributions from multiple scenarios

Other functions

build_parameters_table()
Generate parameter combinations table
convert_desc_table_to_list()
Convert table description to variable lists
distance_euclid()
Euclidean distance
distance_manhattan()
Manhattan distance
estimate_proba_precision_statistic()
Estimate probability of ratio deviation
estimate_proba_precision_statistic_df()
Calculate P(|R-R'|>\(\beta\)), the probability of ratio deviation for a dataframe and given CKM parameter and for each \(\beta\) value.

Example data

Example dataset to test the package functions

dtest
Sample dataset for CKM package