tompollard / tableone

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

Standard mean difference calculation #78

Closed prbndr closed 4 years ago

prbndr commented 5 years ago

Hi - would it be possible to calculate standard mean differences for a given statistical test, e.g. chi square? In the R version of the package, this is possible by setting smd=TRUE, as a flag when running TableOne. This would be great to have in this package, too!

jraffa commented 5 years ago

Hi @prbndr what use case would you like this for?

I primarily see it used in propensity score analysis, and we haven't really implemented the weighting part of R's tableone yet.

prbndr commented 5 years ago

Hi - I would like to use this as a balance measure for individual covariates as opposed to using it after propensity score analysis. Specifically, I would like to apply this to pooled clinical trial data.

Hope this helps, Pradeep Bandaru

On Mon, Jan 28, 2019 at 10:15 AM Jesse Raffa notifications@github.com wrote:

Hi @prbndr https://github.com/prbndr what use case would you like this for?

I primarily see it used in propensity score analysis, and we haven't really implemented the weighting part of R's tableone yet.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tompollard/tableone/issues/78#issuecomment-458170710, or mute the thread https://github.com/notifications/unsubscribe-auth/AGSHebaBy8ANcGztxc8fZgoJ5SGAHy24ks5vHxQegaJpZM4aLu4o .

raheems commented 4 years ago

I second the idea of adding smd.

tompollard commented 4 years ago

@prbndr @raheems we'll try to get onto this soon

raheems commented 4 years ago

No rush but just checking if this feature has been added or in progress :)

tompollard commented 4 years ago

I'll try to take a look today.

tompollard commented 4 years ago

Computing the SMD for categorical variables was more work than I'd expected. The current version on the master branch includes a new smd argument. Before we push to pypi, it would be great to have your feedback. Some demo cases (with comparisons to R) are described at: https://github.com/tompollard/tableone/pull/97

tompollard commented 4 years ago

This is now on pypi (version 0.7.0). Please test!

It will be on Conda shortly.

tompollard commented 4 years ago

Quickest way to play around it is probably to use the notebook at: https://colab.research.google.com/github/tompollard/tableone/blob/master/tableone.ipynb

Just add smd = True to the arguments.