pingouin.friedman

pingouin.
friedman
(dv=None, within=None, subject=None, data=None, export_filename=None)[source] Friedman test for repeated measurements.
 Parameters
 dvstring
Name of column containing the dependant variable.
 withinstring
Name of column containing the withinsubject factor.
 subjectstring
Name of column containing the subject identifier.
 datapandas DataFrame
DataFrame
 export_filenamestring
Filename (without extension) for the output file. If None, do not export the table. By default, the file will be created in the current python console directory. To change that, specify the filename with full path.
 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(dv='DesireToKill', within='Disgustingness', ... subject='Subject', data=df) Source ddof1 Q punc Friedman Disgustingness 1 9.228 0.002384