View source: R/SuppressionFromDecimals.R
| SuppressionFromDecimals | R Documentation |
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 frame |
decVar |
One ore several ( |
freqVar |
A single variable holding counts (not needed) |
numVar |
Other numerical variables to be aggregated |
preAggregate |
Parameter to |
digits |
Parameter to |
... |
Other parameters to |
Several decimal number variables reduce the probability of obtaining whole numbers by chance.
Aggregated data with suppression information
Øyvind Langsrud
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.