dat <- SSBtoolsData("magnitude1")
dat["num2"] <- 1:nrow(dat)
SuppressDominantCells(data = dat,
numVar = "value",
formula = ~sector2 * geo + sector4 * eu,
contributorVar = "company",
k = c(80, 99),
rangePercent = 10, rangeMin = 1,
protectionPercent = 3,
protectionLimit = 5, loProtectionLimit = 4)
SuppressDominantCells(data = dat,
dominanceVar = "value",
numVar = "num2",
formula = ~sector2 * geo + sector4 * eu,
contributorVar = "company",
pPercent = 10,
intervalVar = c("value","freq", "num2"),
rangePercent = c(10, 10, 30), rangeMin = c(1, 0.2222, 2.222))
## Below are two alternative ways of calculating interval requirements.
## In these cases, the requirements are generated by the primary suppression
## functions when the parameter `protectionIntervals = TRUE` is specified.
# See ?MagnitudeRule
SuppressDominantCells(data = dat,
dominanceVar = "value",
formula = ~sector2 * geo + sector4 * eu,
contributorVar = "company",
pPercent = 10,
protectionIntervals = TRUE)
# See ?PrimaryDefault
SuppressSmallCounts(data = dat,
formula = ~sector2 * geo + sector4 * eu,
maxN = 3,
protectionIntervals = TRUE)
## Combining IntervalLimits arguments
## with protectionIntervals = TRUE also works
SuppressSmallCounts(data = dat,
formula = ~sector2 * geo + sector4 * eu,
maxN = 3,
protectionIntervals = TRUE,
protectionPercent = 50)
Run the code above in your browser using DataLab