Resource Compensation or Multiplication? The Interplay between Cognitive Ability and Social Origin in Explaining Educational Attainment

While previous research has conclusively established that children with higher cognitive ability and those originating from advantaged socioeconomic status (SES) backgrounds have better educational outcomes, the interplay between the inﬂuences of cognitive ability and social origin has been largely overlooked. The inﬂuence of cognitive ability might be weaker in high-SES families as a result of resource compensation, and stronger in high-SES families owing to resource multiplication. We investigate these mechanisms while taking into account the possibility that the association between cognitive ability and educational attainment might be partly spurious due to unobserved genetic and environmental inﬂuences. We do so by analysing a large sample of twins from the German TwinLife study ( N pairs ¼ 2,190). Our results show that the association between cognitive ability and educational attainment is to a large extent confounded by genetic and shared environmental factors. If this is not considered, and this is the case in most previous studies, high-SES parents seem to compensate for the lower cognitive ability of their children. However, when we consider the genetic and shared environmental confounding, the resource compensation effect becomes non-signiﬁcant.


Introduction
Research shows time and again that children from more advantaged socioeconomic backgrounds have better educational outcomes, i.e. there is inequality of opportunity (for a review, see Breen and Jonsson, 2005). One important pathway by which parental socioeconomic status (SES) affects educational attainment is through fostering the development of children's cognitive ability (e.g. Sewell and Hauser, 1980;Bukodi, Erikson and Goldthorpe, 2014;Schulz et al., 2017). Another potentially important pathway is that parental SES may influence how much children are harmed by low cognitive ability or benefit from high cognitive ability. However, only a few studies have researched to what extent the influence of cognitive ability on educational attainment depends on SES. Moreover, these studies show mixed results as to whether the statistical interaction between cognitive ability and SES is negative or positive.
A negative interaction indicates that having a higher SES background compensates for having a low cognitive ability. Evidence for such a compensatory effect has been found by Bernardi (2014), Bernardi and Cebolla-Boado (2014), Bernardi and Grä tz (2015), Bernardi and Triventi (2018), and Carneiro and Heckman (2003). A positive interaction between cognitive ability and parental SES indicates that having a higher SES background boosts the returns to cognitive ability in educational attainment. This can be labelled resource multiplication, and some studies have found support for this as well (Lleras, 2008;Bukodi, Erikson and Goldthorpe, 2014;Damian et al., 2014).
Previous studies of resource compensation and multiplication often use continuous measures for SES. Bernardi and Cebolla-Boado (2014) and Bukodi, Erikson and Goldthorpe (2014) are an exception and use a categorical measure for parental class. Although they do not explicitly mention this, their results suggest that the interactions do not occur gradually with increasing SES: they take place only at the top. Whereas the results by Bernardi and Cebolla-Boado (2014) suggest it is especially the upper class who compensate for prior poor school performance, Bukodi, Erikson and Goldthorpe (2014) find that it is the highest social class that multiply the influence of high cognitive ability in educational attainment. It is thus not clear if resource compensation or multiplication occurs, and if it occurs, whether this is only at the top of the social hierarchy. Therefore, we investigate the interplay between cognitive ability and SES and the possible non-linearities. We ask: How does SES affect the influence of children's cognitive ability on educational attainment?
Investigating the influence of SES on the returns to cognitive ability in educational attainment is not straightforward, because the relationship between cognitive ability and educational attainment could be partly spurious. To reliably test compensation and multiplication, it is necessary to take into account all characteristics that might affect cognitive ability and educational attainment (Bernardi, 2014). The factors that affect cognitive ability and educational attainment may be both genetic and social (Krapohl et al., 2014). Behavioural genetics studies have shown that genes explain on average half of the variance in cognitive ability (Plomin and Deary, 2015) and 40% of the variance in educational attainment (Branigan, McCallum and Freese, 2013). It can be expected that part of the genes influencing cognitive ability also influences educational attainment (i.e. genetic confounding). For example, genes related to selfregulation affect performance on a cognitive test but are also important for academic attainment (Rueda, Posner and Rothbart, 2005). Similarly, shared social confounding can be expected. For instance, a warm and responsive parenting style positively influences children's cognitive development, but also creates a supportive home-environment that helps them to perform well in school (Bradley, Caldwell and Rock, 1988). A previous behavioural genetics study has investigated the genetic and shared environmental overlap between cognitive ability and educational achievement and shows that a large share of the association between cognitive ability and educational achievement is due to genetic factors and a smaller part due to social factors (Calvin et al., 2012). It is likely, but yet unknown, if this finding can be extended to educational attainment.
Previous studies have largely ignored such potential confounding. A recent study by Gil-Herná ndez (2019) takes an important step by taking confounding into account using the same twin data as we do but using a different method (i.e. hybrid multilevel models). However, Gil-Herná ndez (2019) focuses mostly on compensation and multiplication of differences in the cognitive ability within the family, which is defined differently from the compensation and multiplication between families that we are interested in. Due to the use of hybrid multilevel models, Gil-Herná ndez's findings about within-family differences are free from confounding, but his findings on between-family differences are based on an association that is not free from confounding. Moreover, a disadvantage of hybrid multilevel models is that they do not distinguish between whether confounding in the association between cognitive ability and educational attainment is genetic or social in nature. In this study, we not only remove the confounding, we also investigate the underlying sources of confounding.
Identifying the amount of genetic and social confounding in the association between cognitive ability and educational attainment is important for evaluating the findings of comparable research with conventional sociological methods, i.e., Ordinary Least Squares (OLS) regression models and family fixed-effects models applied to sibling data. If confounding is mostly social in nature, it would lead to an overestimation of the influence of cognitive ability on educational attainment in OLS regression but not in family fixed-effects models. Yet, results based on OLS regression models would not be biased much either if the social confounding is largely due to factors that are often measured and included, such as parental SES. If there is a substantial amount of genetic confounding, the influence of cognitive ability on educational attainment will be overestimated in both OLS regression models and in family fixed-effects models applied to sibling data. Overestimation may lead to wrong conclusions about compensation and multiplication effects between cognitive ability and SES in educational attainment (Bernardi, 2014). This problem is even more severe if the amounts of social and genetic confounding differ by parental SES.
In the present study, we will take a behavioural genetics approach, which allows us to unravel genetic and social confounding in the association between cognitive ability and educational attainment. We use data from the first wave of the German TwinLife study, which comprise extensive information on twin families from a representative sample in Germany (Diewald et al., 2016). In total, we will analyse 4,380 twins (2,190 twin pairs) from birth cohorts 1991/1992, 1997/1998, and 2003/2004. Germany is an intriguing context to investigate the interplay between cognitive ability and social origin in educational attainment. Like other European countries (e.g. Austria, Belgium, the Netherlands), Germany has a highly stratified educational system (OECD, 2013). In Germany specifically, tracking occurs relatively early. Around the age of 10, children are streamed within different educational levels. Educational track choice depends on the recommendations of the teachers, but in most federal states the final decision is made by parents. Given that stratification based on social origin is relatively strong in highly stratified educational systems (van de Werfhorst and Mijs, 2010), the German context provides a good opportunity for investigating mechanisms for social disparities in educational attainment, namely those of resource compensation and multiplication.

