Compute the effect size estimate (referred to as w) for
Friedman test: W = X2/N(K-1); where W is the Kendall's W
value; X2 is the Friedman test statistic value; N is the sample
size. k is the number of measurements per subject.
The Kendall’s W coefficient assumes the value from 0 (indicating no relationship) to 1 (indicating a perfect relationship).
Kendalls uses the Cohen’s interpretation guidelines of 0.1 - < 0.3 (small
effect), 0.3 - < 0.5 (moderate effect) and >= 0.5 (large
effect)
Confidence intervals are calculated by bootstap.
See the Datanovia tutorial Friedman Test in R for a worked walkthrough.
a data.frame containing the variables in the formula.
a formula of the form a ~ b | c, where a
(numeric) is the dependent variable name; b is the within-subjects
factor variables; and c (factor) is the column name containing
individuals/subjects identifier. Should be unique per individual.
If TRUE, returns confidence intervals by bootstrap. May be slow.
The level for the confidence interval.
The type of confidence interval to use. Can be any of "norm",
"basic", "perc", or "bca". Passed to boot::boot.ci.
The number of replications to use for bootstrap.
other arguments passed to the function friedman.test()
The type of parallel operation to be used when computing
the bootstrap confidence interval. Allowed values are "no" (default),
"multicore" and "snow". Passed to boot().
Defaults to getOption("boot.parallel", "no"), so it can also be set
globally with options(boot.parallel = "multicore"). Only used when
ci = TRUE.
Integer. The number of processes to be used in the parallel
bootstrap. Defaults to getOption("boot.ncpus", 1L). Note that
boot.parallel has no effect unless boot.ncpus > 1. Only used
when ci = TRUE.
return a data frame with some of the following columns:
.y.: the y variable used in the test.
n: Sample
counts.
effsize: estimate of the effect size.
magnitude: magnitude of effect size.
conf.low,conf.high:
lower and upper bound of the effect size confidence interval.
Maciej Tomczak and Ewa Tomczak. The need to report effect size estimates revisited. An overview of some recommended measures of effect size. Trends in Sport Sciences. 2014; 1(21):19-25.
The Datanovia tutorial: Friedman Test in R.
# Load data
#:::::::::::::::::::::::::::::::::::::::
data("ToothGrowth")
df <- ToothGrowth %>%
filter(supp == "VC") %>%
mutate(id = rep(1:10, 3))
head(df)
#> len supp dose id
#> 1 4.2 VC 0.5 1
#> 2 11.5 VC 0.5 2
#> 3 7.3 VC 0.5 3
#> 4 5.8 VC 0.5 4
#> 5 6.4 VC 0.5 5
#> 6 10.0 VC 0.5 6
# Friedman test effect size
#:::::::::::::::::::::::::::::::::::::::::
df %>% friedman_effsize(len ~ dose | id)
#> # A tibble: 1 × 5
#> .y. n effsize method magnitude
#> * <chr> <int> <dbl> <chr> <ord>
#> 1 len 10 1 Kendall W large