DOC: Correct confidence interval terminology in mean_diff_plot
Location of the documentation
https://github.com/statsmodels/statsmodels/blob/main/statsmodels/graphics/agreement.py https://github.com/statsmodels/statsmodels/blob/main/statsmodels/graphics/tests/test_agreement.py
Describe the issue
The mean_diff_plot's sd_limit documentation currently says that sd_limit=1.96 produces 95% confidence intervals for the mean differences.
The implementation calculates: mean_diff ± sd_limit * std_diff
This corresponds to approximate Bland–Altman limits of agreement,not a confidence interval for the mean difference.
A confidence interval for the mean difference would involve a standard error / sqrt(n) term, which mean_diff_plot does not compute
Suggested fix
Update the sd_limit documentation in statsmodels/graphics/agreement.py to use the correct statistical terminology.
Replace:
The default of 1.96 will produce 95% confidence intervals for the means of the differences.
with wording that describes these lines as approximate 95% limits of agreement, for example:
The default of 1.96 will produce approximate 95% limits of agreement when the differences are approximately normally distributed.
Also update the related test comment in statsmodels/graphics/tests/test_agreement.py:
Replace:
# Test the setting of confidence intervals.With:
# Test the setting of limits of agreement.Source: statsmodels/statsmodels