friedman_effsize {rstatix} | R Documentation |
Friedman Test Effect Size (Kendall's W Value)
Description
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.
Usage
friedman_effsize(
data,
formula,
ci = FALSE,
conf.level = 0.95,
ci.type = "perc",
nboot = 1000,
...
)
Arguments
data |
a data.frame containing the variables in the formula. |
formula |
a formula of the form |
ci |
If TRUE, returns confidence intervals by bootstrap. May be slow. |
conf.level |
The level for the confidence interval. |
ci.type |
The type of confidence interval to use. Can be any of "norm",
"basic", "perc", or "bca". Passed to |
nboot |
The number of replications to use for bootstrap. |
... |
other arguments passed to the function |
Value
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.
References
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.
Examples
# Load data
#:::::::::::::::::::::::::::::::::::::::
data("ToothGrowth")
df <- ToothGrowth %>%
filter(supp == "VC") %>%
mutate(id = rep(1:10, 3))
head(df)
# Friedman test effect size
#:::::::::::::::::::::::::::::::::::::::::
df %>% friedman_effsize(len ~ dose | id)