A tighter test with CUPED

HardDuolingoa/b testingconfidence intervalscuped variance reductioncovariancesegments by ntile· 160 XP (40 per question)

Mock interview. You're interviewing for a senior data scientist job at a language learning app. The interviewer says: "We tested a new daily reminder on a random half of learners. The effect looks small and the interval is wide. We know how many lessons each learner did in the two weeks before the test. Can you use that to get a sharper answer?"

reminder_test: one row per learner, with the arm (reminder or control), lessons in the 14 days before the test (lessons_before) and lessons in the 14 days of the test (lessons_during).

A 95% confidence interval for a difference in means: difference ± 1.96 × √(var_t / n_t + var_c / n_c).

Question 1: The two groups

"Show learners per arm, and the average lessons before and during the test."

Expected output

  • Columns arm, learners, avg_before, avg_during (rounded to 2 decimals); sorted by arm

Example of the shape (made-up values):

arm learners avg_before avg_during
control 1000 15.00 15.10

Hints, the later questions and the answer come with Pro.

Question 1 of 4

Write your query here. Ctrl + Enter submits.