How to Perform an ANOVA with Unequal Sample Sizes


One question students often have in statistics is:

Is it possible to perform a one-way ANOVA when the sample sizes of each group are not equal?

The short answer:

Yes, you can perform a one-way ANOVA when the sample sizes are not equal. Equal sample sizes is not one of the assumptions made in an ANOVA.

However, there are two potential issues to be aware of when performing a one-way ANOVA with unequal sample sizes:

(1) Reduced statistical power.

(2) Reduced robustness to unequal variance.

The following sections explain both of these potential issues in detail.

Issue #1: Reduced Statistical Power

When we use any type of statistical test to compare groups, the statistical power of the test is highest when each group has an equal sample size.

Recall that statistical power refers to the probability that a test will detect some effect when there actually is one.

It can be shown that the greater the differences in sample sizes between the groups, the lower the statistical power of an ANOVA.

This is why researchers typically want equal sample sizes so that they have higher power and thus a greater probability of detecting true differences.

It’s certainly possible to perform a one-way ANOVA with unequal sample sizes, but you should be aware that the power of the one-way ANOVA will be reduced.

Issue #2: Reduced Robustness to Unequal Variance

One of the assumptions of a one-way ANOVA is that the variance between each group is equal.

In general, a one-way ANOVA is considered to be robust against violations of the equal variances assumption, but only if each group has the same sample size.

Thus, if you have unequal sample sizes and unequal variances between the groups, then the results of the one-way ANOVA can be hard to trust.

How to Decide to Use a One-Way ANOVA with Unequal Sample Sizes

If you have unequal sample sizes and you’d like to perform a one-way ANOVA to test for differences between group means, you can use the following flow chart to decide how to proceed:

Flow chart for deciding to use one-way ANOVA with unequal sample sizes

Here’s a brief explanation of the flow chart:

Step 1: Determine if each group has the same variance.

To determine if each group has the same variance, you can use one of two approaches:

  • Create boxplots for each group and see if the spread of values in each group is roughly equal.
  • Perform a formal statistical test for equal variances like Bartlett’s Test.

If the variances are not equal, perform a Kruskal-Wallis Test, which is considered the non-parametric equivalent to a one-way ANOVA.

If the variances are equal, proceed to the next step.

Step 2: Determine if each group is normally distributed.

To determine if the values in each group are roughly normally distributed, you can use one of two approaches:

  • Create histograms or Q-Q plots for each group.
  • Perform formal statistical tests like Shapiro-Wilk, Kolmogorov-Smironov, Jarque-Barre, or D’Agostino-Pearson.

If each group is normally distributed, you can proceed to perform a one-way ANOVA and interpret the results as you would with any ordinary one-way ANOVA.

If each group is not normally distributed, perform a Kruskal-Wallis Test instead.

Additional Resources

An Introduction to the One-Way ANOVA
How to Check ANOVA Assumptions
An Introduction to the Kruskal-Wallis Test
How to Interpret the F-Value and P-Value in ANOVA

2 Replies to “How to Perform an ANOVA with Unequal Sample Sizes”

  1. I have data with a continuous variable as a dependent variable and two categorical independent variables. I wanted to check these independent variables’ individual and combined effects on the dependent variable. I chose two-way ANOVA. on checking the assumptions of two-way ANOVA were met, except the homogeneity of equal variance (levene’s test). I have an equal sample size in each group. I read online that if I have an equal sample size with all other assumptions met, I can still perform Two-way ANOVA. I wanted to confirm whether this holds, and I couldn’t find any relevant reference for that particular statement

    1. You’re asking an important and nuanced question. Here’s a detailed clarification based on statistical theory and practical application:

      —

      ### ✅ **Summary Answer**:
      **Yes**, it is generally considered acceptable to proceed with a **two-way ANOVA even if Levene’s test for homogeneity of variances is violated, provided that:**

      1. **Sample sizes are equal** across all groups (which you have), and
      2. **Other assumptions** (normality of residuals, independence) are satisfied.

      This is because **ANOVA is fairly robust to violations of the homogeneity of variance assumption** when **sample sizes are equal**.

      —

      ### 🔍 **Why This Holds** (With References):
      1. **Robustness to Heteroscedasticity with Equal Sample Sizes**:
      – When sample sizes are equal (balanced design), the **F-test** in ANOVA remains **robust to moderate violations of homogeneity of variances**. This is supported in standard texts such as:
      – **Field, A. P. (2013). *Discovering Statistics Using IBM SPSS Statistics*.**
      – **Glass, G. V., & Hopkins, K. D. (1996). *Statistical Methods in Education and Psychology*.**
      – The logic is that unequal variances mostly bias the F-statistic **when group sizes are unequal**, especially if large variances align with small sample sizes.

      2. **Simulation Studies**:
      – Multiple simulation studies (e.g., by Lix et al., 1996; Keselman et al., 2004) show that **Type I error rates remain reasonably controlled** under variance heterogeneity **when samples are equal**.

      —

      ### 📌 Recommendation:
      If you **have equal group sizes**, and you’re sure the **residuals are approximately normally distributed and independent**, **you can proceed with the two-way ANOVA** despite Levene’s test showing a significant result.

      But to be cautious, also consider:
      – **Welch’s ANOVA** if the variances are highly unequal (though it’s more suitable for one-way ANOVA).
      – **Robust ANOVA alternatives** (e.g., using trimmed means or bootstrapping).
      – **Generalized Linear Models (GLMs)** if assumptions are severely violated and data are not well-behaved.

      —

Leave a Reply

Your email address will not be published. Required fields are marked *