@@ -205,13 +205,23 @@ def test_per_client_dau_impact(self):
205
205
test_data , "value" , "control" , experiment , AnalysisBasis .ENROLLMENTS , "all"
206
206
).__root__
207
207
208
- difference = [r for r in result if r .comparison == "difference" ][0 ]
208
+ abs_difference = [r for r in result if r .comparison == "difference" ][0 ]
209
209
# analytically, we should see a point estimate of 10, with 95% CI of (7.155,12.844)
210
210
# at these small sample sizes, mozanalysis's bootstrap can be quite variable
211
211
# so use a large tolerance
212
- assert np .abs (difference .point - 10 ) < 1.0
213
- assert np .abs (difference .lower - 7.155 ) < 1.0
214
- assert np .abs (difference .upper - 12.844 ) < 1.0
212
+ assert np .abs (abs_difference .point - 10 ) < 1.0
213
+ assert np .abs (abs_difference .lower - 7.155 ) < 1.0
214
+ assert np .abs (abs_difference .upper - 12.844 ) < 1.0
215
+
216
+ rel_difference = [r for r in result if r .comparison == "relative_uplift" ][0 ]
217
+
218
+ # analytically, we should see a point estimate of 222%, with 95% CI of (108%,398%)
219
+ # at these small sample sizes, mozanalysis's bootstrap can be quite variable
220
+ # so use a large tolerance
221
+
222
+ assert np .isclose (rel_difference .point , 2.22 , atol = 0.25 )
223
+ assert np .isclose (rel_difference .lower , 1.08 , atol = 0.25 )
224
+ assert np .isclose (rel_difference .upper , 3.98 , atol = 0.25 )
215
225
216
226
def test_binomial (self ):
217
227
stat = Binomial ()
0 commit comments