Hi,
I have a variable called ia_label that defines an area of interest and a variable called rankIA that gives the order in which that area of interest was accessed by participants. I want to create a third variable that defines, for each area of interest and each participant, what was the next area of interest that was accessed. Example of data below:
An example of what I am aiming for is as follows:
Any thoughts would be much appreciated.
I have a variable called ia_label that defines an area of interest and a variable called rankIA that gives the order in which that area of interest was accessed by participants. I want to create a third variable that defines, for each area of interest and each participant, what was the next area of interest that was accessed. Example of data below:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int participant str11 ia_label float(rankIA nextIA) 2 "Label 3" 3 . 2 "Label 2" 2 . 2 "Label 1" 1 . end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int participant str11 ia_label float rankIA str7 nextIA 2 "Label 3" 3 "" 2 "Label 2" 2 "Label 3" 2 "Label 1" 1 "Label 2" end
Comment