Current location - Education and Training Encyclopedia - Graduation thesis - What is the command to take the natural logarithm of time series first and then calculate the difference in SAS?
What is the command to take the natural logarithm of time series first and then calculate the difference in SAS?
Time series variable x is defined in the data step;

The call function log () is converted into a new variable x1;

Call the difference function dif () to convert it into a new variable x2;

X2 analysis;

For example:

Data set;

Enter x;

time = _ n _

x 1 = log(x);

x2 = dif(x 1);

Card;

.

;

Running;