@@ -107,6 +107,12 @@ def fit_null(p, m, cov, continuous, firth=False):
107107 start_vec [0 ] = np .log (np .mean (p )/ (1 - np .mean (p )))
108108 null_mod = smf .Logit (p , v )
109109
110+ # statsmodels does not raise exceptions with perfectly separable data
111+ # but just a warning
112+ # this may stop working in the future
113+ # source: https://github.com/statsmodels/statsmodels/blob/e12de82fabd8e3fd71413aae384763c1442c4516/statsmodels/discrete/discrete_model.py#L186
114+ null_mod .raise_on_perfect_prediction = True
115+
110116 try :
111117 if continuous :
112118 null_res = null_mod .fit (disp = False )
@@ -173,6 +179,11 @@ def fit_lineage_effect(lin, c, k):
173179 axis = 1 )
174180
175181 lineage_mod = smf .Logit (k , X )
182+ # statsmodels does not raise exceptions with perfectly separable data
183+ # but just a warning
184+ # this may stop working in the future
185+ # source: https://github.com/statsmodels/statsmodels/blob/e12de82fabd8e3fd71413aae384763c1442c4516/statsmodels/discrete/discrete_model.py#L186
186+ lineage_mod .raise_on_perfect_prediction = True
176187 try :
177188 lineage_res = lineage_mod .fit (method = 'newton' , disp = False )
178189
@@ -287,6 +298,11 @@ def fixed_effects_regression(variant, p, k, m, c, af, pattern,
287298 try :
288299 if continuous :
289300 mod = smf .OLS (p , v )
301+ # statsmodels does not raise exceptions with perfectly separable data
302+ # but just a warning
303+ # this may stop working in the future
304+ # source: https://github.com/statsmodels/statsmodels/blob/e12de82fabd8e3fd71413aae384763c1442c4516/statsmodels/discrete/discrete_model.py#L186
305+ mod .raise_on_perfect_prediction = True
290306
291307 res = mod .fit ()
292308 intercept = res .params [0 ]
@@ -298,6 +314,11 @@ def fixed_effects_regression(variant, p, k, m, c, af, pattern,
298314
299315 else :
300316 mod = smf .Logit (p , v )
317+ # statsmodels does not raise exceptions with perfectly separable data
318+ # but just a warning
319+ # this may stop working in the future
320+ # source: https://github.com/statsmodels/statsmodels/blob/e12de82fabd8e3fd71413aae384763c1442c4516/statsmodels/discrete/discrete_model.py#L186
321+ mod .raise_on_perfect_prediction = True
301322
302323 start_vec = np .zeros (v .shape [1 ])
303324 start_vec [0 ] = np .log (np .mean (p )/ (1 - np .mean (p )))
0 commit comments