checkMissings {eatGADS} | R Documentation |
Check and Adjust Missing Tags
Description
Functions to check if missings are tagged and labeled correctly in a GADSdat
object.
Usage
checkMissings(
GADSdat,
missingLabel = "missing",
addMissingCode = TRUE,
addMissingLabel = FALSE
)
checkMissingsByValues(GADSdat, missingValues = -50:-99, addMissingCode = TRUE)
Arguments
GADSdat |
|
missingLabel |
Single regular expression indicating how missing labels are commonly named in the value labels. |
addMissingCode |
If |
addMissingLabel |
If |
missingValues |
Numeric vector of values which are commonly used for missing values. |
Details
checkMissings()
compares value labels (valLabels
) and missing tags (missings
) of a GADSdat
object and its
meta data information.
checkMissingsByValues()
compares labeled values (value
) and missing tags (missings
) of a GADSdat
object
and its meta data information.
Mismatches are reported and can be automatically adjusted. Note that all checks are only applied to the
meta data information, not the actual data. For detecting missing value labels, see checkMissingValLabels
.
Value
Returns a GADSdat
object with - if specified - modified missing tags.
Functions
-
checkMissings()
: compare missing tags and value labels -
checkMissingsByValues()
: compare missing tags and values in a certain range
Examples
# checkMissings
pisa2 <- changeValLabels(pisa, varName = "computer_age",
value = 5, valLabel = "missing: No computer use")
pisa3 <- checkMissings(pisa2)
# checkMissingsByValues
pisa4 <- changeValLabels(pisa, varName = "computer_age",
value = c(-49, -90, -99), valLabel = c("test1", "test2", "test3"))
pisa5 <- checkMissingsByValues(pisa4, missingValues = -50:-99)