The package remiod provides functionality to perform controlled multiple imputation of binary and ordinal response in the Bayesian framework. Implemented are (generalized) linear regression models for binary data and cumulative logistic models / ordered probit models for ordered categorical data (Wang and Liu 2022). It is also possible to fit multiple models of mixed types simultaneously. Missing values in variables(if present) will be imputed automatically.
remiod has two algorithmic backend. One is JAGS, with which the function performs some preprocessing of the data and creates a JAGS model, which will then automatically be passed to JAGS with the help of the R package rjags. The another is based on the method proposed by Tang (Tang 2018).
Besides the main modelling functions, remiod also provides functions to summarize and visualize results.
remiod Can be from CRAN:
install.packages("remiod")
Or, it can be installed from GitHub:
# install.packages("remotes")
::install_github("xsswang/remiod") remotes
remiod provides the following main functions:
#processing data and implementing MCMC sampling
remiod #extract imputed data sets
extract_MIdata #Perform analyses using imputed data and pool results miAnalyze
Currently, methods remiod implements include missing
at random (MAR
), jump-to-reference (J2R
), copy
reference (CR
), and delta adjustment (delta
).
For method = "delta"
, argument delta
should
follow to specify a numerical values used in delta adjustment. These
methods can be requested through extract_MIdata()
, and
imputed datasets can be analyzed using miAnalyze()
.
Functions summary()
, coef()
, and
mcmcplot()
provide a summary of the posterior distribution
under MAR and its visualization.
data(schizow)
= remiod(formula = y6 ~ tx + y0 + y1 + y3, data = schizow,
test 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)
= extract_MIdata(object=test, method="J2R",mi.setting=NULL, M=10, minspace=2)
extdt = miAnalyze(y6 ~ y0 + tx, data = extdt, pool = TRUE) result
For any help with regards to using the package or if you find a bug please create a GitHub issue.