Learn R Programming

EditImputeCont (version 1.1.6)

Rcpp_bei-class: Class "Rcpp_bei"

Description

This class implements the MCMC sampler for a joint modeling approach to multiple edit-imputation for continuous data. It provides methods for updating and monitoring the sampler.

Arguments

Extends

Class "'>C++Object", directly.

Fields

  • Y.input: input dataset generated from readData (replacing NA in Y.original by -999 and zero values by 0.01).

  • Y.edited: current edit-imputed dataset.

  • K: number of mixture components (latent classes).

  • n.occ: effective number of mixture components.

  • Prob.A: ratio of the size of the observed sample to the size of the augmented sample.

  • RandomSeed: random seed.

  • msg.level: integer in {0,1,2} specifying the level of displayed message; 0: errors only, 1: errors and warnings, 2: all messages. Defaults to 0.

  • FaultyRecordID: record IDs of Y.orig whose values violate edit rules.

Methods

  • Iterate(): run a single iteration of MCMC.

  • Run(iter): run iter iterations of MCMC.

Details

Rcpp_bei objects should be created with createModel. Please see the example in the demo folder for more detailed explanation.

References

Hang J. Kim, Lawrence H. Cox, Alan F. Karr, Jerome P. Reiter and Quanli Wang (2015). "Simultaneous Edit-Imputation for Continuous Microdata", Journal of the American Statistical Association, DOI: 10.1080/01621459.2015.1040881.

Examples

Run this code
# NOT RUN {
data(SimpleEx)

## read the data
data1 = readData(SimpleEx$D.obs, SimpleEx$Ratio.edit, NULL, 
  SimpleEx$Balance.edit)

## create and initialize the model
# model1 = createModel(data1, K=15)

### run 10 iterations
# model1$Run(10)
# EI_data1 = model1$Y.edited    # store the edit-imputed dataset
# }

Run the code above in your browser using DataLab