R: Concatenate lists of imputed data sets

c.mitml.list {mitml} | R Documentation

## Concatenate lists of imputed data sets

### Description

These functions allow concatenating lists of imputed data sets by data set, row, or column.

### Usage

    ## S3 method for class 'mitml.list'
    c(...)
    ## S3 method for class 'mitml.list'
    rbind(...)
    ## S3 method for class 'mitml.list'
    cbind(...)

### Arguments

`...` | One or several lists of imputed data sets with class `mitml.list` as produced by `mitmlComplete` (or similar).

### Details

These function allow concatenating multiple lists of imputed data sets. The function `c` concatenates by data set (i.e., by appending additional data sets to the list), `rbind` concatenates by row (i.e., appending additional rows to each data set), and `cbind` concatenates by column (i.e., by appending additional columns to each data set).

These functions are intended for experienced users and should be used with caution. Appending rows or columns from multiple imputation procedures is usually unsafe unless in special applications (see Examples).

### Value

A list of imputed data sets with an additional class attribute `mitml.list`.

### Author(s)

Simon Grund

### Examples

    # Example 1: manual imputation by grouping variable

    data(studentratings)
    fml <- ReadDis + SES ~ ReadAchiev + (1|ID)

    imp <- panImpute(subset(studentratings, FedState=="SH"), formula=fml, n.burn=1000, n.iter=100, m=5)
    implist <- mitmlComplete(imp, print="all")

    imp2 <- panImpute(subset(studentratings, FedState=="B"), formula=fml, n.burn=1000, n.iter=100, m=5)
    implist2 <- mitmlComplete(imp2, print="all")

    rbind(implist, implist2)

    # Example 2: predicted values from linear model

    pred <- with(implist, predict(lm(ReadDis~ReadAchiev)))
    cbind(implist, pred.ReadDis=pred)

[Package mitml version 0.3-5 Index]