Welch t-Statistic for A/B Test
Problem
**[Asked at Microsoft and Various]**
Compute Welch t-statistic between treatment and control groups:
t = (mean_t - mean_c) / sqrt(var_t/n_t + var_c/n_c)
Use sample variance (divide by n-1).
Return `t_statistic` rounded to 4 dp.
Tables
Example rows — the live problem includes the full dataset.
ab_observations
| obs_id | variant | metric_value |
|---|
Expected output
Your answer should return 1 row with the columns t_statistic.
Starter code (SQL)
SELECT *
FROM ab_observations;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock