mm <- SSBtools::ModelMatrix(SSBtoolsData("example1"),
formula = ~age * eu + geo, crossTable = TRUE)
crossTable <- mm$crossTable
x <- mm$modelMatrix
default_targeting(crossTable, x) # just NULL
# geo identifying and age sensitive (age sensitive variable)
a2 <- default_targeting(crossTable, x,
identifying = "geo",
sensitive = "age")
a1 <- default_targeting(crossTable, x,
identifying = list(age = "Total", geo = "*"),
sensitive = list(age = "*"))
identical(a1, a2)
a1
# Not ok to disclose 'EU' and 'Portugal'
# But ok to disclose 'Spain' with 'EU' known
# and also ok to disclose 'Spain' in other table cells without 'EU' as marginal
default_targeting(crossTable, x,
sensitive = list(geo = c("Portugal", "EU")))
# As above but now also ok to disclose 'Portugal' from 'EU' known,
# since protection only considers 'age' identifying.
default_targeting(crossTable, x,
identifying = "age",
sensitive = list(geo = c("Portugal", "EU")))
Run the code above in your browser using DataLab