dgromer / apa

Format output of statistical tests in R according to APA guidelines
GNU General Public License v3.0
28 stars 2 forks source link

function `cohens_d`: Hedge's g correction incorrect for one sample design #15

Open spressi opened 6 months ago

spressi commented 6 months ago

Using cohens_d with Hedge's g correction does nothing for a one sample design (i.e., when y = NULL): iris %>% group_by(Species) %>% summarise( cohen_d = apa::cohens_d(Sepal.Length), hedges_g = apa::cohens_d(Sepal.Length, corr="hedges_g"), check = cohen_d == hedges_g )

Hedge's g correction should be applied with df = N-1 according to Cumming (2011) p. 294

dgromer commented 6 months ago

Check ec5a2d7

iris |>
  group_by(Species) |>
  summarize(cohen_d = cohens_d(Sepal.Length),
            hedges_g = cohens_d(Sepal.Length, corr = "hedges_g"),
            check = cohen_d == hedges_g)

now returns

# A tibble: 3 × 4
  Species    cohen_d hedges_g check
  <fct>        <dbl>    <dbl> <lgl>
1 setosa        14.2     14.0 FALSE
2 versicolor    11.5     11.3 FALSE
3 virginica     10.4     10.2 FALSE