Learn R Programming

synMicrodata (version 2.1.3)

Rcpp_modelobject-class: Class "Rcpp_modelobject"

Description

This class implements a joint modeling approach to generate synthetic microdata with continuous and categorical variables with possibly missing values. The method builds on the work of Murray and Reiter (2016)

Arguments

Extends

Class "C++Object", directly.

Fields

  • data_obj input dataset generated from readData.

Methods

  • multipleSyn generates synthetic micro datasets.

Details

Rcpp_modelobject should be created with createModel. Please see the example below.

References

Murray, J. S. and Reiter, J. P. (2016). Multiple imputation of missing categorical and continuous values via Bayesian mixture models with local dependence. Journal of the American Statistical Association, 111(516), pp.1466-1479.

See Also

Examples

Run this code
## preparing to generate synthetic datsets
dat_obj <- readData(Y_input = iris[,1:4],
                    X_input = data.frame(Species = iris[,5]))
mod_obj <- createModel(dat_obj, max_R_S_K=c(30,50,20))

## generating synthetic datasets
res_obj <- multipleSyn(dat_obj, mod_obj, n_burnin = 100, m = 5, 
                       interval_btw_Syn = 50, show_iter = FALSE)

print(res_obj)

Run the code above in your browser using DataLab