tompollard / tableone

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

Remarks = False not suppressing warnings under the table #107

Open Dekermanjian opened 3 years ago

Dekermanjian commented 3 years ago

Hi when setting the argument remarks = False in TableOne() I still get the remarks below the table.

tompollard commented 3 years ago

@Dekermanjian please could you check that you are using the latest version of the package?

import tableone
print(tableone.__version__)

# 0.7.9

If you are using an earlier version, you should be able to upgrade with one of the following commands (depending on whether you are using conda or pip).

# pip
pip install tableone --upgrade

# conda
conda update tableone

In version 0.7.9, you should be able to switch on/off individual checks. e.g.

# Run Tukey's test for far outliers. If variables are found to
# have far outliers, a remark will be added below the Table 1.
# (default: False)

tukey_test = True

# normal_test : bool, optional
# Test the null hypothesis that a sample come from a normal distribution.
# Uses scipy.stats.normaltest. If variables are found to have non-normal
# distributions, a remark will be added below the Table 1.
# (default: False)

normal_test = True

# dip_test : bool, optional
# Run Hartigan's Dip Test for multimodality. If variables are found to
# have multimodal distributions, a remark will be added below the Table 1.
# (default: False)

dip_test = True

Example with tukey_test, normal_test, dip_test

import pandas as pd
from tableone import load_dataset, TableOne

data = tableone.load_dataset('rhc')
data = load_dataset('pn2012')

table1 = TableOne(data, dip_test=True, normal_test=True, tukey_test=True)

Screen Shot 2020-12-30 at 13 59 49