Course / Tutorials / Week 9 / Q-27
Quick tutorial Q-27 · Week 9 · about 15 min · Foundation
An asymmetry index, three definitions
Compute a left–right asymmetry three ways, as the walking app does for three measures, and see that the frame grid can matter more than the formula.
- Ask
- Collect
- Check (this week)
- Interpret (this week)
- Coach
- Reassess
Download notebook ·Python file ·Read as Markdown ·Data folder ·Chapter 9 (sections 9.2, 9.5, 9.8, 10.2)
Every cell runs in this page; the first run downloads Python (about 30 s). Nothing you load leaves your browser. Helpful first: Q-25 Find foot contacts in an ankle trace.
The decision
A runner is told one leg spends longer on the ground than the other. Before anyone acts on it, decide whether the difference is larger than the measurement can resolve, and whether the number was computed the same way as the one it is being compared with.
The raw data
raw/form1_ankles.csv: both ankles' image position and confidence in every frame of a treadmill run filmed from behind at 30 frames per second (464 rows). Chapter 9's example table, also published with the book's data (book/ch09-gait).
Try it
An asymmetry index compares a left value with a right value. Section 9.5 gives the common form, the difference as a percentage of the mean of the two sides:
A = 100 × |L − R| / ((L + R) / 2).
It is not the only one. The walking app uses three definitions for three of its measures (checked in walk/src/lib/metrics.ts): stance time uses the mean of the two sides as the denominator, arm swing uses the larger side, and knee bend uses the plain difference in degrees. Apply all three to one runner's contact times and see how much the definition and the frame rate decide the answer.
Type a prediction to enable Run.
Show the expected result without running
left: 22 contacts, frames [0, 1, 13, 8] (counts of 4, 5, 6, ... frames) right: 22 contacts, frames [0, 1, 13, 8] mean contact: left 211 ms, right 211 ms
Every contact is a whole number of frames, mostly 6 or 7 (200 or 233 ms), and the two feet have exactly the same mix: 13 contacts of 6 frames and 8 of 7 on each side. Now the three definitions, on the runner's two means and on a pair of values that do differ, the median single-leg hop heights of Section 10.2's worked example (0.142 m left, 0.121 m right).
Show the expected result without running
runner, contact time: mean denominator 0.0 %, larger denominator 0.0 %, plain difference 0.0 ms hops, height (Section 10.2): mean denominator 16.0 %, larger denominator 14.8 %, plain difference 2.1 cm one frame in a 6-frame contact: 15.4 % by the mean, 14.3 % by the larger
Show the expected result without running
pairs: median 15.4 %, 9 of 22 exactly 0

Three lessons, one per cell.
- The definition matters. For the same two hops, the asymmetry is 16.0% with the mean as denominator, 14.8% with the larger side, and 2.1 cm as a plain difference. A published value can be compared with yours only if the formula matches (Section 9.5).
- The frame grid matters more. At 30 frames per second a contact of 6 frames against one of 7 is already 15.4% by the mean. Pair by pair, this runner swings between 0% and 15.4% (median 15.4%, 9 of 22 pairs exactly 0, one pair 33%), only because each contact is rounded to whole frames. The walking app's stance-time bands for walking, good under 3% and okay under 8% (the dashed lines), are smaller than one frame here.
- Average before comparing. The two feet's means are identical, 211 ms each, so the asymmetry of the means is 0.0%. Compare means over many contacts, never single pairs.
For the athlete: a left–right difference in contact time from a 30-frames-per-second clip means nothing unless it is larger than one frame and shows in the average over many steps.
With your own data
Run this page on your own two-ankle table, then film the same run at the highest frame rate your phone offers and compare the pair-by-pair spread.
Check yourself
Left 0.142 m, right 0.121 m. What is the asymmetry with the mean of the two as the denominator?
Contacts of 6 and 7 frames at 30 frames per second give 15.4% asymmetry. What happens at 120 frames per second, for the same 0.2 s contact?
The same method in another field
Comparing two channels that should match, two load cells under one beam or two temperature sensors on one pipe, needs the same care: state the formula, and compare the difference with the resolution of each channel before calling it real.
Acknowledgements
Ankle table from Chapter 9 of Data-Driven Athletics; the hop heights are the worked example of Chapter 10.
References
- Chapter 9 of Data-Driven Athletics: The walking measures (the asymmetry index).
Built 2026-11-30 with Python packages numpy 2.5.5, pandas 3.1.1, matplotlib 3.11.2, scipy 1.18.1. In the browser the same code runs on Pyodide, so the last digit can differ.