extractManipData: Remove certain variables from the data set inside a sdc...

Description Usage Arguments Value Author(s) Examples

Description

Extract the manipulated data from an object of class sdcMicroObj-class

Usage

1
2
3
extractManipData(obj, ignoreKeyVars = FALSE, ignorePramVars = FALSE,
  ignoreNumVars = FALSE, ignoreGhostVars = FALSE, ignoreStrataVar = FALSE,
  randomizeRecords = "no")

Arguments

obj

object of class sdcMicroObj-class

ignoreKeyVars

If manipulated KeyVariables should be returned or the unchanged original variables

ignorePramVars

if manipulated PramVariables should be returned or the unchanged original variables

ignoreNumVars

if manipulated NumericVariables should be returned or the unchanged original variables

ignoreGhostVars

if manipulated Ghost (linked) Variables should be returned or the unchanged original variables

ignoreStrataVar

if manipulated StrataVariables should be returned or the unchanged original variables

randomizeRecords

(logical) specifies, if the output records should be randomized. The following options are possible:

  • 'no'default, no randomization takes place

  • 'simple'records are just randomly swapped.

  • 'byHH'if slot 'hhId' is not NULL, the clusters defined by this variable are randomized across the dataset. If slot 'hhId' is NULL, the records or the dataset are randomly changed.

  • 'withinHH'if slot 'hhId' is not NULL, the clusters defined by this variable are randomized across the dataset and additionally, the order of records within the clusters are also randomly changed. If slot 'hhId' is NULL, the records or the dataset are randomly changed.

Value

a data.frame containing the anonymized data set

Author(s)

Alexander Kowarik, Bernhard Meindl

Examples

1
2
3
4
5
6
7
## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata,
  keyVars=c('urbrur','roof'),
  numVars=c('expend','income','savings'), w='sampling_weight')
sdc <- removeDirectID(sdc, var="age")
dataM <- extractManipData(sdc)


Search within the sdcMicro package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.