def test_z_score_control_winning(self): test = (1000, 10) test_rate = stats.conversion_rate(test) test_unc = stats.conversion_rate_uncertainty(test) control = (1000, 50) control_rate = stats.conversion_rate(control) control_unc = stats.conversion_rate_uncertainty(control) out = stats.z_score(test_rate, test_unc, control_rate, control_unc) self.assertEqual(out, -5.279636773484547)
def test_p_value_control_winning(self): test = (1000, 10) test_rate = stats.conversion_rate(test) test_unc = stats.conversion_rate_uncertainty(test) control = (1000, 50) control_rate = stats.conversion_rate(control) control_unc = stats.conversion_rate_uncertainty(control) z_score = stats.z_score(test_rate, test_unc, control_rate, control_unc) self.assertEqual(stats.p_value(z_score), 6.472011328743767e-08)
def test_z_score_even(self): test = (1000, 10) test_rate = stats.conversion_rate(test) test_unc = stats.conversion_rate_uncertainty(test) control = (1000, 10) control_rate = stats.conversion_rate(control) control_unc = stats.conversion_rate_uncertainty(control) out = stats.z_score(test_rate, test_unc, control_rate, control_unc) self.assertEqual(out, 0.0)