Description Usage Arguments Details Value Note Author(s) References Examples
View source: R/localSuppression.R
Algorithm to achieve kanonymity by performing local suppression.
1 2 3 
obj 
a 
k 
threshold for kanonymity 
importance 
numeric vector of numbers between 1 and n (n=length of vector keyVars). This vector represents the "importance" of variables that should be used for local suppression in order to obtain kanonymity. keyvariables with importance=1 will  if possible  not suppressed, keyvariables with importance=n will be used whenever possible. 
combs 
numeric vector. if specified, the algorithm will provide kanonymity for each combination of n key variables (with n being the value of the ith element of this parameter. For example, if combs=c(4,3), the algorithm will provide kanonymity to all combinations of 4 key variables and then kanonymity to all combinations of 3 key variables. It is possible to apply different k to these subsets by specifying k as a vector. If k has only one element, the same value of k will be used for all subgroups. 
... 
see arguments below

The algorithm provides a kanonymized data set by suppressing values in key variables. The algorithm tries to find an optimal solution to suppress as few values as possible and considers the specified importance vector. If not specified, the importance vector is constructed in a way such that key variables with a high number of characteristics are considered less important than key variables with a low number of characteristics.
The implementation provides kanonymity per strata, if slot 'strataVar' has
been set in sdcMicroObjclass
or if parameter 'strataVar' is
used when appying the data.frame method. For details, have a look
at the examples provided.
Manipulated data set with suppressions that has kanonymity with
respect to specified keyvariables or the manipulated data stored in the
sdcMicroObjclass
.
Deprecated methods 'localSupp2' and 'localSupp2Wrapper' are no longer available
in sdcMicro > 4.5.0.
kAnon
is a more intutitive term for localSuppression because the aim is always
to obtain kanonymity for some parts of the data.
Bernhard Meindl, Matthias Templ
Templ, M. Statistical Disclosure Control for Microdata: Methods and Applications in R. Springer International Publishing, 287 pages, 2017. ISBN 9783319502724. doi: 10.1007/9783319502724
Templ, M. and Kowarik, A. and Meindl, B. Statistical Disclosure Control for MicroData Using the R Package sdcMicro. Journal of Statistical Software, 67 (4), 1–36, 2015. doi: 10.18637/jss.v067.i04
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45  data(francdat)
## Local Suppression
localS < localSuppression(francdat, keyVar=c(4,5,6))
localS
plot(localS)
## Not run:
## for objects of class sdcMicro, no stratification
data(testdata2)
sdc < createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
numVars=c('expend','income','savings'), w='sampling_weight')
sdc < localSuppression(sdc)
## for objects of class sdcMicro, no with stratification
testdata2$ageG < cut(testdata2$age, 5, labels=paste0("AG",1:5))
sdc < createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
numVars=c('expend','income','savings'), w='sampling_weight',
strataVar='ageG')
sdc < localSuppression(sdc)
## it is also possible to provide kanonymity for subsets of keyvariables
## with different parameter k!
## in this case we want to provide 10anonymity for all combinations
## of 5 key variables, 20anonymity for all combinations with 4 key variables
## and 30anonymity for all combinations of 3 key variables.
## note: stratas are automatically considered!
combs < 5:3
k < c(10,20,30)
sdc < localSuppression(sdc, k=k, combs=combs)
## data.frame method (no stratification)
keyVars < c("urbrur","roof","walls","water","electcon","relat","sex")
strataVars < c("ageG")
inp < testdata2[,c(keyVars, strataVars)]
ls < localSuppression(inp, keyVars=1:7)
print(ls)
plot(ls)
## data.frame method (with stratification)
ls < kAnon(inp, keyVars=1:7, strataVars=8)
print(ls)
plot(ls, showTotalSupps=TRUE)
## End(Not run)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.