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
Stata not storing my matrix in MataHi all, I am running the code of DLW (2012) with using Stata 15. The command is meant to generate a…
Unique text string I have a dataset, approximately 7500 observations, where clinicians were requested to enter a treat…
Missing marital status between yearsHi all, What I am trying to do is identify all people who have reported being married but for two o…
Deflating Brent Crude Oil Prices ($US) with US CPII currently have Brent Crude Oil prices in US dollars. However, I'd like to deflate it with US CPI s…
Advice Regarding Working With Hierarchical DataI have a dataset of identifiers that are hierarchical - e.g., a given identifier can have a parent i…
Subscribe to:
Post Comments (Atom)
0 Response to Finding minimum value out of 5 different variables for each row
Post a Comment