Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click Transform > Shifted variable in the menu.
  2. Enter a name for the new variable set. 

    Info
    titleVariable set

    Note that Shifted Variables creates a Variable set, containing several shifted new variables. Therefore, to check your shifted variables you can go to the third icon on the left bar.


  3. Enter Lower shift, negative integer value for backward index, default value: - 10.

    Info
    titleLower shift

    Specifies It specifies the lower bound of the shift window. This may be a positive or negative integer. A lower shift of -1 would create an additional variable in the data set that has its rows shifted down one line row compared to the original variable.

    For more information, see Lower shift

  4. Enter Upper shift, positive integer value for forward index, default value: 0. 

    Info
    titleUpper shift

    Specifies It specifies the upper bound of the shift window. This may be a positive or negative integer. An upper shift of 1 would create an additional variable in the data set that has its rows shifted up one line row compared to the original variable.

    For more information, see Upper shift

  5. Enter Step, integer positive value, default: 1. For more information, see Step

    Info
    titleStep

    Specifies It specifies the step size (number of rows) between the upper and lower shifts (step window). A step equivalent to the step window will result in only one new variable new variable being calculated, whereas a step less than the step window will result in N new variables new variables being created. For example, a step window of 10 5 (lower shift = 0 and -5 & upper shift =100), with a step of 2= 1, results in five new variables (+2, +4, +6, +8, +105 new variables (-1, -2, -3, -4, -5).


  6. Select Input variables or variable set. 
  7. Click Save.

...

In the example below, the variable chosen to be shifted is Meal_Feed_B. The lower shift chosen was - 10 which specifies the lower bound of the shift window. A lower shift of -10 would create an additional variable in the data set that has its rows shifted down ten lines compared to the original variable. The upper bond was specified as zero, therefore no upper bond additional variable will be created.  The step is defined as 10, which specifies the step size (number of rows of 10) between the upper and lower shifts (step window). As the  step is equivalent to the step window it will result in only one new variable being calculated (Meal_Feed_B -10). 



All rows of the new variable are shifted down 10 lines compared to the original variable. The previous records of the new variable Meal_Feed_B -10 , from 1 to 10, are empty (missing values). 

...