GaussSuppressDec function

Cell suppression with synthetic decimal numbers

Cell suppression with synthetic decimal numbers

GaussSuppressionFromData, or one of its wrappers, is run and decimal numbers are added to output by executing SuppressDec.

GaussSuppressDec( data, ..., fun = GaussSuppressionFromData, output = NULL, use_freqVar = NA, digits = 9, nRep = NULL, rmse = pi/3, sparseLimit = 500, rndSeed = 123, runIpf = FALSE, eps = 0.01, iter = 100, mismatchWarning = TRUE, whenDuplicatedInner = NULL, whenMixedDuplicatedInner = warning )

Arguments

  • data: Input daata as a data frame

  • ...: Further parameters to GaussSuppressionFromData

  • fun: A function: GaussSuppressionFromData or one of its wrappers such as SuppressSmallCounts and SuppressDominantCells.

  • output: NULL (default), "publish", "inner", "publish_inner", or "publish_inner_x" (x also).

  • use_freqVar: Logical (TRUE/FALSE) with a default value of NA. Determines whether the variable freqVar is used as the basis for generating decimal numbers. If NA, the parameter is set to TRUE, except in the following cases, where it is set to FALSE:

    • If freqVar is not available.
    • If runIpf is FALSE and fun is one of the functions SuppressFewContributors or SuppressDominantCells.

    When use_freqVar is FALSE, only zeros are used instead. This approach is more robust in practice, as decimal numbers can then be stored more accurately. The default value is chosen to ensure compatibility with existing code and to allow for the use of freqVar

    when dealing with frequency tables, which may be useful.

  • digits: Parameter to RoundWhole. Values close to whole numbers will be rounded.

  • nRep: NULL or an integer. When >1, several decimal numbers will be generated.

  • rmse: Desired root mean square error of decimal numbers. Variability around the expected, according to the linear model, inner frequencies. The expected frequencies are calculated from the non-suppressed publishable frequencies.

  • sparseLimit: Limit for the number of rows of a reduced x-matrix within the algorithm. When exceeded, a new sparse algorithm is used.

  • rndSeed: If non-NULL, a random generator seed to be used locally within the function without affecting the random value stream in R.

  • runIpf: When TRUE, additional frequencies are generated by iterative proportional fitting using Mipf.

  • eps: Parameter to Mipf.

  • iter: Parameter to Mipf.

  • mismatchWarning: Whether to produce the warning "Mismatch between whole numbers and suppression", when relevant. When nRep>1, all replicates must satisfy the whole number requirement for non-suppressed cells. When mismatchWarning is integer (>0), this will be used as parameter digits to RoundWhole

    when doing mismatch checking (can be quite low when nRep>1).

  • whenDuplicatedInner: Function to be called when default output and when cells marked as inner correspond to several input cells (aggregated) since they correspond to published cells.

  • whenMixedDuplicatedInner: Function to be called in the case above when some inner cells correspond to published cells (aggregated) and some not (not aggregated).

Returns

A data frame where inner cells and cells to be published are combined or output according to parameter output.

Examples

a <- GaussSuppressDec(data = SSBtoolsData("example1"), fun = SuppressSmallCounts, dimVar = c("age", "geo"), preAggregate = TRUE, freqVar = "freq", maxN = 3) a b <- GaussSuppressDec(data = SSBtoolsData("magnitude1"), fun = SuppressDominantCells, numVar = "value", formula = ~sector2 * geo + sector4 * eu, contributorVar = "company", k = c(80, 99)) b # FormulaSelection() works on this output as well FormulaSelection(b, ~sector2 * geo)

See Also

SuppressionFromDecimals()

Author(s)

Øyvind Langrsud