SES, Cognitive Ability, and Educational Attainment
Cognitive ability is considered an important mediator between parental SES and educational attainment (Erikson, 2016;Bourne et al., 2018). It reflects the capacity for reasoning, problem solving, abstract thinking, learning and adapting, and processing and comprehending complex ideas and information (Gottfredson, 2004). Successful formation of cognitive skills in pre-school years begets later learning and success in school (Heckman, 2000). These in turn influence the decision of teachers and parents to recommend a more demanding academic track. Children from high-SES families are said to have a higher cognitive ability because these families are better able to provide their children with materials (e.g. books or toys), experiences (e.g. language stimulation), and services (e.g. high-quality healthcare and childcare). Therefore, high-SES children are raised in a more development-enhancing and cognitively stimulating environment (Bradley and Corwyn, 2002).
Unlike the present study, previous studies of the role of SES and cognitive ability in explaining educational attainment (see e.g. Jackson, 2013) did not take into account the possibility that the association between cognitive ability and educational attainment might be partly genetically and socially confounded. Therefore, the following hypothesis will be tested while considering such confounding: Parents' SES positively affects children's educational attainment, partly by affecting children's cognitive ability (H1)

Interplay between Cognitive Ability and Social Origin
Resource compensation When resource compensation occurs, the consequences of disadvantageous events and characteristics-such as a low cognitive ability-are less harmful when there are more alternative (parental) resources (Bernardi, 2012;Erola and Kilpi-Jakonen, 2017). There are two main explanations for why children in high-SES families may have such a compensatory advantage in educational attainment. According to the Relative Risk Aversion (RRA) theory, high-SES parents have higher incentives to invest in their children's educational success (Breen and Goldthorpe, 1997). Like all parents, they want to avoid their children becoming downwardly mobile. To reach the same status as their parents, children of high-SES families need to complete a high, and therefore more costly, level of education. In low-SES families, the starting positions are already low and hence social reproduction is less at risk (Blau and Duncan, 1967;Breen and Goldthorpe, 1997). Applying the RRA theory to resource compensation, we conclude that high-SES families have especially higher incentives to invest when their children have low cognitive ability. In particular, high-SES children with low cognitive ability have a large risk of downward mobility. Therefore, high-SES parents are more motivated than low-SES parents are to compensate for their children's low cognitive ability and ensure an educational advantage for them.
Second, high-SES parents have the necessary financial, cultural, and social resources to invest. High-ability children from high-SES families will be placed in higher educational tracks anyway, but when children have a low cognitive ability this may result in a less demanding educational track if parents do not act. High-SES parents could compensate for the possible negative consequences of children's low cognitive ability, for example, by paying for private tutoring or by pressuring teachers to give the recommendation to allocate their child to a higher track. In low-SES families, parents have fewer resources to invest in their children's educational attainment in general, let alone being in a position to provide additional investments to their low-ability children. Hence, low-SES parents are more likely to divide their scarce resources equally among their children or invest in the most able child (Grä tz and Torche, 2016).
Because of these differences in parental incentives and resources, having a low cognitive ability may be less detrimental for the educational attainment of children in high-SES families than in low-SES families. Therefore, we expect resource compensation: The higher the parents' SES, the weaker the influence of children's cognitive ability on children's educational attainment (H2).

