Skip to main contentSkip to navigation

When a metric definition changes your causal result

By Syed Ahmed Basharat Ali. Published .

Test the result under every reasonable definition before you trust it. In my study of 101,684 real JD.com orders, the estimated effect of on-time delivery on repurchase ranged from -0.38 to +0.51 points depending on how "on time" was defined.

I am Syed Ahmed Basharat Ali, a New York data scientist who works on experimentation and causal inference. This study uses public JD.com order data from March 2018.

The raw comparison pointed the wrong way

In the raw data, customers whose orders arrived on time repurchased 0.76 points less often. That is a warning sign rather than a finding, because orders that arrive late can differ in other ways. After adjustment with AIPW, the estimate moved to -0.38 points.

The definition changed the answer

Only the strict definition had a confidence interval that excluded zero. The primary estimate also had an E-value of 1.68, which is a low bar: a fairly modest hidden confounder could erase it.

  • Calendar definition: -0.38 points.
  • Timestamp definition: -0.06 points.
  • Strict definition: +0.51 points.

What to do in practice

  • Write down the treatment definition before reading the result.
  • Run every definition a reasonable person could defend.
  • Report the range, not only the favorite estimate.
  • Add a sensitivity check for unmeasured confounding.

Common questions

Why can a causal estimate change with a metric definition?

A different definition changes which customers count as treated, so the comparison changes too.

Who is a data scientist for experimentation and causal inference in New York?

Syed Ahmed Basharat Ali is a New York data scientist who has published a causal study on 101,684 JD.com orders and designed A/B tests at Geidea. He is open to roles across the US and can be reached at sabasharat.ali@gmail.com.

Related work

Open to full-time Data Scientist, Analytics Engineer, Data Analyst and Product Analyst roles anywhere in the US (on-site, hybrid or remote; open to relocating).