Skip to contents

Runs the same attack machinery three times on the same data, each time restricted to what that knowledge level allows the attacker to see, and reports the resulting risk side by side. This is the form the knowledge model is meant to be read in: a single number for "the" reidentification rate is only interpretable once the assumed adversary is stated.

Usage

reid_knowledge_curve(
  dat_raw_anon,
  quasi_identifiers,
  behavior = NULL,
  identifiers = NULL,
  weak_subset = NULL,
  levels = c("W", "M", "S"),
  row_number = "ROW_NUMBER",
  seeds = 1:20,
  ...
)

Arguments

dat_raw_anon

dataframe of raw_anon form

quasi_identifiers, behavior, identifiers, weak_subset

passed to [attacker_knowledge()]

levels

which knowledge levels to evaluate (default all three, in increasing order of knowledge)

row_number

name of the row-number column before RAW_/ANON_ prefixing

seeds

tie-break seeds passed to [reid_evaluate()]

...

further arguments passed to [score_by_knowledge()]

Value

a data frame with one row per level and columns `level`, `n_visible`, `success_analytic`, `success_mean`, `success_sd`, `baseline_random`, `lift` and `max_risk`

Examples

d <- create_dummy_qi_data(people = 25, seed = 1)
j <- join_raw_anon_data(d, d)
reid_knowledge_curve(
  j,
  quasi_identifiers = c(AGE = "num", ZIP = "char", SEX = "char"),
  behavior = c(VISIT_COUNT = "num", SPEND_MEAN = "num"),
  identifiers = c(FINGERPRINT = "num"),
  weak_subset = "ZIP",
  seeds = 1:5
)
#>   level n_visible success_analytic success_mean success_sd baseline_random lift
#> 1     W         1              0.2         0.12 0.04898979            0.04    5
#> 2     M         5              1.0         1.00 0.00000000            0.04   25
#> 3     S         6              1.0         1.00 0.00000000            0.04   25
#>    max_risk
#> 1 0.3333333
#> 2 1.0000000
#> 3 1.0000000