Resource multiplication
There are also reasons to expect that having a high cognitive ability is more beneficial for children from advantaged social origins than for their counterparts from disadvantaged social origins (i.e. resource multiplication) (Blau and Duncan, 1967;DiPrete and Eirich, 2006). Having a high cognitive ability could benefit educational attainment mainly when (i) children's ability is recognized by their parents and (ii) when children have access to resources to develop their cognitive ability and put it to use.
High-SES parents are more likely to recognize and stimulate the cognitive ability of their children than low-SES parents are. High-SES parents have direct experience of high educational attainment and have knowledge gained from higher education (Bryant, Zvonkovic and Reynolds, 2006). Therefore, they are more likely to recognize (and differentiate between) their children's abilities and help their high-ability children in such a way that they are challenged and develop their talents even further. High-SES parents are able to stimulate their high-ability children, because they can, for example, afford better (quality) education for their talented children or pressure teachers to place their children in a high-ability group and provide them with additional challenging material. Low-SES parents lack the resources to do this. Accordingly, resource multiplication can be expected: The higher the parents' SES, the stronger the influence of children's cognitive ability on children's educational attainment (H3).
Non-linearities in the interplay between cognitive ability and SES So far, the interaction between cognitive ability and parental SES has been thought to occur gradually. However, prior results suggest that the action may take place mainly at the top of the social hierarchy. Interestingly, it has been found that both compensation (Bernardi and Cebolla-Boado, 2014) and multiplication (Bukodi, Erikson and Goldthorpe, 2014) occurred only at the top. There are arguments to expect a threshold in the interplay between cognitive ability and parental SES, especially when compensation or multiplication requires plenty of resources. If compensatory strategies such as private education are very costly, only high-SES parents can afford such investments; even for medium-SES families, they will be too expensive. In that case, compensation will occur only at the top. Similarly, multiplication at the top may occur when very high levels of resources are needed to allow high-ability children to develop their potential fully. These may also include cultural resources. For example, based on their own educational experiences, high-SES parents may know that certain extracurricular activities help their high-ability children to fully excel in the education system. We will explore non-linearities by comparing low-SES, medium-SES, and high-SES families.

Data
We use data from the first wave of TwinLife-a longitudinal study of twins and their families in Germany (Diewald et al., 2016;Brix et al., 2017). The first wave, surveyed in 2014/2015, includes four cohorts of twins born in 2009/2010, 2003/2004, 1997/1998, and 1991/ 1992. To construct a twin sample covering the full range of social structural characteristics of the German population, a multi-stage sampling procedure was used. First, a sample of 500 communities was drawn to identify potential twin families for the four birth cohorts. Twins were identified on the basis of persons of the same sex with the same or similar dates of birth being registered at the same address in the community's register of residents. Next, subsamples of these addresses were selected and approached.
The twins, as well as their parent(s) and one sibling (if present), were surveyed by means of face-to-face interviews. The response rate over all cohorts was 36%, which includes the participation of at least both twins and one parent. This response rate is high for general population surveys in Germany, especially considering the comprehensive scope of the interview (Lang and Kottwitz, 2017). An often-raised concern with twin data is that they include more twin families from higher socioeconomic strata. The TwinLife data were to some degree selective with respect to parental education and to a lesser extent parental occupation and household income. However, this applies mainly to the youngest cohort, which we do not include in this study. The data also still cover the full range of SES, including the upper and lower bounds, and it has been argued that using multidimensional analyses make the selectivity less problematic (Lang and Kottwitz, 2017). 1 The data include 4,097 same-sex twin pairs, of which 1,870 are identical (MZ) pairs, 2,220 fraternal (DZ) pairs; in the case of seven pairs, their zygosity is unknown. Zygosity of the twins was determined by the Zygosity Questionnaire for Young Twins answered by parents for the two youngest cohorts, and the Self Report Zygosity Questionnaire answered by the twins for the two oldest cohorts. This can be considered a valid method for determining zygosity. Validation analyses for a subset of the TwinLife sample using DNAbased zygosity showed correct classification rates in 97% of cases reported by parents and 92% of selfreported cases (Lenau et al., 2017).
We use the combined data of cohort 2003/2004, 1997/1998, and 1991/1992, where the twins were around 11, 17, and 23 years old at the time of the survey (N pairs ¼ 3,087). We exclude the youngest cohort because these twins are too young to attend secondary school, our outcome of interest. We exclude twin pairs with unclear zygosity (N pairs excluded ¼ 4) and twin pairs where both twins have a missing value on cognitive ability or educational attainment (N pairs excluded ¼ 873). When only one twin within a pair had a missing value, this was dealt with using Full-Information Maximum Likelihood (FIML) estimation (Arbuckle, 1996) in the bivariate models. FIML cannot be used for missing cases on covariates and therefore twin pairs with missing data on the covariates were excluded (N pairs excluded ¼ 20). The final sample size consists of 2,190 twin pairs (N MZpairs ¼ 1,042; N DZpairs ¼ 1,148) (see Table 1 for descriptive statistics).

