Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Histograms in Table 1 #132

Open
tompollard opened this issue Sep 21, 2022 · 11 comments
Open

Histograms in Table 1 #132

tompollard opened this issue Sep 21, 2022 · 11 comments

Comments

@tompollard
Copy link
Owner

Not sure how easy this would be to implement, but making a note of this idea: https://twitter.com/DocEd/status/1572603047590916097

why don’t we just have a little histogram for each variable in table 1, in additional to the standard descriptors?

@jraffa
Copy link
Collaborator

jraffa commented Sep 21, 2022

You mean like this?

image

@tompollard
Copy link
Owner Author

tompollard commented Sep 21, 2022

@jraffa
Copy link
Collaborator

jraffa commented Sep 21, 2022

I think the histograms are represented as text:
▇▅▃▅▇

Seems to be unicode characters:
https://www.i2symbol.com/symbols/blocks/x2587-lower-seven-eighths-block-symbol-blocks-symbol-smiley-face

@tompollard
Copy link
Owner Author

Yeah, it looks like these would require each column to be mapped to an 1/8th: https://www.compart.com/en/unicode/block/U+2580. Seems doable...

@MartinBernstorff
Copy link

Just want to let you guys know that skimpy has this implemented, so it should be real easy to learn from 👍

https://github.com/aeturrell/skimpy/blob/9a96f252fca01780425bbbc6d6c62165ce9ccf20/src/skimpy/__init__.py#L273

@tompollard
Copy link
Owner Author

Very cool, thanks Martin, we'll check this out! I haven't come across Skimpy before.

@MartinBernstorff
Copy link

Glad to hear it! I know this isn't on topic, but just want to say I spent 1,5 days implementing something like tableone, found your solution, and deleted all my code. Super happy to find a good, mature solution 👍

@tompollard
Copy link
Owner Author

@MartinBernstorff thanks for your kind words and I'm glad to hear it has been helpful! We've neglected the package recently so I'm hoping to spend a little time soon making some much needed updates, fixes, etc.

@tompollard
Copy link
Owner Author

tompollard commented Apr 24, 2023

I'm not clear what to do in the case where a groupby variable is specified. Do we: (1) plot a distribution for each separate group, i.e. if there are 4 groups, add 4 columns each with a separate histogram; or (2) plot a single histogram of the overall distribution of the variable? Any preference @DocEd?

@DocEd
Copy link

DocEd commented Apr 25, 2023

Tom, i'm delighted that you saw this and picked it up! I imagine an extra histogram column per group, and if there is space, an overall histogram column at the end. a little like histospark works in R (i think a hadley wickham package).

Or if space was at a premium, the summary numbers could be given as normal, and a soft background image of the histogram behind the text within the table cell could be used.

@DocEd
Copy link

DocEd commented Apr 25, 2023

just seen the rest of this thread. yep, exactly like above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants