tompollard / tableone

Create "Table 1" for research papers in Python
https://pypi.python.org/pypi/tableone/
MIT License
164 stars 41 forks source link

Raise warning for outliers #35

Closed tompollard closed 6 years ago

tompollard commented 6 years ago

Related to #19, #22 and #28. Might also be worth raising a warning if outliers appear to be heavily influencing the summary statistics. What is a good approach? (e.g. simple check might be to compare trimmed mean with mean?).

jraffa commented 6 years ago

Tukey's rule is pretty common, although the interpretation depends on the circumstances.

I may just apply this rule, and suggest the user plot the data to check.

tompollard commented 6 years ago

Thanks Jesse. Tukey's rule will be straightforward to incorporate, assuming you mean this IQR based approach: https://en.wikipedia.org/wiki/Outlier#Tukey's_fences

tompollard commented 6 years ago

Pull request: https://github.com/tompollard/tableone/pull/44 adds Tukey outlier test to the cont_describe table:

screen shot 2018-03-20 at 09 33 11

Also raises warnings if outliers are detected:

screen shot 2018-03-20 at 09 33 58