Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float ID byte _j strL question_order 1 1 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 2 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 3 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 4 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 5 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 6 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 7 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 1 8 "CountrysideDrawing2|GraffitiDrawing1|GraffitiDrawing2|StillLifeDrawing1|HouseDrawing2|HouseDrawing1|StillLifeDrawing2|CountrysideDrawing1" 2 1 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 2 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 3 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 4 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 5 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 6 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 7 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" 2 8 "StillLifeDrawing2|GraffitiDrawing1|HouseDrawing2|HouseDrawing1|GraffitiDrawing2|StillLifeDrawing1|CountrysideDrawing2|CountrysideDrawing1" end
The question_order string structurally implies time_periods (very short time periods) that are separated with the pipe character "|". For example, the first question/response participant 1 received was "CountrysideDrawing2" or _j = 6; the second, "GraffitiDrawing1"; and so on... As you can see my data is also in 'long-format' hence where the _j variable comes from.
I am trying to find a clean way to produce a variable "t" for the time period that will capture the order in which they received the stimuli. I cannot think of a clean way of doing this, but I am also still learning STATA.
Any help would be great. Thanks in advance!
0 Response to Convert Long String Order to Time Index
Post a Comment