trevismd / statannotations

add statistical significance annotations on seaborn plots. Further development of statannot, with bugfixes, new features, and a different API.
Other
655 stars 73 forks source link

LaTeX asterisks and chi-square test update #33

Open CameraEngineer opened 3 years ago

CameraEngineer commented 3 years ago

Change to statannot file to allow for asterisks to be the same as in LaTeX and the feature change to allow chi-squared tests on categorical data

Here are two examples of the chi-squared test after implementation in the statannot file: Age60_CountPlot.pdf RegionCountPlot.pdf

The asterisk changed to be the same as the one when you use LaTeX (The default asterisk did not have the same number of corners -- very strange).

I also added a way to not display the groups that were not significant and only list the p-value as an output. This helped for figure generation for Journal articles.

Thanks!

trevismd commented 2 years ago

I think it is time for a little update on this. I have not forgotten about it, but there are several things in one go: count plots, Chi-square tests (using counts), removing annotations for non-significant results, and adapting pvalue_thresholds for LaTeX. Of these things, I think the count plot and Chi-square tests should definitely be integrated. I can port it to the current codebase, but maybe you'd like to have a go at it ? I'm afraid I can't use this commit directly as there has been too many changes in statannotations since then.

Removing non significant results has been quite a popular request, but there was also some good counter points about it. I haven't made my mind about it yet. Finally, the stars formatting for LaTeX is one of these things that can be configured in a user script, so the question is whether to include it as an additional parameter for configuration, such as for_latex=True, and that requires some thought to make it robust. Is there probably any other such export format, and then how to handle those?

CameraEngineer commented 2 years ago

No worries at all. I've been swamped with work as well.

What is your recommendation on moving forward with this? Should I "pull" your most up-to-date version of statannotations and try and integrate the count plot and Chi-square test?

When I added the modification to statannot I printed the statistics p-values to the terminal window regardless of the test result. At the end of the day if the figures are for publication the groups that are not significantly different can be removed from the comparison, which is why I just printed the p-value for each test and indicated that the test was not significant. I really think it depends on what the user is trying to do with their figures.

I think that is an excellent idea to create a parameter flag that allows LaTeX users to have the text render the same. I would definitely have to think about other formats that users would want to add to the plots.

Thanks!

On Mon, Oct 18, 2021 at 12:36 AM Florian Charlier @.***> wrote:

I think it is time for a little update on this. I have not forgotten about it, but there are several things in one go: count plots, Chi-square tests (using counts), removing annotations for non-significant results, and adapting pvalue_thresholds for LaTeX. Of these things, I think the count plot and Chi-square tests should definitely be integrated. I can port it to the current codebase, but maybe you'd like to have a go at it ? I'm afraid I can't use this commit directly as there has been too many changes in statannotations since then.

Removing non significant results has been quite a popular request, but there was also some good counter points about it. I haven't made my mind about it yet. Finally, the stars formatting for LaTeX is one of these things that can be configured in a user script, so the question is whether to include it as an additional parameter for configuration, such as for_latex=True, and that requires some thought to make it robust. Is there probably any other such export format, and then how to handle those?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/trevismd/statannotations/pull/33#issuecomment-945409687, or unsubscribe https://github.com/notifications/unsubscribe-auth/APTIJNYOIKP2IKLENZFZWTTUHO56FANCNFSM5FCYUECQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

CameraEngineer commented 2 years ago

I have since modified the newest version of statannotations to allow for changing the text_format to "LaTeX" to print out a LaTeX asterisk instead of a five-sided star. However, I am unable to create a new branch and push the commit. I created a new branch "LaTeXStar" but got an error message after trying to use my personal access token.