I would like to create a new variable which takes the minimum value in each row, (ignoring the zeros). How do you do this?
I tried this below and it didnt work

foreach var of varlist ethos_1rough ethos_2emerg ethos_3temp ethos_5immigrant {
egen higher_ethos = rowmin(`var') if `var' ~=0
}


* Example generated by -dataex-. To install: ssc install dataex
clear
input float(ethos_1rough ethos_2emerg ethos_3temp ethos_5immigrant)
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 2 3 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 3 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 3 0
0 0 3 0
0 0 3 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0
end
[/CODE]