Approximate score test statistic for testing the transformation $\lambda=\lambda_0$
Box and Cox (1964) analyze the normalized power transformation label{eq:BoxCox}
$$ z(\lambda) = \begin{cases} (y^{\lambda}-1)/(\lambda \dot{y}^{\lambda-1}) \quad \quad \lambda\neq 0\\ \\ \dot{y} \log y \quad \quad \quad \quad \quad \quad \quad \quad \quad \lambda =0 \end{cases} \qquad (1) $$
where symbol $y$ with dot on top denotes the geometric mean of the observations. When $\lambda = 1$, there is no transformation: $\lambda = 1/2$ is the square root transformation, $\lambda = 0$ gives the log transformation and $\lambda = -1$ the reciprocal. These are the most widely used transformations, frequently supported by some empirical reasoning. For example, measurements of concentration often have a standard deviation proportional to the mean, so that the variance of the logged response is approximately constant. For this form of transformation to be applicable, all observations need to be positive. For it to be possible to detect the need for a transformation the ratio of largest to smallest observation should not be too close to one. A similar requirement applies to the transformation of explanatory variables.
The hope is that, for
some $\lambda$ which has to be estimated, the transformed
observations will satisfy the linear regression model. label{eq:linmodeltra}
$$ z(\lambda) = x^T\beta+\epsilon, \qquad (2) $$
where $x$ is p-times-1 and the errors are independently normally distributed with constant variance $\sigma^2$. For inference about the transformation parameter $\lambda$, Box and Cox suggest the likelihood ratio test statistic. For regression models, a computationally simpler alternative test of the hypothesis $\lambda = \lambda_0$ is the approximate score statistic derived by Taylor series expansion of Eq. ref{eq:BoxCox}. label{eq:linmodelTay1}
$$ z(\lambda) \doteq z(\lambda_0)+(\lambda-\lambda_0)w(\lambda_0) \qquad (3) $$
where
$$ \left. w(\lambda_0)= \frac{\partial z(\lambda)}{\partial \lambda} \right|_{\lambda=\lambda_0}$$
If the linearized response (ref{eq:linmodelTay1}) is substituted in the regression model (ref{eq:linmodeltra}), the model becomes (label{linmodelw})
$$ z(\lambda_0)=x^T\beta-(\lambda-\lambda_0) w (\lambda_0)+\epsilon \qquad (4)$$.
Because Eq. (ref{linmodelw}) is again a regression model with an extra variable $w(\lambda_0)$ derived from the transformation, the new variable is called the constructed variable for the transformation. If the true value of $\lambda$ is close to $\lambda_0$, the coefficient $(\lambda-\lambda_0)$ of the constructed variable will be small. The regression model (ref{linmodelw}) can be rewritten more conventionally by putting $\gamma=-(\lambda-\lambda_0)$ label{linmodelfin};
$$ z(\lambda_0)=x^T \beta + \gamma w (\lambda_0)+ \epsilon \qquad (5)$$
Small values of $\gamma$ then indicate that no transformation is necessary. The approximate score statistic for testing the transformation $\lambda=\lambda_0$ (which is often denoted in the statistical literature with symbol $T_p(\lambda)$ is just the $t$-statistic for the coefficient of regression on $w(\lambda_0)$ in Eq. (ref{linmodelfin}).
Compute the score test for the wool dataset:
XX=load('wool.txt') y=XX(:,end); X=XX(:,1:end-1); % Compute the score test using the five most common values of the transformation % parameter [outSc]=Score(y,X) outSc.Score = 17.7059 7.4927 -0.9122 -9.5511 -18.5576
The constructed variable is not significant when we consider λ=0
Compute the score test for the loyalty cards dataset:
load('loyalty.txt'); y=loyalty(:,4); X=loyalty(:,1:3); % la = vector containing the values of λ which have to be tested la=[0.25 1/3 0.4 0.5]; [outSc]=Score(y,X,'la',la); outSc = 4.3160 -0.2124 -3.8334 -9.4717
Using all the observations it seems that the third root is the best value of the transformation parameter.