Skip to contents

[create_dummy_master_data()] produces columns that are all equally "identifying", so there is nothing for an attacker knowledge model (Issue #13) to withhold. This generates data in which the columns fall into the three groups the W / M / S levels distinguish, with deliberately different discriminating power:

Usage

create_dummy_qi_data(people = 100, seed = NULL)

Arguments

people

number of people

seed

integer seed, or NULL to use the ambient RNG stream. Defaults to NULL so the function behaves like the other generators; pass a value to make a fixture self-contained.

Value

a tibble with columns ROW_NUMBER, ID, AGE, ZIP, SEX, VISIT_COUNT, SPEND_MEAN, SPEND_DIST and FINGERPRINT, one row per person.

Details

quasi-identifiers

`ZIP` (very coarse – roughly `people / 5` distinct values, so heavy collisions), `AGE` (moderately coarse) and `SEX` (2 values, almost no information on its own)

behaviour

`VISIT_COUNT`, `SPEND_MEAN` and the colon-joined `SPEND_DIST`, each a rounded summary rather than an exact value

identifier

`FINGERPRINT`, a continuous value that is unique with probability 1 – i.e. the RAW record itself

A level-W attacker restricted to `ZIP` should therefore do only slightly better than guessing, while a level-S attacker holding `FINGERPRINT` should identify essentially everybody.

See also

[dummy_qi_knowledge()], which declares the matching [attacker_knowledge()] specification for this data.

Examples

create_dummy_qi_data(people = 10, seed = 1)
#> # A tibble: 10 × 9
#>    ROW_NUMBER    ID   AGE ZIP   SEX   VISIT_COUNT SPEND_MEAN SPEND_DIST         
#>         <int> <int> <int> <chr> <chr>       <int>      <dbl> <chr>              
#>  1          1 10001    52 Z002  M               4       71.8 72:99:38:78        
#>  2          2 10002    64 Z002  F               7       37   93:21:65:13:27:39:1
#>  3          3 10003    40 Z002  M               1       38   38                 
#>  4          4 10004    50 Z002  M               2       60.5 87:34              
#>  5          5 10005    57 Z001  F              11       55.5 48:60:49:19:83:67:…
#>  6          6 10006    36 Z002  F              14       52.2 65:78:55:53:79:2:4…
#>  7          7 10007    28 Z002  M              18       48.1 10:32:52:66:41:91:…
#>  8          8 10008    58 Z002  M              19       47.6 33:48:89:86:39:78:…
#>  9          9 10009    42 Z002  M               1       64   64                 
#> 10         10 10010    38 Z001  F              10       60.1 88:78:80:46:41:81:…
#> # ℹ 1 more variable: FINGERPRINT <dbl>