Changelog
Source:NEWS.md
GaussSuppression 0.9.5
CRAN release: 2025-02-07
- New pkgdown website for the package
- This package now has a documentation site at https://statisticsnorway.github.io/ssb-gausssuppression/.
- Matrix are moved from Depends to Imports
- To follow best practices for R packages
- Utilizing updates in the SSBtools package (version 1.7.0).
- The new function
tables_by_formulas()
, which is now reexported, is demonstrated in aSuppressSmallCounts()
example and aSuppressDominantCells()
example. - The new function
Extend0fromModelMatrixInput()
is now used in data pre-processing. As a result,hierarchical_extend0
is now a possible parameter, as illustrated in aSuppressSmallCounts()
example.
- The new function
- Improvements to GaussSuppressDec() and SuppressionFromDecimals()
- GaussSuppressDec() now accepts wrappers as input, such as SuppressSmallCounts() and SuppressDominantCells().
- Added new parameter
use_freqVar
to allow decimal numbers to be generated solely from 0s, improving stability. - All output variables from the underlying function are now included in the default output of GaussSuppressDec().
- FormulaSelection() now works correctly with output from GaussSuppressDec().
- SuppressionFromDecimals() has been updated accordingly. In particular, automation is now implemented to detect whether decimal numbers are generated from 0s or from frequencies.
GaussSuppression 0.9.2
CRAN release: 2024-12-09
- Added a check to ensure that at least one of
dimVar
,hierarchies
, orformula
is specified.- This is a breaking change that may affect previous code.
- Previously, if all were unspecified,
dimVar
was automatically generated from the remaining columns. - While this behavior was correctly implemented, it often stemmed from user input errors and could lead to unexpected behavior or crashes.
- This change now requires explicit input, making the function more robust and reducing the risk of user errors.
-
SuppressDominantCells()
and the underlying functionMagnitudeRule()
have been improved:-
contributorVar
(charVar
) can now be combined withsWeightVar
. - Improved handling of
protectZeros
. See this parameter’s documentation in?MagnitudeRule
. - New parameter
removeCodesFraction
allows adjustment of the effect of theremoveCodes
parameter. - New parameter
apply_abs_directly
determines how negative values are treated in the rules:- When
apply_abs_directly = FALSE
(default), absolute values are taken after summing contributions, as performed bymax_contribution()
in the SSBtools package. - When
apply_abs_directly = TRUE
, absolute values are computed directly on the input values, prior to any summation [beyondpreAggregate
]. This corresponds to the old behavior of the function.
- When
- Enhanced output when
allDominance = TRUE
:- Renaming: The variable previously called
primary.2:80
((2,80) dominance)) is nowdominant2
. - IDs associated with the largest contributions are now included.
- The number of contributors is also included.
- Additional outputs are available. See the documentation of the
allDominance
parameter.
- Renaming: The variable previously called
- The new functionality has been enabled by replacing
MaxContribution()
with the improvedmax_contribution()
from SSBtools.
-
- Improved support for
tibble
anddata.table
input (parameterdata
).- Input is now explicitly coerced to a data frame using
as.data.frame()
where necessary to ensure consistent behavior. - When
preAggregate
isTRUE
andaggregatePackage
is"data.table"
, the use ofas.data.frame()
is skipped to avoid unnecessary back-and-forth conversion ofdata.table
objects, preserving efficiency. - Applies to
GaussSuppressionFromData()
and its wrappers.
- Input is now explicitly coerced to a data frame using
- The
SSBtools
functionsFormulaSelection()
and its identical wrapperformula_selection()
are now re-exported.- These functions are useful for extracting smaller datasets from the output.
- With this change, using
library(SSBtools)
is no longer necessary to access them.
- These functions are useful for extracting smaller datasets from the output.
- Note new hierarchy possibilities due to the new version of the SSBtools package (version 1.6.0).
-
Output from functions like
get_klass()
in the klassR package orhier_create()
in the sdcHierarchies package can now be used directly as input. Example of usage:a <- get_klass(classification = "24") b <- hier_create(root = "Total", nodes = LETTERS[1:5]) mydata <- data.frame(tree = sample(a$code[nchar(a$code) > 1], 200, replace = TRUE), letter = LETTERS[1:5]) SuppressSmallCounts(mydata, maxN = 3, hierarchies = list(tree = a, letter = b))
New possibilities for working with both formulas and hierarchies are now available through the
map_hierarchies_to_data()
function.Improved functionality for combining formulas with the
Formula2ModelMatrix()
parameteravoidHierarchical = TRUE
, thanks to the newtotal_collapse()
function which can be applied to output.
-
GaussSuppression 0.9.0
CRAN release: 2024-09-24
- The Gaussian elimination secondary suppression algorithm has now been documented in a “Privacy in Statistical Databases 2024” paper.
- The package description has been updated with this reference (Langsrud, 2024).
- Due to updates in the SSBtools package (version 1.5.4), it is now meaningful to include NA’s in the grouping variables.
- Note the parameter
NAomit
toSSBtools::Formula2ModelMatrix()
:- When
TRUE
, NAs in the grouping variables are omitted in output and not included as a separate category. - This parameter can be input to
GaussSuppressionFromData()
and its wrappers.
- When
-
aggregateNA
is new parameter toGaussSuppressionFromData()
:- Whether to include NAs in the grouping variables while preAggregate/extraAggregate.
- Needs to be
TRUE
(default) to utilize the aboveNAomit
parameter.
- Note the parameter
- Due to updates in the SSBtools package (version 1.5.4), where data.table is now listed under Suggests, some functionality can be speeded up.
- Set the new parameter
aggregatePackage
to"data.table"
to utilize this possibility.-
aggregatePackage
is parameter toGaussSuppressionFromData()
and its wrappers. - Also note the related new parameters
aggregateBaseOrder
androwGroupsPackage
.
-
- Set the new parameter
GaussSuppression 0.8.8
CRAN release: 2024-06-28
- A bug related to the remove0 parameter is now fixed
- There was a bug related to the
remove0
parameter inSuppressFewContributors/NContributorsRule
introduced in version 0.8.0. When a singlenumVar
was used as input, theremove0
functionality failed.
- There was a bug related to the
GaussSuppression 0.8.5
CRAN release: 2024-05-22
-
SuppressDominantCells()
is now considered a common function for both the nk-dominance rule and the p-percent rule.- The
pPercent
parameter is now exposed in theSuppressDominantCells()
documentation.
- The
- The
n
parameter inSuppressDominantCells()
now defaults to1:length(k)
.- To simplify common use.
- A problem in experimental interval suppression is now fixed.
- It was a bug occurring in cases where a response value of zero was secondary suppressed.
- Improvements due to updates in the SSBtools package (version 1.5.2).
- Fix for a rare problem in
GaussSuppression()
,- Could happen with parallel eliminations combined with integer overflow. Then warning message: longer object length is not a multiple of shorter object length
- Minor change to the singleton method
"anySum"
inGaussSuppression()
to align with best theory.- In practice, this rarely makes a difference.
- The previous behavior can be ensured by setting
singletonMethod
to either"anySumOld"
or"anySumNOTprimaryOld"
.
- Fix for a rare problem in
GaussSuppression 0.8.3
CRAN release: 2024-03-22
- Experimental functionality to meet interval width requirements has been incorporated
- If at least one of the two parameters below is specified, in addition to the
lpPackage
parameter, further suppression will be performed to satisfy the interval width requirements.-
rangePercent
: Required interval width expressed as a percentage -
rangeMin
: Minimum required width of the interval
-
- If at least one of the two parameters below is specified, in addition to the
GaussSuppression 0.8.0
CRAN release: 2024-02-02
- Improved singleton methods for magnitude tables
- A new default setting,
singletonMethod = "numttHTT"
, has been introduced in the wrappersSuppressDominantCells()
andSuppressFewContribitors()
. This setting represents the method that offers the highest level of protection. However, it should be noted that with this setting, the computational load of the suppression algorithm may double, which could potentially lead to a doubling of the execution time as well. During these computations, “:::” will be displayed instead of “….”.- To prevent this doubling, set
singletonMethod = "numttHtT"
. - The behavior of version 0.7.0 can be restored by setting
singletonMethod = "numttH"
. - A simpler and faster method is achievable with
singletonMethod = "numttT"
. - As in previous versions, singleton handling can be disabled by setting
singletonMethod = "none"
.
- To prevent this doubling, set
- Additional information can be found by
?SSBtools::NumSingleton
. - Some explanation is provided at the bottom of the magnitude vignette.
- This will later be documented in a more comprehensive manner (paper).
- A new default setting,
- Improved functionality of the
SuppressDominantCells()
andSuppressFewContributors()
wrappers.- Improved support for handling multiple numerical variables, introducing new parameters:
dominanceVar
andcandidatesVar
. - The
removeCodes
parameter is now also available in theDominanceRule()
andSuppressDominantCells()
functions. - Support for multiple
contributorVar
(charVar
) in theSuppressFewContributors()
andNContributorsRule()
functions. - Now,
SuppressDominantCells()
includes special functionality to prevent zero cells, which have been suppressed, from being revealable in cases where negative values cannot occur. See the parametersingletonZeros
. - The update described below enables the specification of the
pPercent
parameter directly throughSuppressDominantCells()
.
- Improved support for handling multiple numerical variables, introducing new parameters:
- The p% rule for magnitude tables has been implemented through the introduction of a new primary suppression function,
PPercentRule()
.- Technically,
PPercentRule()
andDominanceRule()
now serve as wrappers for the newly introduced. general functionMagnitudeRule()
.
- Technically,
-
AdditionalSuppression()
generalized to take a wrappers as input. - New special functions for the avoidance of suppression
- Experimental functionality for interval calculations has been included
- Intervals can now be calculated using the new function
ComputeIntervals()
. - When the
lpPackage
parameter is specified inGaussSuppressionFromData()
or in any of its wrappers, intervals for primary suppressed cells will be computed and included in the output.
- Intervals can now be calculated using the new function
GaussSuppression 0.7.0
CRAN release: 2023-06-07
- More vignettes are included.
- Better singleton handling for magnitude tables when using
SuppressDominantCells()
andSuppressFewContributors()
.- Due to improvements in the SSBtools package (version 1.4.6).
- Due to new default
extraAggregate = TRUE
in the specs,dominanceSpec
andfewContributorsSpec
.
- More default values are explicitly included in the in specs so that they are easier seen.
- See
PackageSpecs()
.
- See
GaussSuppression 0.6.0
CRAN release: 2023-03-31
- A vignette entitled “Defining Tables for GaussSuppression” is now included.
- Now, easy-to-use wrapper functions are included.
-
SuppressSmallCounts()
,SuppressDominantCells()
, andSuppressFewContributors()
, along withSuppressKDisclosure()
(which was available in the previous version).
-
- Built-in specs that contribute to a simpler interface have been adopted.
- See
PackageSpecs()
.
- See
- Sampling weights are now possible in the dominance rule.
- See
DominanceRule()
.
- See
- More advanced singleton handling that makes use of new functionality in the SSBtools package (version 1.4.4).
- Now
forced
andusafe
are possible output columns.- Where unsafe means unsafe primary suppressions due to forced cells. That, is the unsafe primarily suppressed values can be re-calculated from the values of the cells forced to be not suppressed.
- See parameters
forcedInOutput
andunsafeInOutput
toGaussSuppressionFromData()
.
GaussSuppression 0.5.0
CRAN release: 2022-08-30
- Now the original variable names, as specified by
freqVar
andweightVar
, are kept in the output.- In previous versions these names were standardized to
"freq"
and"weight"
. - Code relying on previous behavior with other
freqVar
/weightVar
than"freq"
/"weight"
needs to be updated. -
"freq"
is still default when data is aggregated from microdata withoutfreqVar
specified (see new parameterfreqVarNew
).
- In previous versions these names were standardized to
- Adaption needed after Matrix ver. 1.4-2 (not a user-visible change)