I have a n variables x1 .. xn. Now I want to know for each of these n variables what the maximum value is of the n-1 other values.
So suppose there are 4 variables, then I want to know for x1 the maximum value of x2, x3 and x4. And for x2, I want to know the maximum value of x1, x3 and x4. And so on.
The variables can take any value, both negative and positive.
seems not to be possible because n can vary.
Does anyone know how to handle this?
So suppose there are 4 variables, then I want to know for x1 the maximum value of x2, x3 and x4. And for x2, I want to know the maximum value of x1, x3 and x4. And so on.
The variables can take any value, both negative and positive.
Code:
egen rmax = rowmax(x1 x2 x3)
Does anyone know how to handle this?
Comment