addGhostVars | R Documentation |
specify variables that are linked
to a key variable. This results in all
suppressions of the key-variable being also applied on the corresponding 'ghost'-variables.
addGhostVars(obj, keyVar, ghostVars)
obj |
an object of class |
keyVar |
character-vector of length 1 refering to a categorical key variable within |
ghostVars |
a character vector specifying variables that are linked to |
a modified sdcMicroObj-class
object.
Bernhard Meindl
Templ, M. Statistical Disclosure Control for Microdata: Methods and Applications in R. Springer International Publishing, 287 pages, 2017. ISBN 978-3-319-50272-4. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-319-50272-4")} \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-319-50272-4")}
data(testdata2)
sdc <- createSdcObj(testdata2,
keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
numVars=c('expend','income','savings'), w='sampling_weight')
## we want to link the anonymization status of key variabe 'urbrur' to 'hhcivil'
sdc <- addGhostVars(sdc, keyVar="urbrur", ghostVars=c("hhcivil"))
## we want to link the anonymization status of key variabe 'roof' to 'represent'
sdc <- addGhostVars(sdc, keyVar="roof", ghostVars=c("represent"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.