I have a dataset containing 3 variables:
ID-number, choice (nominal), time (interval).
For every ID, I have to know the choice at the first timepoint.
Thus, here it would be: ID1 = 3, ID2 = 1, ID3 = 4.
The amount of choices differs between participants, it ranges between 1 and around 200.
I know I can work something out with lags and if-functions, but it will be a very complex process, and I think there must be a more elegant way of doing this. Anyone got any tips?
Of course, the real dataset contains more cases and the real problem is more complex (for instance, within subjects I have to do this separately for different trials), but if anyone can point me to a basic syntax that would be great!