shiftdatashort

Shifts data to create lagged versions of the data. Commonly used to calculate lag correlations.

var grid low step high shiftdatashort

Arguments
labeltypedescription
var variable data to be shifted
grid grid grid over which data is to be shifted
low number minimum of range of grid steps to lag. Negative (positive) values indicate a forward (backward) shift in the data along grid. For instance, if low = -6, a data value assigned to grid = n before shiftdatashort is applied (or, equivalently, to grid = n at grid_lag = 0 once shiftdatashort is applied) is assigned to grid = n - (-6) = n + 6 at grid_lag = -6 when shiftdatashort is applied.
step number interval at which data is lagged between low and high. Default value is 1. (optional)
high number maximum of range of grid steps to lag. Negative (positive) values indicate a forward (backward) shift in the data along grid. For instance, if high = +6, a data value assigned to grid = n before shiftdatashort is applied (or, equivalently, to grid = n at grid_lag = 0 once shiftdatashort is applied) is assigned to grid = n - (+6) = n - 6 at grid_lag = +6 when shiftdatashort is applied.
Returns
lagvar variable Same as var except:
1. grid has smaller range of values such that its minimum value is now (original minimum - low) and its maximum value is now (original maximum - high)
2. lagvar dependent on new grid, grid_lag, which has a minumum value of low, maximum value of high, and a step interval of step
Description
shiftdatashort shifts data to create lagged versions of the data. Commonly used to calculate lag correlations
Example
SOURCES .Indices .soi .standardized
T (Jan 1985) (Dec 2003) RANGEEDGES
T -6 1 6 shiftdatashort
Live Example Link


See also

Grid Modification: GRID regridAverage removeGRID renameGRID replaceGRID SAMPLE_MISSING shiftdata shiftGRID splitstreamgrid unsplitstreamgrid zeropointwidth
Independent Variable Creation: classify :cressman grouptogrid invertontogrid shiftdata toS :weaver
Independent Variable Modification: GRID regridAverage regridLB regridLinear removeGRID renameGRID replaceGRID SAMPLE_MISSING shiftdata shiftGRID splitstreamgrid use_as_grid