how do i create a variable called margin_of_victory = votes for 1st place -
votes for 2nd place?, i.e. 21-10 for state 1, 22 - 11 for state 2, 13 - 12
for state 3, 4 - 3 for state 4, etc.
i can't do this by hand, since i have a huge data set.
i know that the command
. egen margin_of_victory = rmax (votesforA votesforB votesforC votesforD)
will help me pick the biggest number in each row, but how do i get to choose
the 2nd biggest number?
thanks many, and sorry if this is a silly question.