Group comparison
Two-Way ANOVA
Tests the separate effects of two categorical factors on a continuous outcome and the interaction between them within a single model.
Method summary
Two-way analysis of variance splits the variability in the outcome into three sources: the main effect of the first factor, the main effect of the second, and their interaction. The interaction term asks whether the effect of one factor depends on the level of the other, and that is usually where the interest lies, because a significant interaction makes the main effects misleading on their own. The panel builds the model with statsmodels and uses type II sums of squares, which suits real survey data where cell sizes are rarely equal. For every effect it returns an F value, a p value and a partial eta squared, together with a table of cell means.
Which research questions does it answer?
- Do gender and education level act independently on technology acceptance scores, or together?
- Does the effect of an advertising message depend on the age cohort of the participant?
- How do remote versus on-site work and department jointly relate to organisational commitment?
- Is there an interaction between package colour and price level in their effect on purchase intention?
When should you use it?
- When the effects of two categorical factors are examined at the same time.
- When the question is whether the effect of one factor changes across the levels of the other.
- When the outcome is continuous and both factors are categorical.
- When participants are assigned independently to the cells, with no repeated measurements.
Required variable types
- Outcome: a single continuous numeric column.
- First and second factor: separate categorical columns, each with at least two levels.
- One row per participant; the analysis needs at least ten complete rows and the number of cells must stay below the number of observations.
Key assumptions
- Independence of observations
- Each participant belongs to a single cell and observations do not influence one another. Designs with repeated measurements from the same person do not fit this model.
- Normality within cells
- The residuals are expected to be approximately normal, with more tolerance as cell sizes grow.
- Homogeneity of variance
- Cell variances should be similar. A difference in variances distorts the result especially when cell sizes are very unequal.
- Adequately filled cells
- Every combination of factor levels needs observations. Empty cells or cells with a single case make the interaction term impossible to estimate.
How YouReply checks these assumptions
- Independence of observations: The panel does not check this assumption automatically; the researcher evaluates it.
- Normality within cells: The panel runs no normality check for this method; run the Normality tests method separately to inspect the distributions.
- Homogeneity of variance: Unlike one-way ANOVA, no Levene test is run here, so you have to judge homogeneity yourself from the descriptive statistics.
- Adequately filled cells: The engine requires at least ten observations and two levels per factor, and refuses to run when the number of cells approaches the number of observations, stating why.
How the analysis is run
- 1Upload a file that holds the two factors and the outcome in separate columns.
- 2On the Variable tab confirm the factor columns are categorical and the outcome numeric.
- 3On the Analysis tab choose Two-Way ANOVA; the data requirements box shows that two categorical and one numeric column are expected.
- 4In the parameter form select the first factor, the second factor and the outcome.
- 5Run the analysis. Both main effects, the interaction, the error term and the cell means open as separate sections.
- 6Read the interaction p value first, then interpret the main effects; download the results as Excel and the chart as PNG.
Statistics and tables produced
- Main effects
- For each factor: sum of squares, degrees of freedom, mean square, F value, p value and partial eta squared.
- Interaction term
- The joint effect of the two factors, reported with the same statistics and its own partial eta squared.
- Error term
- The variability the model does not explain: sum of squares, degrees of freedom and mean square.
- Cell means table
- Mean, count and standard deviation for every combination of factor levels; the shape of the interaction is read here.
- Factor means and grand mean
- Level means for each factor together with the overall sample mean, used when interpreting the main effects.
- Group means chart
- A bar chart comparing the means is drawn in the results panel and can be downloaded as a PNG.
Effect size and confidence intervals
- Partial eta squared
- For each effect, the ratio of its variability to that variability plus the error. The panel labels values below 0.01 negligible, below 0.06 small, below 0.14 medium and above that large. Because it is partial, the values for different effects in the same model do not add up to one.
No confidence interval is returned for the cell means or for the effect sizes; the values are point estimates. In the panel a confidence interval is computed only for the one-sample t-test.
Example research question and example result
The numbers below are a representative example, not data from a real study or a real user.
- Research question
- In a consumer study, how do package colour (three levels) and price level (two levels) affect purchase intention scores (1-7)?
- Variables
- Outcome: purchase intention score (continuous) · First factor: package colour (three levels) · Second factor: price level (low / high)
- Example result
- Main effect of colour F(2, 234) = 3.87, p = 0.022, partial eta squared = 0.032; main effect of price level F(1, 234) = 11.42, p = 0.001, partial eta squared = 0.047; interaction F(2, 234) = 4.95, p = 0.008, partial eta squared = 0.041. The cell means show the three colours close together at the low price and clearly apart at the high price.
- Interpretation
- Because the interaction is significant, the effect of colour cannot be read independently of price: the difference between colours appears only in the high-price condition. Reporting the main effects alone would hide that structure. The partial eta squared values indicate small effects.
Real output on a sample dataset
The results below were produced by the analysis engine from this data file. Changing the variable changes the research question as well; every run was computed in advance, so the page sends no request to the engine.
General customer survey (synthetic)
A wide survey of three hundred respondents: two and three category grouping variables, continuous measures, a five point ordinal scale, a binary purchase outcome, a four category brand choice, three repeated measurements, paired binary questions, three raters, four price questions and deliberately empty cells.
- Rows
- 300
- Columns
- respondent_id, gender, education, region, age, income, satisfaction, service_score, price_score, quality_score, loyalty, nps_score, purchased, brand_choice, satisfaction_level, pre_score, post_score, measure_1, measure_2, measure_3, use_before, use_after, use_followup, rater_1, rater_2, rater_3, price_too_cheap, price_cheap, price_expensive, price_too_expensive, feedback_score, followup_rating
The data is synthetic: it comes from a fixed random seed, not from a real study. The values below were produced by the analysis engine from this file, so uploading the same file to the panel gives the same results.
Research question: Does satisfaction vary by gender and education level, and do the two factors interact?
- First factor column
- gender
- Second factor column
- education
- Dependent variable
- satisfaction
- Grand mean
- 5.24
- Total observations
- 300
Main effect of the first factor
- Factor
- gender
- Sum of squares
- 1.17
- Degrees of freedom
- 1
- Mean square
- 1.17
- F statistic
- 1.27
- p value
- 0.260
- Partial eta squared
- 0.004
Main effect of the second factor
- Factor
- education
- Sum of squares
- 1.24
- Degrees of freedom
- 2
- Mean square
- 0.619
- F statistic
- 0.674
- p value
- 0.511
- Partial eta squared
- 0.005
Interaction effect
- Interacting factors
- gender x education
- Sum of squares
- 3.03
- Degrees of freedom
- 2
- Mean square
- 1.52
- F statistic
- 1.65
- p value
- 0.194
- Partial eta squared
- 0.011
Error term
- Sum of squares
- 270.27
- Degrees of freedom
- 294
- Mean square
- 0.919
Cell means
| Row | Mean | Valid observations | Standard deviation |
|---|---|---|---|
| Female_Bachelor | 5.47 | 50 | 0.838 |
| Female_High school | 5.13 | 59 | 0.868 |
| Female_Postgraduate | 5.33 | 50 | 0.866 |
| Male_Bachelor | 5.06 | 50 | 1.10 |
| Male_High school | 5.20 | 45 | 1.13 |
| Male_Postgraduate | 5.29 | 46 | 0.938 |
First factor level means
- Female
- 5.30
- Male
- 5.18
Second factor level means
- Bachelor
- 5.27
- High school
- 5.16
- Postgraduate
- 5.31
Computation credits: scipy 1.18.0 · statsmodels 0.14.6 · scikit-learn 1.9.0 · numpy 2.5.1 · pandas 3.0.5 · semopy 2.3.11 · 89fc29a · Data seed: 20260914
How to report the result
The interaction between package colour and price level was significant, F(2, 234) = 4.95, p = .008, partial eta squared = .041, with colour differences emerging only in the high-price condition.
An example sentence close to APA style; the numbers are representative.
When you should not use it
- Unnecessary when only one factor is studied; one-way ANOVA is the simpler model.
- Not suitable when repeated measurements come from the same participants; repeated measures ANOVA is needed.
- With empty or nearly empty cells the interaction cannot be estimated, so the design must cover every combination.
- Because the panel runs no assumption checks, homogeneity of variance and normality are the researcher's responsibility.
- No pairwise comparisons are produced for significant main effects; identifying which levels differ requires the descriptive tables and separate analyses.
- If a continuous variable has to be held constant, this model is not enough and analysis of covariance fits better.
What to use when the assumptions are not met
- One-Way ANOVAWhy: When only one categorical factor is of interest; fewer parameters give a more powerful test.
- ANCOVA (Analysis of Covariance)Why: When groups are compared while holding a continuous variable constant.
- Linear Regression (OLS)Why: When continuous predictors join the factors in the model; the regression framework is more flexible.
Frequently asked questions
- Should I report the main effects when the interaction is significant?
- You can report them, but do not interpret them on their own. With a significant interaction the effect of one factor changes across the levels of the other, so the interpretation has to work through the cell means condition by condition.
- My cell sizes are unequal, is that a problem?
- The panel uses type II sums of squares, which behave consistently in unbalanced designs. The greater risk is unequal variances, and since the panel does not check them you need to compare the cell standard deviations yourself.
- What is the difference between eta squared and partial eta squared?
- Eta squared relates an effect to the total variability, while partial eta squared relates it only to that effect plus the error. Partial eta squared is the convention in factorial models and comes out larger, so state which one you report.
- Can I run a three-factor design?
- This method is limited to two factors and their interaction. For three or more factors you would need to model the variables in a regression framework or simplify the design.
References
- Field, A. (2018). Discovering Statistics Using IBM SPSS Statistics
- Tabachnick, B. G., & Fidell, L. S. (2019). Using Multivariate Statistics
- statsmodels anova_lm documentation
Try it with your own data
The free plan includes 50 analysis runs a month and needs no card.