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
a <- GaussSuppressDec(z2, dimVar = c("region", "fylke", "hovedint"),
freqVar = "ant", protectZeros = FALSE, maxN = 2,
output = "inner")
# Add decimal numbers to data
z2$freqDec <- a$freqDec
# Find suppression with "kostragr" in model
b <- SuppressionFromDecimals(z2, dimVar = c("region", "kostragr", "hovedint"),
freqVar = "ant", decVar = "freqDec")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.