timriffe / DemoTools

Tools for the evaluation, adjustment, and standardization of demographic data
https://timriffe.github.io/DemoTools
Other
59 stars 31 forks source link

check_heaping_bachi generates warning if data means default ageMax > max(Age) #209

Closed peterdavjohnson closed 3 years ago

peterdavjohnson commented 3 years ago

Currently, check_heaping_bachi generates a warning if the input data means default ageMax of 77 > max(Age). It would be nice if calling the function without specifying the ageMax would find the right level (either 77 or 67 or ...) depending on the data/ages sent in.

The actual ageMax used can be found in the output as item max_age_used if details = TRUE is specified.

If others want the message, then add an option of verbose = TRUE/FALSE, and I would assume a default of FALSE.

timriffe commented 3 years ago

I think the version I just posted implements this behavior as you describe. If ageMax is too high, then it gets dropped to the highest valid possibility. A message is only passed if ageMax is too high and needs to be lowered. It's not passed if a default is being used.