Versioned data and calculation audits: tracing a corrected result

A published number can change for legitimate reasons: a source corrects a value, an eligibility rule changes or an analyst repairs a formula. An audit trail should make those reasons visible. This guide uses an invented three-record dataset to show why preserving versions matters and why a matching checksum alone cannot establish factual accuracy.

Give each state a stable identity

Treat the original download, cleaned table and published result as separate identifiable objects. The W3C Data on the Web Best Practices recommendation discusses provenance and version information so consumers can understand a dataset’s history. A filename such as latest does not identify which values produced an older result. Use a documented version identifier and preserve the associated timestamp, source reference and transformation record. Distinguish the date a measurement was made from the date it was corrected, downloaded or analysed.

Separate correction from a change of question

Suppose a hypothetical source contains values 10, 20 and 30 units for records A, B and C. Its mean is twenty. A verified correction changes C from thirty to sixty, producing a mean of thirty across the same three records. Excluding C altogether produces a mean of fifteen across A and B. That last change answers a different question about a different set of records; it is not merely another way of implementing the correction. Label the reason and scope of each revision explicitly.

Trace the arithmetic across versions

Invented audit example; values and calculations constructed for this tutorial
Version or outputIncluded valuesSum and countMean
Raw snapshot v110, 20, 3060 / 320
Corrected snapshot v210, 20, 6090 / 330
Restricted output from v210, 2030 / 215
Full-scope republication from v210, 20, 6090 / 330

The fourth row confirms that publishing the corrected full-scope result does not require deleting the restricted output. Both can be retained if their populations and purposes are clear. These are example identifiers rather than real source releases, and no actual provider correction is implied.

Model the derivation chain

The W3C PROV data model distinguishes entities, activities and agents involved in producing information. Applied to the toy example, the raw table is an entity, the correction is an activity and the corrected table is another entity. Record which process or responsible role applied the change and the evidence supporting it. This description does not require exposing personal information. Its purpose is to preserve the relationships needed to understand how the new output was derived from the old input.

Use checksums for their actual purpose

A cryptographic checksum can help detect whether file bytes differ from a recorded reference. It does not show that a table represents the correct population, that a source value is true or that a formula answers the intended question. Even visually identical tables can have different byte representations because of ordering, encoding or formatting. Conversely, a perfectly preserved file can contain an original error. Keep integrity checks alongside semantic checks such as row counts, units, key uniqueness and reconciliation totals, explaining what each check establishes.

Make recalculation independent of memory

The National Academies treatment of computational reproducibility supports retaining inputs and methods sufficient to regenerate results. For the example, the audit record should identify the correction to record C, the selection rule for each output and the mean formula. A reviewer should not need to guess whether sixty was an added record or a replacement value. Keep executable transformations or precise written steps, and record software details when they can affect calculations. A clean rerun should begin from the named input snapshot.

Publish corrections with appropriate continuity

When a corrected result replaces a public value, explain the old and new figures, the reason for the change and whether the interpretation changed. Preserve a readable correction history rather than silently overwriting the past. If access restrictions prevent distributing an original input, state the restriction and retain enough non-sensitive metadata for authorised verification. Version history should support accountability without encouraging unnecessary collection or publication of personal data. The scope of retention should match the project’s legitimate requirements and applicable rules.

Calculation-audit checklist

  • Name the input snapshot and result version.
  • Record observation, retrieval and revision dates separately.
  • Preserve correction evidence and changed record identifiers.
  • Distinguish replacements from additions and exclusions.
  • Reconcile sums, counts, units and formulas.
  • Use checksums as integrity evidence, not truth evidence.
  • Document the correction in the public result history.

For the toy dataset, a successful audit explains all four rows without ambiguity: two input states, two scopes and one consistent averaging rule. The same discipline scales to larger datasets. The essential feature is a traceable chain of reasons and calculations, not the volume of technical metadata or the sophistication of the storage system.

Frequently asked questions

Does a matching checksum prove the data are correct?

No. It supports byte-level integrity relative to a reference, not factual or statistical validity.

Should a correction erase the old result?

A clear version history normally preserves the previous state and explains the correction, subject to legitimate retention and access constraints.

Is removing a record the same as correcting its value?

No. Removal changes the analysis population, while replacing a value can preserve the same population. Both need explicit documentation.

Sources and verification