Esempio n. 1
0
 def test_correct_ci(self):
     # SAS does not provide CI's for IRD easily. Instead comparing to OpenEpi calculator
     oe_ci = -0.02639, 0.07639
     ird = incidence_rate_difference(6, 14, 100, 400)
     npt.assert_allclose(ird.point_estimate, 0.025)
     npt.assert_allclose(ird[1:3], oe_ci, atol=1e-6)
Esempio n. 2
0
 def test_value_error_for_negative_counts(self):
     with pytest.raises(ValueError):
         incidence_rate_difference(-5, 1, 1, 1)
Esempio n. 3
0
 def test_match_sas(self):
     sas_ird = 0.025
     ird = incidence_rate_difference(6, 14, 100, 400)
     npt.assert_allclose(ird.point_estimate, sas_ird)
Esempio n. 4
0
 def test_incidence_rate_difference_equal_to_1(self):
     ird = incidence_rate_difference(6, 6, 100, 100)
     assert ird.point_estimate == 0