{'fraction_non_alphanumeric': 0.027516013280123413, 'fraction_numerical': 0.014152050705925751, 'mean_word_length': 5.377820553951449, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Do Same-Gender Peers in the Classroom Have Heterogeneous Impacts on Male and Female Students?

The authors investigate if same-gender peers in the immediate learning context have heterogeneous associations with academic outcomes of male and female students. By applying within-student across-subjects models to data from 44 countries in the Trends in International Mathematics and Science Study, the authors examine “situational” within-classroom differences between immediate (peer) learning environments for the same student. The results show, first, that student outcomes are correlated primarily with traits of same-gender peers and, second, that different peer traits have diverse associations with student outcomes. Because of the empirical design, the authors are able to hold factors such as the socioeconomic composition of peers and friendships constant. These findings highlight the importance of gender in the peer influence process in the classroom as well as the diverse channels through which peer traits operate.


Original Article
Many social scientists have studied peer effects. There is a broad consensus in the literature that a student's school and classmates play an important role in the educational process and can help maintain or exacerbate inequalities (Ewijk and Sleegers 2010). Peer effects may appear through diverse mechanisms and in various contexts. Accordingly, empirical studies across different disciplines, such as economics, psychology, and sociology, have focused on a wide range of peer traits (typically cognitive skills and demographic characteristics), as well as on numerous individual outcomes, including students' cognitive and noncognitive outcomes (for comprehensive reviews see, e.g., Epple and Romano 2011;Ewijk and Sleegers 2010;Sacerdote 2011). Results from this literature have shown that a student's peers affect not only cognitive outcomes such as test scores or grades but also noncognitive outcomes such as students' self-perceived ability (Marsh and Parker 1984), subject interest (Raabe, Boda, and Stadtfeld 2019), and effort (Gong, Lu, and Song 2019). Empirical studies have mostly defined the peer group as a student's close friends, classmates, or schoolmates. However, various strands of research have highlighted the importance of gender in shaping the peer influence process. First, recent research on gender differences in science, technology, engineering, and mathematics (STEM) has suggested that we should also pay explicit attention to gender in studies of peer effects, as the STEM-related outcomes of boys and, in particular, girls are strongly influenced by their same-gender peers (Raabe et al. 2019;Riegle-Crumb, Farkas, and Muller 2006). Second, since Willis's (1983) classic study of oppositional culture among working-class boys, several ethnographic studies have shown how peer culture in education is intrinsically gendered and particularly influential for boys' academic outcomes (Bragg et al. 2018;Renold 2001;Swain 2006;Younger, Warrington, and Williams 1999). These findings have been corroborated in several quantitative studies of gendered peer influence, which generally show that boys in particular are subject to peer influence in education (Coleman 1961;Heyder, van Hek, and Van Houtte 2021;Rosenqvist 2018;Thijs, Verkuyten, and Helmond 2010;Van Houtte 2004). Third, research has also shown evidence of peer pressure for gender conformity in school (Aspenlieder et al. 2009;Carver, Yunger, and Perry 2003;Hoffman et al. 2019;Lamb, Easterbrooks, and Holden 1980; and that such pressures often stem from same-gender peers (Lamb et al. 1980). Finally, a few studies within the econometric literature on peer effects have identified peer effects from same-gender peers rather than the entire peer group (Arcidiacono and Nicholson 2005;Ficano 2012). This is primarily the result of two different mechanisms relating to the peer group definition. First, students have a tendency to select same-gender friends (Raabe et al. 2019), thus influencing one another through friendships and forming gendered peer cultures (Coleman 1961;Van Houtte 2004). Second, students are exposed to same-gender peers in their immediate learning context (Rosenqvist 2018).
In the present analysis, we investigate the role of samegender peers in students' immediate classroom learning context. Previous econometric studies of peer effects in education have often neglected the role of social identities such as gender in the formation of peer influence (with notable exceptions: Arcidiacono and Nicholson 2005;Ficano 2012), while studies of gendered peer cultures (e.g., Geven, Jonsson, and van Tubergen 2017;Heyder et al. 2021) have examined specific peer traits or heterogeneous impacts of gender composition. The present study complements this previous research on the gendered nature of peer influence by considering how general academic peer traits (achievement, self-concept, and interest) of same-and other-gender peers are related to individual students' achievement and self-concept. Despite a strong interest in the effects of gender composition on individual students' outcomes, much research until now has focused on the "x side" of the peer-effect equation, that is, studying gendered peer effects by focusing on gender composition (Demanet et al. 2013;Hoxby 2000;Lavy and Schlosser 2011;. However, building on recent research, we argue that research should also focus on the "y side," that is, whether male and female peers have heterogeneous impacts on boys and girls. We expand on previous research on peer effects by investigating whether student outcomes are differentially associated with traits of same-gender and other-gender peers in the immediate learning context; specifically, we explore whether girls are affected mainly by their female peers and boys mainly by their male peers. We distinguish between noncognitive skills, measured as students' academic selfconcept (Blossfeld, Blossfeld, and Blossfeld 2015) and subject interest in math and science, which are both key components for understanding students' achievement behaviors and academic outcomes (Liem, Lau, and Nie 2008;Wigfield and Eccles 2000), and cognitive skills, measured as students' academic achievement in math and science. Specifically, we examine the link between cognitive and noncognitive traits of same-gender classmates and individual students' academic achievement and academic selfconcept. Although previous research has typically focused on the whole school or classroom as the relevant (peer) unit of analysis, we argue that girls (boys) are primarily affected by their female (male) peers and to a lesser extent by othergender peers (Raabe et al. 2019). We test this notion using data from 44 countries in the Trends in International Mathematics and Science Study (TIMSS) 2015, which because of the sampling of classrooms provides us with detailed information on all students within a classroom, as well as information on students' cognitive and noncognitive traits. We examine the data on peers in two academic subject areas (math and science) and on individual students' academic achievement and academic self-concept in the same academic subjects to estimate within-classroom across-subject models (Aslam and Kingdon 2011;Clotfelter, Ladd, and Vigdor 2010;Dee 2005;Schwerdt and Wuppermann 2011). Under the assumption that school, classroom, and student factors are subject invariant, this identification strategy allows us to take account of unobserved heterogeneity that could otherwise bias the results.
In summary, our study expands on previous research on peer effects in education by using a robust methodological framework to provide general evidence concerning cognitive and noncognitive peer traits and the gendered nature of peer influence on academic outcomes for both boys and girls.

Conceptualizing the Peer Context
Previous research on the influence of peers on individual students' outcomes has operationalized the specific peer context in multiple ways. Although some studies have considered peers at the school level (Huyge, Van Maele, and Van Houtte 2015), others have analyzed the influence of within-school learning environments such as classrooms (Ammermueller and Pischke 2009) or tracks (Lefgren 2004), social networks (Raabe et al. 2019), or a student's close friends (Riegle-Crumb et al. 2006). From a theoretical point of view, different definitions of the peer group can be conceptualized as either peer sorting, peer influence or peer exposure (Carbonaro 2019;Raabe et al. 2019). Peer sorting refers to the processes determining how a student is matched with a given group of peers and can as such be considered a selection effect. Sorting can be both formal and informal and takes place both between and within schools. Peer influence refers to individuals' tendency to behave in a similar manner to their close friends, while peer exposure refers to the impact of a student's entire social context. Building on previous research on the importance of local schooling environments Riegle-Crumb and Morton 2017), in this study we focus on exposure to peers in the immediate learning environment. Classrooms differ from friendships in that they are formal organizations as opposed to voluntary associations (Riegle-Crumb et al. 2006). Although a student's close friends may be more important for certain outcomes, such as their educational aspirations or choices because students adopt the aspirations of their friends (Lorenz et al. 2020), we argue that the classroom context is more important for achievement and for noncognitive outcomes such as selfconcept, which to a large degree develop in the classroom as the unit where learning occurs (Ammermueller and Pischke 2009) and through learning-oriented peer cultures (Legewie and DiPrete 2012) and social comparison with classroom peers (Guo et al. 2018). A student is exposed to peer traits in the immediate learning environment regardless of friendships-and for a considerable amount of time.
Classrooms vary significantly in terms of students' cognitive and noncognitive skills because of initial sorting into specific schools on the basis of parental background, to the specific schooling environment, and to teacher effects (see, e.g., Sund 2009). At the same time, however, peer processes are likely to lead to additional within-classroom variation because of students' different abilities, behaviors, and preferences in relation to different academic subjects. Imagine that Peter is a student at school A in class B. Peter is taught different subject areas, such as math and science, with his classmates in class B. Accordingly, Peter is exposed to the exact same peers regardless of academic subject, meaning the socioeconomic peer influence is constant. However, even though Peter's classroom peers are constant across different academic subjects, they may have different abilities, behaviors, and orientations in relation to these different academic subjects. Accordingly, Peter's peer exposure is likely to differ across different the learning environments in different academic subjects: not in terms of social peer exposure (i.e., the impact of peers' socioeconomic backgrounds) but in terms of educational peer exposure (i.e., the impact of peers' cognitive and noncognitive traits). Consequently, even within the same class, a student's educational peer exposure may differ between academic subjects. In this study, we investigate such differences in exposure to peers with different cognitive and noncognitive traits by examining withinstudent and within-peer variations across academic subjects.

