Example #1
0
 def test_match_sas_ci(self, counts_1):
     sas_se = 0.4566, 2.1902
     odr = odds_ratio(counts_1[0], counts_1[1], counts_1[2], counts_1[3])
     npt.assert_allclose(np.round(odr[1:3], 4), sas_se)
Example #2
0
 def test_odds_ratio_greater_than_risk_ratio(self):
     odr = odds_ratio(50, 50, 25, 75)
     rr = risk_ratio(50, 50, 25, 75)
     assert odr.point_estimate > rr.point_estimate
Example #3
0
 def test_value_error_for_negative_counts(self):
     with pytest.raises(ValueError):
         odds_ratio(-5, 1, 1, 1)
Example #4
0
 def test_odds_ratio_equal_to_1(self, counts_1):
     odr = odds_ratio(counts_1[0], counts_1[1], counts_1[2], counts_1[3])
     assert odr.point_estimate == 1