https://raw.githubusercontent.com/MatthewReid854/reliability/master/docs/images/logo.png

two_proportion_test

class reliability.Reliability_testing.two_proportion_test(sample_1_trials=None, sample_1_successes=None, sample_2_trials=None, sample_2_successes=None, CI=0.95, print_results=True)

Calculates whether the difference in test results between two samples is statistically significant.

For example, assume we have a poll of respondents in which 27/40 people agreed, and another poll in which 42/80 agreed. This test will determine if the difference is statistically significant for the given sample sizes at the specified confidence level.

Parameters:
  • sample_1_trials (int) – The number of trials in the first sample.

  • sample_1_successes (int) – The number of successes in the first sample.

  • sample_2_trials (int) – The number of trials in the second sample.

  • sample_2_successes (int) – The number of successes in the second sample.

  • CI (float, optional) – The desired confidence interval. Must be between 0 and 1. Default = 0.95 for 95% CI.

  • print_results (bool, optional) – If True the results will be printed to the console. Default = True.

Returns:

lower,upper,result (tuple) – The lower and upper are bounds on the difference. The result is either ‘significant’ or ‘non-significant’. If the bounds do not include 0 then it is a statistically significant difference.