coalition: numeric vector of length one, representing possible size of an attacking coalition. This parameter corresponds to the parameter k in the definition of k-disclosure.
mc_hierarchies: a hierarchy representing meaningful combinations to be protected. Default value is NULL.
upper_bound: numeric value representing minimum count considered safe. Default set to Inf
dimVar: The main dimensional variables and additional aggregating variables. This parameter can be useful when hierarchies and formula are unspecified.
formula: A model formula
hierarchies: List of hierarchies, which can be converted by AutoHierarchies. Thus, the variables can also be coded by "rowFactor" or "", which correspond to using the categories in the data.
freqVar: name of the frequency variable in data
...: parameters passed to children functions
spec: NULL or a named list of arguments that will act as default values.
Returns
A data.frame containing the publishable data set, with a boolean variable $suppressed representing cell suppressions.
Examples
# datadata <- SSBtools::SSBtoolsData("mun_accidents")# hierarchies as DimListsmun <- data.frame(levels = c("@", rep("@@",6)),codes = c("Total", paste("k",1:6, sep ="")))inj <- data.frame(levels = c("@","@@","@@","@@","@@"),codes = c("Total","serious","light","none","unknown"))dimlists <- list(mun = mun, inj = inj)inj2 <- data.frame(levels = c("@","@@","@@@","@@@","@@","@@"),codes = c("Total","injured","serious","light","none","unknown"))inj3 <- data.frame(levels = c("@","@@","@@","@@","@@"),codes = c("shadowtotal","serious","light","none","unknown"))mc_dimlist <- list(inj = inj2)mc_nomargs <- list(inj = inj3)#' # Example with formula, no meaningful combinationout <- SuppressKDisclosure(data, coalition =1, freqVar ="freq", formula =~mun*inj)# Example with hierarchy and meaningful combinationout2 <- SuppressKDisclosure(data, coalition =1, freqVar ="freq",hierarchies = dimlists, mc_hierarchies = mc_dimlist)#' # Example of table without mariginals, and mc_hierarchies to protectout3 <- SuppressKDisclosure(data, coalition =1, freqVar ="freq",formula =~mun:inj, mc_hierarchies = mc_nomargs )