prep2gads: Convert eatPrep Data and Meta Info to 'GADSdat' object as...

prep2GADSR Documentation

Convert eatPrep Data and Meta Info to GADSdat object as used in package eatGADS

Description

This function converts a data.frame with data that have been prepared for IRT analyses with eatPrep to an eatGADS object.

Usage

prep2GADS(dat, inputList, trafoType = c("scored", "raw"),
misTypes = list(mvi = -95, mnr = -96, mci = -97, mbd = -94, mir = -98, mbi = -99),
verbose = TRUE)

Arguments

dat

A data.frame, typically one in the last transformation status after eatPrep-based transformations (after 'scoring'). However, merged, recoded and aggregated, but not scored data can also be handled, as long as this data.frames' colnames correspond to the unit-names 'units' in the inputList (that is trafoType=="scored"). Merged but not recoded, not aggregated and not scored data can also be converted to a GADSdat object (using trafoType=="raw").

inputList

A list following the typical structure of an eatPrep inputList. Only the first three data frames are needed to utilize this function. See ‘Details’.

trafoType

Character string. Whether raw data (including original values and subunits) or scored data (usually, 0/1 and mistypes like mbi/mbo et al. and everything aggregated to units) shall be exported.

misTypes

A named list with definitions how to recode the different types of missings (mainly used when trafoType=="scored").

verbose

logical. If TRUE, additional information is printed.

Details

This function converts a recoded, aggregated and scored data set to an eatGADS object using the meta information stored in an inputList. Only the first three data.frames of a typical inputList are used (subunits, values and units). However, the order of these three data.frames in the inputList is irrelevant.

Examples of data frames subunits, values and units can be found via data(inputList).

Value

A GADSdat object.

Author(s)

Karoline Sachse

Examples

data(inputDat)
data(inputList)

prepDatScored <- automateDataPreparation(inputList = inputList, datList = inputDat,
    readSpss = FALSE, checkData=FALSE, mergeData = TRUE, recodeData=TRUE,
    aggregateData=TRUE, scoreData=TRUE, writeSpss=FALSE, verbose = TRUE)

GADSobj1 <- prep2GADS(dat = prepDatScored, inputList = inputList[1:3], trafoType = "scored",
                                verbose=TRUE)

prepDatRaw <- automateDataPreparation(inputList = inputList, datList = inputDat,
    readSpss = FALSE, checkData=FALSE, mergeData = TRUE, recodeData=FALSE,
    aggregateData=FALSE, scoreData=FALSE, writeSpss=FALSE, verbose = TRUE)

GADSobj2 <- prep2GADS(dat = prepDatRaw, inputList = inputList[1:3], trafoType = "raw",
                                verbose=TRUE)


sachseka/eatPrep documentation built on June 9, 2025, 9:36 a.m.