# Why is this nested?

Is it fair to compare two models one with one of the predictors treated as a continuous variable and in the other, you treat it as categorical variable using ANOVA? Can we call the first model nested under the second?

Nested models are models where all regressors in model A are also included in model B, as-is, without transformations. Thus, a model with a main effect $X$ would be nested in a model with an interaction term $X\times Y$ - as long as the main effect is also present in the interaction model. If the second model does not contain the main effect, then the first model is not nested in the second any more.