I have a data set that has multiple dates and associated values stored as separate variables like this: 'creatinine_1_date', 'creatinine_1_value', 'creatinine_2_date', 'creatinine_2_value' ... 'creatinine_350_date', 'creatinine_350_value' etc, but in no particular chronological order. I want to find the first and last date and associated value for each observation. Finding the last date is easy using:
egen lastdate = rowmax(creatinine_*_date)
but I cannot figure out how to find the associated value that corresponds to this date. Can anyone provide help? I'm using Stata 13.1.
egen lastdate = rowmax(creatinine_*_date)
but I cannot figure out how to find the associated value that corresponds to this date. Can anyone provide help? I'm using Stata 13.1.
Comment