Friedman rank-sum test (non-parametric repeated-measures omnibus)
Source:R/ops-timefreq.R
friedmanTest.RdThe non-parametric repeated-measures omnibus test: compares k >= 2 matched
treatments (columns) measured on the same N blocks/subjects (rows), by
ranking within each block and testing whether the rank totals differ. It is
the within-subject, distribution-free counterpart of the one-way ANOVA
(oneWayAnova). The tie-corrected chi-square statistic and its
p-value reproduce base R stats::friedman.test bit-for-bit and
scipy.stats.friedmanchisquare to machine precision.
Arguments
- x
A blocks-by-treatments numeric matrix (rows = subjects/blocks, columns = conditions/treatments), or a list of
kequal-length numeric vectors (one per treatment, aligned by block). Rows with any missing value are dropped (complete blocks only).- ...
Additional treatment vectors when
xis a single vector.
Value
A list with statistic (the tie-corrected Friedman chi-square),
p_value, df (k - 1), k (treatments) and n (complete blocks).