Produces a comprehensive data quality report covering digit preference, completeness, plausibility, and sampling weight diagnostics.

steps_data_quality(raw, cleaned, cols)

Arguments

raw

The raw (pre-cleaning) data frame, typically from import_steps_data().

cleaned

The cleaned data frame from clean_steps_data().

cols

Column mapping list from detect_steps_columns().

Value

A list of class "steps_quality" with elements:

digit_preference

Terminal-digit tables and heaping indices for physical measurements (SBP, DBP, height, weight, waist).

completeness

Per-variable missingness counts and percentages, grouped by STEPS domain.

plausibility

Summary of values outside plausible ranges.

weights

Sampling weight distribution statistics.

Details

Digit preference / heaping is assessed using the Whipple-style heaping index: the ratio of observed frequency at a digit (0 or 5) to the expected frequency under uniform distribution. An index of 1.0 = no preference; >1.5 = moderate heaping; >2.0 = severe.

Completeness reports missing values for key STEPS variables grouped by Step (behavioural, physical, biochemical).

Plausibility counts values outside WHO-recommended ranges (e.g. height 100–250 cm, weight 20–300 kg, SBP 60–300 mmHg).

Weight diagnostics summarise the distribution of sampling weights and flag potential issues (high CV, zero/NA weights).