mqr.inference.rate.

test_2sample#

mqr.inference.rate.test_2sample(count1, n1, count2, n2, meas1=1.0, meas2=1.0, H0_value=None, alternative='two-sided', method='score', compare='diff')#

Hypothesis test for equality of rates.

Null-hypothesis by compare
‘diff’
count1 / n1 / meas1 - count2 / n2 / meas2 == H0_value
‘ratio’
count1 / n1 / meas1 / (count2 / n2 / meas2) == H0_value

Calls sm..test_poisson_2indep.

Parameters:
count1int

Number of events in first observation.

n1int

Number of periods over which first events were counted.

count2int

Number of events in second observation.

n2int

Number of periods over which second events were counted.

meas1float, optional

Extent of one period in first observation.

meas2float, optional

Extent of one period in second observation.

H0_valuefloat, optional

Null-hypothesis value. Default 1 when compare is ‘ratio’, 0 when compare is ‘diff’.

alternative{‘two-sided’, ‘less’, ‘greater’}, optional

Sense of alternative hypothesis.

methodstr, optional

See statsmodels docs.

compare{‘diff’, ‘ratio’}, optional
‘diff’
Compare the difference between rates.
‘ratio’
Compare the rate of ratios.
Returns:
mqr.inference.confint.ConfidenceInterval