Description Usage Arguments Value References Examples
The user has to pass his data to the function.
Optionally he passes his analysis model formula so that hmi
runs the imputation model
in line with his analysis model formula.
And of course he can specify some parameters for the imputation routine
(like the number of imputations and iterations and the number of iterations
within the Gibbs sampling).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
data |
A |
model_formula |
A |
family |
To improve the default pooling, a family object supported by |
additional_variables |
A character with names of variables (separated by "+", like "x8+x9")
that should be included in the imputation model as fixed effects variables,
but not in the analysis model.
An alternative would be to include such variable names into the |
list_of_types |
a list where each list element has the name of a variable
in the data.frame. The elements have to contain a single character denoting the type of the variable.
See |
m |
An integer defining the number of imputations that should be made. |
maxit |
An integer defining the number of times the imputation cycle (imputing x_1|x_{-1} then x_2|x_{-2}, ... and finally x_p|x_{-p}) shall be repeated. The task of checking convergence is left to the user, by evaluating the chainMean and chainVar! |
nitt |
An integer defining number of MCMC iterations (see |
burnin |
An integer for the desired number of Gibbs samples that shall be regarded as burnin. |
pvalue |
A numeric between 0 and 1 denoting the threshold of p-values a variable in the imputation model should not exceed. If they do, they are excluded from the imputation model. |
mn |
An integer defining the minimum number of individuals per cluster. |
k |
An integer defining the allowed maximum of levels in a factor covariate. |
spike |
A numeric value saying which value in the semi-continuous data might be the spike.
Or a list with with such values and names identical to the variables with spikes
(see |
heap |
Use spike instead. |
rounding_degrees |
A numeric vector with the presumed rounding degrees of rounded variables.
Or a list with rounding degrees, where each list element has the name of a rounded continuous variable.
Such a list can be generated using |
rounding_formula |
A formula with the model formula for the latent rounding tendency G.
Or a list with model formulas for G, where each list element has the name of a rounded continuous variable.
Such a list can be generated
using |
pool_with_mice |
A Boolean indicating whether the user wants to pool the |
The function returns a mids
object. See mice
for further information.
Matthias Speidel, Joerg Drechsler and Shahab Jolani (2020): "The R Package hmi: A Convenient Tool for Hierarchical Multiple Imputation and Beyond", Journal of Statistical Software, Vol. 95, No. 9, p. 1–48, http://dx.doi.org/10.18637/jss.v095.i09
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.