View source: R/manipulation_seqimp.R
fromseqimp | R Documentation |
seqimp
into a dataframe or a mids
objectThe function converts a seqimp
object into a specified format.
fromseqimp(data, format = "long", include = FALSE)
data |
An object of class seqimp as created by the function seqimpute |
format |
The format in which the seqimp object should be returned. It
could be: |
include |
logical that indicates if the original dataset with missing
value should be included or not. This parameter does not apply
if |
The argument format
specifies the object that should be returned
by the function. It can take the following values
"long"
produces a data set in which imputed data sets are stacked vertically.
The following columns are added: 1) .imp
referring to the
imputation number, and 2) .id
the row names of the original dataset
"stacked"
the same as "long"
, but without the inclusion of
the two columns .imp
and .id
"mids"
produces an object of class mids
, which is the format
used by the mice
package.
Transform a seqimp
object into the desired format.
Kevin Emery
## Not run:
# Imputation with the MICT algorithm
imp <- seqimpute(data = gameadd, var = 1:4)
# The object imp is transformed to a dataframe, where completed datasets are
# stacked vertically
imp.stacked <- fromseqimp(data = imp,
format = "stacked", include = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.