ANCOVA when continuous predictor is a main factor of interest: extension of a related post From the literature, I understand that we often assume an ANCOVA is only useful for "controlling" for covariates. However, from this related Stack Exchange post, an ANCOVA should also be mathematically similar to a regression and a possible test when the independent variable is continuous (and not a covariate).
I have been searching for some articles or reviews that even mention using an ANCOVA with a continuous variable of interest but have been unsuccessful thus far.
Would anyone be able to recommend any literature with this particular frame on the ANCOVA?
 A: This is just linear regression with two predictor variables. In fact, both classical ANOVA and ANCOVA are examples of a more general form of testing nested linear regression models. The gist is that the null is that some of the parameters in the larger model is zero, with an alternative that not all of them are. In ANOVA, the large model considers the groups to which subjects belong, and the small model does not (intercept-only). In ANCOVA, the large model considers the groups to which subjects belong as well as some covariate value, and the small model only considers the covariate.
You even can flip the usual narrative about ANCOVA. Yes, traditional ANCOVA tests the model with the groups and covariate against the model with just the covariate, but you could test the full model against the model with just the groups. An example might be if drug dose influences some variable. That is the main issue being considered, but perhaps the investigator wants to consider the fact that different species of animals (say dogs and cats) do not have the same reaction to the drug.
Or maybe, instead of that binary dog/cat variable, the investigator wants to consider how some continuous variable influences that same outcome, even if that continuous variable is not the variable of interest (it is just a covariate). Then it is a matter of testing the full model against the model with just that continuous covariate.
In R:
set.seed(2021)
N <- 100
main <- sample(seq(0, 1, 1/(N - 1)), N, replace = F)
covariate <- sample(seq(0, 1, 1/(N - 1)), N, replace = F)
y <- main - covariate + rnorm(N)
L_full <- lm(y ~ main + covariate)
L_reduced <- lm(y ~ covariate)
anova(L_reduced, L_full) # This does an F-test of the nested models, and classical ANOVA is one such example

In this code, the large model uses the main variable of interest, plus a covariate, while the small model only uses the covariate. The test in anova asks if the parameter on the main variable in the large model is statistically different from zero.
