Linearising the relationship between Y and X
Even though two variables, X and Y, are nonlinearly related, applying a nonlinear transformation to one or other of the variables can linearise the relationship. In other words, some transformation of X may be linearly related to some transformation of Y.
For example, it may happen that the Y2 is linearly related to log(X), satisfying the following model.
y2 = β0 + β1 log x + ε
ε ~ normal (0 , σ)
The parameters of this model could again be estimated by least squares, based on the transformed values of the two variables, and confidence intervals and hypothesis tests would be valid.
Transformation of X
In the following example, only transformations of the explanatory variable, X, will be considered.
Vitamin B and weight gain of rats
The following data set was obtained from an experiment in which 18 rats were given diets containing different quantities of riboflavin (vitamin B2). The doses used in the experiment were 2.5, 5, 10 and 20 mug per day and the weight gains of the rats (grams) were recorded over a period of 4 weeks. The relationship between weight gain and dose is nonlinear — weight gains seem to be less affected by increasing the dose once it is over 10 mug per day.
Drag the red line on the horizontal axis towards the right to apply a power transformation to the dose. Observe that a log transformation (between a power of 0.01 and -0.01) linearises the relationship reasonably well. (Use the arrow keys on the keyboard to make fine adjustments to the power.)
A normal linear model explaining weight gain in terms of log(dose) is therefore reasonable. Note that a linear model between weight gain and log(dose) implies a nonlinear model between weight gain and dose.
Again drag the red line to apply a log transformation to the dose of vitamin B2. The least squares line is drawn on the diagram on the left and its equation is shown below. The diagram on the right shows this equation on a the original untransformed axes; observe that it is curved.
In the next page, we will examine how transformations of the response, Y, may also be used when there is curvature.