Programming · free software · the open webSubscribe via RSS

How Should a Tool Represent a Sensor’s Missing Reading?

From the earlier reference collection. Read the current software blog.

Represent an absent measurement explicitly so users do not mistake a gap for zero or for a repeated observation.

Missing is a distinct state

When no reading exists for an expected observation, represent the value as missing or unavailable. Zero is a valid numeric value in many measurement systems, so using it to mean “no data” changes the meaning. A blank cell can also be ambiguous if a user cannot tell whether it means missing, not applicable, or not yet loaded.

A clear interface might show “No reading reported” alongside the expected time. In a data structure, use a documented null or missing marker and, where possible, a separate status field that explains the state. Do not invent a temperature value to make a chart look continuous.

Do not silently carry values forward

Repeating the last known value across missing intervals can make an instrument appear to have produced measurements it never reported. A flat line may be interpreted as evidence that conditions remained stable, even though the source was simply silent. If a display intentionally carries a value forward for a specific operational reason, label it as carried forward and keep its original observation time visible.

For example, a 14.2 °C observation at noon should not appear as a new 14.2 °C measurement at 12:15 when no sample arrived then. The later interval can remain a gap, with the last observed value shown separately if useful. That preserves the difference between a past measurement and a current absence.

Explain why data are absent when known

Missingness can have different causes: a sensor may not have sampled, transmission may have failed, the source may have withheld a value, or an import may still be pending. Record a reason only when the system has evidence for it. Otherwise, use a neutral label such as “unavailable” rather than guessing that an outage or hardware fault occurred.

A status field can distinguish states such as “not received,” “withheld,” and “not applicable,” if the data source supports those distinctions. Define the states in documentation and preserve the original source marker when importing data. Consistent meanings make missing values easier to analyze and compare.

Show gaps clearly in analysis

Charts should leave visible gaps where measurements are absent, unless a stated method intentionally estimates values. Summaries should document how missing observations are handled. A mean calculated from available points is not the same as an average over every expected interval if missing periods are unevenly distributed.

For a daily summary, report the number of observations used or the coverage period when that information is available. If a statistic is estimated or interpolated, label it as such and explain the method. Explicit gaps help readers assess whether the remaining data support their question, without turning absence into a false measurement.

Suggest a correction · All posts