Which codes are (nearly) always coded on lines that also carry another code. Before accumulation a nested code's parent is split into its subcodes plus a residual and the family's connections are masked, so this is a data step shared by every model (ENA, ONA, TMA). Only the numeric signal is computed here; a codebook hierarchy or the code names are the caller's to combine with it.
Value
Named list: cooccurrence (codes x codes matrix, diagonal =
lines per code, off-diagonal = lines with both), pairs (k x 2
matrix of 0-based (sub, parent) column indices, by sub then parent),
containment (length k, cooccurrence[sub, parent] /
cooccurrence[sub, sub]), duplicates (d x 2, 0-based (i, j)
with i < j and identical presence).
Details
A pair (sub, parent) is reported when the sub occurs on at least
min_rows lines, at least threshold of those lines also
carry the parent, and the parent occurs on more lines than the two share.
Two codes present on exactly the same lines are duplicates: they appear
in duplicates and never in pairs.