Hello and thank you!
I am trying to generate a new variable that is the variable with the max value among a list of 8 variables. When I use the egen command with a rowmax function is it possible to list which variable within my list is variable for the max value? I'ld like to create this new variable across observations.

For example,

id v1 v2 v3 v3 v4 v5
1 0 2 1 9 7 8
2 1 1 2 3 4 6
3 9 8 7 6 5 4

For this new variable I would like it to generate it as such:

id max_v
1 v3
2 v5
3 v1

My current problem is that the roxmax is returning just the numeric maximum for each observation rather than which variable within my list of variables is the maximum. Any and all help would be amazing.