Closed davidkurland closed 3 months ago
@davidkurland Not currently, as far as I'm aware, I'm sorry. We could potentially add it, so I'll keep this issue open.
@jraffa @davidkurland how about adding a new pval_threshold
argument. If the p-value is less than or equal to the threshold, we display a *
after the value?
I have added a draft implementation on the https://github.com/tompollard/tableone/tree/tp/pval_threshold branch, if you'd like to give it a try.
Clone the repo, switch to the pval_threshold
branch (git switch pval_threshold
), then pip install .
within the folder to install.
from tableone import TableOne, load_dataset
data = load_dataset('pn2012')
table1 = TableOne(data, groupby="death", pval=True, pval_threshold=0.2)
print(table1.tabulate(tablefmt = "github"))
Missing | Overall | 0 | 1 | P-Value | ||
---|---|---|---|---|---|---|
n | 1000 | 864 | 136 | |||
Age, mean (SD) | 0 | 65.0 (17.2) | 64.0 (17.4) | 71.7 (14.0) | <0.001* | |
SysABP, mean (SD) | 291 | 114.3 (40.2) | 115.4 (38.3) | 107.6 (49.4) | 0.134* | |
Height, mean (SD) | 475 | 170.1 (22.1) | 170.3 (23.2) | 168.5 (11.3) | 0.304 | |
Weight, mean (SD) | 302 | 82.9 (23.8) | 83.0 (23.6) | 82.3 (25.4) | 0.782 | |
ICU, n (%) | CCU | 0 | 162 (16.2) | 137 (15.9) | 25 (18.4) | <0.001* |
CSRU | 202 (20.2) | 194 (22.5) | 8 (5.9) | |||
MICU | 380 (38.0) | 318 (36.8) | 62 (45.6) | |||
SICU | 256 (25.6) | 215 (24.9) | 41 (30.1) | |||
MechVent, n (%) | 0 | 0 | 540 (54.0) | 468 (54.2) | 72 (52.9) | 0.862 |
1 | 460 (46.0) | 396 (45.8) | 64 (47.1) | |||
LOS, mean (SD) | 0 | 14.2 (14.2) | 14.0 (13.5) | 15.4 (17.7) | 0.386 |
@jraffa @davidkurland Please let me know your thoughts!
Is there are way to call out or highlight a cell when p<0.05?