I am doing an analysis in which I want to use the LEAD function. I want
to copy the value of the chosen variable from the following line.
However, since I have several observations per trial, I must be careful
not to cross trial boundaries with the LEAD function (otherwise, I will
copy values from the following trial into the current trial).
I have created similar variables (working in the opposite time
direction) using the LAG function before, and have a script that solves
the trial boundary problem:
> DO IF ((lag (subject) = subject) AND (lag (trial) = trial)).
> COMPUTE fixdrlag = lag(fixdur).
> END IF.
I have tried unsuccessfully, however, to use the LEAD function within
this command structure. That is, simply switching the term LEAD for LAG
results in error messages, where there were none before when used with
the LAG function.
I am not quite sure what could be the cause of the problem since both
functions seem to require the same parameters and arguments in their
Any help on this problem would be extremely appreciated.
Thanks in advance!
Human Perception and Performance Group
Beckman Institute for Advanced Science and Technology
405 North Mathews
Urbana, IL 61801