Parents tend to favor children of one gender in certain situations—or so evolutionary biologists tell us. A new study used colored backpack sales data to show that parental wealth may influence spending on sons versus daughters.

In 1973 biologist Robert Trivers and computer scientist Dan Willard published a paper suggesting that parents invest more resources, such as food and effort, in male offspring when times are good, and in female offspring when times are bad. According to the Trivers-Willard hypothesis, a son given lots of resources can outcompete others for mates—but parents with few resources are more inclined to invest them in daughters, who generally find it easier to attract reproductive partners. Trivers and Willard further posited that parental circumstances could even influence birth ratios, a concept widely supported by research across species.

Studying parental investment after birth is difficult, however. The new study looked for a metric of such investment that met several criteria: it should be immune to inherent sex differences in the need for resources; it should measure investment rather than outcomes; and it should be objective.

Study author Shige Song, a social demographer at Queens College, City University of New York, examined spending on pink and blue backpacks purchased in China in 2015 from a large retailer, JD. com. He narrowed the data to about 5,000 bags: blue backpacks bought by households known to have at least one boy and pink ones bought by households known to have at least one girl. The results showed that wealthier families spent more on blue versus pink backpacks—suggesting greater investment in sons. Poorer families spent more on pink packs than blue ones. The findings were published online in February in Evolution and Human Behavior.

Song's evidence for the Trivers-Willard hypothesis is “indirect” but “pretty convincing,” says Rosemary Hopcroft, a sociologist at the University of North Carolina at Charlotte, who was not involved in the new study. Hopcroft reported in 2016 that U.S. fathers with prestigious occupations were more likely to send their sons to private school than their daughters, whereas fathers with lower-status jobs more often enrolled their female children. Although the new study does not prove the families were buying the blue backpacks for boys and pink ones for girls, Hopcroft notes that “it's a clever and interesting paper, and it's a very novel use of big data.”