【问题标题】:How can I calculate confidence intervals for epsilon-squared (Effect size for Kruskal-Wallis test) in R?如何计算 R 中 epsilon-squared(Kruskal-Wallis 检验的效应大小)的置信区间?
【发布时间】:2019-07-02 12:03:47
【问题描述】:

我想计算 R 中 epsilon-squared effect size 统计量的置信区间。这是我用来计算 epsilon-squared 值的代码:

#set up two vectors, a numerical vector and a factor vector (grouping variable)
x=c(3,2,4,7,4,6,9,2,3,4,1,0,8,6,9,5,3,3,6,7,8,2,8,9)
y=as.factor(c(rep("cond1",12),rep("cond2",12)))

#run kruskal-wallis test
kruskal.test(x~y)
library(rcompanion)
df=data.frame(x,y)

#calculate epsilon squared
epsilonSquared(x = df$x, 
           g = df$y)

这给了我我的效果大小。但该函数只输出一个数字。请问如何计算效果大小的置信区间?

【问题讨论】:

    标签: r epsilon kruskal-wallis


    【解决方案1】:

    你可以阅读帮助,我刚刚做了什么:

    ci 如果为 TRUE,则通过引导程序返回置信区间。可能会很慢。

    epsilonSquared(x = df$x, 
                   g = df$y,ci = T)
    
      epsilon.squared lower.ci upper.ci
    1           0.185  0.00479     0.54
    

    【讨论】:

    • 谢谢!这为我返回了一个值 - 直到我更新了包!现在它返回 CI 值 - 非常感谢
    • 不客气。如果它确实回答了问题,请毫不犹豫地接受答案
    猜你喜欢
    • 2020-09-09
    • 2019-06-14
    • 2018-02-14
    • 1970-01-01
    • 2015-05-07
    • 2017-06-16
    • 2018-06-16
    • 1970-01-01
    • 2016-01-15
    相关资源
    最近更新 更多