Time Series Analysis Package

SCALE Method

  • rc = TSA.SCALE (y, min, max, nomiss, x, <nmiss>);

The SCALE function scales a time series between a specified minimum value and a specified maximum value.

Required Arguments

You must specify the following arguments, separated by commas:

y

specifies the input time series array.

min

specifies the minimum value in the output array.

max

specifies the maximum value in the output array.

nomiss

specifies how missing values are treated. You can specify the following values:

0

allows missing values in the input array.

1

does not allow missing values in the input array. If missing values exist, the output array x Subscript t becomes missing for all values of t.

The default is 0.

Returned Values

The SCALE function returns the following values:

rc

returns one of the following scalar return codes:

rc Termination Reason
5 The input series is nearly constant
4 Missing values were found when the value 1 was specified for nomiss
3 One or more arguments are ignored
2 One or more arguments are set to the default value
1 The input series is all missing
–1 One or more arguments are not supported
–2 The minimum value of the transformed series is greater than its maximum value
–4 Extreme slope
–99 Bad arguments

x

returns the transformed series.

Optional Returned Values

You can also specify the following argument to request an additional returned value:

nmiss

returns the number of missing values that are generated.

Example

This example uses the TSMODEL procedure to scale the time series array Air between a minimum value of 0 and a maximum value of 100:

proc tsmodel data=mylib.air outarray=mylib.scale_array;
   id date interval=month;
   var air;
   outarrays t1;
   require tsa;
   submit;
   declare object TSA(tsa);
   rc=TSA.SCALE(air, 0, 100, , t1, );
   endsubmit;
run;
Last updated: July 09, 2026