
Check if labeled values fall within the specified missing value range
check_missing_range.RdThis function checks whether all labeled values in the meta data of a GADSdat object fall within the specified range for missing values.
It identifies values that are labeled as valid but should be declared as missing based on the defined missingRange.
Value
A data.frame listing labeled values that are within the specified missingRange but marked as valid in the meta data.
The output includes the following columns:
varName: The name of the variable containing the value.value: The value itself that falls within themissingRange.valLabel: The label associated with the value.missings: The current missing status in the meta data (should be"valid"if reported here).
If all values within the missingRange are already declared as missing, the function returns an empty data.frame.
Examples
# Example usage:
# Load example GADSdat object
GADSdat <- eatGADS::import_spss(system.file("extdata", "example_data2.sav", package = "eatFDZ"))
# Check if labeled values are within the missing value range (-50 to -99 by default)
missing_range_report <- check_missing_range(GADSdat)
# Print the report
print(missing_range_report)
#> varName value valLabel missings
#> 1 books -99 omitted valid
#> 2 school -99 omitted valid
#> 3 school -98 unclear answer valid
#> 4 school -97 unknown valid