Ages are considered redundant if values for the underlying single ages are repeated. This might occur if there is an extra open age group below the final open age group. For example we have single ages 0 to 84, with an open age group of 85+, but the data also contain an open age group of 70+, leading to age 70 appearing twice. This will also detect
is_age_redundant(Age, AgeInt)
Age | integer vector of single ages (lower bound) |
---|---|
AgeInt | integer vector. Age interval widths |
logical. Are there repeated values in the Age
vector?
Missing AgeInt
are conservatively imputed with 20, which will most often trigger FALSE
and thereby flag for further inspection.
Age <- c(0:100,70) AgeInt <- c(rep(1,100),NA,NA) # it doesn't matter if Age is sequential for this check is_age_redundant(Age, AgeInt)#> [1] TRUE