# pingouin.mixed_anova

pingouin.mixed_anova(data=None, dv=None, within=None, subject=None, between=None, correction='auto', export_filename=None)[source]

Mixed-design (split-plot) ANOVA.

Parameters
datapandas.DataFrame

DataFrame. Note that this function can also directly be used as a Pandas method, in which case this argument is no longer needed.

dvstring

Name of column containing the dependant variable.

withinstring

Name of column containing the within factor.

subjectstring

Name of column containing the subject identifier.

betweenstring

Name of column containing the between factor.

correctionstring or boolean

If True, return Greenhouse-Geisser corrected p-value. If ‘auto’ (default), compute Mauchly’s test of sphericity to determine whether the p-values needs to be corrected.

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
aovDataFrame

ANOVA summary

'Source' : Names of the factor considered
'ddof1' : Degrees of freedom (numerator)
'ddof2' : Degrees of freedom (denominator)
'F' : F-values
'p-unc' : Uncorrected p-values
'np2' : Partial eta-square effect sizes
'eps' : Greenhouse-Geisser epsilon factor ( = index of sphericity)
'p-GG-corr' : Greenhouse-Geisser corrected p-values
'W-spher' : Sphericity test statistic
'p-spher' : p-value of the sphericity test
'sphericity' : sphericity of the data (boolean)


anova

One-way and N-way ANOVA

rm_anova

One-way and two-way repeated measures ANOVA

Notes

Results have been tested against R and JASP.

Missing values are automatically removed (listwise deletion) using the pingouin.remove_rm_na() function. This could drastically decrease the power of the ANOVA if many missing values are present. In that case, it might be better to use linear mixed effects models.

If the between-subject groups are unbalanced (= unequal sample sizes), a type II ANOVA will be computed.

Examples

Compute a two-way mixed model ANOVA.

>>> from pingouin import mixed_anova, read_dataset