I would like to create a new variable that equals the minimum value out of 5 different variables for each row.
Example: For each "ID" would like to find the minimum value out of v1,v2,v3,v4,v5 and create a new variable "v6" using that value
ID v1 v2 v3 v4 v5
1 22 25 28 30 11
2 15 28 14 19 29
Update: Realized this works, sorry for the wasted post!
egen v6=rowmin( v1 v2 v3 V4 V5)
Related Posts with Finding minimum value out of 5 different variables for each row
Fixed, Random or Pool OLS.Hi, I have panel data containing firm observations for two years. I have to choose Panel model amon…
export F test of excluded instruments of 1st stage of 2SLSI want to export F test of excluded instruments of 1st stage of 2SLS using estout. Code: ivreg2 DV…
Multiple loop commands into one, "program error: code follows on the same line as open brace”Hi everyone, I have a panel data set that consists of portfolio weights of 25 different currencies …
Transforming data in a Correlation MatrixDear all, I'm having a 410x410 correlation matrix, which looks like this A B C D A 1 0.1 0.2 …
Extension of maximum number of variables by "maxvar" is not possible:I have Stata 15 with a Stata/SE license. So extension of memory space should be possible. However us…
Subscribe to:
Post Comments (Atom)
0 Response to Finding minimum value out of 5 different variables for each row
Post a Comment