This thesis contributes to the understanding of peer effects, both methodologically and empirically. The endogeneity of network formation has been a major obstacle to the study of peer influence. The first and the second chapters of the thesis propose a causal identification solution in the potential outcome framework. Combining results from multiple causal inference and statistical network analysis, I show that confounding can be addressed by inferring propensity scores of network link formation from the adjacency matrix. This identification strategy imposes minimum restrictions on the data-generating process and, unlike existing econometric solutions, does not rely on any parametric modelling. As an application, I estimate the effect of high school friendships on bachelor’s degree attainment. While previous literature finds that exposure to more high-achieving boys makes girls less likely to obtain a bachelor’s degree, I show that if the girls consider the boys as friends, their interactions induce a positive impact instead. Since friendship endogeneity has been addressed, the estimated effect is causal. The third chapter looks at the peer effects generated by group competition. It focuses on the gender differences in preference for competition in a setting where the competition does not involve face-to-face confrontation, and effort is the only determinant of the final ranking. I first develop a model of group competition with heterogeneous preference for ranking. With empirical implications generated from the theoretical model, I then test the gender difference in the preference parameter using web-scraped data from Duolingo, a free online foreign-language learning platform with over 300 million users. Every week, language learners on Duolingo are randomly allocated to groups of 30 people to compete on the number of language lessons completed during that week. The empirical results suggest in this setting, females have a stronger preference for ranking than males.