ACCLAB / DABEST-python

Data Analysis with Bootstrapped ESTimation
https://acclab.github.io/DABEST-python/
Apache License 2.0
341 stars 47 forks source link

plot absolute mean differences as percentage of control #69

Closed BioinfoTongLI closed 5 years ago

BioinfoTongLI commented 5 years ago

Hi, @josesho I'm wondering is it possible to change the mean_diff subplot to a percentage subplot ? To clarify, instead of giving the differences of mean, can DABEST show the mean diff/reference mean ? Just in order to see whether it's a big difference or a small difference as compared with the control condition.

josesho commented 5 years ago

Hi,

  1. We do have plans to design an estimation graphic to present differences in proportions.

  2. You could normalize both the control and the test groups: divide all values by the mean of the control group first, then produce the estimation graphic.

  3. Another alternative is to use a standardized effect size, specifically either Cohen's d or Hedges' g. The difference between both groups are expressed in terms of the pooled standard deviations of both the control and test groups. Both Cohen's d or Hedges' g can be compared across experiments using different raw/absolute metrics as well.

Hope this helps!

BioinfoTongLI commented 5 years ago

Thank you for the helps. As for the second solution you proposed. I believe you mean normalization before passing to DABEST. In this case, the raw values are lost in the swarm plot, isn't it ? I'm looking for a solution keeping the current swarm plot and a proportion plot on the bottom. I believe I have to change the internal code for this, am I right ?

josesho commented 5 years ago

The raw values aren't lost; they can be recapitulated by multiplying by the normalization factor anyway.

Without modifying code, you can produce a Cumming plot with raw values, then another Cumming plot with normalized values, and stitch together the rawplot from the first with the difference plot from the second.

BioinfoTongLI commented 5 years ago

Yes, Of course. You're right.

I know what to do now. Just an idea about the proportion of diff, you may add a second axis on the right of the kde plot. So that you can have both at the same time. A parameter like do_proportion=True/False to enable/disable it. Just a suggestion. Many thanks !

josesho commented 5 years ago

Hi,

Thanks for clarifying. What you refer to as proportion of difference is not what Gardner et al. meant, where there is a control proportion (say 60%) and a test proportion (say 100%), and you want to know what the difference between the proportions is.

You want to express the effect size as a percentage of the control mean; we feel this is adequately captured by either of the standardized effect sizes.

Happy to consider a PR from you if you implement such a functionality; unfortunately it is not a priority for us now.

Closing this as we have resolved the issue. Thanks!