Measurements
The dependent variable is children's level of secondary education. Children were asked which type of school they were attending; this originally included ten answer categories. These were recoded into five categories of secondary education. General elementary secondary education ('Hauptschule', ages 10-15), which leads to a minimum qualification, was coded as '1'. Integrated lower and intermediate secondary schools were coded as '2'. General intermediate secondary education ('Realschule', ages 10-16), leading to a medium-level qualification, was coded as '3'. Comprehensive schools, which may combine elements of all three types of school, as '4'. Finally, we coded upper secondary education ('Gymnasium', ages 10-19) with the 'Abitur', which usually leads to university studies, as '5'. Categories that did not fit this classification (e.g. orientation level for secondary school, school for special needs children) were coded as missing.
For those no longer attending secondary school, including the twins from cohort 4, we used the highest educational degree (or diploma, qualification) because this indicates which level of secondary education they attended. The categories originally included: left school without school-leaving qualification ('1'), primary/lower secondary school-leaving qualification ('2'), intermediate secondary school-leaving qualification ('3'), university of applied sciences entrance diploma ('4'), upper secondary school-leaving qualification ('5'), and other qualification ('6'). We excluded those who left school without a qualification and those with other qualifications. The remaining categories were coded as described previously. The university of applied sciences entrance diploma was coded as upper secondary education ('5'), because pupils with this diploma also attended the Gymnasium (Schneider, 2008). The variable was treated as a continuous variable in the analyses, and we assume that the educational categories have an equal distance. We do not think this is a very problematic assumption. In relation to the International Standard Level of Education (ISLED) (a continuous comparative education measure) for Germany, the distance between general elementary education and general intermediate education (17.14) is very similar to the distance between general intermediate education and upper secondary education (16.61) (Schrö der and Ganzeboom, 2014).
Children's cognitive ability was assessed by a computer version of the valid and widely used Culture Fair Intelligence Test (CFT). The CFT aims to measure 'fluid intelligence' (e.g. reasoning, abstract thinking, and problem solving) as a proxy for general cognitive ability, which is independent of learning. This is in contrast to 'crystallized intelligence' (e.g. using skills, knowledge, and experience), which is more a product of educational and cultural experiences. We hypothesize that cognitive ability predicts educational attainment. It is therefore important that our measure is minimally affected by educational experience. Hence, the CFT seems to be a suitable measure for cognitive ability in our study.
All four subtests of the CFT were used, including 'Figural Reasoning' (15 items), 'Figural Classification' (15 items), 'Matrices' (15 items), and 'Reasoning' (11 items) (for details, see Gottschling, 2017). Each subtest of the CFT has a good internal consistency (a > 0.80), and the CFT generally has a high test-retest reliability (Weiss, 2006). The total summed scores for each subtest were used as generated by the TwinLife research team. We combined the total summed scores for the four subtests into one CFT score by extracting one factor using factor analysis with the iterated principal factor method, a commonly used method (Ruiz, 2009). The results are presented in Supplementary Table SA1. We recoded outliers on the scale, defined as values more than three SD above or below the mean, to the nearest value within the normal range of three SD.
For measuring parents' SES, a scale was constructed based on three indicators, the measurements for which are derived from the parent reports. For the first indicator, parents' income, we used information on the monthly net income of all household members. From this, the monthly net equivalent income (in euros) based on the new OECD scheme was created by the TwinLife research team (OECD, 2013). This adjusts the reported net household income to take account of household size.
Parents' education was operationalized as the educational attainment of the highest educated parent in the household. Educational attainment was measured using the International Standard Classification of Education (ISCED) 1997 with two digits; it ranges from 1 ('level 1-primary education') to 11 ('level 6-second stage of tertiary education'). We recoded this into the collapsed version, with six categories for the six levels.
Parents' occupational status was operationalized as the highest occupational status present in the household. The International Socio-Economic Index of occupational status (ISEI) was used, which is derived from the International Standard Classification of Occupations (ISCO) (Ganzeboom, De Graaf and Treiman, 1992).
An overall measure for SES was constructed by performing a Confirmatory Factor Analysis (CFA) on the three indicators in Mplus. Mplus has the advantage that it can handle missing data, which enabled us to obtain SES factor scores even when one or two of the three indicators was missing. The results of the CFA are presented in Supplementary Table SA2. We additionally created three SES groups (low, medium, and high SES) by splitting the SES scale into terciles (see Supplementary Table  SD1 for descriptive statistics).
Control variables. As is standard practice in twin analyses, we control in all models for age (in years) and sex (0 ¼ female, 1 ¼ male).

