fit_mice_for_diag | R Documentation |
mice
object for diagnosticsFunction that creates a mice
object for diagnostics, with
m = 5
. Iteratively increases the number of iterations by 5 until
Rhat < Rhat.threshold
for mean and variance of all variables in imputation model.
Thus, accessing $iteration
in the resulting mice
object
will give the value of maxit
to be used in the final m > 5
imputation model.
fit_mice_for_diag(..., iter10 = FALSE, Rhat.threshold = 1.1, final.maxit = 100)
... |
Arguments to be passed to |
iter10 |
Logical switch indicating whether function should use the
iterative procedure to find a sufficient number of iterations. When
|
Rhat.threshold |
Maximum acceptable R-hat statistic |
final.maxit |
Number of iterations after which search should stop, regardless of whether Rhat threshold has been met. |
Always uses same random seed. Includes a dataframe with all Rhat values at
each step, which can be accessessed via mice$rhat
. See mice::mice
for more documentation of arguments.
library(mice)
pred.matrix <- quickpred(boys, mincor = .10, minpuc = 0.50)
mice.m5 <- fit_mice_for_diag(data = boys,
predictorMatrix = pred.matrix,
method = c("pmm"))
mice.m5$m
mice.m5$iteration
mice.m5$rhat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.