ANCOVA

ANCOVA with Type III sums of squares and adjusted means

ANCOVA compares group means after the influence of one or more continuous covariates has been removed. It is the right tool when the groups started out unequal on something that predicts the outcome — and the wrong tool when the covariate acts differently in each group, which is exactly what the parallelism test is there to catch.

The honest part

What ANCOVA adjusts, and the assumption that trips people up

Analysis of covariance fits a model in which the outcome depends on the grouping factor and on one or more numeric covariates, then asks whether the groups still differ once the covariates are held constant. It reports adjusted (least-squares) means — the group means you would have seen if every group had the same covariate value. The classic covariate is a baseline or pretest measurement of the very outcome being studied.

The design decision that matters is the type of sums of squares. With unbalanced groups or correlated covariates, the sequential (Type I) sums of squares depend on the order the terms enter the model. ANCOVA here uses Type III (marginal) sums of squares — each term adjusted for all the others — which is the correct reference for the question "does the factor explain the outcome after the covariates", and it matches R's car::Anova with type = 3 and sum-to-zero contrasts.

The assumption that trips people up is homogeneity of slopes: ANCOVA assumes the covariate has the same effect in every group. If the factor-by-covariate interaction is significant, that assumption is violated and the single adjusted-means comparison is questionable. Magic Stat runs the parallelism test and reports it, instead of letting a hidden interaction invalidate the result.

What it does

What Magic Stat gives you for ANCOVA

How it works

Covariates in, adjusted means out

  1. Load your data. the outcome, the grouping factor and one or more numeric covariates in the same spreadsheet.
  2. Open Statistics → ANCOVA (Analysis of Covariance). the dialog collects the design in one place.
  3. Select the DV, the factor and the covariates. the factor needs two or more levels; select one or more numeric covariates (Ctrl+click or drag).
  4. Run the analysis. it fits the Type III model and fills three tabs: the ANCOVA table, the adjusted means and the parallelism test.
  5. Read and export. check the factor row in the ANCOVA tab and the parallelism tab, then export the report to .docx/.html/.md.
Options

The settings, in the dialog

Design: one between-subjects factor (2+ levels) and one or more numeric covariates.

ANCOVA table: Type III sums of squares, F and p for each covariate and for the factor after adjustment, plus partial eta-squared for the factor.

Adjusted means: least-squares means per group, with each covariate fixed at its global mean.

Parallelism: the factor-by-covariate interaction per covariate and the joint test, with an explanatory note when the model cannot be fit.

Frequently asked

ANCOVA questions, answered honestly

ANCOVA or a mixed model?

ANCOVA handles one between-subjects factor with numeric covariates. If your design is repeated measures, has a random grouping structure, or has missing data by design, a mixed model is usually the more honest answer — ANCOVA assumes independent observations.

What does the parallelism test tell me?

It tests whether the covariate's slope is the same in every group. A non-significant result supports the plain ANCOVA; a significant one means the slopes differ and the single adjusted comparison is questionable, so you should model the interaction or analyse the groups separately.

Should I report adjusted or raw means?

Report the adjusted (least-squares) means whenever the groups differ on the covariates, because those are the means that answer the question the ANCOVA asks. The raw group means are still useful descriptively, but they are not the comparison the model tests.

Why Type III and not Type I?

With unbalanced groups or correlated covariates, Type I sums of squares change with the order the terms enter the model, which makes the factor's p depend on an arbitrary ordering. Type III adjusts each term for all the others, which is the reference for the factor-after-covariates question.

Is my data uploaded somewhere?

No — the analysis runs locally, and the only automatic signal is an anonymous installation counter.

ANOVA → Linear regression → Planned contrasts →