Concepts of Quantitative Behavioural Genetics
This study employs twin methods, which use the information in MZ and DZ twin pairs to disentangle the genetic and environmental sources of variance in an individual trait using Structural Equation Modelling (SEM) (Knopik et al., 2016). 2 Three sources of variance can be distinguished. First, additive genetic influences (A), which represent the effect of many genes having a small effect. The A component of, for example, cognitive ability may refer to genetic influences specific to cognitive ability, but also to genetic factors shared with traits related to cognitive ability (e.g. genes related to self-regulation, openness, attentional processes, and processing speed) (Rueda, Posner and Rothbart, 2005;Krapohl et al., 2014). Second, common environmental influences (C), which include all environmental influences that make twins raised in the same family more alike (e.g. SES, school, and peer influences shared by both twins). Last, unique environmental influences (E) that make twins dissimilar (e.g. subjective experience, differential treatment, accidents), including measurement error. Twin data enable us to estimate the different variance components because MZ and DZ twin pairs grow up in similar environments, while they differ in the extent to which they are genetically related (100% for MZ pairs, c. 50% for DZ pairs). If MZ twins are more alike in a given trait than DZ twins are, this is an indication of genetic effects. If DZ twins resemble each other more than half the extent to which MZ twins resemble one another, this indicates shared environmental effects (Falconer, Mackay and Frankham, 1996). Since for MZ twins, differences in the trait under study can be caused only by unique environmental influences, this provides an estimate for E. The path diagram for the classic univariate twin model is presented in Figure 1. The present study will use a more complex version of this model, which will be explained in the Analyses section.

Analyses
The twin data were analysed by means of a series of SEM models with increasing complexity using OpenMx (Boker et al., 2011). The several steps are described in detail below. The SEM models work with maximum likelihood estimation, which assumes normally distributed variables. Although our dependent variable is slightly left-skewed, univariate skewness and kurtosis are acceptable (Hancock and Mueller, 2006). Missing data were dealt with using FIML in the bivariate models, and listwise deletion was used when this was not possible (e.g. for missing data on covariates). In all models, we controlled for age and sex, and z-standardized all continuous variables.
Step 0: Univariate ACE models Prior to the key analyses, we first fitted the saturated model and univariate twin model for cognitive ability and educational attainment. Saturated models describe the data with no free parameters left (i.e. no constraints on equal means and variances for zygosity and birth order), and we use this model for three purposes: (i) to estimate twin correlations, variances, and means, (ii) to test the assumptions of equality of means and variances, and (iii) to obtain a baseline for judging the model fit of the subsequent univariate models. The results of these tests are presented in Appendices B and C (see Supplementary Data). We use the univariate twin model (see Figure 1) for a first inspection of the variance decomposition of cognitive ability and educational attainment. This model includes three latent factors A, C, and E, which are standardized to a variance of one. The underlying parameters a, c, and e that are estimated denote the effects of the latent factors on the observed trait. The square of these estimates represents the variance of the trait accounted for by the corresponding latent factor. Heritability of a trait is defined as the proportion of the genetic variance to the total variance. In the univariate ACE model, this is specified as where a 2 is the genetic variance of the trait and r 2 x ¼ a 2 þ c 2 þ e 2 the total variance.
Step 1: Bivariate ACE-b model We fitted a so-called bivariate ACE-b model (Kohler et al., 2011) to test the influence of cognitive ability on educational attainment. This model, presented in the upper part of Figure 2, estimates the direct effect of cognitive ability, the ACE components for cognitive ability, and tests whether the same AC components that influence cognitive ability also influence educational attainment. Additionally, there may be unique residual variance in educational attainment that is independent of cognitive ability, which is decomposed in the second set of ACE components. The a xx , c xx , and e xx parameters represent the contributions of genetic influences, shared environmental influences, and unique environmental influences on cognitive ability. The a yx and c yx parameters show to what extent these same influences also predict educational attainment. The b parameter represents the effect of cognitive ability on educational attainment separate from genetic and environmental confounders, which comes close to a causal effect. To obtain this parameter, it is assumed the e yx path is equal to zero. 3 The a yy , c yy , and e yy parameters represent the contribution of genetic, shared environmental, and unique environmental influences that influence educational attainment but not cognitive ability.
The bivariate ACE-b model has the advantage that it includes not only the direct effect b of cognitive ability on educational attainment that could be obtained by using an MZ twins fixed-effects model, but also the contributions of unobserved genetic and shared environmental factors to the variation and covariation of cognitive ability and educational attainment. For example, the proportion of covariance between cognitive ability and educational attainment that can be attributed to unobserved genetic factors influencing both cognitive ability and educational attainment is given by: Similarly, the proportion of the total covariance that can be attributed to the shared environmental covariance, and the proportion unaccounted for by genetic and shared environmental confounders, can be calculated.
Step 2: Bivariate ACE-b model with main effects of SES Next, we include the SES scale in the bivariate ACE-b model to test the effect of SES on cognitive ability and  Step 2). Notes: The latent variables represent the genetic (A), shared environmental (C), and non-shared environmental (E) components of cognitive ability (superscript x) and educational attainment (superscript y). Parameters with subscript xx denote the influences on cognitive ability, yx the influences on educational attainment shared with cognitive ability, and yy the residual influences on educational attainment. Parameter b is the causal effect of cognitive ability on educational attainment, under the assumption that e yx is zero. educational attainment (H1). In this model, the parameters s x and s y represent the main effects of SES on cognitive ability and educational attainment respectively (see Figure 2). Because the indicators of SES are at the family level, it is part of the shared environment, and hence including SES would decrease the estimated variance of the C component. This implies that in this model, C should be interpreted as shared-environmental influences in addition to the influence of parents' SES.
Step 3: Bivariate ACE-b model moderated by SES In this model, we allow the causal effect of cognitive ability on educational attainment, and the genetic and shared environmental factors that influence the cognitive ability and educational attainment, to be moderated by SES. We do this by estimating the model as specified under Step 2 for low-SES, medium-SES, and high-SES families in a multigroup model. 4 When b becomes lower as SES increases, this supports the resource compensation hypothesis (H2), whereas a higher b with increasing SES supports the resource multiplication hypothesis (H3). To investigate possible non-linearities in resource compensation or multiplication, we look at the differences in b between SES groups.

