As a former Science, Technology, Engineering, Mathematics (STEM) high schoolteacher, I am interested in factors that influence students' STEM performance, particularly in the role that adolescents' social lives—especially friendships—play in their STEM achievement. Previous research suggests that adolescents' friendships influence their academic motivation and achievement; however, the mechanism of how friendships influence adolescents' academic motivation and achievement is not well understood. Our study examined how adolescents' perceptions of friends' academic and social behaviors influenced math performance while accounting for complex role of gender by using structural equation models and testing specific pathways for mediation and moderation. This case study provides an account of using a large national data set and structural equation modeling to test an empirical theory on how adolescent friendships influence math performance. This case also sheds light on the particularly challenging issues of using large data sets to test theories, preparing and choosing data for structural equation analysis, and testing and interpreting moderated mediation in structural equation modeling.