Categorical factor with g levels
If the explanatory variable is categorical with g levels, its effect can be modelled with a separately adjustable response mean for each level.
yi = µk + εi | |
where εi ∼ normal (0, σ) and the i'th experimental unit gets the k'th level of the factor |
Since this model has g different parameters defining the explained variation (the g means), this model has g degrees of freedom.
A more useful notation for this model uses with double subscripts in which the first subscript denotes the factor level and the second denotes the replicate within that factor level. If there are ni replicates for factor level i, the model can be expressed as:
yij = µi + εij for i = 1 to g and j = 1 to ni | |
where εij ∼ normal (0, σ) |
Using this model for a numerical factor
This model can also be used with numerical factors. The model contains a parameter for the mean response at each level of the factor and does not impose any constrains of 'smoothness' in the relationship between the factor and response.
Cement packing machines
The cement-packing data are shown below. The controlled factor (machine) is categorical so we can use a normal model with a separately adjustable mean for each machine. The three means can be adjusted by dragging the red arrows in the diagram. (The model therefore has three degrees of freedom.)
Adjust the three to make them close to the data points. The distances between the jittered crosses and the model means are called residuals and are displayed in pink. The best-fitting line will result in small residuals. (We will discuss an objective way to estimate the model parameters later.)
Cereal bowl-life
In the cereal bowl-life experiment, the controlled factor (milk temperature) is numerical, but its effect can also be modelled with a separately adjustable mean for each of the four temperatures. The means can be adjusted using the red arrows below to investigate the flexibility of this model.
Note that this model does not require that the mean bowl-life decreases smoothly with milk temperature.