Hi everyone - I have a dataset where I'd like to compare a record against the first row in the dataset. For example, if I have the following: ID Height 1 40 2 35 3 40 4 58 I want to be able to create another variable that says which ones are greater than the first. ID Height Flag 1 40 0 2 35 0 3 40 0 4 58 1 I don't think a lag will work since I always want to compare against record 1, not the record immediately preceding. And I can't get a first. command to work since I need to sort by ID in order to get my comparison row on the top, though I think there may be a way to do this that I can't figure out. Any ideas? Thank you!
... View more