Hi, there is the following dataset. data dsin; input ID$ pair$ type$ time_point bp; datalines; 1 1 a 3 111 1 1 a 6 134 2 1 b 3 110 2 1 b 9 123 3 2 a 6 131 3 2 a 12 102 3 2 a 18 120 4 2 b 12 121 4 2 b 18 123 ; run; The need is to plot differences for the variable "bp" between IDs that belong to the same pair at these time_points: 3, 6, 9, 12, 15, 18. There will be instances when there is no data in a time_point but we want to record that time_point difference as missing. Also, if one ID is missing data at a time_point, the difference will be recorded as missing. This is the desired output: data dsout; input ID$ pair$ type$ Diff_3 Diff_6 Diff_9 Diff_12 Diff_15 Diff_18; datalines; 1 1 a 1 . . . . 2 1 b 1 . . . . 3 2 a . . . 19 . 3 4 2 b . . . 19 . 3 ; run; Can you please help with a code that will produce the desired output? I am stuck after transposing the data from long to wide. Thank you.
... View more