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
Unknown correlation between regressorsDear Statalist, I am grateful for any help on the following question: I have several datasets, eac…
Make a loopHi, I'm very bad making loops I tried to export and generate variables in this way. I have to do th…
Survival analysis in StataDear Stata Users, Please help me with the following issue. I have the data below where “gvkey” is a…
stpm2 graphGood morning. I am a student unfamiliar with stpm2. I have a rudimentary question regarding stpm2. F…
stpm2 tvc df graphGood morning. I am a researcher unfamiliar with stpm2. I have some questions regarding stpm2 executi…
Subscribe to:
Post Comments (Atom)
0 Response to Finding minimum value out of 5 different variables for each row
Post a Comment