Before trusting any A/B test result, an analyst must confirm the traffic split actually landed close to what was configured. Your experimentation platform was configured for a 50/50 control/treatment split. After two weeks you observe:
Run a chi-square goodness-of-fit test against the expected 50/50 allocation and flag a Sample Ratio Mismatch (SRM) if the p-value is below 0.01 (the stricter threshold conventionally used for SRM, since even a small allocation bug can silently invalidate every downstream metric).
Return a dict result with keys chi2_stat (rounded to 4 decimals), p_value (unrounded), and srm_detected (bool).
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.