I'm stumped. I have a situation where for each unique observation of casenum I would like to run varies queries and arithmatic operations between various observations of 'code' for that 'casenum' (see below). For example for casenum 1234567 I would like subtract data for code 0200 - code 0234 or 531 - 53. Please keep in mind that there are thousands of observations in this dataset.Is there an easy way to do this or to do row comparisons with the particular .
/please note casenum and code are character variables and data is a numeric variable/
Here is an example of how the dataset is structured:
casenum code data
1234567 0123 4597
1234567 0234 53
1234567 0100 789
1234567 0200 531
1234567 0300 354
1111112 0123 79
1111112 0234 78
1111112 0100 77
1111112 0200 7954
1111112 0300 35