Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
SAS Macros and Functions

Overview

Transformations of the dependent variable are a useful way of dealing with nonlinear relationships or heteroscedasticity. For example, the logarithmic transformation is often used for modeling and forecasting time series that show exponential growth or that show variability proportional to the level of the series.

The Box-Cox transformation is a general class of power transformations that include the log transformation and no-transformation as special cases. The Box-Cox transformation is

Y_{t} = \cases{
 \frac{(X_{t}+c)^{{\lambda}}-1}{{\lambda}}
 & \rm{for }{\lambda}{\neq}0\space \cr
 {\ln}(X_{t}+c) & \rm{for }{\lambda}=0\cr}
The parameter {\lambda} controls the shape of the transformation. For example, {\lambda}=0 produces a log transformation, while {\lambda}=.5 results in a square root transformation. When {\lambda}=1 the transformed series differs from the original series by c-1.

The constant c is optional. It can be used when some Xt values are negative or 0. You choose c so that the series Xt is always greater than - c.

The %BOXCOXAR macro tries a range of {\lambda} values and reports which of the values tried produces the optimal Box-Cox transformation. To evaluate different {\lambda} values, the %BOXCOXAR macro transforms the series with each {\lambda} value and fits an autoregressive model to the transformed series. It is assumed that this autoregressive model is a reasonably good approximation to the true time series model appropriate for the transformed series. The likelihood of the data under each autoregressive model is computed, and the {\lambda} value producing the maximum likelihood over the values tried is reported as the optimal Box-Cox transformation for the series.

The %BOXCOXAR macro prints and optionally writes to a SAS data set all of the {\lambda} values tried and the corresponding log likelihood value and related statistics for the autoregressive model.

You can control the range and number of {\lambda} values tried. You can also control the order of the autoregressive models fit to the transformed series. You can difference the transformed series before the autoregressive model is fit.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.