The Peer Influence Process
Peers have long been acknowledged as crucial in theories of educational outcomes. The seminal Wisconsin model of status attainment assumes that students are influenced by "significant others," which includes both classmates and close friends (Sewell, Haller, and Portes 1969). Furthermore, research has shown that peers become increasingly important to individuals throughout adolescence ) and provide a more significant frame of reference than parents, because of time spent together and similar life circumstances (Brechwald and Prinstein 2011;Osterman 2000).
There are at least two mechanisms through which peers in the immediate learning environment may be expected to influence individual student outcomes. First, peers are strong socializing agents (Hallinan 1982). Reviewing previous research on peer mechanisms, Ryan (2000) proposed that socialization through processes of norm and value reinforcement drives peer influence, which corresponds to the idea of normative reference groups (Kemper 1968;Richer 1976). Peer groups may affect cognitive as well as noncognitive outcomes, for instance by encouraging or discouraging achievement-related behavior (Van Houtte 2004;Willis 1983), such as putting effort into studying, or by communicating social and cultural norms Salikutluk and Heyne 2017). The individual student will be inclined to conform to such norms to gain acceptance and membership of the peer group (Shibutani 1955). It has been suggested that this inclination toward conformity is especially potent in formally organized settings, such as classrooms, because individuals are less secure in their position compared with the more secure positions in friendship relations . The idea of normative reference groups as a driving mechanism of peer effects is supported by previous empirical research concerning the influence of friendships on course selection Riegle-Crumb et al. 2006) and subject preference (Raabe et al. 2019).
Second, social comparison theory states that individuals compare themselves with similar others to evaluate their own opinions and beliefs (Festinger 1954), a notion that has received significant empirical support (Gerber, Wheeler, and Suls 2018). Specifically, social comparison has been defined as processes of "thinking about information about one or more other people in relation to the self" (Wood 1996). Exposure to different characteristics of one's peer group may have both positive and negative effects on individual cognitive and noncognitive outcomes (Alivernini et al. 2020;Demanet et al. 2013;Rosenqvist 2018). Social comparison theory has, for instance, served as the basis for the frog pond (Davis 1966) and the big-fish-little-pond effect (Marsh and Parker 1984), which claims that school-or class-level average achievement is negatively related to students' perceptions of their own abilities net of individual achievement. Consequently, peers can influence one another in several ways, such as through socialization or exposure to a comparable reference group.

