Compute the pooled two-proportion z-statistic for two groups of 0/1 outcomes under the null hypothesis that both groups have the same underlying rate.
Implement solve(a, b).
Returns. Return the z-statistic as a Python float, positive when a has the higher rate. If every outcome in both groups is identical the pooled variance is zero and the statistic is not finite.
Example 1
Input:
solve([1, 1, 0, 1, 0, 0, 1, 1], [0, 0, 1, 0, 0, 1, 0, 0])
Output:
1.511858
Example 2
Input:
solve([1, 0, 1, 0], [1, 0, 1, 0])
Output:
0.0
No results yet
Run your code to check it against the examples, or submit to run every test.