Dear All, Suppose that I have the following data
I want to generate a new variable `m', which has the maximum values across all rows but replaced with the corresponding variable name as follows:
Any suggestions?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(onehf twohf threehf) 1 2 3 4 6 5 9 7 8 end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(onehf twohf threehf) str10 m 1 2 3 "threehf" 4 6 5 "twohf" 9 7 8 "onehf" end
Comment