Hi everyone, I've been struggling with what SAS function to use--thank you so much for your help. My dataset has multiple ages for the same ID and I transposed all the unique ages (Age1-Age3) and ran a check on the best age, where Check1 is the check for Age1, Check2 for Age2, etc. I want to pick one best age for each ID. The best age is the age with that corresponds to the highest value for Check by ID (eg. in the dataset below, 52 is the best age for C because Check2 has the highest sum and corresponds with Age2). I know how to sum up Check1-Check3 (using Proc means, sum function). But how do I correspond Age1 to Check 1, Age2 with Check2 etc to identify the correct age that corresponds to the highest summed check? Here is my dataset: ID Age Age1 Age2 Age3 Check1 Check2 Check3 A 65 65 66 . 1 0 . A 66 65 66 . 1 0 . B 63 63 . . 1 . . B 63 63 . . 1 . . C 68 68 52 54 0 1 1 C 52 68 52 54 0 1 0 C 54 68 52 54 0 1 0 Thank you so much, Louise
... View more