Learn R Programming

sdcMicro (version 4.6.0)

freq: Print and Extractor Functions for objects of class sdcMicroObj-class

Description

Descriptive print function for Frequencies, local Supression, Recoding, categorical risk and numerical risk.

Usage

freq(obj, type = "fk")
"print"(x, type = "kAnon", ...)

Arguments

obj
An object of class sdcMicroObj-class
type
Selection of the content to be returned or printed-
x
An object of class sdcMicroObj-class
...
the type argument for the print method, currently supported are:
  • general: basic information on the input obj such as the number of observations and variables.
  • kAnon: displays information about 2- and 3-anonymity
  • ls: displays various information if local suppression has been applied.
  • pram: displays various information if post-randomization has been applied.
  • recode: shows information about categorical key variables before and after recoding
  • risk: displays information on re-identification risks
  • numrisk: displays risk- and utility measures for numerical key variables

Details

Possible values for the type argument of the print function are: "freq": for Frequencies, "ls": for Local Supression output, "pram": for results of post-randomization "recode":for Recodes, "risk": forCategorical risk and "numrisk": for Numerical risk.

Possible values for the type argument of the freq function are: "fk": Sample frequencies and "Fk": weighted frequencies.

Examples

Run this code
data(testdata)
sdc <- createSdcObj(testdata,
  keyVars=c('urbrur','roof','walls','relat','sex'),
  pramVars=c('water','electcon'),
  numVars=c('expend','income','savings'), w='sampling_weight')
fk=freq(sdc)
Fk=freq(sdc,type="Fk")
print(sdc)
print(sdc,type="general")
print(sdc,type="ls")
print(sdc,type="recode")
print(sdc,type="risk")
print(sdc,type="numrisk")
print(sdc,type="pram")
print(sdc,type="kAnon")

Run the code above in your browser using DataLab