Abstract This study examines how heterogeneity in classroom characteristics affects the influence of peer interactions on educational outcomes. Using unique friendship network data from German upper secondary schools, we investigate the roles of class size and gender composition in shaping academic achievement. To capture these dynamics, we propose a multivariate instrumental variable (MVIV) approach that extends conventional homogeneous peer effects models and accounts for error heterogeneity a
