- statsmodels.stats.proportion.score_test_proportions_2indep(count1, nobs1, count2, nobs2, value=None, compare='diff', alternative='two-sided', correction=True, return_results=True)¶
Score test for two independent proportions
This uses the constrained estimate of the proportions to compute the variance under the Null hypothesis.
- count1, nobs1
count and sample size for first sample
- count2, nobs2
count and sample size for the second sample
diff, ratio or odds-ratio under the null hypothesis. If value is None, then equality of proportions under the Null is assumed, i.e. value=0 for ‘diff’ or value=1 for either rate or odds-ratio.
in[‘diff’, ‘ratio’ ‘odds-ratio’]
If compare is diff, then the confidence interval is for diff = p1 - p2. If compare is ratio, then the confidence interval is for the risk ratio defined by ratio = p1 / p2. If compare is odds-ratio, then the confidence interval is for the odds-ratio defined by or = p1 / (1 - p1) / (p2 / (1 - p2)
If true, then a results instance with extra information is returned, otherwise a tuple with statistic and pvalue is returned.
If return_results is True, then a results instance with the information in attributes is returned. If return_results is False, then only
test statistic asymptotically normal distributed N(0, 1)
p-value based on normal distribution
- other attributes :
additional information about the hypothesis test
Status: experimental, the type or extra information in the return might change.