Giter VIP home page Giter VIP logo

Comments (11)

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Thanks in advance,

Ana

from dabest-python.

josesho avatar josesho commented on May 30, 2024

Hi @AnaFVicente , thanks for flagging this up!

I think this is a case of the commutative property of means, vs. the inherent weirdness of medians?

Using t5 and t6 from above:

>>> np.mean(t5) - np.mean(t6)
-0.023344683345558614
>>> np.mean(t5 - t6)
-0.023344683345558614 # Same result as above.

but

>>> np.median(t5) - np.median(t6)
-0.22693218492666745
>>> np.median(t5 - t6)
0.0528625540482075 # Not the same result...

Right now, I think the best option is for us to remove the mean lines for Gardner-Altman paired median plots....

Again, thanks for bringing this to our attention.

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Thanks for your response.
If I understood well, the median of the differences (black line) is calculated with a different method than the distribution of the differences (grey histogram). That's why there's a shift between both representations. Is there a way to calculate both parameters by using the same method: np.median(t5) - np.median(t6) or np.median(t5 - t6), so I get nice plots?
Ana

from dabest-python.

josesho avatar josesho commented on May 30, 2024

The problem isn't that they are calculated in a different way. It seems to be much deeper than that. The paired median difference of t5 and t6 is positive, even though the median of t6 is lower than the median of t5....

After thinking about it for a while, there might not be a good way to depict paired median difference with the Gardner-Altman estimation plot. You might have to use the Cumming estimation plot to do so.

Simply use

 two_groups_paired.median_diff.plot(float_contrast=False)

to plot the sampling error histogram below the paired slopegraph.

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Thanks for your reply. However, if I plot the cumming estimation I still have the same problem: the histogram corresponding to 95% CI distibrution (grey histogram) is not aligned with the interval (black line)

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

image

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Would you suggest just to remove 95% grey histogram, corresponding to CI distibrution ?

from dabest-python.

josesho avatar josesho commented on May 30, 2024

The error curve actually is aligned with the 95CI; bootstraps derived from medians often have non-normal distributions. If you find the error curve distracting, you could remove it in a vector graphics program, but I'd advise including it as it highlights:

  • the non-normality of the median difference
  • the graded nature of the confidence interval.

Hope this helps!

from dabest-python.

josesho avatar josesho commented on May 30, 2024

Also, we are looking into how to properly compute and display paired median differences, taking into account all we have discussed above. Thanks for flagging this up to us!

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Thanks a lot for your help!

from dabest-python.

AnaFVicente avatar AnaFVicente commented on May 30, 2024

Just a last question. I don't understand how the curve can be correctly aligned if it represents the median differences distribution while the black line represents 95%CI. Most of the curve should be inside the black line, only 5% of the date could be outside. If I understand correctly. Thanks in advance.

from dabest-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.