tompollard / tableone

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

appropriateness of summary descriptive statistics with respect to modality #22

Closed tompollard closed 6 years ago

tompollard commented 6 years ago

ref: https://github.com/tompollard/tableone/issues/19

While categorical variables are being considered, all other variables are being described in terms of a unimodal perspective. This can be potentially dangerous, since mean, medians, standard deviations, and IQRs are only appropriate for the interpretation of unimodal distributions. This is a basic problem in the biomedical field as a whole; however, these types of tools like tableone may actually facilitate the inappropriate use of summary descriptive statistics in the misinterpretation of study data.

...the authors should address issues of the appropriateness of summary descriptive statistics with respect to modality

...... Possible approaches include providing facilities to (self)identify non-unimodal distributions ... Try to go the next step and prevent possible misinterpretation of data.

jraffa commented 6 years ago

So I would suggest two things:

1: Hartigan's Dip Test: https://cran.r-project.org/web/packages/diptest/

2: Some clever way to link a plot (histogram or kernel density estimate) in the output.

tompollard commented 6 years ago

Thanks Jesse. I'm not sure there is an existing implementation of the diptest in Python, so we might need to code this ourselves, unless we can find a good alternative.

We can look into incorporating plots, though I would prefer to avoid this if possible, mainly because it would need several additional dependencies and expands the scope somewhat.

jraffa commented 6 years ago

Have not vetted, but: https://github.com/alimuldal/diptest

tompollard commented 6 years ago

It's not available on PyPi and I'd prefer to avoid the GPL license, so not sure it's going to be useful unfortunately.

tompollard commented 6 years ago

https://projecteuclid.org/DPubS?service=UI&version=1.0&verb=Display&handle=euclid.aos/1176346577

http://www.nicprice.net/diptest/Hartigan_1985_ApplStat.pdf

tompollard commented 6 years ago

Pull request: https://github.com/tompollard/tableone/pull/44 adds hartigan's Dip Test to the cont_describe table:

screen shot 2018-03-20 at 09 33 11

Also raises warnings if possible multimodality is detected:

screen shot 2018-03-20 at 09 33 58