remiod {remiod} | R Documentation |
Reference-Based Multiple Imputation for Ordinal/Binary Response
Description
Reference-Based Multiple Imputation for Ordinal/Binary Response
Usage
remiod(formula, data, trtvar, refcats = NULL, family = NULL,
method = "MAR", delta = 0, algorithm = c("tang_seq", "jags"),
rinv = 1e-04, scheme = 2, model_order = NULL, models = NULL,
ord_cov_dummy = TRUE, n.chains = 2, n.adapt = 100, n.iter = 1000,
thin = 2, start = NULL, end = NULL, seed = 1234,
exclude_chains = NULL, subset = NULL, include = FALSE, mess = TRUE,
warn = FALSE, progress.bar = TRUE, ...)
Arguments
formula |
a two sided model formula (see |
data |
a |
trtvar |
the name of treatment variable. When necessary, its reference category,
i.e. control arm, can be set in |
refcats |
optional; either one of |
family |
only for |
method |
a method for obtaining multiple-imputed dataset. Options include
|
delta |
specific value used for Delta adjustment, applicable only for method="delta". |
algorithm |
either algorithm |
rinv |
a small number used to adjusting Fish information matrix |
scheme |
scheme of distribution used for proposing coefficients of imputation models. scheme=1: beta ~ N( mean + inv(I)*score, inv(I)); scheme=2: beta ~ N( mean , inv(I)). |
model_order |
optional. manually specify an order for imputation models. |
models |
optional; named vector specifying the types of models for
(incomplete) covariates.
This arguments replaces the argument |
ord_cov_dummy |
optional. specify whether ordinal variables should be treated as
categorical variables or continuous variables when they are
included as covariates in the sequential imputation models.
Default is |
n.chains |
number of MCMC chains |
n.adapt |
number of iterations for adaptation of the MCMC samplers
(see |
n.iter |
number of iterations of the MCMC chain (after adaptation;
see |
thin |
thinning interval (integer; see |
start |
the first iteration of interest
(see |
end |
the last iteration of interest
(see |
seed |
optional; seed value (for reproducibility) |
exclude_chains |
optional vector of the index numbers of chains that should be excluded |
subset |
subset of parameters/variables/nodes (columns in the MCMC
sample). Follows the same principle as the argument
|
include |
logical, if TRUE, raw data will be included in imputed data sets with imputation ID = 0. |
mess |
logical; should messages be given? Default is
|
warn |
logical; should warnings be given? Default is
|
progress.bar |
character string specifying the type of
progress bar. Possible values are "text" (default), "gui",
and "none" (see |
... |
additional, optional arguments
|
Value
A list includes (1) Information from JAGS modeling and MCMC samples
and (2) A data.frame
in which the original data (if
include = TRUE
) and the imputed datasets are stacked onto
each other.
The variable Imputation_
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 = 10, thin = 2, warn = FALSE, seed = 1234)