localSupp2 {sdcMicro} | R Documentation |
An Algorithm to perfom local suppression to achieve k-anonymity.
localSupp2(x, keyVars, w, importance=rep(1, length(keyVars)), method="minimizeSupp", k=1)
x |
data frame or matrix |
keyVars |
column index of key variables |
w |
column index of sampling weights |
importance |
weights for each key variable |
method |
“minimizeSupp” (default), further methods will be included in future versions of the package |
k |
parameter for k-anonymity. |
With the help of this algorithm you can achieve k-anonymity in an optimized way. The procedure set missings only to those key variables for which the importance is greater than 0. Key variables with higher importance will be prefered to be the variable which will used for suppression of specific values, i.e. the vector of importance assign to each key variables a weight which is considered by the algorithm.
To guarantee k-anonymity the wrapper of function localSupp2 should be applied (localSupp2Wrapper())
However, if the importance of some key variables are equal to zero, the alorithm may not find a k-anonymity solution (because there isn't any solution reachable at all, for example). The easiest way to overcome this situation is to re-run the alorithm and allow for NA's in some more key variables, i.e. re-run the algorithm with importance greater than 0 for all entries of importance. This will result in k-anonymizated results and leads to only few suppressions in the key variables which does have zero importance first.
Method fastSupp avoids some calculation steps but this method is only significant faster if there is a large data sets with few key variables. This method leads to an oversuppression (sligthly).
Object from class localSupp2.
xAnon |
resulting data with suppressions |
supps |
number of suppressions in the key variables |
totalSupps |
total number of suppressions. |
anonymity |
TRUE, if k-anonymity is achieved |
keyVars |
index of the key variables. |
importance |
weight vector for key variables |
k |
k for k-anoymity |
fix me: Implementation in C and interface to R.
Matthias Templ, Bernhard Meindl
## example from Capobianchi, Polettini and Lucarelli: data(francdat) l1 <- localSupp2(francdat, keyVars=c(2,4,5,6), w=8) l1 l1$x l2 <- localSupp2(francdat, keyVars=c(2,4,5,6), w=8, k=2) l3 <- localSupp2(francdat, keyVars=c(2,4,5,6), w=8, k=4) ## long computation time, wait some seconds to get an information ## about the estimated computing time. ## l = localSupp2(free1, keyVars=1:3, w=30, k=2, importance=c(0.1,1,0.8))