Gender and Social Identity in the Classroom
Although individual students are in principle exposed to all peers in their immediate learning environment, their influence is not necessarily homogeneous, as different peer subgroups are likely to exist within classrooms (Hallinan 1982), and male and female students from the same school have different reference groups (Coleman 1961). Accordingly, students most likely do not evaluate themselves relative to everybody in the classroom. The influence is likely stronger among students with stronger social ties to one another or students within a similar social category, such as gender (Raabe et al. 2019). Social identity theory focuses on social contexts as the key determinant of self-definition, identity, and behavior (Tajfel 1978). Through social categorization, individuals systematize the social world, which provides a system for self-reference. Social groups thus provide individuals with a social identification, which can be understood as relative and comparative: they define the individual as similar to or different from, as "better" or "worse" than, members of other groups. As gender is among the most prevalent social categories (Akerlof and Kranton 2002) and is highly salient for the everyday lives of children (Ruble, Martin, and Berenbaum 1998), students in a classroom are likely to self-categorize on the basis of gender, serving to generate same-gender social groups in the classroom that are important to their identity. On the basis of self-categorization, students thus construct in-group versus out-group boundaries (i.e., girls as separate from the boys in the class). Individual students will then align themselves with their ingroup (same-gender) peers and draw on in-group commonalities to define themselves. Consequently, students' behavior is primarily influenced by peers of the same gender. In addition, academic behavior and attitudes have been found to be gendered, with math and science typically coded as male and language as female (Charles and Bradley 2009;Nowicki and Lopata 2017). There is also evidence that boys to a larger degree feel pressure to gender conformity (Hoffman et al. 2019) and are careful to conform to traditionally masculine norms in terms of subject interest (Chaffee et al. 2020) or oppositional culture among boys (Willis 1983;Younger et al. 1999). Thus, students may be inclined to conform to gendercongruent achievement-related behavior and attitudes, as prescribed by their social environment in general (Ridgeway and Correll 2004) and peer environment in particular (Carver et al. 2003;Geven et al. 2017;Heyder et al. 2021;Raabe et al. 2019). Furthermore, self-categorization guides social comparison processes, leading to within-gender comparisons (Thijs et al. 2010). One aspect of social comparison is the process of selecting comparable others. This is often done on the basis of similarity or categories signifying similarity, including gender (Wood 1989). As comparisons with "local" peers are particularly potent (Gerber et al. 2018), the classroom is an apt setting for social comparison. Accordingly, classroom peers represent a naturalistic comparative reference group and a lens through which students evaluate themselves (Hallinan 1982;Kemper 1968). Thus, for most children, same-gender classroom peers will serve as the most salient object for social comparison, especially concerning achievement-related outcomes such as academic achievement and self-concept.
On the basis of previous research, we anticipate that gender as a highly salient social category (Akerlof and Kranton 2002) will prompt students to self-categorize as either male or female and thus develop an in-group frame of reference in relation to their same-gender peers. As such, gender-specific peer groups are likely to exist within the same classroom, serving as an object of social identity and comparison that shapes achievement-related behavior. Although our analysis cannot disentangle these different mechanisms, they serve as a basis for our understanding of the ways in which classroom peers affect individual student outcomes. We recognize that gender nonconformity is increasingly common and therefore the binary focus on girls and boys in our analysis has certain limitations (Bragg et al. 2018).