Results
Step 0: Univariate ACE Models As can be seen in Table 2, the correlations for the cognitive ability variable were rMZ ¼ 0.706 and rDZ ¼ 0.466, implying that there are genetic and shared environmental factors that contribute to individual variance in cognitive ability. The total variance in cognitive ability is 0.643 (¼ 0.584 2 þ 0.351 2 þ 0.423 2 ). The heritability of cognitive ability is 0.530 (¼ 0.584 2 /0.643), meaning that genetic differences explain 53.0% of the individual differences in cognitive ability. Additionally, 19.2% of the total variance can be attributed to shared environmental influences and 27.8% to unique environmental influences. For educational attainment, the correlations were rMZ ¼ 0.840 and rDZ ¼ 0.586. The heritability of educational attainment is 0.477. When there is equality of educational opportunity, children follow the education most suited to their potential, indicated by a large genetic effect. Our results show that variation in educational attainment is for a substantial part produced instead by differences in the shared environment (35.7%) and unique environment (16.6%). This indicates inequality of educational opportunity.
It is important to control for the influences of age and sex in these and all subsequent models, since both variables had a significant influence on both cognitive ability and educational attainment. Older, male twins have a higher measured cognitive ability. Younger, female twins have a higher educational attainment.
Step 1: Bivariate ACE-b Model The effect of cognitive ability on educational attainment was tested by performing a bivariate ACE-b model. Model comparison showed that the full model is the preferred model (Supplementary Table SC1, Appendix C). The results of the ACE-b model (Model 1, Table 3) show that there is a direct effect of cognitive ability on educational attainment (b ¼ 0.082, se ¼ 0.026, P ¼ 0.002). The association between cognitive ability and educational attainment is largely a spurious one. The proportion of the total covariance (cov(x, y) ¼ 0.378) that is attributable to the genetic covariance is meaning that 33.9% of the association between cognitive ability and educational attainment is due to genetic effects (and hence a spurious effect due to genetic confounding factors). Similarly, it can be derived that 47.8% of the association can be explained by common shared environmental effects. Only a small part of the association between cognitive ability and educational attainment (18.3%) is not confounded by genetic or shared environmental factors and comes close to a causal effect of cognitive ability on educational attainment. Such an unconfounded effect could be, for example, that children need to possess a certain capacity for processing abstract information in order to learn new knowledge in school.
Step 2: Bivariate ACE-b Model with Main Effects of SES Next, we include the main effects of SES on cognitive ability and educational attainment. The full ACE-b model fitted the data best (Supplementary Table SC2, Appendix C). Model 2 in Table 3 shows the results of this model. We expected SES to affect educational attainment, partly through children's cognitive ability (H1). We do indeed find that SES positively affects cognitive ability (b ¼ 0.250, se ¼ 0.017, P < 0.001) and educational attainment (b ¼ 0.350, se ¼ 0.018, P < 0.001).
Including SES in our model explains part of the shared environmental influences. The shared environmental influences that affect only cognitive ability (c xx ) decreases from 0.410 to 0.326 (a decrease of 20.5%) once SES is taken into account. The shared environment effect common to cognitive ability and educational attainment (c yx ) decreases from 0.441 to 0.295 (33.1%). The shared environmental influences on educational attainment but not on cognitive ability (c yy ) decrease from 0.353 to 0.344 (2.5%). Because SES influences both cognitive ability and educational attainment, SES is an important shared environmental confounder. Almost half of the shared environmental confounding can be attributed to SES, as the shared environmental covariance decreases from 0.181 (¼ 0.410 Â 0.441) to 0.096 (¼ 0.326 Â 0.295).
Step 3: Bivariate ACE-b Model Moderated by SES For the interplay between cognitive ability and SES, two competing hypotheses were formulated: resource compensation (H2) and resource multiplication (H3). As can be seen in Figure 3, the effect of cognitive ability on educational attainment is strongest in low-SES families (b ¼ 0.098, se ¼ 0.049, P ¼ 0.045), slightly weaker in medium-SES families (b ¼ 0.090, se ¼ 0.043, P ¼ 0.036), and weakest (and non-significant) in high-SES families (b ¼ 0.042, se ¼ 0.040, P ¼ 0.294) (for all the parameter estimates, see Supplementary Table SD2). This suggests that resource compensation occurs only in high-SES families. However, when we test the difference in the b parameter between SES groups, none of the differences are statistically significant. Therefore, our results do not support our hypotheses. Notes: ** P < 0.01, *** P < 0.001. All continuous variables have been transformed to z-scores. The subscripts x and y refer to cognitive ability and educational attainment, respectively.
When we inspect the differences between SES groups in more detail, we see significant differences between SES groups in the total association between cognitive ability and educational attainment. The covariance is significantly higher for low-SES (cov(x, y) ¼ 0.421, 95% CI [0.352, 0.497]) and medium-SES children (cov(x, y) ¼ 0.315, 95% CI [0.263, 0.372]) than for high-SES children (cov(x, y) ¼ 0.187, 95% CI [0.151,0.225]). Therefore, if we had tested our hypotheses in a conventional way, we would have found support for resource compensation. If we control only for shared environmental confounding, this considerably reduces the covariance for low-and medium-SES families (by 36.6% [from 0.421 to 0.267] and 52.1% [from 0.315 to 0.151] respectively), but not for high-SES families (by 1.1% [from 0.187 to 0.185]). In this case, the pattern of compensation disappears. When we additionally control for genetic confounding, the covariance is further reduced by 64.0% to 0.094 for low-SES, by 54.3% to 0.069 for medium-SES, and by 84.9% to 0.028 for high-SES families. As a result, the pattern of compensation reemerges, though it is not significant.
The reason for this is that, although the sources of confounding differ, the total confounding is comparable between SES groups. Taking into account both genetic and shared environmental confounding decreases the covariances by 77.7% (from 0.421 to 0.094) for low-SES, 78.1% (from 0.315 to 0.069) for medium-SES, and 85% (from 0.187 to 0.028) for high-SES families. However, to examine whether the pattern of compensation truly reflects SES disparities in the returns to cognitive ability, these variances must be standardized by dividing them by the total variance in the cognitive ability of low-SES ðr 2 x ¼ 1:056Þ, medium-SES (r 2 x ¼ 0:763Þ, and high-SES ðr 2 x ¼ 0:666Þ families. This leads to the betas of b ¼ 0.098, b ¼ 0.090, and b ¼ 0.042, respectively, which also shows a compensation pattern, though less strong and non-significant.

Conclusions and Discussion
Numerous studies have investigated the role of cognitive ability in explaining socioeconomic inequalities in educational attainment (Jackson, 2013;Erikson, 2016;Bourne et al., 2018). These studies implicitly assume that the influences of cognitive ability and SES are additive. In the present study, we investigated another mechanism for educational inequality by examining how SES affects the influence of children's cognitive ability on being in a particular educational track. We used a behavioural genetics approach to take into account the possibility that the association between cognitive ability and educational attainment may be partly spurious due to both social and genetic factors. Our first main finding is that only a small part of the association between children's cognitive ability and educational attainment is unconfounded by genetic and social factors. Second, we find indications that high-SES families compensate for children's low cognitive ability in educational attainment, but when taking the genetic and social confounding into account this interplay becomes non-significant. Concerning our first finding, there is only a small yet significant effect of cognitive ability on educational attainment. The association between cognitive ability and educational attainment is present largely because there are sets of genetic influences (e.g. genes related to selfregulation) and shared environmental influences (e.g. parenting style) that predict both cognitive ability and educational attainment. In previous studies, cognitive ability is often included as a mediator between social origin and educational attainment. In this way, it is (implicitly) assumed that cognitive ability is a function of SES (Lucchini, Della Bella and Pisati, 2013), and that cognitive ability (causally) influences educational attainment. We show that genetic influences explain around 50% and shared environmental influences 20% of the variance in cognitive ability. Because these genetic and shared environmental influences on cognitive ability also partly influence educational attainment, they explain a large part of the association between cognitive ability and educational attainment. Genetic influences account for 34% of the association and shared environmental influences for 48% (of which a third can be explained by parental SES). Therefore, previous studies not applying a behavioural genetic approach overestimate the effect of cognitive ability and/or make incorrect assumptions about the underlying mechanism as to how cognitive ability plays a role. This applies especially to studies using OLS regression without sufficient betweenfamily controls. We also show that results of a previous behavioural genetic study into the genetic and shared environmental overlap between cognitive ability and educational achievement can only partly be extended to the overlap between cognitive ability and educational attainment. In both cases, there is a large overlap. But whereas in the case of achievement genetic overlap trumps environmental overlap (Calvin et al., 2012), in the case of attainment this is reversed.
Although the behavioural genetic approach has the advantage that it can take into account genetic and shared environmental confounding, it also has disadvantages. Estimating the unconfounded effect relies on differences within MZ twins. The variance in cognitive ability and educational attainment within MZ twin pairs is lower than the variance in the total population, which may lead to an underestimation of the effect. This problem is exacerbated when we divide the sample into subgroups by SES. Especially the variance in the highest SES group is relatively small. Also, the effect of cognitive ability for MZ twins may be smaller because these twins might be more likely to imitate the school choice of their co-twin. Lastly, relying on differences within MZ twins exacerbates the effect of measurement error in cognitive ability, which may downwardly bias the effect of cognitive ability (Kohler, Behrman and Schnittker, 2011). Our estimate of the unconfounded effect of cognitive ability on educational attainment should therefore be seen as a lower bound.
It is important to point out that while we have ruled out the confounding factors for the association between ability and attainment, the influence of SES on cognitive ability and educational attainment may still be confounded. To some extent, parents have a high SES because of their genetic endowment, and their children inherit some of these genes, giving them a higher cognitive ability and allowing them to perform better at school as well. Investigating the causal influence of SES is impossible with our data. It requires other designs, such as adoption studies (Sacerdote, 2007) or novel approaches such as a children-of-twins design (McAdams et al., 2014), which is a promising direction for future research.
Our second main finding is that when we take genetic and shared environmental confounding into account, we do not find evidence for an interplay of cognitive ability with SES. Although, when we analyse the data in the traditional way, we find indications that high-SES families compensate for low cognitive ability in educational attainment, this does not hold when we perform a strict test that takes genetic and shared environmental confounding into account. The results are still in the direction of compensation, but the difference between low-and high-SES families is non-significant. Therefore, based on our results, we cannot draw a firm conclusion about whether compensation takes place or not.
Some previous studies did find that parents compensated low academic performance or scholastic ability in England (Bernardi and Grä tz, 2015), France (Bernardi, 2014;Bernardi and Cebolla-Boado, 2014), Italy (Bernardi and Triventi, 2018), and the United States (Carneiro and Heckman, 2003), also when confounding was taken into account (Bernardi, 2014;Bernardi and Grä tz, 2015). Future research could investigate whether compensation is context dependent. For example, in Germany, the costs of compensatory strategies such as private tutoring are not very high. Additionally, in Germany, the living standard of low-SES families is not as low as in other countries.
Our study also differs from previous studies by using twin data. Some previous studies found evidence for compensation while taking confounding into account with a regression discontinuity design applied to nontwin data (Bernardi, 2014;Bernardi and Grä tz, 2015). It is important to use different designs when studying compensation. While our design allows to distinguish different sources of confounding, other causal designs may have more external validity. One concern with using twin designs is namely the generalizability to non-twins. There could be differences in parental interactions and investments that twins receive compared to non-twins, and the home environments of MZ twins may be more similar than those of non-twins or DZ twins. However, using the same twin data, Mö nkediek et al. (2020) find only small differences in parenting and in levels of differential treatment that twins and non-twins receive, and most of the difference disappears once age differences are controlled for. Hence, we believe that our results would not be very different for non-twins.
In conclusion, our study challenges the commonplace approach to studying the influences of social origin and cognitive ability on educational attainment by investigating how these influences interact and by taking into account genetic and shared environmental confounding. We show that the association between cognitive ability and educational attainment is largely a spurious one due to unobserved genetic and shared environmental factors. When we take these unobserved factors into account, we find no support for resource compensation. That only a small part of the association between cognitive ability and educational attainment is unconfounded not only has consequences for testing compensation and multiplication effects but also for stratification research that includes cognitive ability as a mediator. Cognitive ability is a characteristic that is influenced by genes, and these same genetic influences also partly affect educational attainment. Similarly, there are also shared environmental influences that cognitive ability and educational attainment have in common. Therefore, in order to enhance our understanding of cognitive ability in educational attainment such unobserved pathways should be investigated. Applying insights and methods of behavioural genetics may be useful in this regard.

Supplementary Data
Supplementary data are available at ESR online.

Notes
1 For more details on sampling design and representativeness, see Lang and Kottwitz (2017). 2 Several assumptions have to be made in order to fit a twin model. Possible violations of these assumptions are not expected to be problematic for our study (see Supplementary data Appendix B). 3 This assumption is similar to the underlying assumption in MZ twins fixed-effects models. It implies that the unique environmental influences (i.e. individualspecific shocks) affecting cognitive ability do not correlate with the unobserved shocks to educational attainment, but that these have only an indirect influence through the effect on cognitive ability (Kohler et al., 2011). This is a plausible assumption, although there is still a probability that to a small extent the effect is confounded by unique environmental factors. Because we rule out the largest confounders (i.e. unobserved genetic and shared environmental factors), b becomes close to a true causal effect. 4 Dividing the SES scale into categories affects the sample size and variability, and may therefore have consequences for the results. Descriptive statistics (see Supplementary Table SD1) show that there is less variation in the dependent variable and in SES (but hardly in cognitive ability) with increasing SES. Therefore, as robustness checks, we performed these analyses with three SES groups defined by an equal range on the scale instead of an equal n, and with two SES groups (both defined by an equal n and an equal range on the scale). All these results (not shown) were in line with the main analyses based on terciles.