Visual EDA for ANOVA etc.
🎯 Purpose¶
This guide outlines visual exploratory data analysis (EDA) techniques to prepare for conducting ANOVA, MANOVA, ANCOVA, and MANCOVA. Each method requires evaluating group differences in means, variance, and distributional assumptions.
🟦 ANOVA (Analysis of Variance)¶
✅ Use Case¶
Compare the means of a single continuous dependent variable across 2 or more categorical groups.
📈 Visual Tools¶
-
Box Plot:
✔️ Highlights differences in medians and spreadsns.boxplot(x="group", y="outcome", data=df)
-
Violin Plot:
✔️ Combines KDE with boxplot for richer shape comparisonsns.violinplot(x="group", y="outcome", data=df)
-
Strip/Swarm Plot:
✔️ Reveals individual observations and clusteringsns.stripplot(x="group", y="outcome", data=df, jitter=True)
-
Histogram by Group:
✔️ Compares distribution overlapsns.histplot(data=df, x="outcome", hue="group", kde=True, element="step")
🟩 MANOVA (Multivariate ANOVA)¶
✅ Use Case¶
Compare the means of 2+ continuous dependent variables across groups.
📈 Visual Tools¶
-
Pair Plot by Group:
✔️ Visualize interactions between multiple DVs by groupsns.pairplot(df, hue="group", vars=["outcome1", "outcome2"])
-
Group Mean Plot (Centroids): Plot average values for each DV per group using scatter
-
Correlation Heatmap (DVs only):
✔️ Check for collinearity between dependent variablessns.heatmap(df[["outcome1", "outcome2"]].corr(), annot=True)
🟨 ANCOVA (Analysis of Covariance)¶
✅ Use Case¶
Compare group means of a continuous DV while controlling for a continuous covariate.
📈 Visual Tools¶
-
Scatter Plot with Regression Lines:
✔️ Show linear trends by group, adjusting for covariatesns.lmplot(x="covariate", y="outcome", hue="group", data=df)
-
Box Plot + Covariate Distribution:
-
Plot covariate distribution per group to ensure no confounding imbalance
-
Interaction Plot (optional): Shows how slope of DV vs covariate changes per group
🟥 MANCOVA (Multivariate ANCOVA)¶
✅ Use Case¶
Compare 2+ dependent variables across groups, controlling for one or more covariates.
📈 Visual Tools¶
-
Facet Grid Regression: Visualize each DV against covariate, by group
-
Multivariate Scatter or PCA Plot: Reduce DVs to 2D (via PCA) and color by group for pattern detection
-
Partial Residual Plot: Show adjusted effects of group differences post-covariate adjustment
📌 Summary Table¶
Method | Visual Focus |
---|---|
ANOVA | Box/violin plots, histograms, stripplots |
MANOVA | Pair plots, mean centroids, DV correlation map |
ANCOVA | lmplot (scatter w/ covariate), covariate hist |
MANCOVA | Faceted plots by DV, partial plots, PCA clustering |
✅ Final Tips¶
- Always start with distribution and spread checks
- Use color to encode group membership
- Ensure covariates are balanced and linear across groups (for ANCOVA/MANCOVA)
🔗 Related Notes¶
- [[Links]]