Studies of peer effects in educational settings confront two main problems. The first is the presence of endogenous sorting which confounds the effects of social influence and social selection on individual attainment. The second is how to account for the local network dependencies through which peer effects influence individual behavior. We empirically address these problems using longitudinal data on academic performance, friendship, and advice seeking relations among students in a full-time graduate academic program. We specify stochastic agent-based models that permit estimation of the interdependent contribution of social selection and social influence to individual performance. Evidence of peer effects is indeed found. Students tend to assimilate the average performance of their friends and of their advisors. At the same time, students attaining similar levels of academic performance are more likely to develop friendship and advice ties. Together, these results imply that processes of social influence and social selection are components of a more general a co-evolutionary process linking multiplex network structure and individual behavior.