IndrajeetPatil / ggstatsplot

Enhancing {ggplot2} plots with statistical analysis 📊📣
https://indrajeetpatil.github.io/ggstatsplot/
GNU General Public License v3.0
1.98k stars 184 forks source link

support one-sample test in `ggbarstats` #532

Open IndrajeetPatil opened 3 years ago

IndrajeetPatil commented 3 years ago

if y is missing, create an internal column with a unique value?

not sure how happy the statsExpressions would be with this behavior

AntoineSoetewey commented 2 years ago

Hello,

I see that one-proportion and chi-square goodness of fit tests are possible with ggpiestats().

I am not a big fan of pie charts, I'd rather use bar charts (and I believe I am not alone). By any chance, is there any plan to include the exact same tests but with bar charts instead of pie charts?

Thanks again for the package!

IndrajeetPatil commented 2 years ago

is there any plan to include the exact same tests but with bar charts instead of pie charts

That is exactly what the current issue is about! :)

The problem is that a bar chart is an inherently bivariate visualization, while a pie chart a univariate one. So one-way table tests play nicely with the latter but not the former.

When I work on this, my approach is probably going to be to create a temporary internal variable so that the bar chart is happy and one-way table tests can be carried out.

AntoineSoetewey commented 2 years ago

Thanks for your reply.

Just one quick question :

« The problem is that a bar chart is an inherently bivariate visualization » —> I thought barplot(table(data$variable)) was considered as univariate, isn’t the case?