Calculates Kendall's W coefficient of concordance,
which can be used as an effect size statistic for
unreplicated complete block design
such as where Friedman's test might be used.
This function is a wrapper for the KendallW
function in the DescTools
package,
with the addition of bootstrapped
confidence intervals.
kendallW(
x,
correct = TRUE,
na.rm = FALSE,
ci = FALSE,
conf = 0.95,
type = "perc",
R = 1000,
histogram = FALSE,
digits = 3,
...
)
A k x m matrix or table, with k treatments in rows and m raters or blocks in columns.
Passed to KendallW
.
Passed to KendallW
.
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.ci
.
The number of replications to use for bootstrap.
If TRUE
, produces a histogram of bootstrapped values.
The number of significant digits in the output.
Additional arguments passed to the KendallW
function.
A single statistic, W. Or a small data frame consisting of W, and the lower and upper confidence limits.
Thanks to Indrajeet Patil, author of ggstatsplot
,
and groupedstats
for help in the inspiring and
coding of this function.
See the KendallW
function in the DescTools
package
for details.
When W is close to 0 or very large, or with small sample size, the confidence intervals determined by this method may not be reliable, or the procedure may fail.
Because W is always positive, if type="perc"
,
the confidence interval will
never cross zero, and should not
be used for statistical inference.
However, if type="norm"
, the confidence interval
may cross zero.
When producing confidence intervals by bootstrap, this function treats each rater or block as an observation. It is not clear to the author if this approach produces accurate confidence intervals, but it appears to be reasonable.
# NOT RUN {
data(BobBelcher)
Table = xtabs(Likert ~ Instructor + Rater, data = BobBelcher)
kendallW(Table)
# }
Run the code above in your browser using DataLab