friedman
statistics: p = friedman (x)
statistics: p = friedman (x, reps)
statistics: p = friedman (x, reps, displayopt)
statistics: p = friedman (x, reps, displayopt, Name, Value)
statistics: [p, tbl] = friedman (…)
statistics: [p, tbl, stats] = friedman (…)
Performs the nonparametric Friedman’s test to compare column effects in a
two-way layout. friedman tests the null hypothesis that the column
effects are all the same against the alternative that they are not all the
same.
friedman requires one up to three input arguments:
anova2 does.
friedman returns up to three output arguments:
stats also holds the effect size of the test, an Octave extension:
KendallsW, Kendall’s coefficient of concordance, and
KendallsWCI, its two-sided confidence interval at the level
100 (1 - alpha) percent. With b blocks of r
replicates over c columns, W = Q / Q_max, where Q is
the test statistic, corrected for ties, and
Q_max = b r^2 (c^2 - 1) / (r c + 1) the value it takes when every
block ranks the columns in the same order; without replicates this is the
usual W = Q / (b (c - 1)). By default the interval inverts the
noncentral chi-square distribution of Q on c - 1 degrees of
freedom, taken as Q’s distribution under the alternative, which it
is for many blocks, and bounds the expected value of W,
(c - 1 + lambda) / Q_max for the noncentrality lambda; the
lower bound is therefore above zero, W itself averaging 1/b
where the columns do not differ. Three options after displayopt,
also an Octave extension, set it:
| Name | Value |
|---|---|
'Alpha' | The significance level of the interval, a scalar between 0 and 1, 0.05 by default. |
'ConfidenceIntervalType' | 'exact', the default,
or 'bootstrap' for the bias-corrected and accelerated bootstrap
interval, resampling the blocks. |
'NumBootstraps' | The number of bootstrap replicates, a positive integer, 1000 by default. |
If friedman is called without any output arguments, then it prints the results in a Friedman’s ANOVA table to the standard output.
Examples:
load popcorn; friedman (popcorn, 3); |
[p, anovatab, stats] = friedman (popcorn, 3); disp (p); |
See also: anova2, kruskalwallis, multcompare
Source Code: friedman
load popcorn; friedman (popcorn, 3);
Source SS df MS Chi-sq Prob>Chi-sq Columns 99.7500 2 49.8750 13.7586 0.0010 Interaction 0.0833 2 0.0417 Error 16.1667 12 1.3472 Total 116.0000 17
load popcorn; [p, atab] = friedman (popcorn, 3, 'off'); disp (p);
1.0289e-03