sdcTools / sdcMicro

sdcMicro
http://sdctools.github.io/sdcMicro/
79 stars 22 forks source link

localSuppression for subsets of keyVariables fails #279

Closed alexkowa closed 5 years ago

alexkowa commented 5 years ago
  data(testdata2)
  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')
  combs <- 5:3
  k <- c(10,20,30)

  sdc <- localSuppression(sdc, k=k, combs=combs)
alexkowa commented 5 years ago

@bernhard-da did you write that part of localSuppression , namely the function suppSubset ?

alexkowa commented 5 years ago

The root of the problem was that testdata2 is stratified into groups and in some of them are less then k (=10) observations. Now the code stops with an error messages. I think it is best way to go since the desired k -Anonymity can not be achived?!