You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: combine_effects DerSimonian-Laird tau2 not truncated at zero #10520
combine_effects(method_re='dl') in statsmodels/stats/meta_analysis.py does not truncate the DerSimonian-Laird tau^2 estimate at zero:
tau2= (q-df) /c
For nearly homogeneous studies the raw estimate is negative, which produces nonsense random-effects results: the combined mean can fall outside the range of the study effects, and for other inputs var_eff_w_re becomes negative and the standard deviation is NaN. The published DL estimator (DerSimonian & Laird 1986) and R metafor truncate tau^2 at zero, as does this module's own Paule-Mandel path (_fit_tau_iter_mm uses max(0, tau2_new)). The one-step moment estimator _fit_tau_mm has the same issue.
tau2 = np.maximum(0, (q - df) / c). With truncation, tau^2 = 0 here and the random-effects results coincide with the fixed-effects results (mean 0.2955, within the range of the effects), consistent with R metafor (rma(yi, vi, method="DL") returns tau^2 = 0).
Activity
BUG: Floor h2 and i2 in combine_effects and accept lists
TST: Add metafor references and boundary tests for combine_effects