fromseqimp: Transform an object of class 'seqimp' into a dataframe or a...

View source: R/manipulation_seqimp.R

fromseqimpR Documentation

Transform an object of class seqimp into a dataframe or a mids object

Description

The function converts a seqimp object into a specified format.

Usage

fromseqimp(data, format = "long", include = FALSE)

Arguments

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: "long", "stacked" and "mids". See the Details section for the interpretation.

include

logical that indicates if the original dataset with missing value should be included or not. This parameter does not apply if format="mids".

Details

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.

Value

Transform a seqimp object into the desired format.

Author(s)

Kevin Emery

Examples


## 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)


seqimpute documentation built on May 29, 2024, 4:35 a.m.