miVariable object.
miVariable(x, Imputations, whichNA = which.na(x), subset = F,
Names = 1:length(Imputations), row.names)
as.miVariable(x)
miVariable): atomic (non-list) variable.
as.miVariable):
miList object whose
imputations are atomic variables with the same length, mode, and attributes,
or an
miVariable object.
More general
mi objects are allowed, but the result will
not be an
miVariable object.
x
(or equal to the length of
x, if
subset=TRUE).
x are
missing.
TRUE, then each element of
Imputations will be replaced with
the subset indicated by
whichNA.
Imputations
data frame in the returned value. These are used if supplied explicitly,
otherwise if the
Imputations argument has names they are used,
otherwise default names are used.
Imputations data frame in the returned value.
"miVariable", with slots:
x to
miVariable; this may have its
own class),
whichNA and as many columns
as there are sets of multiple imputations.
as.miVariable, if
x cannot
be converted to an
miVariable object, then a more general
mi
object will be returned.
The
whichNA argument is typically equal to
which.na(x)
or
is.na(x).
x may be a matrix or array.
Schafer, J. L. (1997), Analysis of Incomplete Multivariate Data , Chapman & Hall, London.
c3 <- miEval(crimeImpExample[[3]])
c3 # an miList object, 10 sets of imputations
as.miVariable(c3) # same data, but stored as miVariable
x <- miVariable(c(1,2,NA,NA),
list(Imp1 = c(3,4), Imp2 = c(4,2)))
x
# Use of the subset argument (otherwise like x just above):
miVariable(c(1,2,NA,NA), subset = T,
list(Imp1 = c(99,99,3,4), Imp2 = c(99,99,4,2)))
# as.miVariable does not always return an miVariable object
y <- as.miList(x)
as.miVariable(y) # an miVariable
y[[1]] <- 1:6 # Now first imputation is longer
as.miVariable(y) # miList (couldn't convert to miVariable)