kassambara / rstatix

Pipe-friendly Framework for Basic Statistical Tests in R
https://rpkgs.datanovia.com/rstatix/
440 stars 50 forks source link

anova_summary effect size report #180

Open SanD94 opened 1 year ago

SanD94 commented 1 year ago

According to the documentation, when "ges" and "pes" are both used as a parameter to effect.size for anova_summary function, the table would have ges and pes values for each factor. However, only pes values are returned. The expected behavior is that the anova summary table has two values at the same time.

library(rstatix)
library(magrittr)

sample_data <- data.frame(
  id = rep(1:5, each = 2),
  dv = 1:10,
  within = rep(c(0, 1), times = 5)
)
# anova_test uses anova_summary for table generation
res <- sample_data %>% anova_test( 
  dv          = dv,
  wid         = id,
  within      = within,
  effect.size = c("pes", "ges"),
  detailed    = TRUE
)
(actual)
ANOVA Table (type III tests)

       Effect DFn DFd   SSn SSd      F     p p<.05   pes
1 (Intercept)   1   4 302.5  80 15.125 0.018     * 0.791
2      within   1   4   2.5   0    Inf 0.000     * 1.000
(expected)
       Effect DFn DFd   SSn SSd      F     p p<.05   pes   ges
1 (Intercept)   1   4 302.5  80 15.125 0.018     * 0.791 0.791
2      within   1   4   2.5   0    Inf 0.000     * 1.000 0.030