Cell suppression from synthetic decimal numbers
Decimal numbers, as calculated by GaussSuppressDec
, are used to decide suppression (whole numbers or not). Technically, the calculations are done via GaussSuppressionFromData
, but without running GaussSuppression
. All suppressed cells are primary suppressed.
SuppressionFromDecimals( data, decVar, freqVar = NULL, numVar = NULL, preAggregate = FALSE, digits = 9, ... )
data
: Input data as a data framedecVar
: One ore several (nRep>1
) decimal number variables.freqVar
: A single variable holding counts (not needed)numVar
: Other numerical variables to be aggregatedpreAggregate
: Parameter to GaussSuppressionFromData
digits
: Parameter to RoundWhole
. Values close to whole numbers will be rounded....
: Other parameters to GaussSuppressionFromData
Aggregated data with suppression information
Several decimal number variables reduce the probability of obtaining whole numbers by chance.
z2 <- SSBtoolsData("z2") # Find suppression and decimal numbers with "fylke" in model a1 <- GaussSuppressDec(z2, fun = SuppressSmallCounts, dimVar = c("region", "fylke", "hovedint"), freqVar = "ant", protectZeros = FALSE, maxN = 2, output = "inner") # Add decimal numbers to data z2$freqDec <- a1$freqDec # Find suppression with "kostragr" in model a2 <- SuppressionFromDecimals(z2, dimVar = c("region", "kostragr", "hovedint"), freqVar = "ant", decVar = "freqDec") tail(a2) b1 <- GaussSuppressDec(data = SSBtoolsData("magnitude1"), fun = SuppressDominantCells, numVar = "value", formula = ~sector2 * geo + sector4 * eu, contributorVar = "company", k = c(80, 99)) b2 <- SuppressionFromDecimals(b1[b1$isInner, ], formula = ~(sector2 + sector4) * eu, numVar = "value", decVar = "freqDec") FormulaSelection(b2, ~sector2 * eu)
Øyvind Langsrud
Useful links