ParlayAPI Field Guides

How missing quotes change average age

Imagine reviewing 24 quotes at noon. Twelve came from Venue A and twelve from Venue B. Their average age is 22 seconds. If Venue B drops out of the response, the visible average falls to 16 seconds, even though every quote kept its original timestamp.

Open the exercise full screen or run the Python notebook in Colab. The example uses fictional data and runs without a key.

Reproduce the comparison

Quote age is the review time minus the source update time. The fixture assigns Venue A ages of 5, 7, …, 27 seconds and Venue B ages of 17, 19, …, 39 seconds. The full mean is the sum of all 24 ages divided by 24. The visible mean uses only the retained rows in both the sum and the denominator. With zero retained rows, the visible mean is undefined.

Pattern Removal order
Balanced across venues and ages Remove the youngest and oldest remaining rows at each venue in groups of four.
Venue B first Remove youngest–oldest pairs from Venue B until it is empty, then do the same at Venue A.
Oldest quotes first Sort all quotes by descending age. For a tie, remove Venue A’s quote first.

The known full mean lets you measure the distortion in this exercise. In a real response you can count received rows, but their timestamps alone cannot tell you the ages of quotes you never received. Record the requested scope and an independent expected count when you have one. Compare source time with receipt time or inspect the public odds preview.

Watch the 35-second example

The video compares three samples of 12 fictional quotes. Balanced removal leaves a mean age of 22 seconds. Losing Venue B leaves 16 seconds. Removing the oldest half leaves 14.5 seconds. Download the captioned MP4 or read the timed captions.

Embed the exercise

Paste this into an article or teaching page that permits HTML embeds. The file contains the controls and dataset, so it can also be saved and opened offline.

<iframe title="How missing quotes change average age"
  src="https://jacobiusmakes.github.io/parlayapi-notebooks/missing-observations-assets/lab.html"
  width="100%" height="740" loading="lazy" sandbox="allow-scripts"
  style="border:0"></iframe>