% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/diagnostics.R
\name{steps_data_quality}
\alias{steps_data_quality}
\title{Data Quality Diagnostics for WHO STEPS Data}
\usage{
steps_data_quality(raw, cleaned, cols)
}
\arguments{
\item{raw}{The raw (pre-cleaning) data frame, typically from
\code{\link[=import_steps_data]{import_steps_data()}}.}

\item{cleaned}{The cleaned data frame from \code{\link[=clean_steps_data]{clean_steps_data()}}.}

\item{cols}{Column mapping list from \code{\link[=detect_steps_columns]{detect_steps_columns()}}.}
}
\value{
A list of class \code{"steps_quality"} with elements:
\describe{
\item{digit_preference}{Terminal-digit tables and heaping indices for
physical measurements (SBP, DBP, height, weight, waist).}
\item{completeness}{Per-variable missingness counts and percentages,
grouped by STEPS domain.}
\item{plausibility}{Summary of values outside plausible ranges.}
\item{weights}{Sampling weight distribution statistics.}
}
}
\description{
Produces a comprehensive data quality report covering digit preference,
completeness, plausibility, and sampling weight diagnostics.
}
\details{
\strong{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.

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

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

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