Estimate Cohen's d for effect size

前端 未结 3 887
北恋
北恋 2021-02-01 08:24

given two vectors:

x <- rnorm(10, 10, 1)
y <- rnorm(10, 5, 5)

How to calculate Cohen\'s d for effect size?

For example, I want to

3条回答
  •  囚心锁ツ
    2021-02-01 08:47

    Another option is to use the effsize package.

    library(effsize) 
    set.seed(45) x <- rnorm(10, 10, 1) 
    y <- rnorm(10, 5, 5) 
    cohen.d(x,y)
    # Cohen's d
    # d estimate: 0.5199662 (medium)
    # 95 percent confidence interval:
    #        inf        sup 
    # -0.4353393  1.4752717
    

提交回复
热议问题