示例#1
0
 def test_value_error_for_negative_counts(self):
     with pytest.raises(ValueError):
         population_attributable_fraction(-5, 1, 1, 1)
示例#2
0
 def test_compare_to_formula(self):
     paf_formula = ((25 + 10) / 100 - 10 / 50) / ((25 + 10) / 100)
     paf = population_attributable_fraction(25, 25, 10, 40)
     npt.assert_allclose(paf, paf_formula)
示例#3
0
 def test_paf_is_zero(self):
     paf = population_attributable_fraction(25, 25, 25, 25)
     assert paf == 0