pingouin.friedman

pingouin.
friedman
(data=None, dv=None, within=None, subject=None)[source] Friedman test for repeated measurements.
 Parameters
 data
pandas.DataFrame
DataFrame
 dvstring
Name of column containing the dependent variable.
 withinstring
Name of column containing the withinsubject factor.
 subjectstring
Name of column containing the subject identifier.
 data
 Returns
 stats
pandas.DataFrame
'Q'
: The Friedman Q statistic, corrected for ties'punc'
: Uncorrected pvalue'dof'
: degrees of freedom
 stats
Notes
The Friedman test is used for oneway repeated measures ANOVA by ranks.
Data are expected to be in longformat.
Note that if the dataset contains one or more other within subject factors, an automatic collapsing to the mean is applied on the dependent variable (same behavior as the ezANOVA R package). As such, results can differ from those of JASP. If you can, always doublecheck the results.
Due to the assumption that the test statistic has a chi squared distribution, the pvalue is only reliable for n > 10 and more than 6 repeated measurements.
NaN values are automatically removed.
Examples
Compute the Friedman test for repeated measurements.
>>> from pingouin import friedman, read_dataset >>> df = read_dataset('rm_anova') >>> friedman(data=df, dv='DesireToKill', within='Disgustingness', ... subject='Subject') Source ddof1 Q punc Friedman Disgustingness 1 9.227848 0.002384