compare_mids | R Documentation |
mids
Objects and Show Summarycompare_mids()
is a combination of
all.equal()
and
identical()
for mids
objects. Like
all.equal()
, it displays a summary of element-wise differences (it also
explicitly lists elements that are equal). However, rather than outputting
these differences as a character
vector if found, it always returns either
TRUE
or FALSE
. If quiet = FALSE
, the return value is invisible.
compare_mids(
x,
y,
show_msg = TRUE,
show_rtn = !show_msg,
ignore_rng = NULL,
ignore_call = TRUE,
ignore_version = TRUE,
ignore_date = TRUE
)
x, y |
|
show_msg |
Should the message displaying element-wise comparisons be shown? |
show_rtn |
Should the return value be visible? The default is the
opposite of |
ignore_rng |
Should elements or components of elements affected by the
RNG state be ignored? See Details for more information. The default is to
ignore when different package namespaces are detected in the |
ignore_call, ignore_version, ignore_date |
Should the corresponding
|
Proper random number generation requires different methods when performing
operations in parallel; thus, is it generally not possible to exactly
replicate mids
objects produced sequentially when imputing chains in
parallel. In particular, the imputed values will differ, as well as any
functions of those values (chainMean
, chainVar
, loggedEvents
). This
function takes the stance that imputations performed by functions in the
same package should be consistent, but functions from different packages
may handle random number generation differently. Thus, if compare_mids()
can detect that two functions came from the same package, it will compare
the full RNG-related elements by default. Otherwise, it will check that
attributes independent of random number generation are the same, but it will
allow differences between attributes and data dependent on the RNG state. If
RNG-related attributes are ignored, the RNG state itself is also ignored, so
differences in seed
and lastSeedValue
are also allowed in this case.
TRUE
or FALSE
m_mids <- mice::mice(mice::nhanes, m = 1L, maxit = 1L)
f_mids <- future_mice(mice::nhanes, m = 1L, maxit = 1L)
compare_mids(m_mids, f_mids)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.