heaping: Correction of Heaping on Individual Level

Provides methods for correcting heaping (digit preference) in survey data at the individual record level. Age heaping, where respondents disproportionately report ages ending in 0 or 5, is a common phenomenon that can distort demographic analyses. Unlike traditional smoothing methods that only correct aggregated statistics, this package corrects individual values by replacing a calculated proportion of heaped observations with draws from fitted truncated distributions (log-normal, normal, or uniform). Supports 5-year and 10-year heaping patterns, single heap correction, and optional model-based adjustment to preserve covariate relationships.

Package details

AuthorMatthias Templ [aut, cre] (ORCID: <https://orcid.org/0000-0002-8638-5276>), Bernhard Meindl [ctb]
MaintainerMatthias Templ <matthias.templ@gmail.com>
LicenseGPL (>= 2)
Version0.1.0
URL https://github.com/matthias-da/heaping
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("heaping")

Try the heaping package in your browser

Any scripts or data that you put into this service are public.

heaping documentation built on Feb. 10, 2026, 1:08 a.m.