extract_MIdata {remiod}R Documentation

Extract a specified number of multiple imputed datasets

Description

Extract a specified number of multiple imputed datasets

Usage

extract_MIdata(object, method = c("MAR", "J2R", "CR", "delta"), delta = 0,
  mi.setting = NULL, M = 10, minspace = 2, mess = FALSE)

Arguments

object

object inheriting from class 'remoid'

method

a method for obtaining multiple-imputed dataset. Options include MAR, J2R, CR, and delta adjustment. Default is MAR.

delta

specific value used for Delta adjustment, applicable only for method="delta".

mi.setting

a list of arguments related to multiple imputation, including trtvar, algorithm, method, include, exclude_chains, thin, start, end, and seed.

M

number of imputed datasets

minspace

minimum number of iterations between iterations to be chosen as imputed values (to prevent strong correlation between imputed datasets in the case of high autocorrelation of the MCMC chains).

mess

logical; should messages be given? Default is TRUE.

Value

A data.frame in which the imputed datasets are stacked onto each other. The variable Imp_ indexes the imputation, while .rownr links the rows to the rows of the original data. In cross-sectional datasets the variable .id is added as subject identifier.

Examples


# data(schizow)

test = remiod(formula = y6 ~ tx + y0 + y1 + y3, data = schizow,
              trtvar = 'tx', algorithm = 'jags', method="MAR",
              ord_cov_dummy = FALSE, n.adapt = 10, n.chains = 1,
              n.iter = 100, thin = 2, warn = FALSE, seed = 1234)

extdt = extract_MIdata(object=test, method="J2R",mi.setting=NULL, M=10, minspace=2)



[Package remiod version 1.0.2 Index]