Learn R Programming

sdcMicro (version 4.6.0)

localSupp: Local Suppression

Description

A simple method to perfom local suppression.

Usage

localSupp(obj, threshold = 0.15, keyVar, ...)

Arguments

obj
object of class freqCalc or sdcMicroObj
threshold
threshold for individual risk
keyVar
Variable on which some values might be suppressed
...
see arguments below
  • indivRiskobject from class indivRisk

Value

Manipulated data with suppressions or the sdcMicroObj-class object with manipulated data.

Methods

list("signature(obj = \"sdcMicroObj\")")
list("signature(obj = \"ANY\")")

Details

Values of high risk (above the threshold) of a certain variable (parameter keyVar) are suppressed.

References

Templ, M. Statistical Disclosure Control for Microdata Using the R-Package sdcMicro, Transactions on Data Privacy, vol. 1, number 2, pp. 67-85, 2008. http://www.tdp.cat/issues/abs.a004a08.php

See Also

freqCalc, indivRisk

Examples

Run this code
## example from Capobianchi, Polettini and Lucarelli:
data(francdat)
f <- freqCalc(francdat, keyVars=c(2,4,5,6),w=8)
f
f$fk
f$Fk
## individual risk calculation:
indivf <- indivRisk(f)
indivf$rk
## Local Suppression
localS <- localSupp(f, keyVar=2, indivRisk=indivf$rk, threshold=0.25)
f2 <- freqCalc(localS$freqCalc, keyVars=c(4,5,6), w=8)
indivf2 <- indivRisk(f2)
indivf2$rk
## select another keyVar and run localSupp once again,
# if you think the table is not fully protected


## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata2,
  keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
  numVars=c('expend','income','savings'), w='sampling_weight')
sdc <- localSupp(sdc, keyVar='urbrur')

Run the code above in your browser using DataLab