Learn R Programming

sdcMicro (version 4.6.0)

dataGen: Fast generation of synthetic data

Description

Fast generation of (primitive) synthetic multivariate normal data.

Usage

dataGen(obj, ...)

Arguments

obj
data.frame or matix
...
see possible arguments below
  • namount of observations for the generated data

Value

the generated synthetic data.

Methods

list("signature(obj = \"data.frame\")")
list("signature(obj = \"matrix\")")
list("signature(obj = \"sdcMicroObj\")")

Details

Uses the cholesky decomposition to generate synthetic data with approx. the same means and covariances. For details see at the reference.

References

Have a look at http://crises2-deim.urv.cat/docs/publications/lncs/443.pdf

See Also

sdcMicroObj-class, shuffle

Examples

Run this code
data(mtcars)
cov(mtcars[,4:6])
cov(dataGen(mtcars[,4:6]))
pairs(mtcars[,4:6])
pairs(dataGen(mtcars[,4:6]))

## for objects of class sdcMicro:
data(testdata2)
sdc <- createSdcObj(testdata2,
  keyVars=c('urbrur','roof','walls','water','electcon','relat','sex'),
  numVars=c('expend','income','savings'), w='sampling_weight')
sdc <- dataGen(sdc)

Run the code above in your browser using DataLab