Closed bodhisat closed 3 months ago
I am adding my comment to this post cause I have found the same thing. The parameter ratio
doesn't seem to work when I run ggbarstat
or ggpiestat
and specify also the y
argument. Is it normal?
E.g.:
ggpiestats(
data = Titanic_full,
x = Survived,
y = Sex,
ratio = c(.73, .27)
)
ggpiestats(
data = Titanic_full,
x = Survived,
y = Sex,
ratio = c(.27, .73)
)
If I run the two lines of code, the results won't change. Is there a way to fix this?
Thanks
When I specify the "ratio" argument in "ggbarstats()" or "ggpiestats()", the test results seem wrong. However, manual application of the "contingency_table()" function from the "statsExpressions" package to a grouped tibble seems to give the right output.
I inspected the definition of "ggbarstats()" and I fail to understand why the results differ; see the example below.
Created on 2022-11-28 with reprex v2.0.2