imputationList {mitools}R Documentation

Constructor for imputationList objects

Description

Create and update imputationList objects to be used as input to other MI routines.

Usage

imputationList(datasets)
## S3 method for class 'imputationList':
update(object,...)
## S3 method for class 'imputationList':
rbind(...)
## S3 method for class 'imputationList':
cbind(...)

Arguments

datasets a list of data frames corresponding to the multiple imputations
object An object of class imputationList
... Arguments tag=expr to update will create new variables tag by evaluating expr in each imputed dataset

Value

An object of class imputationList

Examples

data.dir<-system.file("dta",package="mitools")
files.men<-list.files(data.dir,pattern="m.\.dta$",full=TRUE)
men<-imputationList(lapply(files.men, foreign::read.dta))
files.women<-list.files(data.dir,pattern="f.\.dta$",full=TRUE)
women<-imputationList(lapply(files.women, foreign::read.dta))
men<-update(men, sex=1)
women<-update(women,sex=0)
all<-rbind(men,women)
all<-update(all, drinkreg=as.numeric(drkfre)>2)
all

[Package mitools version 1.0 Index]