Introduction
In biomedical and clinical research, it is common to compare groups while adjusting for the influence of an important continuous variable such as age, baseline score, or body mass index. Analysis of Covariance (ANCOVA) is a powerful statistical technique that combines features of ANOVA and regression to achieve this goal.
This article provides a complete, practical guide to performing and interpreting ANCOVA using MedCalc, based on a real output file. The example investigates whether treatment groups differ in systolic blood pressure after adjusting for age as a covariate.
What Is ANCOVA?
ANCOVA evaluates group differences in a dependent variable while statistically controlling for one or more covariates.
In this analysis:
- Dependent variable: Systolic Blood Pressure
- Fixed factor: Treatment Group (Drug A vs Drug B)
- Covariate: Age (years)
ANCOVA increases statistical power and removes bias caused by covariate imbalance between groups.
Example Dataset Overview
| Variable | Role in ANCOVA |
|---|---|
| Systolic_BP | Dependent variable |
| Treatment_Group | Independent categorical factor |
| Age_years | Covariate |
| Sample size | 10 (5 per group) |
📥 Download ANCOVA Example Dataset
Assumption Checks in MedCalc
Before interpreting ANCOVA results, all assumptions must be satisfied.
Equality of Error Variances (Levene’s Test)
| Statistic | Value |
|---|---|
| F | 0.029 |
| df | 1, 8 |
| P value | 0.869 |
Interpretation
Since P = 0.869 (> 0.05), the assumption of homogeneity of variances is met. The variability of systolic blood pressure is similar across treatment groups.
Homogeneity of Regression Slopes
| Source | F | P |
|---|---|---|
| Heterogeneity of slopes | 3.375 | 0.116 |
Interpretation
The interaction between Age × Treatment Group is not statistically significant (P > 0.05).
This confirms that the relationship between age and systolic BP is similar across groups, allowing valid ANCOVA interpretation.
Normality of Residuals
| Test | Result |
|---|---|
| Shapiro–Wilk | W = 0.9178 |
| P value | 0.3386 |
Interpretation
Residuals follow a normal distribution, satisfying a key ANCOVA assumption.
Tests of Between-Subjects Effects
This table represents the core ANCOVA results.
| Source | F | P value |
|---|---|---|
| Corrected Model | 170.674 | < 0.001 |
| Age (covariate) | 204.120 | < 0.001 |
| Treatment Group | 90.536 | < 0.001 |
Interpretation of Main Effects
Covariate Effect (Age)
Age has a highly significant effect on systolic blood pressure (P < 0.001).
This confirms the importance of adjusting BP values for age differences.
Treatment Effect
After adjusting for age, treatment group remains highly significant (P < 0.001).
This indicates a true treatment effect independent of age.
Model Fit
| Statistic | Value |
|---|---|
| R² | 0.9799 |
| Adjusted R² | 0.9742 |
Interpretation
Nearly 98% of the variance in systolic blood pressure is explained by the model, indicating excellent model performance.
Estimated Marginal Means
Estimated marginal means represent age-adjusted group means.
| Treatment | Mean BP | 95% CI |
|---|---|---|
| Drug A | 136.93 | 136.19 – 137.68 |
| Drug B | 132.67 | 131.92 – 133.41 |
Interpretation
After controlling for age, Drug A shows a higher systolic BP compared to Drug B.
Pairwise Comparisons (Bonferroni Adjusted)
| Comparison | Mean Difference | P value |
|---|---|---|
| Drug A – Drug B | 4.269 | < 0.0001 |
Interpretation
The adjusted systolic BP of Drug A is significantly higher than Drug B by 4.27 mmHg, even after Bonferroni correction. This confirms a clinically and statistically meaningful difference.
Summary Statistics
| Variable | Mean | SD |
|---|---|---|
| Systolic BP | 134.8 | 4.37 |
| Age (years) | 49.5 | 3.63 |
These values provide context for the sample and support the covariate adjustment.
How to Report This ANCOVA
Example Statement
An analysis of covariance (ANCOVA) was conducted to compare systolic blood pressure between treatment groups while controlling for age. The effect of treatment group was statistically significant, F(1,7) = 90.54, P < 0.001. Age was also a significant covariate, F(1,7) = 204.12, P < 0.001. Adjusted mean systolic blood pressure was higher in Drug A (136.93 mmHg) compared to Drug B (132.67 mmHg).
Conclusion
This MedCalc-based ANCOVA analysis demonstrates how adjusting for a clinically relevant covariate (age) can clarify true treatment effects. All ANCOVA assumptions were satisfied, the model fit was excellent, and the treatment difference remained highly significant after adjustment.
Key Takeaways
- ANCOVA improves accuracy by removing covariate influence
- Assumption testing is essential before interpretation
- MedCalc provides clear, publication-ready ANCOVA outputs
- Adjusted means and pairwise comparisons strengthen conclusions



