Hello Statalisters!
Another potentially trivial question, bur again something I'm incapable of finding a solution to.
I have 4 variables, each a different task. For each observation, efficiency scores are reported if the observation carried out that task. For the purposes of my research I wish to remove the minimum value in each observation, but only one of them. for example, the second observation - I wish to remove one of the 40's and for the 3rd observation I wish to remove the 20. I'm able to remove all minimum variables with the following code, but don't know how to remove just one:
Another potentially trivial question, bur again something I'm incapable of finding a solution to.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(var1 var2 var3 var4 var5) 69 . 50 . 30 40 50 40 60 80 20 25 20 30 . 80 100 20 40 50 end
I have 4 variables, each a different task. For each observation, efficiency scores are reported if the observation carried out that task. For the purposes of my research I wish to remove the minimum value in each observation, but only one of them. for example, the second observation - I wish to remove one of the 40's and for the 3rd observation I wish to remove the 20. I'm able to remove all minimum variables with the following code, but don't know how to remove just one:
Code:
foreach var of varlist var1-var4 { sum `var', meanonly qui gen `var'2 = `var' if `var' != r(min) } If anyone has any advice that would be much appreciated! Thanks in advance statalisters!!!
Comment