Equivalence of models
It is important to think of models in terms of their flexibility for modelling the response mean corresponding to the observed data. For a numerical explanatory variable, X, it is only the model mean at the x-values used in the experiment that matters. Although we may use a linear or quadratic model to predict the response at intermediate x-values, for assessing how well the model fits the actual experimental data, only the predictions at the used x-values matters.
Explanatory variables with two levels
If the explanatory variable is numerical but only two x-values are used in the experiment, the linear model allows complete flexibility in the values for the response mean at these two x-values. (Both models have two unknown parameters.)
The 2-level model that treats these two x-values as categorical has identical flexibility and is equivalent with respect to the fit of the model.
A numerical explanatory variable with 2 levels can be equivalently modelled as categorical.
Conversely,
A categorical variable with 2 levels could equivalently be coded as 0/1 and treated as numerical.
Explanatory variables with three levels
In a similar way, if an experiment involves a numerical explanatory variable that only takes three distinct values, a quadratic model has complete flexibility to give any mean responses at these three x-values. (Both models have three unknown parameters.)
The 3-level model that treats the three x-values as categorical is identical to the quadratic model in its flexibility and fit.
Antibiotic effectiveness
The following diagram again shows the data that were collected for the lowest two concentrations of antibiotic.
Use the pop-up menu to change from a linear to a 2-group model and observe that both models have the same flexibility.
Effect of copper on aquatic animals
An experiment was conducted to determine the effect of copper concentrations in water on the lifetime of a small aquatic animal, daphnia magna. Fifteen daphnia were kept in separate containers and were randomly split into groups getting 0, 20 or 40 micrograms/litre of copper. Their lifetimes (days) were recorded. (One container was contaminated so only 14 lifetimes could be analysed.)
Observe that both the quadratic and 3-group models have complete flexibility in allowing any values for the mean lifetime at concentrations 0, 20 and 40.