Why Audit Units and Derived Variables?
A dataset can contain plausible-looking numbers that are wrong because a unit was misunderstood, a time conversion was applied inconsistently, or a formula was implemented incorrectly. Such errors can change the scale or meaning of an analysis variable without making the dataset obviously invalid. An independent review therefore checks not only whether values are present, but whether each value can be reconstructed from its inputs using the documented units, formula, and conventions.
This audit concerns unit consistency and derived dataset variables such as dose-normalized measurements, elapsed time, and body-size measures. It does not establish that a variable belongs in a particular analysis or that a model uses it correctly. The core review question is narrower: given the stated inputs and derivation, does the dataset value have the right numerical value and unit?
Establish the Unit Contract Before Recalculation
For each audited variable, identify the source fields, their units, the intended formula, and the output unit. Also record conventions that affect interpretation: whether dose means administered or prescribed dose, whether time is measured from the actual or scheduled event, and which height and weight measurements are paired. Unit labels should be explicit. “Time” alone is not sufficient if the stored values might represent minutes, hours, or calendar timestamps.
A basic dimensional check asks whether the units on the right-hand side of a formula combine to the unit claimed on the left. Conversion factors should be written with units so that cancellation is visible. For example, converting minutes to hours uses a factor equal to one:
The minutes cancel, leaving hours. This does not by itself prove that the recorded number is correct: the source unit and conversion factor must also be verified. It does expose many errors, such as multiplying by 60 when converting minutes to hours.
Recalculation is meaningful only when the inputs and conventions are adequately specified. If a field’s unit is undocumented, or if an event’s date, time zone, or reference event is ambiguous, an auditor should report that limitation rather than silently assume a convention. Preserve the original fields and create an independently calculated comparison value; overwriting source data removes useful evidence about how a discrepancy arose.
Worked Recalculations
Worked Example: Dose-Normalized Concentration
Hypothetical data. A record has a concentration of 3.6 mg/L and an administered dose of 180 mg. The documented derived variable is concentration divided by administered dose. Recalculate the value and check its units.
The formula is \(C_{\mathrm{norm}}=C/D\), where \(C\) is concentration and \(D\) is dose. Substitution gives:
The milligram units cancel, leaving inverse liters. The dataset value should therefore be approximately 0.0200 L−1, or the equivalent value in the dataset’s explicitly documented output convention. To retain the interpretation of the operation, a reviewer might also document the calculation as 0.0200 (mg/L)/mg. These expressions are dimensionally equivalent.
This result depends on using the stated administered dose and expressing dose in milligrams. If the dose were stored as 0.180 g, it would first need conversion: \(0.180\ \mathrm{g}\times1000\ \mathrm{mg/g}=180\ \mathrm{mg}\). Dividing by 0.180 as though it were milligrams would give 20.0 rather than 0.0200 L−1, a thousandfold discrepancy. The arithmetic alone cannot decide whether concentration divided by dose is the scientifically intended quantity; that definition must be confirmed from the dataset documentation.
Worked Example: Elapsed Time Across Midnight
Hypothetical data. A dose is recorded at 22:40 on July 8, and a sample is recorded at 01:10 on July 9. The derived variable is elapsed time in hours from dose to sample. Assume both timestamps use the same time zone and the stated dates are correct.
Convert each clock time to minutes after midnight on its own date. The dose time is \(22\times60+40=1{,}360\) minutes. The sample time is \(1\times60+10=70\) minutes, but it occurs on the next day. Therefore, the elapsed time is the remaining minutes in the first day plus the minutes on the second day:
The derived value is 2.5 hours. Subtracting the clock readings while ignoring the dates would produce a negative interval, which is inconsistent with the stated event order. If timestamps are stored with time zones, daylight-saving changes or differing zone offsets can also affect elapsed duration; the reviewer must use the documented timestamp convention rather than infer one from clock times alone.
Worked Example: Recomputing Body-Surface Area
Hypothetical data. A dataset contains height 172 cm and weight 68.4 kg for one record, and reports body-surface area (BSA) using the Mosteller formula. Check the calculation and output unit.
The formula is \( \mathrm{BSA}=\sqrt{(\mathrm{height\ in\ cm}\times\mathrm{weight\ in\ kg})/3600}\), with BSA in square metres. Substituting the values:
The value is approximately 1.808 m2. The stated formula requires height in centimetres and weight in kilograms; entering height as 1.72 without converting it would not follow that formula. The formula’s constant is tied to the stated units, so it is not valid to change an input unit and leave the rest of the expression unchanged. Also check that the height and weight are the intended measurements for this record, rather than merely selecting the nearest available values.
A Reproducible Audit Procedure
A useful audit separates checking the definition from checking the implementation. First confirm the formula, input fields, units, and conventions in the available documentation. Then independently calculate a comparison value from the source fields. Compare that value with the dataset output using a tolerance appropriate to the variable’s rounding precision. Exact equality is appropriate only when the derivation and storage are expected to produce exactly the same representation.
Write down what the derived variable represents, its source fields, the formula, and the required output unit. Resolve ambiguities before calculating.
Confirm the input units and conversion factors, and verify details such as the reference event for elapsed time or the dose definition for dose normalization.
Use an independent calculation from retained inputs. Check a variety of records, including boundary cases such as midnight, unit changes, or unusually large and small values.
Compare recomputed and stored values, classify discrepancies, and preserve enough detail to reproduce the audit: input values, units, formula, output, and comparison rule.
For a formula with a constant, check that the constant’s unit convention is documented. For example, the Mosteller BSA expression is conventionally used with height in centimetres and weight in kilograms. A numeric check using different units is not a valid independent verification unless the formula has also been transformed correctly.
Diagnostics, Alternatives, and Limitations
A strong review combines spot checks with systematic checks. Manual calculations are transparent and useful for validating a formula on selected records, especially edge cases. Automated assertions can then check every row for conditions such as missing inputs, nonpositive denominators, impossible date ordering under the stated convention, or disagreement beyond a defined rounding tolerance. These approaches complement each other: a script can apply the wrong formula consistently, while a few manual checks may miss a rare error affecting only a subset of records.
Useful diagnostic patterns include a constant factor-of-60 discrepancy in time values, a factor-of-1,000 discrepancy associated with grams versus milligrams, negative elapsed times caused by incorrect date handling, and abrupt changes in a derived variable when source-unit conventions change. Summaries and plots can help locate such patterns, but unusual values are flags for investigation, not proof of an error. A high concentration or large BSA might be valid; the audit tests derivation and unit consistency, not clinical plausibility alone.
The audit also has limits. Recomputing a value cannot establish that its source measurement is accurate, that the documented formula is scientifically appropriate, or that the variable is appropriate for a particular analysis. A mismatch may arise from rounding, an undocumented transformation, a wrong source record, or an implementation error. Each possibility should be distinguished using the available records and documentation. If the derivation cannot be reconstructed, record the variable as not independently verified rather than presenting an assumed reconstruction as fact.
Common Pitfalls
- Treating unit labels as decoration. The wrong reasoning is that a number stays the same when its label changes. In fact, 0.180 g and 180 mg are equal quantities but different numeric values; convert before applying a formula.
- Subtracting clock times without dates. A later clock time can occur on the next calendar day. Use complete timestamps or an explicit day-boundary rule.
- Checking arithmetic but not the definition. Correctly dividing concentration by dose does not verify that the documented dose is the intended denominator. Confirm what the variable is defined to use.
- Comparing rounded values as if exact. A small difference may be due to storage precision. Set and document a tolerance based on the known rounding process; do not use a tolerance so wide that it hides a substantive unit error.
- Silently repairing inputs. Changing raw values or choosing a different height or weight can make a result appear to match while obscuring the original discrepancy. Keep source values intact and record any proposed correction separately.
Check Your Understanding
Answer each question, then compare your reasoning with the short solutions below.
- A concentration is 1.5 mg/L and the documented dose denominator is 75 mg. What is concentration divided by dose, and what are its units?
- A timestamp is 09:20 and the reference event is 07:50 on the same date. Calculate elapsed time in hours.
- Why is it invalid to use height in metres directly in the stated Mosteller formula while retaining its constant of 3600?
- A stored elapsed time is negative even though the sample occurred after the dose on the following date. Name one likely cause and one check.
- A stored derived value differs slightly from your recomputation. What should you establish before deciding that it is an error?
Solutions. (1) \(1.5/75=0.0200\ \mathrm{L^{-1}}\), because the milligram units cancel. (2) The difference is 1 hour 30 minutes, or \(90/60=1.5\) hours. (3) The formula’s constant is specified for height in centimetres and weight in kilograms; changing height to metres without transforming the formula changes the result. (4) The calculation may have subtracted clock times while ignoring the date. Check both full dates and the elapsed-time convention. (5) Establish the documented formula, input units, storage precision, and comparison tolerance; a small rounding difference and a substantive discrepancy are not the same finding.