Knowledge of prognostic factors can improve the ability to analyze randomized trials. Suppose that there is a strongly prognostic factor in a clinical trial in which the investigators did not use it as a stratifying variable (perhaps they were unaware of this factor) and that the treatment groups are not balanced with respect to this prognostic factor. Then a simple comparison of treatment groups A and B could yield misleading results as shown in the illustration below.

You can see that most of the b's have the lower level of the covariate, and most of the a's have the higher level of the covariate. The apparent difference between the A mean and the B mean is due to the differing values in the covariate. But how do we adjust for these differences and then compare A and B?.

Analysis of covariance (ANCOVA) models can eliminate or reduce the problem of different levels of the covarariates to yield a fair comparison of treatment groups. With respect to nonrandomized studies, ANCOVA models can have the same effect.

How does ANCOVA adjust for these differences?

The unadjusted or raw means for groups A and B, respectively, are:

\(\bar{Y}_A =\frac{1}{n_A}\sum_{i=1}^{n_A}Y_{Ai} \text{ and } \bar{Y}_B =\frac{1}{n_B}\sum_{i=1}^{n_B}Y_{Bi}\)

The adjusted means for groups A and B, respectively, from the ANCOVA are:

\(\bar{Y}_{A, adj} =\frac{1}{n_A}\sum_{i=1}^{n_A}(Y_{Ai}-X_{Ai}\hat{\beta}) \text{ and } \bar{Y}_{B, adj} =\frac{1}{n_B}\sum_{i=1}^{n_B}(Y_{Bi}-X_{Bi}\hat{\beta})\)

where X represents the covariate and \(\hat{\beta}\) represents the estimated slope for X based on the entire set of covariate values across both groups. We are interested in the adjusted values, which have accounted for the covariate. The adjusted mean is an average of the adjusted values. In the graphical illustration above, the covariate slope is positive and the covariate values for the A group are greater, so the adjustment to the A mean is larger. Subtracting these adjustments from the measured responses as indicated in the formula for the adjusted mean (above) will bring the mean of A closer to the mean of B.