Discrete Choice Models of Assortative Mating, Part 1: Simulating a Marriage Market
assortative mating
discrete choice models
log-linear models
simulation
spatial analysis
The first in a series looking at the advantages and pitfalls of using DCM for AM research. This post develops a simulated data set, and data generating functions, to be used in subsequent posts.
Author
Benjamin F. Jarvis
Published
August 25, 2026
Introduction
There’s a been a subtle trend in sociological research on assortative mating away from log-linear modeling and towards a more flexible style of discrete choice modeling, primarily based on McFadden’s conditional logit model (1974).1 Examples include the work of Karen Haandrikman (2012), Aaron Gullickson (2021), and my colleague and student, Jesper Lindmarker (2025). That this trend in assortative mating research is taking place outside of economics, where discrete choice models were first developed, is perhaps not too surprising: sociologists are less constrained by questions of causal identification, general equilibrium, and stable matching that often preoccupy economists. Using an out-of-the-box discrete choice modeling approach largely elides these issues in favor of arriving at parameter estimates that are causally/structurally ambiguous, but provide richer fodder for sociological interpretation.
But something that I think remains underappreciated is that the conditional logit model provides a more general formulation of the log-linear models that have served as the bread and butter of mobility and assortative mating research. In other words, you can use the conditional logit model to obtain identical parameter estimates and standard errors as equivalently specified log-linear models. This knowledge is not really new: Richard Breen (1994) has shown this, as has John A. Logan (1983). And Logan even points to knowledge of the equivalence dating back to the 1970s. Beyond producing parameter estimates that are identical to those produced using log-linear models for count data, Logan and Breen make the point that conditional logit models allow for the inclusion of idiosyncratic individual- and match-level covariates that more closely align with the theorizing and claims-making that sociologists and demographers are most interested in.
So a goal of these posts is to set down an accessible marker for future researchers seeking to integrate these models into their analytic practice, perhaps as an alternative or supplement to traditional log-linear modeling. Beyond that, I also want to explore the greater possibilities, as well as the interpretive perils, that go along with this modeling approach. I do so using a simulated dataset representing some stylized but essential features of assortative mating and marriage markets.
This is just part one in a series. I won’t make it to model fitting here. This post just sets the scene using simulation, stipulating and then allocating singles to social and spatial positions in a stylized marriage market and then forming unions between those singles using an econometric matching algorithm. In subsequent posts, I’ll show how to fit log-linear and conditional logistic regression models to the resulting data, how the parameter estimates compare, and then how these parameter estimates might give us a skewed view of the “deeper” parameters that may drive union formation in simulated and, of course, real-world data sets. So, let’s get to it.
Generating the marriage market
I consider a marriage market characterized by a simplified geographic space, consisting of spatial positions that are occupied by actors with a narrow set of attributes. I do this in three steps: first, I construct a grid of positions, then I generate a set of singles, and third I match singles to positions on the grid in such a way as to produce some spatial segregration.
Positions
I start with a square grid of discrete spatial locations for singles to occupy. I inflate the number of places in the grid so that there are some vacancies, i.e., there are more positions than there will be singles.
I assume actors are split into two genders, men and women, with sebsequent unions constituted by opposite gendered pairs. I’ll make the market gender balanced for the sake of simplicity, and when all is said and done, each actor will be paired with one and only one opposite gender partner. Beyond gender and (eventually) position, I stipulate that each actor is characterized by just two other attributes: group membership, proxying something like race or ethnicity, and age, with the possibility of different age distributions for each group.
I use scaled beta distributions to generate the ages. This allows me to constrain the ages to fall between two bounds. This is represented in the following function:
With this function in hand, I can create a dataset of simulated actors, for whom I also generate identifiers, which will be convenient in subsequent posts. The mean ages of the groups differ, but the age ranges are the same.
# A tibble: 10 × 4
id sex group age
<int> <chr> <chr> <dbl>
1 996 woman c 18.0
2 631 man b 33.9
3 575 man a 44.3
4 50 woman a 41.4
5 685 man b 24.0
6 228 woman a 37.3
7 939 man c 37.8
8 39 man a 43.7
9 146 woman a 29.7
10 834 woman b 21.2
The differing sampled age distributions, broken down separately for men and women, can be visualized using a density plot:
group_colors <- viridis::plasma(4)[1:3]ggplot(actors, aes(age, fill = group)) +geom_density(alpha =0.45, color =NA) +facet_wrap(~sex) +scale_fill_manual(values = group_colors) +labs(x ="Age", y ="Density", fill ="Group") +theme_minimal(base_size =12)
Groups differ in mean age, but the simulated age distributions overlap.
Assigning actors to locations
I want to introduce some group and age segregation into the simulated marriage market. I accomplish this by designating a set of poles that serve as attraction points. A point in the center pulls in younger actors. Then a set of three, group-specific poles outside the center pull in members of the corresponding group.
Group-specific attractors and the central youth attractor.
To assign actors to locations, I use a utility-based probabilistic assignment approach. The utility functin has deterministic and random parts. The deterministic part is a function of the distance to the actor’s respective group pole and the distance to the youth attraction point, with the latter depending on the age of the actor him/herself. The random part is drawn from a normal distribution with a standard deviation scaled relative to the standard deviation of the deterministic part. The algorithm for generating assignments involves creating a fully exploded actor-by-location data set, calculating the utility for each actor-by-location pair, and then iterating through and assigning actors to locations from highest utility to lowest. As actors and locations are assigned, they are absorbed into running lists to ensure that no actor or location is assigned more than once.
I produce several assignments under various assumptions about the strength of the underlying spatial sorting parameters. In scenario A, only the group clustering parameter (i.e., attraction to group-specific poles) is activated, and the noise term has the same standard deviation as the underlying utilities. Scenario B is like A except the only youth clustering is activated. In scenario C, both youth and group clustering are activated. Scenario D is like scenario C, but the standard deviation of the noise term is increased relative to the determinsitc part of the utility, creating a more mixed distribution of groups and ages. Plotting the scenarios shows that even this relatively simple set-up provides rich variation in the spatial structure of the population in terms of age and group membership.
Assigned locations. Point size increases with age.
Forming unions
To generate unions from a given set of singles, I use a utility-based, stable matching framework using the Gale-Shapley algorithm.
Calculating utilities for possible unions
I first ennumerate all possible combinations of men and women. I calculate utilities as a linear combination of a proximity term, a group endogamy term, an age difference term, and a scaled, random noise term.
Plotting the distribution of utilities by group, shows, that utilities are higher for within group pairings, but with substantial heterogeneity and distributional overlap, as intended.
ggplot(data = union_utils, aes(x = utility, fill = group_woman)) +geom_density(alpha =0.45, color =NA) +facet_wrap(~group_man) +labs(fill ="woman's\ngroup")
Simulated match utilities by man and woman’s group membership.
Tranforming utilities into unions
I use the the Gale-Shapley algorithm implemented in the matchingR package to transform the complete set of utilities into one-to-one dyadic matches. The package expects matrices of proposer utilities and reviewer utilities, where I treat the men as proposers and the women as reviewers. The proposer matrix contains the utilities men (in columns) would obtain from being matched with a given woman (in rows). The reviewer matrix contains the utilities the women (now in columns) would obtain from being matched with each man (in rows). In our case, we calculate a single utility for each union, and men’s and women’s matrices are transposes of each other. But in principle these matrices could differ more substantially in their elements. For example, the utility function that men use to evaluate women could differ from the function that women use to evaluate men. That’s a wrinkle to consider in a different post. In any case, the code to construct the matrices and make the matches is as follows:
men <-sort(filter(singles, sex =="man")$id)women <-sort(filter(singles, sex =="woman")$id)utility_matrix <-xtabs(utility ~ id_woman + id_man, data = union_utils)unions <- matchingR::galeShapley.marriageMarket(proposerUtils = utility_matrix,reviewerUtils =t(utility_matrix))matches <-tibble(id_man =as.integer(colnames(utility_matrix)),id_woman =as.integer(rownames(utility_matrix)[as.integer(unions$proposals)]),matched =TRUE)union_utils <- union_utils |>left_join(matches) |>mutate(matched =if_else(is.na(matched), FALSE, TRUE))
A quick glance suggests that the final matches align with what might be expected based on the utility functions used for simulation: The simulated matches are closer together in distance and age, and are more likely to share group membership, compared to the non-matches.
And we can graphically compare the full distributions of distance and age gaps for matches vs. non-matches, once again confirming that things have worked as intended.
ggplot(data = union_utils, aes(x = distance, fill = matched)) +geom_density(alpha =0.4, color =NA) +theme_minimal()
Distance to opposite sex in matched vs. non-matched pairs
ggplot(data = union_utils, aes(x = age_gap, fill = matched)) +geom_density(alpha =0.4, color =NA) +theme_minimal()
Absolute age difference from opposite sex in matched vs. non-matched pairs
A reusable data generating function
For convenience, a data generating function can be wrapped around sub-functions that create actors, positions, position assignments, and matches. The main function, simulate_marriage_market(), returns a list containing the assigned singles, the realized matches, a lean exploded man-woman pair data set with matching utilities, and relevant input parameters. I produce the fully exploded pair utilities because they are useful for the modeling that I cover in the next post.
As a quick check, I call the wrapper with a different set of assumptions and summarize the resulting matches. Specifically, I narrow the differences in group sizes, include stronger group clustering, reverse the age clustering effect, reduce the location assignment noise, and specify stronger preferences for same-group and same-age partners.
Breen, Richard. 1994. “Individual LevelModels for MobilityTables and Other Cross-Classifications.”Sociological Methods & Research 23 (2): 147–73. https://doi.org/10.1177/0049124194023002001.
Gullickson, Aaron. 2021. “A Counterfactual Choice Approach to the Study of Partner Selection.”Demographic Research 44: 513–36. https://doi.org/10.4054/DemRes.2021.44.22.
Haandrikman, Karen, and Leo J. G. van Wissen. 2012. “Explaining the Flight of Cupid’s Arrow: ASpatialRandomUtilityModel of PartnerChoice.”European Journal of Population 28 (4): 417–39. http://www.jstor.org/stable/23274970.
Lindmarker, Jesper, and Benjamin F. Jarvis. 2025. “However FarAway? TheSpatialContingencies of AssortativeMating.” SocArXiv. https://doi.org/10.31235/osf.io/4tq8z_v1.
Logan, John A. 1983. “A MultivariateModel for MobilityTables.”American Journal of Sociology 89 (2): 324–49. http://www.jstor.org/stable/2779144.
McFadden, Daniel. 1974. “Conditional LogitAnalysis of QualitativeChoiceBehaviour.” In Frontiers in Econometrics, edited by Paul Zarembka, 105–42. Economic Theory and MathematicalEconomics. New York: Academic Press. http://elsa.berkeley.edu/pub/reprints/mcfadden/zarembka.pdf.
Footnotes
Confusingly, this is also sometimes referred to as the multinomial logistic regression model. In fact, the conditional logit model nests what sociologists and political scientists often call the multinomial model.↩︎