Added validity check for num input parameter. Fixed data frame to exclude outcomes of NA from ranking.