# Doubt on checking linearity assumption in a mixed-ANCOVA design

I am a PhD student and I have to run a mixed-ANCOVA on some questionnaire scores (my dependent variable) according to the following model. Factors of ANCOVA are (a) Timepoint (pre-intervention, post-intervention) and (b) Type of intervention (experimental group, control group) with covariate 'pre-intervention values of questionnaires'. I use as a covariate the baseline measures because according to literature this is the preferred general approach for making statistical comparisons in randomized trials with baseline and post-intervention measurements, especially with a small sample size (Vickers and Altman, 2001). My question is: should I check for linearity considering (1) one linearity test with a distribution with dependent variable that is the post-intervention values of questionnaire and the covariate is the pre-intervention values of questionnaire and then run another linearity test with a distribution with dependent variable that is the pre-intervention values of a questionnaire and the covariate is the pre-intervention values of the questionnaire (here, dependent and covariate are the very same distribution) or (2) run a unique linearity test where the dependent variable is a distribution including both pre-intervention and post-intervention values (in the same distribution of scores) of questionnaires and the covariate is the pre-intervention values of questionnaire? (of course in both 1 and 2 I will group them - separate them - according to type of treatment).

• See stats.stackexchange.com/a/627765 . Don’t run a “linearity test”. If there is any chance of a nonlinear baseline vs. follow-up relationship then just allow for it (e.g., using a regression spline or quadratic component). When the sample size is not small I almost always allow for such nonlinearity because you don’t want to underfit baseline and I’m seeing more nonlinearity than I would have expected. Commented Oct 2, 2023 at 12:31
• Thanks! What if the sample size is small?
– Fil
Commented Oct 2, 2023 at 15:12
• It depends on the signal:noise ratio (true R^2 for the whole model). With lower S:N where small may be 50, adding a nonlinear term may add some noise to the model, widening confidence intervals just a bit. Depends on prior knowledge about linearity. Most cohesive strategy is to put a skeptical prior on degree of nonlinearity; this wears off as $N \uparrow$. Commented Oct 2, 2023 at 15:21

When performing a mixed-ANCOVA with the pre-intervention scores of a questionnaire as a covariate, you're making the assumption that the relationship between the covariate and the dependent variable is linear. Checking for this linearity is essential to ensure that the assumptions of the ANCOVA are met.

Given your description and the model you intend to run, the linearity assumption is specifically about the relationship between the pre-intervention scores (covariate) and the post-intervention scores (dependent variable), after accounting for group differences. Here's how I would approach it:

Option 1: Check linearity between:

a) the post-intervention values (dependent variable) and the pre-intervention values (covariate). This is the main relationship of interest since we use ANCOVA to adjust the post-test scores based on pre-test scores.

and

b) the pre-intervention values (dependent variable) and the pre-intervention values (covariate). However, this test is somewhat redundant, as you're essentially checking the relationship of the variable with itself, which is perfectly linear.

Option 2: Create a combined distribution of both pre-intervention and post-intervention scores and check its linearity with the pre-intervention scores. This approach could be a bit tricky and might mask the specific relationship of interest. By blending the pre and post scores into one distribution, you might dilute or confuse the linearity relationship we are primarily interested in (i.e., between pre-test as covariate and post-test as dependent variable).

Recommendation:

It's more straightforward and theoretically aligned with the purpose of ANCOVA to opt for the first approach. Specifically:

Check the linearity between the post-intervention scores (as the dependent variable) and the pre-intervention scores (as the covariate). This test will show if the relationship between your covariate and dependent variable is linear, which is a primary assumption of ANCOVA. The second test in Option (1) is not necessary since, as mentioned, you're checking the linearity of a variable with itself.

Remember, after ensuring linearity, also verify the other assumptions of ANCOVA, such as homogeneity of regression slopes. This ensures that the relationship between the covariate and the dependent variable is consistent across the different levels of your independent variable (in this case, types of intervention).

Lastly, citing Vickers and Altman (2001) shows you're on the right track by adjusting for baseline values, as this often increases statistical power and accounts for any baseline differences that might exist even with randomization.