Created
July 4, 2022 14:19
-
-
Save m-Py/8b7119fda6f45de8533bafd2b37c87b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compare Cohen's h and phi coefficient as effect sizes for comparing proportions | |
library(effectsize) | |
# test data (have to be contingency tables; one column is always the same) | |
matrices <- lapply(1:999, function(i) matrix(c(i, 1000-i, 999, 1), ncol = 2)) | |
phis <- sapply(matrices, function(x) effectsize::phi(x)$phi) | |
hs <- sapply(matrices, function(x) effectsize::cohens_h(x)$Cohens_h) | |
plot(abs(hs), phis, type = "l") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment