Least squares estimation

The model with interaction,

is a general linear model, so it can be fitted by least squares — the parameters of the model are chosen to give the smallest possible value for the sum of squared residuals.

Energy expenditure of bees

In an experiment, an entomologist recorded energy expenditure (joules/sec) for bees drinking water with different sucrose concentrations (%) and at different temperatures.

The diagram initially shows the least squares estimates for the model without interaction. Rotate the diagram to get a feel for the positions of the points in relation to the plane.

Now click the checkbox Interaction and choose Show as squares from the pop-up menu. Drag the four red arrows to make the sum of squared residuals (red area) as small as possible. Finally, click Least squares to see the least squares estimates.

After clicking Least squares, click the y-x rotation button. Observe that the fitted model shows that energy expenditure rises more slowly with temperature at low sucrose levels than at high sucrose levels.

Click the y-z rotation button and observe that energy expenditure rises more slowly as sucrose increases at low temperatures than at high temperatures.

Increasing sucrose and temperature together has a particularly high effect on energy expenditure.


Testing for interaction

In the following model, the interaction is modelled by the term involving the product of x and z.

The test for interaction therefore asks whether the coefficient of this term is zero.

Since the model is a general linear model, the method that was described earlier for testing the parameters of any GLM can be applied to test whether the parameters of this model are zero. Interaction can therefore be tested with a t-test for the interaction term. As in other t-tests, this is based on a t statistic that divides the parameter estimate by its standard error.

Energy expenditure of bees

We will now test whether the interaction between sucrose and temperature that is apparent in the least squares estimates could have arisen by chance.

The table shows the parameter estimates, their standard errors, t-statistics and p-values. The p-values show the strength of evidence for whether the corresponding parameters are non-zero.

The p-value for the interaction term is 0.0013, giving very strong evidence that there is interaction between the effects of sucrose and temperature.

The other p-values should not be interpreted since it does not make sense to drop the linear terms in sucrose or temperature when there is an interaction in the model.