pingouin.friedman

pingouin.
friedman
(data=None, dv=None, within=None, subject=None)[source] Friedman test for repeated measurements.
 Parameters
 datapandas DataFrame
DataFrame
 dvstring
Name of column containing the dependant variable.
 withinstring
Name of column containing the withinsubject factor.
 subjectstring
Name of column containing the subject identifier.
 Returns
 statsDataFrame
Test summary
'Q' : The Friedman Q statistic, corrected for ties 'punc' : Uncorrected pvalue 'dof' : degrees of freedom
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 dependant 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.228 0.002384