Description Usage Arguments Details Value Examples
mnrCoding
converts missing responses coded as missing by intention at the end of a block of items to missing not reached.
1 2 3 |
dat |
A dataset. Missing by intention needs to be coded |
pid |
Name or column number of identifier (ID) variable in |
rotation.id |
A character vector of length 1 indicating the column name of the test booklet identfier in |
blocks |
A data frame containing the sequence of subunits in each block in long format. The column names need to be |
booklets |
A data frame containing the sequence of blocks in each booklet in wide format. The column names need to be |
breaks |
Number of blocks after which |
subunits |
Optional: A data frame with subunit information if a dataset is used that has been recoded with |
nMbi |
Number of |
mbiCode |
Character indicating |
mnrCode |
Character to which |
invalidCodes |
Character vector indicating missing codes to be ignored. |
verbose |
logical. If |
In order to code mnr
, a certain number of subunits at the end of a block need to be coded mbi
. This number can be specified with the argument nMbi
. The default is 2, i.e. if the last and second to last subitem in a block are coded mbi
, both subunits, as well as the preceding subunits coded mbi
, will be recoded to mnr
. If nMbi
is larger than the number of subunits in a given block, no subitem in this block will be recoded. If all subunits in a block are coded mbi
, none of them will be recoded to mnr
.
If a subunits
data frame is specified, recodeMbiToMnr
expects to find the recoded subunits in dat
.
Examples for data frames booklets
, blocks
, rotation
and subunits
can be found via data(inputList)
A data frame with missing not reached coded as mnr
. For each person with at least one mnr
in the returned dataset the names of recoded variables are given as an attribute to dat
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(inputDat)
data(inputList)
prepDat <- automateDataPreparation (inputList = inputList,
datList = inputDat, readSpss = FALSE, checkData=FALSE,
mergeData = TRUE, recodeData=TRUE, aggregateData=FALSE,
scoreData= FALSE, writeSpss=FALSE, verbose = TRUE)
prepDat2 <- mergeData("ID", list(prepDat, inputList$rotation))
mnrDat <- mnrCoding (dat = prepDat2, pid = "ID",
booklets = inputList$booklets, blocks = inputList$blocks,
rotation.id = "booklet", breaks = c(1, 2),
subunits = inputList$subunits, nMbi = 2, mbiCode = "mbi",
mnrCode = "mnr", invalidCodes = c("mbd", "mir", "mci"),
verbose = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.