R Under development (unstable) (2024-03-07 r86063 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # require(sdcMicro) > # set.seed(199723) > # activedataset <- testdata > # sdcObject <- createSdcObj(activedataset, keyVars=c("urbrur", "roof", "sex", "age"), > # numVars=c("expend", "income", "savings"), > # weightVar=c("sampling_weight"), hhId=c("ori_hid")) > # sdcObject <- varToFactor(sdcObject, var=c("urbrur")) > # sdcObject <- varToFactor(sdcObject, var=c("roof")) > # sdcObject <- varToFactor(sdcObject, var=c("sex")) > # sdcObject <- groupAndRename(sdcObject, var=c("sex"), before=c("1"), after=c("m")) > # sdcObject <- groupAndRename(sdcObject, var=c("sex"), before=c("2"), after=c("w")) > # sdcObject <- globalRecode(sdcObject, column=c("age"), breaks=c(6), labels=paste0("AGE",1:6)) > # sdcObject <- groupAndRename(sdcObject, var=c("age"), before=c("AGE5", "AGE6"), after=c("AGE5_6")) > # sdcObject <- localSuppression(sdcObject, k=c(2), importance=c(1, 3, 1, 3)) > # sdcObject <- localSuppression(sdcObject, k=c(3), importance=c(1, 3, 1, 3)) > # sdcObject <- microaggregation(sdcObject, aggr=c(3), method=c("mdav"), > # variables=c("expend"), strata_variables=c("sex")) > > proc.time() user system elapsed 0.15 0.10 0.20