Abstract
This paper studies how a student's ordinal achievement rank affects performance and specialization choices in university. We exploit data from a setting where students are randomly assigned to teaching sections and find that students with a higher rank in their section achieve higher grades, become more likely to graduate, and are more likely to choose related follow-up courses and majors. These effects are stronger for men who, in contrast to women, respond to a higher rank with an increase in their study effort. Our results highlight that social comparisons with peers can have lasting effects on students' careers.