View source: R/IntervalLimits.R
| IntervalLimits | R Documentation |
Creates one or more sets of requirements for feasibility intervals of cell values in protected tables. These can include lower bound requirements ("lomax_"), upper bound requirements ("upmin_"), and/or minimum width requirements ("rlim_*"). The requirements may be specified as relative percentages or as absolute distances, and can be set symmetrically around the true cell value or separately for lower and upper bounds.
IntervalLimits(
...,
protectionPercent = 0,
protectionLimit = 0,
loProtectionPercent = protectionPercent,
loProtectionLimit = protectionLimit,
rangePercent = 0,
rangeMin = 0,
primary,
num,
freq,
freqVar,
dominanceVar = NULL,
intervalVar = NULL
)
... |
Unused parameters |
protectionPercent |
Required distance in percent between the true cell value and the upper
bound of the feasibility interval. If |
protectionLimit |
Required absolute distance between the true cell value and the upper
bound of the feasibility interval. If |
loProtectionPercent |
Required distance in percent between the true cell value and the lower
bound of the feasibility interval. Is by default set to |
loProtectionLimit |
Required absolute distance between the true cell value and the lower
bound of the feasibility interval. Is by default set to |
rangePercent |
Minimum required width of the feasibility interval expressed as a percentage of the true cell value. |
rangeMin |
Minimum required width of the feasibility interval expressed as an absolute value. |
primary |
The |
num |
The |
freq |
The |
freqVar |
As input to e.g. |
dominanceVar |
As input to e.g. |
intervalVar |
Numerical variable(s) used for interval calculations.
If |
A matrix with column names constructed from the type of requirement and the associated variable name.
Interval requirements can also be generated by the primary suppression
functions when protectionIntervals = TRUE is specified (see examples
below). More details are given in the description of protectionIntervals
in the MagnitudeRule() and PrimaryDefault() functions.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.