
Reading an old demography piece yesterday (it’s not important which one) I noticed they attributed a skewed sex ratio to son preference and families tending to stop having children after giving birth to a boy. This is a common misperception, so I wrote a short simulation to show it is not true.
Not true, that is, given the assumption that the sex at birth of each baby is random. This is well established. There is a long history of arguing about this, which is tangled up with biological or genetic theories about sex running in families, the sex of older siblings affecting subsequent births, and so on, but the math question is easily settled. Classic papers include the fascist statistician Corrado Gini’s in 1951 (here), and Goodman wrote about it here: (paywalled | pirated); and here’s a more recent one by Grech et al.: (paywalled | pirated).
Of course, son preference also leads to sex selection, mostly through abortion, which is quite different (I’ve written about this several times). That’s all set aside here, but I will comment on the family effects of a stopping rule below.
The logic is just that if the decision whether to have another child is determined only after each child is born, it cannot affect anyone’s sex. If you have another, it’s randomly a boy or a girl; if you don’t, your previous kids are already randomly boys or girls. I wrote a Stata program to show this. Here’s what you get.
I made 10 million families. Every baby born in the scenario is a boy or girl, and the sex ratio at birth is 105 boys per 100 girls, about the world average now (that is, 51.22% male). Each family has babies until a boy is born and then stops — unless they get to 8 girls, then they’re done. Here are the first 25 families:

Every family has exactly one boy. In these example families there are 13 families with just a boy, and there are 21 girls across the other 12 families. For every family with a bunch of girls and just one boy, in other words, there are a bunch of families with just a boy each. In my 10 million families, I get an overall sex ratio of 105. This is what the proofs predict, of course.
Here’s the distribution of all families, by number of girls and boys:

If I lower the limit, incidentally, it still doesn’t change the overall sex ratio, even though you get more families with all girls — it just combines the last few rows of the table.
So, no change in the sex ratio because of a stopping rule — but it does change the nature of gender in our fictional society in important ways. Every boy is either the youngest or the only child in the family. No girl is an only child, and no girl is the youngest child. The average boy has 0.9 siblings, while the average girl has 2.8 siblings. The only-child pattern and fewer siblings favor boys, at least in terms of family resources. Being the youngest is generally not advantageous, but in families that prize boys it might be. These patterns could make a big difference for gender in the society.
Code
In a Bluesky thread I shared my original code, which was klunky and used no loops, taking 27 lines to generate the dataset. Ian Tamaeus offered the shortest alternative, using a forval loop, so that’s what I’m sharing here.
This is the simple loop. I can understand code like this:
forval c = 1/8 {
local b = `c' - 1
gen byte sex`c’ = runiform() <= 0.5122 if sex`b’ == 0
}
But I can’t write it without writing out the long version first. Maybe I could learn if I set my mind to it.
—
Previously Published on familyinequality with Creative Commons License
***
Join The Good Men Project as a Premium Member today.
All Premium Members get to view The Good Men Project with NO ADS. A complete list of benefits is here.
—
Photo credit: unsplash
