Hi STATA users
The following problem is probably very basic to you, but I hope you will help me
My data is from camera-recordings of long-jumps.
The data is sorted on the variable Frame. For each jump two frames have been marked as either "toe off" or "heel strike".
I would like to generate a new variable called "Phase". This variable should tell me if the observation(row) is from a part of the jump where the person is preparing to jump (Frames before "toe off), is hanging in the air (Frames between "toe off" and "heel strike) or landing (Frames after heel strike).
A simplified version of my data set looks like this:
(Marks is a string variable, the rest are continuous)
And I would like to have it look like this:
The code is probably very easy but I dont know what command to use, and I´m not sure what such a command could be called.
The reasoning should be something like this:
if Frame< (Frame where Marks=="toe off") then Phase==Preparation
if Frame> (Frame where Marks=="heel strike") then Phase==Landing
if Frame> (Frame where Marks=="toe off") AND <(Frame where Marks=="heel strike") then Phase==Air
Any help with just the first of these commands, or a finger point to where I can look to learn more about this will be very much appreciated.
I hope the above makes sense.
The following problem is probably very basic to you, but I hope you will help me
My data is from camera-recordings of long-jumps.
The data is sorted on the variable Frame. For each jump two frames have been marked as either "toe off" or "heel strike".
I would like to generate a new variable called "Phase". This variable should tell me if the observation(row) is from a part of the jump where the person is preparing to jump (Frames before "toe off), is hanging in the air (Frames between "toe off" and "heel strike) or landing (Frames after heel strike).
A simplified version of my data set looks like this:
Frame | Marks | Joint Variable |
0 | ||
1 | toe off | |
2 | ||
3 | ||
4 | heel strike | |
5 | ||
6 |
And I would like to have it look like this:
Frame | Marks | Phase | Joint Variable |
0 | Preparation | ||
1 | toe off | ||
2 | Air | ||
3 | Air | ||
4 | heel strike | ||
5 | Landing | ||
6 | Landing |
The code is probably very easy but I dont know what command to use, and I´m not sure what such a command could be called.
The reasoning should be something like this:
if Frame< (Frame where Marks=="toe off") then Phase==Preparation
if Frame> (Frame where Marks=="heel strike") then Phase==Landing
if Frame> (Frame where Marks=="toe off") AND <(Frame where Marks=="heel strike") then Phase==Air
Any help with just the first of these commands, or a finger point to where I can look to learn more about this will be very much appreciated.
I hope the above makes sense.