Dear All,
How could I get the max value in rows (sr11-sr12 s02-s13), and sr1-s13 all types are long. I use the code:
egen s1=rowmin(sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13)
egen s2=rowmax(sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13)
but in the first row the final s1=8, the s2=86.
apparently, I want to get the value in the first row, s1=10%, s2=33%. I am wondering how I should do it.
symbol enddate1 sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13
1 2007 10% 15% 33%
1 2008 18% 25%
1 2009 20% 25%
1 2010 22% 25%
1 2011 24% 25%
1 2012 25%
1 2013 25.00%
1 2014 25%
1 2015 25%
1 2016 25%
1 2017 25%
1 2018 25%
1 2019 25%
How could I get the max value in rows (sr11-sr12 s02-s13), and sr1-s13 all types are long. I use the code:
egen s1=rowmin(sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13)
egen s2=rowmax(sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13)
but in the first row the final s1=8, the s2=86.
apparently, I want to get the value in the first row, s1=10%, s2=33%. I am wondering how I should do it.
symbol enddate1 sr11 sr12 s02 s03 s04 s05 s06 s07 s08 s09 s10 s11 s12 s13
1 2007 10% 15% 33%
1 2008 18% 25%
1 2009 20% 25%
1 2010 22% 25%
1 2011 24% 25%
1 2012 25%
1 2013 25.00%
1 2014 25%
1 2015 25%
1 2016 25%
1 2017 25%
1 2018 25%
1 2019 25%


Comment