Previous Research on Same-Gender Peer Effects
As peer effects occur in many contexts and through multiple mechanisms, studies have examined the effect of numerous peer traits on various individual outcomes, both cognitive and noncognitive (Hallinan 1982). Cognitive traits, such as achievement composition among peers, have generally been shown to correlate with individual achievement (Epple and Romano 2011;Sacerdote 2011;Vigdor and Nechyba 2004). Accordingly, students with more able peers perform better academically, although research suggests that this effect is not linear (Burke and Sass 2013). Higher achieving peers may be associated with learning-oriented values and norms that emphasize academic performance and can encourage individual academic investment (Legewie and DiPrete 2012). Although empirical studies on the impact of peers on noncognitive outcomes are more sparse, research within psychology has shown that school or classroom peers affect individual academic self-concept. Specifically, studies applying the big-fish-little-pond perspective have suggested that students' self-concept is negatively correlated with average academic achievement at the school or classroom level (Marsh and Parker 1984) and that this effect occurs mainly between same-gender peers (Thijs et al. 2010).
In the econometric literature, most empirical research looking to identify peer effects has focused on average effects; nevertheless, many studies have investigated the effects of gender composition on individual outcomes (see Epple and Romano 2011). These studies have generally found that a higher proportion of girls improves achievement through a better disciplinary climate (Figlio 2007;Hoxby 2000;Lavy and Schlosser 2011). However, less attention has been paid to how male and female peer groups in school may have heterogeneous impacts on boys and girls, although studies exist focusing on gendered peer cultures. First, ethnographic studies have shown that boys are more likely to form oppositional peer cultures in schools, hampering their achievement (Renold 2001;Swain 2006;Willis 1983;Younger et al. 1999). In general, peer culture tends to form along gendered lines and affect the academic outcomes of boys and girls in heterogeneous ways (Demanet et al. 2013;Huyge et al. 2015;Van Houtte 2004;. Second, studies within STEM education have investigated the role of same-gender friendships on students' STEM preferences and behavior. Raabe et al. (2019) found that students adjust their subject preferences to align with those of their friends. Both boys and girls adopt similar preferences to their friends and, because students mostly have same-gender friends, this results in patterns of genderspecific influence. Similarly, a study of the effects of samegender friendships in high school showed that the academic achievement of same-gender friends predicts course taking for girls but not for boys (Riegle-Crumb et al. 2006). Third, at the college level, Ficano (2012) argued that aggregate peer measures may mask intragender effects and found that male peer academic ability positively influenced male but not female course grade point average. Arcidiacono and Nicholson (2005) concluded that the achievement of the female medical students in their study was higher when their female peers in medical school had higher scores on the Medical College Admission Test. Finally, Rosenqvist (2018) showed how both the normative and comparative function of peer groups on students' educational decisions are stronger for same-gender peers.

Research Agenda and Hypotheses
The key focus of this article is to investigate gendered peer effects in students' immediate learning environment. To this end, we test two hypotheses. First, we expect cognitive and noncognitive peer traits to affect individual student outcomes. Second, we expect peer effects to be gender specific. Although previous studies have examined gender composition effects (i.e., the impact of the share of female students in a school or class on individual student outcomes), the purpose of this research is to expand this body of literature by investigating not just gender peer effects but gendered peer effects. This includes analyzing not only the impact of a specific gender peer group but also heterogeneity in the impact of male and female peers across male and female student outcomes. Although related research has investigated samegender peer effects, we know little about the impact of exposure to same-gender peers in the immediate learning environment on both cognitive and noncognitive traits across multiple country contexts.

Data and Sample
We used data from TIMSS 2015, which is a large international survey of student achievement conducted by the International Association for the Evaluation of Educational Achievement (IEA). TIMSS includes information on fourth and eighth grade students' achievement in mathematics and science, student background characteristics, and students' attitudes toward the academic subjects, as well as teacher and school characteristics. Students were sampled through a two-stage stratified cluster design. First, schools were randomly sampled. Second, within schools, one or more classrooms were randomly selected and students and teachers were surveyed, thus generating a hierarchical data set of students nested in classrooms (and teachers), schools, and countries. TIMSS samples intact classrooms, which means that every student in a classroom is surveyed, thus providing us with complete information about the classroom peer group. The student-level response rate ranged from 91 percent to 99 percent for the included countries, meaning that almost the full peer group was sampled.
TIMSS 2015 includes 53 countries participating with fourth grade students and 45 countries with eighth grade students. We excluded countries on the basis of two criteria: first, countries in which more than 40 percent of students are in gender-segregated classrooms and, second, countries participating in only one academic subject, as this would be incompatible with our empirical approach of using student fixed effects across academic subjects. We included data from the remaining 44 countries participating with fourth grade and/or eighth grade students. We pooled data for all countries because our ambition was not to carry out a comparative analysis of the role of educational systems in shaping gendered peer effects, something that would require additional theorization, hypotheses, and analysis that are beyond the scope of this study.
Students with more than one teacher per academic subject, students in gender-segregated classrooms, and classrooms with fewer than 8 or more than 35 students were excluded. Table 1 provides an overview of included countries, divided by gender and grade.

Variables
The achievement measure was based on TIMSS tests in mathematics and science. Test questions are based on common curricula for the participating countries. Given the extensive set of test items in TIMSS, only a random subset of items is administered to each student, leaving the rest to be imputed . Therefore, variables measuring achievement consist of five so-called plausible values for both mathematics and science, which are essentially imputed values of the test score for the entire pool of test items. As such, the plausible values can be treated as multiply imputed variables in the analyses (Laukaityte and Wiberg 2017); that is, according to Rubin's (1987) rules. These values are standardized by the IEA to have a mean of 500 and a standard deviation of 100.
Self-concept was measured on the basis of a pool of items from TIMSS 2015 across academic subjects and grade levels. TIMSS combines these items into scales using the Rasch partial credit model . All items are similarly worded across academic subjects and grade levels and answered on a four-point Likert-type scale, for example, "I am just not good at mathematics/science" (all items are shown in Table 2). Fit indices from the Rasch model, internal reliability indices from principal-component analyses, and Cronbach's α all indicate that the scales are acceptable .
At the student level, we included students' subject-specific interest. Similar to self-concept, TIMSS 2015 includes a scale measuring subject interest on the basis of similarly worded items measured on a four-point Likert-type scale, for example, "I like mathematics/science" (see Table 2).
We constructed the peer variables by calculating the mean measures separately for male and female students at the classroom level, excluding student i. Whether it is sensible to form contextual variables on the basis of individual responses, such as the peer variables in the present study, can be evaluated using intraclass correlation coefficients (ICCs), Note: Analytic sample after multiple imputation and exclusion of gender-segregated classrooms, classrooms with fewer than 8 or more than 35 students, students with more than one teacher in each subject, and students with missing values on gender and dependent variables.
where a higher ICC indicates a higher reliability of classroom average means (Marsh et al. 2012). As reported in Tables A1 and A2 in the Appendix online, ICCs at the male/ female classroom level range from 18.6 percent to 34.1 percent, from 14.7 percent to 16.6 percent, and from 16.5 percent to 19.4 percent for achievement, self-concept, and interest, respectively. The ICCs indicate an acceptable level of within-classroom reliability to justify aggregation. The ICCs for achievement were lower in fourth grade than in eighth grade, which makes sense, as students have been part of the same learning environment for longer in eighth grade. We measured teachers' gender, age, experience, and education. The age variable consists of six categories (see Table 3). Experience is measured in years. Education is measured by two variables: one is a dummy variable indicating whether teachers majored in the academic subjects they are teaching, and the other is a dummy variable indicating whether they hold master's degrees or higher. Finally, we standardized all continuous variables within country and academic subject. Table 3 displays means and standard deviations for the variables included in our analysis for fourth and eighth grade, respectively.

Empirical Strategy
The aim of the empirical analysis is to examine whether peer traits have heterogeneous impacts on boys and girls. For this purpose, we use TIMSS's inclusion of separate measurements of achievement and attitudes for both science and mathematics to estimate within-classroom (and within-student) across-subjects models (Aslam and Kingdon 2011;Clotfelter et al. 2010;Dee 2005;Schwerdt and Wuppermann 2011). A key assumption of this model is that factors that do not vary across academic subjects (e.g., social background) do not vary in their effects across academic subjects. This is a strong assumption, particularly across diverse subjects such as math and language as found in some previous studies (Lavy, Silva, and Weinhardt 2009;Sund 2009). We use math and science, which we believe measure comparable skills and are thus similar enough to justify the assumption of subject invariance. Accordingly, this identification strategy allows us to take account of unobserved heterogeneity that might otherwise bias the results by assuming that subject-invariant school, classroom, and student factors are not subject specific. Essentially, the approach involves subtracting the mean of the dependent and independent variables across the two academic subjects for each student. Thus, we identify the peer correlations on the basis of the variation in peer traits occurring between the two academic subjects. The model can be specified as follows:  where i denotes the individual student and j the academic subject (math or science). Peer variables are denoted by p. Finally, s denotes the student control variables (subject interest and self-concept or achievement) and t the teacher control variables (age, gender, education, major, and experience). We estimated fixed-effects regression models for achievement and self-concept. Our independent variables included measures at the student, peer, and teacher levels. The main explanatory variables were female and male peer achievement, self-concept, and interest. We controlled for individual interest and for self-concept in the models using achievement as the dependent variable and vice versa. As teachers vary across academic subjects, we controlled for teachers' gender, age, experience, and education. Models were estimated separately for boys and girls but including both male and female peer variables for both and controlling for the entire variation in the peer variables. Furthermore, to account for differences across grade levels, we estimated these models separately by grade level. To formally test if the peer variables vary in their effect by gender, we also estimated a model in which we pooled the female and male students and add interaction terms between gender and each independent variable. Standard errors were adjusted for the hierarchical nature of the data. We used the house weight, provided by IEA, which adjusts for the probability of selection for each student. Because of the correlated peer traits, we have checked for multicollinearity issues using variance inflation factors, and these did not exceed the conventional thresholds (O'Brien 2007). Finally, we included a control for the academic subject of analysis to make sure that gendered patterns across subjects are not confounded by the gender-specific peer measures.
We used multiple imputation using chained equations to deal with missing data (Rubin 1987). There were 2 percent to 6 percent missing values at the student level and 10 percent to 25 percent at the teacher level. Five imputations (one for each plausible value; for a similar approach, see Heisig, Gesthuizen, and Solga 2019) were calculated separately by country and with variables indicating school and classrooms to account for the multilevel structure of the data. Models included all variables from the analyses as well as auxiliary variables on social background and age. After generating the Variable is standardized within gender in the pooled analysis and within gender and country in the country-specific analyses. b.
Variable is standardized within gender and subject when used as a dependent variable and within gender, subject, and country in the country-specific analyses.
imputed data sets, we excluded students with missing values for gender (0.01 percent and 0.02 percent, respectively, for eighth and fourth grade students) and self-concept (2.54 percent and 2.64 percent for eighth and fourth grade students), as imputed values on dependent variables may inflate standard errors (Von Hippel 2007).

Robustness Checks
The estimated influence of peers, β p , can be interpreted as causal if it is uncorrelated with the error term. There are several reasons why this assumption may not hold in the context of our study. Using Manski's (1993) terminology, we are interested in estimating endogenous effects, meaning the effect of peer outcomes on individual outcomes. Yet identifying such effects can be problematic for several reasons and will often be biased by so-called correlated effects. Correlated effects occur because of shared contextual factors (e.g., teacher or school effects). Furthermore, endogenous peer group formation may generate selection effects (e.g., similar students group together in schools).
We performed two sensitivity analyses to check the robustness of the results in light of these potential sources of bias. First, we reestimated the models on a subsample of data in which students were taught by the same teacher in both academic subjects. Although our methodological strategy, under certain assumptions, by design accounts for observed heterogeneity at the student level, we cannot rule out that the results might be driven by unobserved differences among teachers. If, for instance, male and female teachers adopt different instructional strategies, which might in turn have heterogeneous impacts on male and female students' learning processes (Andersen and Reimer 2019; Lavy 2016), this could potentially bias the results. To test this, we performed a robustness check using a subsample of students who had the same teacher in both academic subjects, thereby effectively introducing teacher fixed effects to our analyses.
Second, we reestimated all models separately by country. Through this approach, we are able to determine if our findings are robust across different social, cultural, and institutional settings. Particularly two types of country-level differences are relevant for our research question. The first type concerns the degree of selectivity, such as tracking and ability grouping. Previous studies have found gender-specific effects of tracking on educational outcomes (van Hek, Buchmann, and Kraaykamp 2019; Van Houtte 2017), and any gendered patterns in tracking or ability grouping could potentially result in gendered patterns in our estimates. The Nordic countries (Denmark, Norway, and Sweden) all operate comprehensive educational systems with no tracking before the age of 16 (West and Nikolai 2013) and can thus serve as a check for whether the effects are driven by tracking. Second, we looked at country-level differences in gender achievement gaps in mathematics and science. If country-level gender gaps are also present at the classroom level, they may generate mechanical correlations between individual outcomes and same-gender peer traits. However, several countries exhibit no gender gaps in mathematics or science achievement , which means that results from these countries can serve as a check for mechanical correlations. Finally, to evaluate gendered patterns of selection into classrooms, we estimated a country and school fixed-effects regression model with the ratio of girls in the classroom as the dependent variable and socioeconomic indicators and teacher variables as independent variables.

Results
We present results from the empirical analysis in two steps. First, we examine the associations between peer traits and individual academic achievement for female and male students in fourth grade, followed by female and male students in eighth grade. Second, we examine the associations between peer traits and the self-concept of female and male students in fourth grade, followed by female and male students in eighth grade. Table 4 presents the results of a fixed-effects model of the relationships between gender-specific peer traits and individual academic achievement for female and male students in fourth and eighth grade, respectively.

Gendered Peer Effects on Students' Academic Achievement
Specifically, Table 4 shows that cognitive traits of female peers, measured as average female achievement, clearly have a greater association with individual female achievement than that of cognitive traits of male peers. We find a statistically significant and positive association between female peer achievement and individual female achievement for both grade levels. By comparison, the link between male peer achievement and individual female achievement is smaller but still statistically significant. The opposite holds true for male students: male peer achievement has a comparatively larger correlation with individual male achievement than female peer achievement. The noncognitive traits of same-gender peers show small coefficients, whereas the coefficients of noncognitive traits of other-gender peers are generally not statistically significant.
To further illustrate how cognitive and noncognitive peer traits vary in their relationships by gender, Figure 1 presents the results of the same model as Table 4 for fourth grade students but pooled for male and female students and including an interaction term between all the peer measures and gender. Figure 1 confirms the patterns shown in Table 4, namely, that same-gender peer achievement has a comparatively larger association with individual achievement than othergender peer achievement, whereas noncognitive peer traits have only minuscule associations.  Figure 2 exhibits the same patterns as Figure 1, with larger coefficients for same-gender peer achievement than other-gender peer achievement, whereas noncognitive peer traits have only minuscule coefficients.
In sum, Table 4 and Figures 1 and 2 all tell the same story: same-gender peer achievement is positively correlated with individual achievement, whereas other-gender peer achievement has a smaller correlation. In addition, there are small or no correlations between noncognitive peer traits and academic achievement regardless of gender. As such, the results lend support to the hypothesis that student outcomes are primarily affected by same-gender peers in the classroom. Furthermore, student achievement is primarily associated with cognitive peer traits and only to a much lesser extent with noncognitive peer traits. Table 5 presents the results of a fixed-effects model of the impact of gender-specific peer traits on individual academic self-concept for female and male students in fourth and eighth grade.

Gendered Peer Effects on Students' Self-Concept
The general pattern shown in Table 5 is that the coefficients of same-gender peer traits are larger and more often statistically significant than the coefficients of other-gender peer variables. As suggested by the big-fish-little-pond hypothesis, peer achievement is negatively correlated with individual self-concept, and this relationship is more pronounced for same-gender peer achievement. The self-concept of same-gender peers has a positive relation to individual self-concept, whereas this relation is smaller for other-gender peer self-concept. However, peer interest has a negative coefficient, which is larger for same-gender peers than for other-gender peers. Figures 3 and 4 are based on pooled analyses for males and female students and include an interaction term between all the peer measures and gender. The results shown in Figure  3 largely correspond to the pattern shown in Table 5 for fourth grade students. Specifically, peer achievement and interest have a negative association with individual self-concept, whereas the association is positive for peer self-concept. All these associations are more pronounced for same-gender peers than for other-gender peers. Figure 4 present the results for eighth grade students' individual self-concept. Here we observe the same patterns as in Figure 3, with larger coefficients for same-gender peer cognitive and noncognitive traits than those of other-gender peers.
In sum, the results show that the association with peer traits is also greater for same-gender peers when it comes to students' self-concept. The links between same-gender peers and individual self-concept are generally both larger and more often statistically significant than for other-gender  peers. Thus, the results support the hypothesis that peer associations are gender-specific for both noncognitive and cognitive outcomes. The results for associations between same-gender peer achievement and individual self-concept support the predictions of the big-fish-little-pond theory, as same-gender peer achievement correlates negatively with individual self-concept.
As the reported estimates are standardized coefficients, they can be interpreted similarly to effect sizes. However, the correlational nature of this study means that the effect sizes are presumably larger than those that would be found in an experimental study, because of different types of biases inflating the estimate (Kraft 2020). Nevertheless, according to the framework proposed by Kraft (2020), the correlations between same-gender achievement and individual achievement are generally large, whereas the corresponding correlations for other-gender peers are medium. For the self-concept outcome, same-gender achievement and noncognitive traits have a medium to large association, while the association for other-gender peers is small or statistically nonsignificant. Finally, our analyses show two general results that are important for understanding the peer influence process. First, cognitive and noncognitive peer associations essentially work through different processes. Although noncognitive peer traits are linked to both students' cognitive and noncognitive outcomes, cognitive peer traits are linked mainly to students' cognitive outcomes. Second, although our results show a very consistent pattern of gender-specific peer associations, the associations with noncognitive peer traits vary. Although the self-concept of same-gender peers generally exhibits positive correlations with individual self-concept, the interest of same-gender peers exhibits negative correlations. Consequently, cognitive and noncognitive peer traits are linked to student outcomes in complex and diverse ways.

Results from Robustness Checks
We performed three sensitivity checks to test the robustness of our results. First, we reran analyses on a subsample of data in which students were taught by the same teacher in both Note: Adjusted predictions with 95 percent confidence intervals from fixed-effects regressions on multiply imputed data. Controlled for individual selfconcept and interest and teacher age, experience, major, and level of education.
academic subjects of analysis. The results of these analyses did not differ significantly from the main results (see Tables  A3 and A4 in the Appendix online). Consequently, the gender-specific patterns in our results are not driven by unobserved heterogeneity at the teacher level. Second, to check country heterogeneity, we analyzed data separately by country. Although there is some variation in the coefficients between countries, these analyses generally revealed the same pattern as the pooled results (see Tables A5-A12 in the Appendix online). Results from the Nordic countries (Denmark, Norway, and Sweden) generally reveal the same pattern as the pooled results, suggesting that results are not driven by country-level differences in tracking. Furthermore, results from countries with no gender gap in achievement in either subject (countries marked in boldface type in the Appendix) show no systematic differences from the remaining countries. This suggests that our results are not an artifact of gender gaps. Third, the results of the models with classroom gender ratio as a dependent variable revealed small gendered selection effects for socioeconomic status and teacher education in eighth grade and no selection effects in fourth grade (results available from authors upon request). To assess the impact of gendered selection in the eighth grade sample, we estimated the selection model for Norway separately, as the Norwegian school system is nonselective. We find no selection effects in Norway. As the main results for Norway (see Tables A5, A6, A9, and A10) were similar to the overall patterns, this suggests that gendered selection did not drive our results for eighth grade. In sum, our results are highly robust to different empirical specifications.

Discussion
Numerous studies within a diverse array of social science disciplines show that peers affect individual students' outcomes in general, and their educational trajectories in particular. The purpose of this study was to investigate the impact of samegender peer traits on individual students' outcomes. We apply a student and classroom composition fixed-effects model across immediate learning environments to data from TIMSS Note: Adjusted predictions with 95 percent confidence intervals from fixed-effects regressions on multiply imputed data. Controlled for individual selfconcept and interest and teacher age, experience, major, and level of education.
2015 to examine how differences in same-gender peer traits induce differences in student outcomes.
The main conclusion from our empirical analysis is that the traits of classroom peers in the immediate schooling environment are important for students' outcomes. Furthermore, student outcomes are linked primarily with traits of same-gender peers, despite being exposed to both same-and other-gender peers in the classroom. This finding is consistent across different student outcomes, different age groups, and countries operating very different education systems. The results partly support the sparse research on intragender friendships, which shows that particularly girls are prone to the influence of same-gender peers in STEM subjects (Raabe et al. 2019;Riegle-Crumb et al. 2006) and that boys are susceptible to peer influence in education more generally ( Van den Broeck et al. forthcoming;Van Houtte 2004). However, we expand on these studies by considering the association between several gender-specific peer traits and both academic achievement and self-concept. Thus, we provide evidence that the gendered nature of peer influence is present for a range of peer traits and outcomes. From a theoretical perspective, our findings are important for understandings of the peer influence process and should be taken into account in future empirical and theoretical research on gender interactions in the school or classroom context. Although many sociological studies of peer influence incorporate the role of gender (e.g., Demanet et al. 2013;, economic studies of peer effects in particular could benefit from taking gender into account (Akerlof and Kranton 2002). Our study uses a unique empirical design in which we are able to hold factors such as the socioeconomic composition of peers and friendships constant while analyzing micro-situational variations stemming from academic subject-specific differences in peer traits across different educational contexts. Accordingly, our findings show that the formal organization of classroom peer exposure is important for the peer influence process and cannot be attributed to socioeconomic resources or friend selection processes. As students' friendships cannot be expected to differ across subjects, classroom peer exposure is important in itself and not just as a proxy for close friends.
Furthermore, our results show that (same-gender) peer achievement is associated with students' academic achievement and to a lesser extent with their self-concept. By contrast, (same-gender) peer self-concept and subject interest are linked to individual students' self-concept, but results are more mixed concerning peer academic achievement. Consequently, different peer measures operate through different channels and are primarily linked to student outcomes along similar dimensions.
Finally, our results show that noncognitive peer traits can have diverse associations with student outcomes, indicating that same-gender classroom peers serve as both normative and comparative reference groups (Kelley 1952;Kemper  1968). We find that peer self-concept has a consistently positive association with the self-concept of individual students, while peer subject interest has a negative association. One potential explanation for this initially surprising finding may be that the academic self-concept of classmates is more salient than their interest in the subject. Although academic self-concept is not necessarily something that peers "flash" in the classroom, and in that sense is not directly observable, peers may be more likely to explicitly express their subject interest, thus making it more of an external frame of reference. In other words, the residual variance in peer interest, once controlled for peer achievement and peer self-concept, may serve as a more directly observable indicator of peer ability to the individual student. As a result, although peer self-concept is linked with student self-concept indirectly through the quality of a more able learning environment, peer subject interest may be negatively associated with students' self-concept through a social comparison effect. Accordingly, in line with the big-fish-little-pond perspective (Marsh and Parker 1984), students may have a more negative perception of their ability, and thus a lower self-concept, when their peers position themselves as having great interest in a subject. Furthermore, the results show a negative link between individual self-concept and the achievement and interest of peers but a positive link between peer achievement and individual achievement, pointing to an important theoretical interpretation in terms of the peer influence process. Students may be less confident in a subject when they have high-achieving peers, but at the same time, they may also themselves achieve at a higher level in the subject. Thus, students do not necessarily internalize the positive influence of higher achieving peers, seemingly because the relative achievement gains observed through social comparison overshadow the absolute achievement gains. This finding is analogous to Kelley's (1952) notion of two functions of reference groups, stating that peers can have paradoxical effects on educational decisions through conformity and social contrast. Such paradoxical peer effects have previously been shown for various outcomes (Alivernini et al. 2020;Demanet et al. 2013;Spears 2021), including effects of peers on choice of secondary education, where students on the one hand conform to peer choice, but higher peer achievement lowers ambition levels (Rosenqvist 2018). Previous research has shown how negative social comparison effects occur for status-related peer factors such as socioeconomic status (Alivernini et al. 2020;Crosnoe 2009). Thus, if peer subject interest serves as a readily observable proxy for peer achievement or as a status indicator, it can trigger negative social comparison processes. Specifically, our results indicate that students conform in terms of achievement, but that social contrast or comparison hinders internalization of the gains in achievement. For decisions regarding tertiary education, normative processes have been found to increase the likelihood of enrolling in higher education, while comparative processes may influence more specific decisions, such as choice of institution (Van den Broeck et al. forthcoming). Thus, our findings can potentially help explain why students may endogenously select into further education tracks that are not optimal in terms of their ability. In other words, students may have a skewed self-concept on the basis of the achievement level of their peer group, which may lead to suboptimal educational choices. This is especially relevant in the case of girls and gender disparities in STEM-related outcomes (Ellis, Fosdick, and Rasmussen 2016). Although our results indicate that same-gender peers serve as both normative and comparative reference groups simultaneously, there are other potential mechanisms that can generate peer influence. These include pressures toward gender conformity (Aspenlieder et al. 2009;Carver et al. 2003;Hoffman et al. 2019;Lamb et al. 1980; and gendered peer cultures shaping study attitudes and behavior (Demanet et al. 2013). Whatever the explanation for the heterogeneous relationships between peer and individual outcomes, our results clearly suggest that the mechanisms leading to peer effects are complex and diverse. Future research should investigate possible channels through which same-gender peer effects Note: Adjusted predictions with 95 percent confidence intervals from fixed-effects regressions on multiply imputed data. Controlled for individual achievement and interest and teacher age, experience, major, and level of education.
operate and disentangle mechanisms pertaining to the individual, classroom, teacher, and school levels.
Our study has a number of limitations. First, the TIMSS data are essentially cross-sectional, which means that we cannot draw causal conclusions. However, we have strived to account for unobserved heterogeneity by estimating within-student across-subject models and performed a number of robustness checks. Considering the clearly gendered patterns of the peer associations in our results, it is unlikely that our results are driven by endogenous selection into schools or classrooms, as that would require parents to selfselect their children into classrooms on the basis of genderspecific characteristics. Furthermore, our robustness check using a subsample of data in which students were taught by the same teacher in both subjects shows no deviations from our main results. Nevertheless, our estimates may still be inflated by unobserved subject-varying factors, and because of the simultaneity of the peer measures and the individual outcomes, we cannot determine the causal direction. However, it seems fair to assume that individual students do not drive the achievement of the entire peer group. Furthermore, although unobserved student ability and teacher adaptations of instruction across subjects may introduce bias from correlated effects into our estimates of peer influence, the gender specificity of our results, as well as our robustness checks, renders such explanations for our results unlikely, as such factors would affect (within-)student outcomes for both male and female students.
Second, the countries participating in TIMSS operate very different education systems. Some countries have tracking systems and others do not. This could potentially affect country heterogeneity in the results because the students' peer groups would be very different. In addition, students in some countries do not have all their lessons with the same group of peers but have different classmates in different subjects. In the TIMSS data, we only observe a student with one of potentially more classes. Although we acknowledge that there could be important country differences due to their different education systems, we believe that this is not a major issue in our analyses, as our results are generally consistent across countries, though we do observe some variation. Importantly, results for countries without tracking and where students only belong to one classroom (e.g., the Nordic countries) do not differ significantly from the remaining countries in the analysis. An important avenue for future research could be to study potential systematic variation in same-gender peer associations across country contexts.
Third, as the information on student gender provided by TIMSS is binary, students may self-identify as nonbinary (Carver et al. 2003). Because gender self-identification is important for the formation of an in-group with same-gender peers (Tajfel 1981), it potentially limits our results that we base our analyses on binary male and female categories.
Finally, a factor potentially limiting the generalizability of our study across subjects is that math and science are traditionally stereotyped as male-dominated fields (Nowicki and Lopata 2017). Previous studies have shown that girls are particularly prone to peer influence in STEM-related subjects (Raabe et al. 2019;Riegle-Crumb et al. 2006), whereas boys are more generally prone to conformity with gender expectations (Heyder et al. 2021). Peer effects may have a greater tendency to follow gendered pathways in traditionally gender-stereotypical academic areas, such as math and science (Menon and Perry 2016;Riegle-Crumb et al. 2006). Thus, the gendered patterns in our results may be more pronounced than would be the case for more gender-neutral subjects. Future research should explore potential heterogeneity between subject domains in terms of same-gender peer effects.
In conclusion, our analyses show that the peer influence process is a complex one in which peers affect individual outcomes in diverse ways. However, despite this complexity, our results show a very consistent pattern of gendered peer associations. Research on school effects in general and on peer effects in particular has traditionally been occupied with informing policy with the explicit aim of improving academic achievement. However, the results presented in this article, showing no signs of country heterogeneity, suggest that optimal classrooms are not necessarily something that can be achieved through educational policy and assignment of students to classrooms on the basis of objective characteristics of students. Peer effects (also) arise from micro-situational interactions that happen every day in the immediate learning context and should be understood as such.