wptmdoorn / methcomp

Python package providing functionality and plotting for chemistry method comparison
MIT License
14 stars 9 forks source link

ZeroDivisionError from passingbablok() #2

Closed cyrill-r closed 3 years ago

cyrill-r commented 3 years ago

Dear William

Thanks a lot for this great project. While evaluating your package I kept getting ZeroDivisionErrors with certain datasets. I do believe there is an error in the _passingbablok function in regression.py, line 268: self.slope = self.sv[int((n + 1) / k + 2)]

According to "Passing H and Bablok W. J Clin Chem Clin Biochem, vol. 21, no. 11, 1983, pp. 709 - 720", page 712, I would suggest to change that line to: self.slope = self.sv[int((n + 1) / 2 + k)]

Best regards Cyrill

wptmdoorn commented 3 years ago

Hi @cyrill-r

Thank you for pinpointing such a specific error. My apologies for the late response. I've addresses this issue in the recent commit: https://github.com/wptmdoorn/methcomp/commit/d432fcfdcf1930d71189be24059831c7231855c7.

I will close the issue for now, please contact me if this did not completely answer your question.

Thanks a lot.

All the best, William