Substitution transformations REPLACE RESCALE SEQ SET SUB

REPLACE

!REPLACE old new replaces data values old with new values new in the current variable.


IF(DataValue.EQ.Old) DataValue=New
 Rate !REPLACE -9 0

RESCALE

!RESCALE o s rescales the column(s) in the current variable, or !G group of variables, by adding o and scaling the result by s
 Rate !RESCALE -10 0.1

SEQ

!SEQ replaces the data value with a sequential number starting at 1 which increments whenever the data value changes between successive records; the current field is presumed to define a factor and the number of levels in the new factor is set to the number of levels identified in this sequential process. Missing values remain missing.
 plot !=V3 !SEQ

SET

!SET vlist for a list of n values, vlist, replaces the data values 1:n by the corresponding element from vlist; data values less than 1 or greater than n are replaced by zero.

vlist may run over several lines provided each incomplete line ends with a comma, i.e., a comma is used as a continuation symbol.
 treat !L C A B
 CvR !=treat !SET 1 -1 -1
 group !=treat !SET 1,
    2 2 3 3 4

SUB

!SUB vlist replaces data values which appear in the list vlist with their position number. Data values not found in vlist are set to 0.0.

vlist may run over several lines provided each incomplete line ends with a comma. ASReml allows for a small rounding error when matching. It may not distinguish properly if values in vlist only differ in the sixth decimal place.
  year 3 !SUB 1966 1967 1968

Return to start