## 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

The parameter controls the shape of the transformation.
For example, =0 produces a log transformation,
while =.5 results in a square root transformation.
When =1 the transformed series differs from the original
series by *c*-1.
The constant *c* is optional.
It can be used when some *X*_{t} values are negative or 0.
You choose *c* so that the series *X*_{t}
is always greater than - *c*.

The %BOXCOXAR macro tries a range of values and
reports which of the values tried produces the optimal Box-Cox transformation.
To evaluate different values,
the %BOXCOXAR macro transforms the series with each 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 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 values tried and the corresponding
log likelihood value and related statistics
for the autoregressive model.

You can control the range and number of 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.

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