This function select variables and some (or all) imputed datasets of an object of class BIFIEdata and saves the resulting object also of class BIFIEdata.

BIFIEdata.select(bifieobj, varnames=NULL, impdata.index=NULL)

Arguments

bifieobj

Object of class BIFIEdata

varnames

Variables chosen for the selection

impdata.index

Selected indices of imputed datasets

Value

An object of class BIFIEdata saved in a non-compact or compact way, see value cdata

See also

See BIFIE.data for creating BIFIEdata objects.

Examples

#############################################################################
# EXAMPLE 1: Some manipulations of BIFIEdata objects created from data.timss1
#############################################################################
data(data.timss1)
data(data.timssrep)

# create BIFIEdata
bdat1 <- BIFIEsurvey::BIFIE.data( data.list=data.timss1, wgt=data.timss1[[1]]$TOTWGT,
            wgtrep=data.timssrep[, -1 ])
summary(bdat1)

# create BIFIEcdata object
bdat2 <- BIFIEsurvey::BIFIE.data( data.list=data.timss1, wgt=data.timss1[[1]]$TOTWGT,
            wgtrep=data.timssrep[, -1 ], cdata=TRUE )
summary(bdat2)

# selection of variables for BIFIEdata object
bdat1a <- BIFIEsurvey::BIFIEdata.select( bdat1, varnames=bdat1$varnames[ 1:7 ] )
# selection of variables and 1st, 2nd and 4th imputed datasets of BIFIEcdata object
bdat2a <- BIFIEsurvey::BIFIEdata.select( bdat2, varnames=bdat2$varnames[ 1:7 ],
                impdata.index=c(1,2,4) )
summary(bdat1a)
summary(bdat2a)