{'fraction_non_alphanumeric': 0.031119787107391716, 'fraction_numerical': 0.012369130571798732, 'mean_word_length': 4.807676664972039, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Group lending, matching patterns, and the mystery of microcredit: Evidence from Thailand

How has the microcredit movement managed to push financial frontiers? Theory shows that if borrowers vary in unobservable risk, then group-based, joint liability contracts price for risk more accurately than individual contracts, provided that borrowers match with others of similar project riskiness (Ghatak (1999, 2000)). This more accurate risk-pricing can attract safer borrowers and rouse an otherwise dormant credit market. We extend the theory to include correlated risk, and show that borrowers will match with partners exposed to similar shocks to lower their chances of facing liability for their partners. We use unique data on Thai microcredit borrowing groups to test for homogeneous matching by project riskiness and type of risk exposure. Evidence supports the theory, in that groups are more homogeneous in riskiness but less diversified in type of risk exposure than they would be under random matching. The results suggest that group lending is improving risk-pricing by embedding a discount for safe borrowers, and can thus explain part of the unprecedented rise in financial intermediation among the world’s poor; but that a potential pitfall of voluntary group formation is antidiversification, which points to strategies for lender intervention.


Introduction
Microcredit is the extension of relatively small, institutional loans to households throughout the developing world. While aspects of microcredit continue to be debated, 1 it is widely accepted that it has advanced rapidly in recent decades and is today remarkably widespread. Maes and Reed (2012) reported that over 200 million people have borrowed from nearly 4000 microfinance institutions throughout the world. Forty years ago, any prediction of this development would likely have been greeted with skepticism. As the 2006 Nobel Peace Prize Press Release puts it, "Loans to poor people without any financial security had appeared to be an impossible idea." 2 The unprecedented expansion of microcredit gives rise to the following puzzle: how has this growth in intermediation and financial services among the world's poor been possible? How have lenders managed to overcome the obstacles involved in lending to borrowers without using collateral?
The current paper is focused on this "mystery" of microcredit. 3 Specifically, it tests a leading theory, due to Ghatak (1999Ghatak ( , 2000, whose answer is based on group lending and borrower matching. The context is a standard adverse selection environment in which there is limited liability and no collateral, and borrowers' projects have identical expected values but different degrees of risk. In this environment, a lender that cannot observe borrowers' project risk offers all borrowers the same terms. But these standardized loan terms force safer borrowers to cross-subsidize riskier borrowers, who are more likely to default; cross-subsidization can cause a large portion of the potential market (safer households) to avoid borrowing. This market breakdown is the key potential inefficiency: good projects may go unfunded due to the lender's inability to price for risk, that is, to tailor interest rates to reflect individual borrower default risk. 4 Ghatak adds to this context local information-borrowers know each other's risk, though the lender does not-and shows that group-based, joint liability lending contracts can harness this local information to improve the lender's ability to price for risk. The idea is as follows. First, the joint liability contract induces borrowers of similar risk levels to match with each other. Second, given this matching pattern (here called "homogeneous matching"), joint liability contracts improve risk pricing. Consider the pooling case. 5 Even though contract terms are the same for all borrowers, an implicit discount is built in for safer borrowers: they have safer partners, due to homogeneous matching, and thus when they succeed the joint liability clause is less costly in expectation for them. That is, joint liability plus homogeneous matching helps to undo the cross-subsidization and equalize the repayment burden across borrowers. 6 This can forms associated with the microcredit movement that may underpin its unprecedented success in lending among the poor. Armendariz and Morduch (2010), Ghatak and Guinnane (1999), and Morduch (1999) provided introductions to the topic. See next section for further discussion. 4 Accurate risk-pricing of loans is a substantial concern of lenders in many contexts, as seen in the significant resources spent on credit scoring, for example. It seems significantly less feasible in typical microcredit markets due to lenders' lack of information about borrowers and due to the small loan size rendering substantial due diligence on individual loans cost-ineffective. 5 Ahlin (2015) showed that pooling works just as well as screening in this context, that is, a single joint liability contract can achieve the same efficiency as any menu of individual and joint liability contracts. What matters is not the lender's ability to screen borrowers, but its ability to improve risk-pricing through joint liability. 6 Optimal joint liability plus homogeneous matching plus large groups asymptotically equalizes the repayment burden across borrowers, as long as typical joint liability scenarios are affordable (Ahlin (2015)).
draw into the market safer borrowers who would have been inefficiently excluded under standard, individual loans. The beauty of this result is that the lender is improving risk-pricing-and with it the efficiency and size of the market-by offering all borrowers the same contract, without learning their riskiness. This is appealing in practical terms. It implies that even a very passive or unsophisticated lender that offers a single, standardized group contract is giving implicit discounts to safe borrowers, and hence more accurately pricing for risk than if it used individual contracts. Thus, this theory can help explain the popularity of group lending in microcredit-lenders that use it may be reversing partial market breakdown-as well as the growth of credit markets among the poor as this contract form is discovered and diffused.
The lynchpin in this theory is that borrowing groups match homogeneously by project risk; this is what provides the implicit discounts for safe borrowers. To our knowledge, however, matching patterns of microcredit groups have yet to be empirically tested. 7 A main contribution of the current paper is to test directly for homogeneous matching by project risk among microcredit groups in Thailand.
The paper also extends the theory on matching for credit to consider correlated risk, asking whether borrowers will match with other borrowers exposed to similar or different types of risks. The finding is that groups match homogeneously in both dimensions: they match with borrowers of similar riskiness, and among those, with partners exposed to similar types of risk. The intuition for the latter result is that by matching in such a way as to induce correlated risk within the borrowing group, borrowers reduce the odds of facing liability for fellow group members. This points to a potentially negative consequence of voluntary group formation, since correlated risk within groups limits the effectiveness of group lending (Ahlin and Debrah (2019)).
To test empirically whether groups are homogeneous in both riskiness and type of risk exposure, the Townsend Thai dataset is used. It contains data on borrowing groups from the Bank for Agriculture and Agricultural Cooperatives (BAAC). The BAAC is the predominant rural lender in Thailand. It offers joint liability contracts to largely selfformed groups of borrowers with little or no collateral. This unique dataset includes multiple groups from each of a number of villages-taking the village as the matching market, this allows matching patterns to be tested using a number of independent matching markets.
To analyze matching along one dimension, we first present two types of metrics that are maximized under the theoretically predicted matching outcome. The pattern approach exploits the prediction that equilibrium matching will produce maximally homogeneous groups, and thus uses several metrics to measure homogeneity of groups in the match. The payoff approach specifies a group payoff function, and exploits the result that equilibrium matching maximizes the sum of groups' payoffs (similar to Fox (2010Fox ( , 2018). Having specified these matching metrics, we proceed nonparametrically. First, a given village's outcome using a given matching metric is compared to those of all permutations of observed borrowers into groups of the sizes observed; this delivers a percentile ranking of the village's observed match on a homogeneity or payoff scale. Second, we compare the distribution of these village matching percentiles to what would obtain under theoretically predicted matching and under random matching. We show that if matching is random, village matching percentiles are distributed uniformly; thus, we test for a uniform distribution of village matching percentiles using the Kolmogorov-Smirnov test.
Observed matching falls between the stark theoretically predicted matching outcomes and random matching, and in fact closer to the latter. However, the null hypothesis of random matching with respect to riskiness is rejected, against the alternatives of homogeneous matching and complementarity-based matching. Random matching with respect to types of risk exposure is also rejected, against the alternative of antidiversified groups, when measured based on clustering of bad income years. These findings provide support for the theory: groups are more homogeneous in riskiness, and in timing of bad income years, than random matching would predict. The one finding counter to theory is that random matching can be rejected in favor of diversified groups when this is measured by occupational similarity; that is, groups look more occupationally diversified than random. Possibly the lender encourages diversification in an observable attribute like occupation, but borrowers are still able to achieve some antidiversification by matching on lender-unobserved characteristics.
Multidimensional matching analysis is carried out next using Fox's (2018) matching maximum score estimator, which chooses parameter values that maximize the frequency with which observed groupings yield higher payoffs than feasible, unobserved groupings. These results mirror the univariate results, but further allow us to establish that both modeled dimensions of matching are independently predictive for matching patterns.
In sum, Ghatak's theory is partially corroborated: within-group homogeneity of project risk is not as extreme as predicted, but greater than random matching would deliver. This finding suggests that group lending is successfully embedding a discount for safe borrowers because their equilibrium partners are safer; if so, this can partly explain how microcredit has successfully awakened previously dormant credit markets. But the detected antidiversification suggests that lenders may benefit from increasing the incentives to match for diversification, if this can be done cleanly.
We show how to quantify the size of the implicit discount safe borrowers are receiving, ignoring correlated risk. This exercise shows that, due to finite borrower populations (in contrast to theory's continuum) and to the skewed distribution of the relevant homogeneity metric across all matches, matching that is more homogeneous than random need not be enough to provide discounts to safe borrowers; it must be significantly more homogeneous than random. Our rough estimate is that borrowers that are less risky by one standard deviation are receiving a discount in their implied interest rate in the range of a slightly negative fraction of a percentage point to two and a half percentage points. This is non-negligible, though perhaps not transformative. However, this estimate should be treated as provisional due to issues we discuss.
More broadly, the paper does not establish causal determinants of group formation. However, we argue that to assess whether group lending enables better risk-pricing by targeting discounts to safe borrowers, this is not necessary (Section 5.3). As theory makes clear, whether risk-homogeneity results from purposeful matching or as a byproduct of other constraints or objectives, it is by itself the key mechanism for the improvement in risk-pricing that enables group lending to revitalize markets.
The paper is organized as follows. Related literature is discussed in Section 2. The model setup and theoretical matching results are in Section 3. Data are described and variables defined in Section 4. Section 5 presents the methodology behind the univariate tests (Section 5.1), the univariate empirical results (Section 5.2), a discussion of causality (Section 5.3), and a quantification of the safe-borrower discount (Section 5.4). Section 6 presents the multivariate estimation. Section 7 concludes. The replication code is posted online see Ahlin (2020).

Relation to the literature
This paper contributes to framing and unraveling a key mystery of microcredit, that is, how and why institutional lending has grown so dramatically among low-asset households across the world in the past several decades. It does so by highlighting a plausible mechanism through which credit markets can be revived, and finding empirical evidence for it.
Of course, it does not fully resolve the puzzle. For one, not all successful microlenders use group lending contracts. Also, the paper focuses on one mechanism, in an adverse selection environment, rather than testing across multiple mechanisms or environments. However, given that the puzzle's solution is likely to be multi-faceted, this paper makes the contribution of providing empirical evidence for one key theory.
A number of other papers also shed light on this puzzle empirically or theoretically. Among other topics, they examine the innovations that gave rise to microcredit's expansion, 8 the underlying credit market frictions, 9 and the types of contracts that work best. 10 Relative to this literature, this paper is the first to focus empirically on matching combined with group lending as a key mechanism for repairing credit markets, and to offer direct evidence on a specific mechanism that may help explain the rise of microcredit.
The substantive focus of the paper is an empirical assessment of matching patterns in microcredit groups. To our knowledge, this has not been done before, though related and complementary work exists. Eeckhout and Munshi (2010) studied commercial ROSCAs 11 in India and showed that changes in group composition and characteristics, in response to new regulation capping interest rates, are in line with predictions of their matching model. We differ in characterizing microcredit groups rather than ROSCAs, which in theory display quite different equilibrium matching patterns: ROSCAs group together both borrowers and lenders, that is, agents of heterogeneous types, while microcredit groups are composed of homogeneous borrowers. The empirical approaches are also different: we characterize matching patterns of borrowing groups, while they test comparative statics of group composition in response to changes in the environment. Although it is not their main focus, Giné, Jakiela, Karlan, and Morduch (2010) studied group formation in a microcredit field laboratory game, and found evidence that participants with similar levels of risk aversion group together to play the game.
A key difference is that we use data on active microcredit groups; this avoids the concern that a specific lab game may differ from practiced microcredit in important ways. There is also a literature on matching for risk-sharing, in the lab (e.g., Attanasio, Barr, Cardenas, Genicot, and Meghir (2012) and Barr and Genicot (2008)) and using household data (e.g., Fafchamps and Gubert (2007)). While sharing some features in common with microcredit group formation, these settings lack key features of credit, so it is not clear that results are applicable to a microcredit context. 12,13 The paper also proposes a new statistical test for homogeneous or heterogeneous matching, and matching based on complementarity or substitutability, as alternatives to a null hypothesis of random matching. This test applies to one-sided matching when data on matches in multiple markets is available. It shares in common with independent work by Fox (2018) the idea of comparing observed and unobserved matches in multiple markets, but takes this in a new direction using permutation scaling combined with a result linking the uniform distribution to random matching. Unlike Fox's estimator, however, this test is not equipped to estimate matching fundamentals in a multicharacteristic matching setting.
Finally, the paper contributes to the theory of matching for microcredit by introducing a second dimension of heterogeneity of borrowers, the type of risk they are exposed to. This is the first multidimensional matching analysis we know of in the microcredit context, and it uncovers a new result-that matching based on type of risk exposure may lead to antidiversification-with the novel implication that voluntary matching need not work in favor of efficiency, at least not in all dimensions.
Group lending with joint liability is a fundamental building block of this paper. In one field experiment, however, no significant difference in repayment rates between group and individual lending was found (Giné and Karlan (2014)); other studies have documented a trend toward declining use of group lending among microfinance institutions (MFIs) (e.g., De Quidt, Fetzer, and Ghatak (2018)). These findings may cast doubt on group lending as a key to unlocking dormant credit markets. However, the experimental evidence cited came from an MFI that was willing to abandon group lending at its own risk, and thus potentially unrepresentative of a typical MFI using group lending. Further, there is evidence that, to the extent that group lending is on the decline, this 12 Indeed, Schulhofer-Wohl (2006) finds equilibrium matching to be negative assortative in his model of matching to share risk, while the microcredit model of this paper finds positive assortative matching. 13 An even more different, but interesting, setting in which matching has been analyzed is in the formation of community-based organizations, for example, Arcand and Fafchamps (2012) and Barr, Dekker, and Fafchamps (2015). may be better explained by MFIs gaining experience than by an industry-wide movement away from group lending (Ahlin and Suandi (2019)). If so, this appears compatible with the conclusions of the current paper. Risk-pricing may become less difficult as MFIs lend repeatedly over time, thereby gaining experience with particular clients or locations; this can make their reliance on group lending less necessary. Still, their earlier reliance on group lending may have been instrumental in the initial opening up of credit markets, when asymmetric information was more systemic. In sum, this paper advances the theoretical understanding of how microcredit groups form, and provides a first empirical characterization of matching patterns of existing groups. These results underpin one plausible if partial explanation for the recent explosion in microlending, and point to the necessity for more work unraveling this mystery.

Baseline model and results
The model here follows Ghatak (1999Ghatak ( , 2000, which builds on work of Stiglitz and Weiss (1981). There is a continuum of risk-neutral agents, each endowed with no capital and one project. Each project requires one unit of capital and has expected value R. Agents and their projects differ in riskiness, indexed by p ∈ P, where P is the interval [p p] with 0 < p < p < 1. The project of an agent of type p grosses R p ("succeeds") with probability p and grosses 0 ("fails") with probability 1 − p. Thus, p · R p = R, for all p ∈ P. The higher p, the lower the agent's riskiness.
An agent's riskiness is observable to other agents, but not to the outside lender. 14 In this context, uncollateralized individual loan contracts can be inefficient. They bear an interest rate based on the average risk in a borrowing pool, a rate at which safer borrowers may find it unprofitable to borrow. 15 Thus, the lending market can (partially) collapse, excluding all but the riskier borrowers due to a failure to price for risk. Efficiency losses in this context result from leaving good projects unfunded-the safer borrowers'-and raising efficiency comes from attracting more borrowers.
In this context, group lending can increase efficiency by improving risk-pricing, by offering implicit discounts to safer borrowers. A lender requires potential borrowers to form groups of size two, each member of which is liable for the other. Without loss of generality (Ahlin (2015)), a single, standardized contract is offered to all borrowers, after which borrowers decide whether to borrow and with whom. In the contract, a borrower who fails pays the lender nothing, due to limited liability. A borrower who succeeds pays the lender gross interest rate r > 0. A borrower who succeeds and whose partner fails makes an additional liability payment c > 0. Thus, a borrower of type p i who matches with a borrower of type p j has expected payoff assuming the borrowers' returns are uncorrelated.
Group lending's risk-pricing is clearly seen via comparison to a standard individual loan contract, where the payoff is R − p i r and the interest rate does not vary by risk type. To compare, rewrite the borrower's payoff under the group lending contract (equation (1)) as Here,r ij is interpretable as the implied interest rate paid by borrower i when successful and matched with borrower j. Two components make up this implied interest rate: the direct interest rate r, and the expected bailout payment for the partner, c(1 − p j ).
Because this second component depends on partner quality (p j ), the question of how borrowers match is critical. Utility is transferable in this context, and side transfers between borrowers are allowed. Thus, following Ghatak (1999Ghatak ( , 2000 and Legros and Newman (2002), the equilibrium includes (a) an assignment of agents into twomember borrowing groups or nonborrowing, and (b) payoffs of all agents such that all nonborrowing agents earn the outside option, two cogrouped agents' equilibrium payoffs sum to their total group payoff and each weakly exceed the outside option, and no two agents can earn strictly higher payoffs by grouping together. It is well known that in such an equilibrium, no two groups can be rearranged to produce a higher sum of group payoffs-a fact that will be used later.
Note that That is, the group payoff function exhibits complementarity, and the stable outcome when there is a continuum of agents is that groups are perfectly homogeneous in riskiness, as Ghatak has shown. 16 A borrower with a safer partner (higher p j ) has a lower implied interest rate (equation (2)), because his chance of owing a bailout payment when successful is lower. What homogeneous matching gives is that safer borrowers have safer partners, and thus, lower implied interest rates. With perfectly homogeneous matching, each group contains identical borrowers, sõ Safer borrowers have safer partners, and thus can expect fewer bailout payments when successful. As a result, safer borrowers face a lower implied interest rate under joint 16 The intuition is that, while all borrowers prefer to have a more reliable (safer) partner, having a safer partner is worth more to safer borrowers, since a borrower is "on the hook" for his partner only if he succeeds. Thus, even with side payments a riskier borrower cannot lure a safer borrower away from a safer partner.
liability-as they would under full information. In this way, group lending harnesses social information to vary the interest rate implicitly by riskiness, thus improving riskpricing. This is true even under an unsophisticated pooling strategy, where the lender simply offers all comers a standard joint liability contract (r c). Whether the lender knows it or not, if matching is homogeneous, the contract embeds discounts for safe borrowers and can draw more of them into the market. Unsophisticated group lending can be responsible for reviving a lending market, underpinning a substantial increase in intermediation. 17

Variations on the baseline model
The previous section's results are due to Ghatak (1999Ghatak ( , 2000. In this section, we discuss several variations in assumptions that go beyond Ghatak's baseline model. Consider a finite population of borrowers rather than a continuum. Matching into perfectly homogeneous groups is generally impossible, but in any equilibrium all groups will be rank-ordered by riskiness. That is, for any group size k ≥ 2, 18 the k riskiest borrowers match together, the next k riskiest borrowers match together, and so on (Ahlin (2017)). Given rank-ordered matching, group lending has qualitatively similar risk-pricing advantages over individual lending: safer borrowers have generally safer partners, so they face lower implied interest rates. Thus, the theory does not critically rely on unrealistically large numbers of borrowers or perfectly homogeneous groups. 19 Consider instead removing the assumption that borrowers know each other's riskiness. If riskiness is uncorrelated with any characteristics that do drive matching, then matching would be random with respect to riskiness, instead of homogeneous. In a large borrowing pool, all borrowers would then face the same implied interest rate, in expectation, equivalent to matching with a borrower of average riskiness in the pool. With no variation in ex ante implied interest rate across borrowers, group lending would lose its risk-pricing advantage over individual lending in this context and could not draw additional borrowers into the market. 20 But, if borrowers matched into "homogeneous" 17 Consider instead the De Meza and Webb (1987) setting, where it is R that is constant across borrowers while expected return R varies: p · R = R p . In this setting with asymmetric information, inefficiency comes from the funding of too many projects-failing to weed out low-return risky projects-rather than too few. Group lending can improve efficiency via the same kind of enhancement in risk-pricing. Theory predicts homogeneous matching, through which group lending charges risky borrowers relatively more than safe and can raise the price for risky projects enough to drive inefficient ones out of the market (Ghatak (2000)).
The Stiglitz and Weiss (1981) assumption is arguably a better candidate explanation, since it seems more plausible that levels of financial intermediation prior to microcredit were inefficiently low. Regardless, homogeneous matching is key to group lending's efficiency in both settings, and this is what we test. 18 This assumes complementarity of types holds under the k-borrower joint liability contract. 19 That said, a finite population provides a force for negative correlation between own risk and partner risk. This is because a borrower must match with someone else, so the pool of potential partners for a safe borrower is slightly riskier than for a risky borrower. See Section 5.4 for more discussion and implications. 20 See Ahlin and Townsend (2002, Section 5.4.7) and Ahlin (2015, Lemma 3).
In a somewhat different context involving costly auditing, Armendariz and Gollier (2000) show how joint liability can raise efficiency even with random matching. The idea is that risky borrowers pay more under joint liability if audited when successful, since their projects have higher returns when successful. groups based on nonrisk characteristics that are predictive of riskiness, for example, due to proximity or friendship, one could still observe some degree of group homogeneity in riskiness. Interestingly, group lending could still embed an implicit discount for safe borrowers, for the reasons discussed. To the extent that groups formed somewhat homogeneously in riskiness, group lending could still be a force for expanding the lending market. 21 Next, consider group size. For simplicity, the theory in this paper is for groups of fixed size two. In a model with fixed group size larger than two, the same forces are at work: standard joint liability contracts induce homogeneous matching, which gives safe borrowers discounts in their implicit interest rates, and can improve efficiency by drawing them into the market (Ahlin (2015)). That is, with larger groups, it remains homogeneous matching that is critical for the market-reviving effects of group lending. 22 Summarizing so far, within-group homogeneity in riskiness obtains in a number of alternative settings, allowing group lending to improve risk-pricing and facilitate more efficient lending.
However, joint liability per se does not necessarily lead to homogeneous matchingthe contract details matter. Sadoulet (1999) and Guttman (2008) considered dynamic contracts where liability for one's partner carries the threat of being denied future loans if both borrowers fail. In this context, the group payoff function can exhibit substitutability rather than complementarity, leading safer borrowers to match with riskier partners. Intuitively, having a more reliable partner is worth more to riskier borrowers, since they more often need their partner to be successful in order to continue receiving loans. 23 However, these nonhomogeneous matching results hold under joint liability contracts that are not claimed to be optimal. To our knowledge, the only analysis of dynamic lending with hidden types that characterizes constrained-efficient contracts with endogenous matching restricts attention to the class of contracts that induce homogeneous matching (Ahlin and Waters (2016)). Thus, the literature does not establish any efficiency properties of joint liability contracts that give rise to substitutability of types and nonhomogeneous matching. Efficiency of some such contract may yet be shown; further, lenders may blunder in model selection or contract design. Empirically, we will consider the prediction of nonhomogeneous matching based on type substitutability, but focus primarily on the Ghatak model's prediction of homogeneous matching based on type complementarity.

Matching over degree and type of risk
This section adds a second dimension of heterogeneity, opening the possibility for correlated risk. Given the agricultural setting of many micro-lenders, including the one in 21 This logic does not guarantee that standardized group lending would be the optimal approach to lending in such a context, only that it would (weakly) dominate standardized individual lending. 22 Even if group size is endogenous, if types are complements and the payoff function is sum-based, any two equilibrium groups must be rank-ordered regardless of their equilibrium sizes (Ahlin (2017)). 23 In a static model, Ahlin (2015) provided an example of a joint liability contract (for groups of three or more borrowers) that makes riskiness types substitutes rather than complements in the payoff function and leads to nonhomogeneous group formation. our data, this is a potentially important extension. However, it is rarely modeled in the group lending literature, and to our knowledge not at all in the context of endogenous group formation.
Return to the baseline model of riskiness types observed by all potential borrowers but not the lender. Given two borrowers i and j with unconditional probabilities of success p i and p j , respectively, all possible joint output distributions can be captured by a single parameter and written as: The case of ij ≡ 0 is the case of independent returns considered by Ghatak. A positive (negative) ij gives positive (negative) correlation between borrower returns. Correlation parameter ij may differ across pairs of borrowers {i j}. We proceed by placing a simple structure on correlations which ensures that ij = > 0 for any two borrowers facing the same types of risk, and ij = 0 for all other pairings.
Assume there are two i.i.d. broadly shared sources of uncertainty, or "shocks," A and B. Each equals 1 or −1 with equal probability. Every agent is assumed to be exposed to risk from either shock A or shock B, or neither (N). Let s i ∈ S ≡ {A B N} denote agent i's shock exposure-type. Shock exposure-type is known by all agents but not the lender. 24 The probability of success of an agent with s i = A and project risk parameter p i equals p i + γA, for some γ > 0. That is, if there is a good shock (A = 1), the agent's success probability is p i + γ; a bad shock (A = −1) lowers the agent's success probability to p i − γ. This agent's project outcome is independent of shock B. The success probability of an agent with s i = B and project risk parameter p i is exactly analogous: p i + γB, independent of A. The remaining agents, with s i = N, succeed or fail independently from A and B. Shocks A and B are realized at the same time as individual incomes, after matching and borrowing decisions are made.
With these assumptions, at the time of matching the ij of expression 5 varies across borrowers i and j in a straightforward way. Let ≡ γ 2 and κ i j = 1{s i = s j = A s i = s j = B}. Then That is, returns are positively correlated for borrowers exposed to the same type of risk (κ i j = 1), because probabilities of success will be pushed in the same direction by the shock. 25 For borrowers not exposed to the same risk (κ i j = 0), ij = 0, because the shocks each borrower is exposed to are independent. 24 In reality, the lender may have some clues, for example, borrower occupation. One can interpret this assumption as applying to the unobserved aspects of risk exposure. 25 With probability 1/2, the shock to which both are exposed is good and the probability of both succeeding is (p i + γ)(p j + γ); similarly, with probability 1/2 the probability of both succeeding is (p i − γ)(p j − γ). The unconditional probability of both succeeding is thus p i p j + γ 2 .
In summary, the correlation structure boils down to ij = ( ij = 0) for pairs exposed (not exposed) to the same shock. The expected payoff of borrower i matched with borrower j is The last term (c ) represents a payoff boost from matching with a partner exposed to the same risk. Payoffs are boosted because positive correlation of returns in the group lowers chances of having to bail out one's partner.
In this context, the following can be shown (see Appendix A for proof ).
Proposition 1. Assume a continuum of borrowers. In equilibrium, almost every group is perfectly homogeneous in both riskiness (p ∈ [p p]) and shock exposure-type (s ∈ {A B N}).
Thus, groups match homogeneously in riskiness (p i ) and shock exposure-type (s i ); each group contains either all A-risk, all B-risk, or all N-risk borrowers. The intuition for shock exposure homogeneity is simple: borrowers prefer matching with similarly exposed partners to enhance within-group correlated risk and lower their chances of facing liability for fellow group members. 26 However, homogeneous matching in exposure-type, that is, antidiversification, works against efficient lending. By raising correlated risk within borrowing groups, it lowers the effective rate of joint liability. In the extreme case of perfectly correlated risk, for example, the effective rate of joint liability is 0 regardless of how the bank sets c: when one borrower fails, they both do, so joint liability payments are never made (see also Ghatak (2000)). In general, the greater the correlation, the smaller the parameter space over which group lending can achieve efficient lending (Ahlin and Debrah (2019)). 27 Here is a dimension of voluntary matching that does not work in favor of efficiency.
Proposition 1 holds with a continuum of borrowers, which makes ideal matching along both dimensions feasible. In a finite population, maximal antidiversification may be incompatible with maximal riskiness homogeneity, in which case tradeoffs between the two dimensions of matching arise. Borrowers may have to choose whether to match with someone closer in riskiness or closer in shock exposure, and homogeneity in one dimension may be (partially) sacrificed to achieve it in the dimension with greater payoff 26 The two dimensions of matching contrast somewhat. The riskiness dimension is vertically differentiated: safer partners are universally preferred, since everyone would like lower chances of facing liability for their partner. This leads to competition for safer partners. Under complementarity, it is the safer types that more strongly prefer safer partners, so they out-compete riskier types to match with safer partners. In contrast, the risk exposure dimension is horizontally differentiated: partners prefer other partners that face similar shocks as themselves, again to lower chances of facing liability for their partner. Borrowers match with similar partners without competition. 27 Under reasonable parameter assumptions, group lending under correlated risk remains weakly more efficient than individual lending (Ahlin and Debrah (2019)).
salience. Nonetheless, payoff function complementarities will push toward homogeneity in both dimensions. 28 A point made in Section 3.2 holds here as well: other ways of implementing joint liability could lead to different matching patterns. For example, dynamic joint liability contracts involving the denial of future loans could lead to formation of diversified groups; diversification would raise chances of partner bailouts that could extend the valuable borrowing relationship. So, the empirical work will consider both diversification and antidiversification hypotheses, the latter being the focal hypothesis.

Data and variable descriptions
The empirical goal of the paper is to characterize borrower matching with respect to riskiness and types of risk exposure.

Data description and environment
A subset of the Townsend Thai data are used. In May 1997, a cross-section of 192 villages was surveyed, covering four provinces from two contrasting regions of Thailand, both with large agricultural sectors. In each village as many borrowing groups of the Bank for Agriculture and Agricultural Cooperatives (BAAC) as possible were interviewed, up to two. This baseline survey contains data on 262 groups, 200 of which are one of two groups representing their village. Unfortunately for this study, the borrower-level data provided in this survey are minimal-they do not include risk variables-and they are all provided by the group's official leader, not the individual borrowers. 29 Hence, we turn to a resurvey, conducted in April and May 2000. The resurvey data were collected from a random subset of the same villages, stratified at the subdistrict (tambon) level. Included are data on 87 groups, 14 of which are the only groups in their village, 70 of which are one of two groups interviewed from the same village, and 3 of which are one of three groups interviewed from the same village. 30 Though observations are fewer, the resurvey data are preferable because individual group members respond to questions on their own behalf, up to five per group and on average 4 5; and because several resurvey questions were designed to measure income risk and correlatedness, the key variables in the theory. In total, we have 36 villages with multiple groups.
The BAAC is a government-operated development bank in Thailand, established in 1966 and the primary formal financial institution serving rural households. It has estimated that it serves 4 88 million farm families, in a country that had just over sixty million inhabitants, about two thirds of which lived in rural areas. In the Townsend Thai baseline household survey covering the same villages, BAAC loans constituted 34 3% 28 As Fox (2010Fox ( , 2018 showed, under a plausible assumption and with a sufficient amount of data on matches and borrower characteristics, complementarities in both dimensions can be identified and estimated, along with the relative strength of the two complementarities. We follow this approach in Section 6. 29 The concern is that when one person responds for all group members, measurement error can be highly correlated within the group, causing homogeneity of matching to be overestimated. 30 This was apparently a mistake in implementation of the data collection methodology, which capped responses to two groups per village; we use the three-group village anyway. of the total number of loans, as compared with 3 4% for commercial banks, 12 8% for village-level financial institutions, and 39 4% for informal loans and reciprocal gifts (Kaboski and Townsend (1998)). The BAAC allowed smaller loans to be backed only with group-based joint liability. 31 This kind of borrowing was widespread: of the nearly 3000 households in the baseline household survey, just over 20% had a group-guaranteed loan from the BAAC outstanding in the previous year. Borrowing in this way required membership in an official BAAC borrowing group and choosing the group-guarantee option on the loan application. The group then faced explicit liability for the loan; that is, the BAAC could opt to follow up with a delinquent borrower or other group members in search of repayment. There could also be dynamic repercussions: some group members reported delays or greater difficulties in getting future loans when another group member defaulted. Given lender discretion, it is impossible to specify the exact contract structure, but both static and dynamic elements of joint liability seem operative.
Groups in the data usually have between 5 and 15 members; about 15% are larger. Typically, groups were born when borrowers proposed a list of members to the BAAC, and the BAAC then approved some or all members. The BAAC seemed to use its veto power sparingly: only 12% of groups in the baseline survey reported that the BAAC struck members from the list. 32 The most common explanations when this occurs have to do with insufficient income or assets, nonresidence in the village, or bad behavior or credit record. Also mentioned is that the BAAC checks occupation to ensure borrowers are farmers, in line with its agricultural lending mission. Likely imperfect, this occupational targeting could lead to greater dispersion of farmers across groups than the decentralized outcome. In sum, while the BAAC had some say in group formation, it appears that group formation was primarily at the discretion of the borrowers themselves. 33

Variable descriptions
To characterize matching along the two modeled dimensions, measures that reflect borrower riskiness and within-group correlatedness are necessary. These are summarized in Table 1.
Our main measure of riskiness takes the theory (Section 3.1) literally. Group members were asked what their income would be in the coming year if it were a good year (R Hi ), what their income would be if it were a bad year (R Lo ), and what they expected their income to be (R). Assuming that income can take only one of two values, R Hi and 31 The cap on group loans at the time of the baseline survey was 50,000 Thai baht, about $2000. The median group loan was closer to $1000. 32 This is in response to a free-form question about how the group's original members were determined. 33 More generally, there is variation across microcredit lenders in the extent of their involvement in the group formation process. Some lenders assign borrowers to groups, for example, FINCA-Peru (Karlan (2007)) and VFS in West Bengal (Feigenberg, Field, and Pande (2013)); seemingly more common is to leave group formation to borrowers, for example, Grameen (Morduch (1999)) and Spandana (Banerjee, Duflo, Glennerster, and Kinnan (2015)). R Lo , and that R represents the mean, the probability of success, or p, works out to be Another measure of risk, less directly related to the model, is the coefficient of variation of income, C. 35 Based on the same assumed income distribution, this works out to be which is simply the percentage deviation from expected income, averaged (geometrically) over good and bad outcomes. Correlatedness is proxied in two ways. First, we create a measure of occupation. Borrowers list the most recent year's revenue in more than 30 categories, and expenses in three aggregated categories: agriculture (rice or other crop farming, livestock), aquaculture (raising shrimp or fish), and business (e.g., restaurant, mechanic shop, trading). To transform these revenue and expense data into an individual's occupation, we proxy for the share of income coming from each of four categories: agriculture, aquaculture, business, and wage labor. A simple way of calculating a borrower's income would be the borrower's revenues minus expenses. This leads to a practical and a related conceptual problem. Practically, in each category there would be a number of borrowers with negative incomes; conceptually, given risk, one year's net income in a given category may be a quite noisy proxy for usual or expected income in that category. Since revenues seem likely to vary more widely than expenses from year to year, we proxy for income using 34 The measure described here is used by Ahlin and Townsend (2007b) in their finding of evidence for adverse selection in this credit market. 35 The coefficient of variation equals the standard deviation divided by the mean. expense data (in the three categories with expense data). A borrower's agriculture expenses are translated into that borrower's expected agriculture earnings using a samplewide profit rate (revenues/expenses), calculated as the sum of all agricultural revenues in the sample divided by the sum of all agricultural expenses in the sample; aquaculture and business expected earnings are found analogously. Thus, for each borrower we have a proxy for expected or usual earnings in agriculture, aquaculture, and business, based on that borrower's expenses in each of these categories multiplied by a category-specific, sample-wide factor translating expenses to earnings. Earnings in the fourth category are simply taken as revenues from wages or salaries. 36 Given occupational vectors for borrowers i and j, (ω i1 ω i2 ω i3 ω i4 ) and (ω j1 ω j2 ω j3 ω j4 ), each entry of which is the fraction of total earnings from one occupation, we proxy the degree of correlatedness between borrowers i and j as the negative rectilinear distance between their occupational vectors, − 4 k=1 |ω ik − ω jk |. This correlatedness measure is maximal for two borrowers with identical occupational vectors, and minimal for two borrowers that drew revenue from no common categories. 37 Second, we use timing of bad income years, worst_year. Specifically, borrowers were asked which year of the past two was worse for household income: "1 year ago," "2 years ago," or "neither." If borrowers are exposed to correlated shocks, bad income years are more likely to coincide; thus coincidence of bad years can proxy borrowers' correlatedness.
One could certainly envision more informative measures of riskiness and correlatedness than the ones available from this dataset. However, a primary effect from noisiness in these measures is likely to be making random matching harder to reject. Our conjecture is that any mismeasurement is mainly causing an underestimation of systematic matching patterns.

Univariate methodology and results
In this section, we examine matching patterns one characteristic at a time. Section 6 extends the analysis to consider matching along multiple characteristics.

Univariate methodology
Our strategy is first to choose a matching metric that is maximized, over feasible matching outcomes, by the theoretically predicted matching outcome; then, for each village, 38 to score the observed matching outcome using this matching metric; and finally, to compare the set of village scores to what would be expected both in theory and under random matching. 36 Translating revenues to earnings (rather than expenses to earnings) using a similar strategy produces very similar results, as do a number of variations on this approach. 37 Euclidean distance seems less appropriate here. It says that a dedicated farmer (1 0 0 0) is closer in occupation to someone who is half in business and half in wage labor (0 0 1/2 1/2) than to someone who is all in business (0 0 1 0) or all in wage labor (0 0 0 1); there is no difference under the rectilinear distance. 38 Throughout the paper, we treat the village as synonymous with the matching market-a reasonable assumption since villages are relatively small and geographically concentrated.
This paper follows two approaches to choosing a matching metric, discussed in the next two sections. 5.1.1 Choice of matching metric: Pattern approach Theory makes stark predictions about equilibrium matching patterns: groups are homogeneous in both riskiness and shock exposure-type (Proposition 1). These are core predictions: group homogeneity in riskiness is at the heart of group lending's ability to restore the credit market in this theoretical context, and group homogeneity in shock exposure is what risks nullifying the advantages of group lending.
A first set of metrics is designed to test these key predictions by measuring the degree of homogeneity of a match. We call this the "pattern approach," since it tests theoretical predictions for matching patterns, and the metrics involved we call "homogeneity metrics," since they measure match homogeneity.
Consider riskiness first, and let p denote a borrower's riskiness type. Assume data from two groups L and M in village v, of respective sample sizes l and m: L = (p 1 p l ) and M = (p l+1 p l+m ). An assignment of these l + m borrowers into two groups of size l and m will be called a match, or equivalently, a "grouping." One off-the-shelf homogeneity metric is variance decomposition: decomposition of the variance of P = (p 1 p l+m ) into between-and within-group components. The between-group variance component is maximized in a rank-ordered grouping (Lemma 1, Appendix C), so a larger between-group component can be taken as stronger evidence for homogeneous matching.
To illustrate, consider a village with 2 groups of size 4, with success probabilities P = (1 2 4 5 6 7 8 9) (in tenths). Compare the borrower grouping L = (2 5 6 8) and M = (1 4 7 9) with the grouping L = (1 2 5 6) and M = (4 7 8 9). The first grouping has a between-group variance component equal to 0% of the overall variance, while the second grouping has a between-group component of 44%. The higher value reflects the more homogeneous matching of the second grouping-relatively close to rankordering-while the lower value reflects the more mixed first grouping-equal means, and thus far from rank-ordering.
These homogeneity metrics can be used with either measure of borrower riskiness, probability of success or the coefficient of variation for income. However, they cannot be applied to risk exposure-type s, measured by occupation and worst_year, since these are nonordered, categorical variables.
A suitable homogeneity metric for categorical variables is the chi-squared test statistic. This statistic quantifies deviations from the grouping in which each group has the same proportion of borrowers of each type. Thus, it is minimized under an equal distribution of types across groups, and maximized when each group is perfectly homogeneous (Lemma 3, Appendix C). For example, letting A and B be two risk exposure-types-in the data, two occupations or worst years-compare the grouping L = (A A B B) and M = (A A B B) with L = (A A A B) and M = (A B B B). The chi-squared test statistic for the first grouping is 0 and for the second grouping is 2. 39 5.1.2 Choice of matching metric: Payoff approach In equilibrium within a matching market, the sum of two groups' payoffs is higher than those arising from any reconfiguration of the two groups' borrowers (see Section 3.1). Hence, the sum of two groups' payoffs is a metric that is maximized under the theoretically predicted matching outcome; this is the metric used in the "payoff approach." The specification for this "payoff metric" comes directly from the theory. Consider first the baseline model with unidimensional types reflecting only riskiness. Let groups L = {i j} and M = {i j } be observed in a village, and group payoff functions be Π L = π ij + π ji and Π M = π i j + π j i . Using equation (1), the total payoffs in this grouping are Theory predicts that this sum of payoffs is maximized, over all groupings of the observed borrowers, by the equilibrium grouping. However, only part of this payoff may vary across groupings of borrowers, and the rest can be ignored. Specifically, note that all groupings of the observed borrowers give the same value for the individual part of the payoffs, 4R − (r + c)(p i + p j + p i + p j ). Further, c merely scales the final parenthetical term, and c > 0 due to joint liability-this is the key assumption that delivers complementarity of types. Together, this implies that the equilibrium grouping maximizes the final parenthetical term, which is what we use for the payoff metric. Letting p −k be the success probability of borrower k's partner, this payoff metric can be written k∈L p k p −k + k∈M p k p −k Taking the theory to data is complicated by the fact that the borrowing groups in the data are not pairs, but typically involve 5-15 members; further, the sample contains a maximum of five borrowers per group. Our strategy is to proxy for p −k in expression (7) using the average success probability of the other sampled group members. Specifically, let group G be a set of grouped borrowers, S G be the sampled subset of group G, and p S G −k be the average success probability in S G excluding borrower k. Our sample estimate of the payoff metric (expression (7)) is 39 The chi-squared statistic easily accommodates fractional types, for example, a borrower being 30% in occupation A and 70% in occupation B. It is based on summing number of borrowers of each type within group and village, and these sums are well-defined whether summing parts or wholes of borrowers.
This estimate is simply the sum, over all sampled village borrowers, of the borrower's success probability multiplied by the average success probability of other same-group, sampled borrowers. 40 This can be directly calculated from the data using the success probability variable (see Section 4.2). Consider next the contract when borrowers have two-dimensional types, capturing riskiness and type of risk exposure, as in Section 3.3. Let κ k −k be the indicator for whether borrower k shares the same risk exposure-type as his partner. Using payoff function (6) gives As argued above, the individual part of the payoffs (first line) can be ignored. The riskiness interaction terms (first parenthetical, second line) are also ignored when testing for homogeneity in risk exposure-type using the univariate techniques of this section. 41 Finally, since c > 0 and > 0 merely scale the final parenthetical term, they may be dropped. Following the strategy used above and defining κ S G k −k as the average correlatedness indicator of borrower k in group G with other sampled group G members, our payoff metric for the correlated risk dimension is This measure is simply the sum, over all sampled village borrowers, of the fraction of other same-group, sampled borrowers exposed to the same risk. 42 Intuitively, the contract delivers a diversification-averse payoff function, and thus the equilibrium grouping will score as high as possible in the fraction of borrowers' fellow group members exposed to the same shocks. The remaining question is how to use the data to proxy for κ i j , the indicator for being exposed to the same risk. In the case of worst_year, κ i j is simply proxied by 1{worst_year G i = worst_year G j }; that is, two borrowers are considered exposed to the same risk iff they give the same answer in identifying the worst year. In the case of occupation, a vector with the fraction of earnings coming from each of four broad occupations, κ i j is proxied by the negative rectilineal distance between the borrowers' occupational vectors. 43 40 To illustrate, sampled grouping L = (2 5 6 8) and M = (1 4 7 9) has sum of group payoffs of 202, that is, 2 * 19/3 + 5 * 16/3 + · · · + 9 * 4, compared to 234 2 3 for grouping L = (1 2 5 6) and M = (4 7 8 9). 41 That is, we examine each dimension separately in this univariate analysis, matching on riskiness and on risk exposure-type. Testing both together based on the entire payoff function is reserved for Section 6. fellow group members is exposed to the same shock, the correlation-related payoffs sum to 8 · 1 3 = 2 2 3 . In grouping L = (A A A B) and M = (A B B B), the correlation-related payoffs sum to 6 · 2 3 + 2 · 0 = 4. 43 See Section 4.2. Scaling this measure to lie on [0 1] will not affect results.

5.1.3
Comparison of payoff approach and pattern approach An advantage of the payoff approach is that its matching metric comes directly from theory, unlike in the pattern approach. 44 On the other hand, the pattern approach features intuitively appealing metrics, while the payoff approach risks jointly testing unimportant details of the payoff function alongside important features. We view the two approaches as complementary, and report results using each.
However, since the payoff metric focuses cleanly on complementarity versus substitutability in the case of riskiness, and diversification-aversion versus diversificationlove in the case of risk exposure, and since these aspects of the payoff functions are what drive the resulting matching patterns, the payoff approach may be expected not to differ substantially from the pattern approach in most cases. Indeed, both types of matching metrics are maximized under the theoretically predicted match. They may differ, though, in how they rank the many matching outcomes that are not predicted by theory.
In one particular case, the pattern and payoff approaches are not just similar, but equivalent. This follows because one grouping is more homogeneous in riskiness than another based on the borrower-partner covariance metric iff it scores higher on the payoff metric for riskiness (Lemma 4, Appendix C). Thus, in the case of riskiness, the pattern approach (with a particular metric) and the payoff approach exactly coincide in how they rank all feasible groupings. Since our approach will rely only on relative rankings of groupings, the borrower-partner covariance results and the results of the payoff approach for riskiness are identical and reported once only, with labels used interchangeably.

5.1.4
Testing the matching outcomes We next compare observed village matching outcomes using these metrics to what would obtain both in theory and under a random matching benchmark. Having settled on particular matching metrics, the remainder of the approach is nonparametric.
Central to the approach are comparisons of each observed village match with feasible, counterfactual borrower matches. The set of feasible matches is assumed to consist of all groupings of observed borrowers within a village that preserve observed group sizes. 45 We first transform each village's score under each matching metric from an absolute scale to a relative scale. This is done by comparing how the observed village match compares to all feasible village matches, on the matching metric's scale. Specifically, consider observed groups L and M, of respective sizes l and m, in village v. For all possible combinations of the l + m borrowers into two groups of respective sizes l and m, we 44 Pitfalls can arise in the pattern approach because, while complementarity makes clear predictions about matching patterns, substitutability's predictions are much weaker and context-sensitive. As a result, substitutability can give rise to matching patterns that are observationally similar to complementarity's under certain homogeneity metrics (Ahlin (2017)). 45 This reflects the assumption that the village is the matching market, as discussed above. Focusing only on matches that preserve observed group sizes allows us to bypass the issue of optimal group size, as does the theory.
apply the matching metric. The observed village grouping is then assigned a "matching percentile" reflecting how high the observed grouping scores compared to all feasible groupings. Of course, given finite populations and (possibly) ties, the result will always be a percentile range, rather than a point. This "matching percentile range" is defined as [LB UB], where LB (resp., UB) is the fraction of feasible groupings that score strictly (resp., weakly) lower than the observed grouping, using the given matching metric.
To illustrate, consider the village with two groups of size four, with success probabilities P = (1 2 4 5 6 7 8 9). There are 8 4 /2 = 35 feasible groupings of these eight borrowers, into two groups of size four. Compared to the grouping L = (2 5 6 8) and M = (1 4 7 9), 32 groupings register higher between-group variance while 3 (including the grouping itself ) register exactly the same (zero) between-group variance. Thus, based on variance decomposition, this grouping has a matching percentile range of In sum, this permutation procedure scales each matching metric for each village into a relative score (range of scores) in [0 1]. It thus ranks the observed degree of match homogeneity or payoff maximization relative to all possible matches given the observed distribution of borrower types. It also facilitates comparing observed matching behavior to theoretically predicted behavior and to random behavior.
The outcome predicted by theory is straightforward: the observed match should maximize the matching metric. This implies that matching percentile ranges should always be of the form [X 1], for every village and matching metric. This prediction is stark, and easy to reject in our data; more often than not, the observed match does not maximize the matching metric.
However, this seems to set the bar too high; given measurement error, matching on other dimensions, or matching constraints, the theory may fail to hold precisely even though it does hold to a degree. 46 That is, even though safe borrowers may not appear to be receiving the maximum possible implicit discount, which would come from maximally homogeneous matching, they may be receiving a substantial discount from moderately homogeneous matching. Indeed, it is random matching that leads to a zero discount for safe borrowers (in a continuum; Ahlin (2015)); there is significant room between random matching and maximally homogeneous matching for safe borrower discounts to be substantially positive.
Hence, we also test the null hypothesis of random matching, that is, that every feasible grouping is equally likely. If random matching can be rejected against the alternative hypothesis of homogeneous matching, in the pattern approach, or high complementarity-based payoffs, in the payoff approach, this provides partially supportive evidence for the theory: it establishes that matching outcomes are nonrandom in the direction predicted.
What matching percentiles are predicted by random matching? We claim that if matching is random, a village's matching percentile is distributed uniformly on [0 1]. Consider the case of a large number of borrowers in a village, no two groupings of which result in a tie using the given matching metric. If each of the N, say, possible groupings is equally likely, as it is under random matching, then each 1/Nth matching percentile is equally likely to be realized by a given village. That is, a village's matching percentile is drawn from the uniform distribution-approximately, with the difference getting arbitrarily small as N increases.
With smaller numbers of borrowers and ties, a village is assigned a matching percentile range, rather than a point, but the uniform distribution still applies as long as the village's matching percentile (point estimate) is drawn from the village's matching percentile range via the uniform distribution.
In short, let a village's matching percentile range be calculated by the permutation method described above; and let its matching percentile (point estimate) be drawn at random from the uniform distribution over its matching percentile range. Then the exact distribution of a village's matching percentile under random matching, regardless of the matching metric, is the uniform distribution on [0 1] (see Appendix A for proof ).

Proposition 2. Under random matching, for any homogeneity or payoff metric, a village's matching percentile is drawn from the uniform distribution on [0 1].
The test for random matching then constructs a sample CDF from the observed village matching percentiles, and compares it to the uniform distribution CDF using erately homogeneous to be observable in equilibrium, even though equilibrium matching based only on observables would give rise to maximal homogeneity. Two ways of implementing this approach empirically are to assume some structure on the unobservables (e.g., Choo and Siow (2006)), or to assume directly that matchings that produce higher observable payoffs are more likely to be observed when matching is based both on observables and unobservables (Fox (2010(Fox ( , 2018). The "payoff approach" described above is similar in spirit to the Fox approach of assuming that matches that produce higher observable payoffs are more likely to be observed. The "pattern approach" is also similar, but to an approach that judges matches more likely if they produce higher observable homogeneity, rather than higher observable payoffs.
the Kolmogorov-Smirnov (KS) test. If the sample CDF stochastically dominates the uniform, this means villages' matching percentiles tend to be higher than random matching would give rise to and provides statistical evidence for homogeneous (or complementarity-based) matching. On the other hand, if the sample CDF is stochastically dominated by the uniform, this means villages' matching percentiles tend to be lower than what random matching would produce, suggesting nonhomogeneous (or substitutability-based) matching. We thus report p-values for these KS one-sided tests of stochastic dominance.
Note that a range of p-values is possible, since each one relies on a set of random choices: the random draws that select villages' matching percentiles from their matching percentile ranges. We report the average p-value across one million tests with independent draws. Since each test produces a valid and independent p-value, that is, probability under the null of observing a test statistic at least so extreme as the one observed, the average p-value across many draws approximates the expected probability under the null of observing a test statistic at least so extreme across all possible sets of draws, and thus is appropriate for inference.
In short, the sample CDF of village matching percentiles is compared to the uniform CDF using the KS test, to test for random matching. Both CDFs are displayed graphically, along with the CDF of village matching percentiles that would obtain if the grouping in each village fit the theory perfectly (maximally homogeneous or payoffmaximizing).

Univariate results
Sorting by riskiness. The first set of results measures riskiness with the success probability, or p. Figure 1, left panel, graphs results from the pattern approach, specifically the sample CDF of village matching percentiles based on variance decomposition. 47 According to this metric, the mean (median) village grouping is more homogeneously matched than 57% (62%) of all groupings of the same borrowers that preserve observed group sizes. The random-matching benchmark, the uniform, is graphed as a dashed line. The KS test rejects random matching at the 5% level, against the alternative of homogeneous matching, that is, that the true distribution of village homogeneity percentiles first-order stochastically dominates the uniform. The dash-dotted line shows that observed matching is even further from predicted matching than from random matching, however. These results point to matching by riskiness that is not perfectly homogeneous, but statistically distinguishable from random matching in the direction of homogeneity. Figure 1, right panel, graphs the sample CDF of village matching percentiles based on the payoff metric. The results are quite similar. 48 The mean (median) village group-47 For this and all graphs in this section, the reported p-values are averages over 1 million KS p-values, each based on an independent set of random draws from villages' percentile ranges. Sample CDFs are calculated incorporating the percentile range of each village directly, and means and medians are computed similarly. 48 Recall that these results are identical to those using the borrower-partner covariance homogeneity metric. ing produces higher complementarity-based payoffs than 56% (61%) of possible groupings, and random matching is rejected at the 5% level against the alternative of complementarity-based matching. Still, matching is further from payoff maximization than from randomness. A second measure of riskiness is the coefficient of variation of projected income. Figure 2 graphs results from the pattern approach, the left panel using the variance decomposition metric, and the right panel using the borrower-partner covariance metric. The variance decomposition results give strong evidence of homogeneous matching: the mean (median) village grouping is more homogeneously matched than 63% (72%) of all possible borrower groupings, and random matching is rejected at the 5% level against the alternative of homogeneous matching. Similar results obtain using the borrower-partner covariance: the mean (median) is 61% (63%), and the KS test rejects random matching at the 5% level. Again, matching is closer to randomness than maximal homogeneity.
Overall, the data show that while matching by riskiness falls short of perfect homogeneity and complementarity-payoff maximization, it is more homogeneous and complementarity-payoff maximizing than random matching would deliver. This provides some support to the theory. Sorting by risk exposure-type. We next examine diversification within groups, first using the coincidence of worst_year within groups. Figure 3, left panel, reports results from the pattern approach using the chi-squared homogeneity metric. The average (median) village grouping has greater within-group homogeneity of bad income years than 60% (66%) of possible groupings, and random matching is rejected at the 10% level against the alternative of homogeneous matching (antidiversification). The payoff method results, right panel, are nearly identical: the average (median) village grouping produces higher diversification-averse payoffs than 60% (65%) of possible groupings, and random matching is rejected at the 10% level. 49 Observed matching is further from optimal than from random, but not as far as in the other cases, since the relative lack of variation in worst_year leads to quite a few ties. 49 One might wonder whether correlated risk within groups is not due to matching, but to the joint liability contract itself, which can make one borrower's bad year a bad year for others who are liable. This is unlikely because the survey question used for worst_year is designed to refer to income prior to transfers. Indeed, when asked for the reason for the bad year, about 85% of responses are agricultural shock-relatedprices, weather, or pests. The survey follows up by asking how the household responded to the bad income year, and here is where a number of the responses have to do with transfers. Occupational diversification results, from the pattern and payoff approaches, are graphed in Figure 4. Results are nearly opposite those from worst_year. Using the chisquared metric, the average (median) village grouping has greater within-group occupational heterogeneity than 56% (61%) of possible groupings. 50 Using the payoff metric, the average (median) village grouping produces higher diversification-loving payoffs than 57% (59%) of possible groupings. Though this is far from matching that is maximally heterogeneous and diversification-loving payoff maximizing, random matching is rejected at the 5% level in the payoff case, and at the 15% level in the pattern case, against these alternatives.
Interestingly, groups are somewhat antidiversified along income lines (worst_year), but somewhat diversified along occupational lines. One interpretation is that the lender encourages diversification within groups along observable dimensions, including by occupation, with at least partial effect; but that the borrowers are able to achieve some antidiversification by exploiting other, less observable characteristics. This would suggest that antidiversification is occurring, and partially undoing the risk-pricing improvements, but not to the degree it would be if groups were less occupationally diverse.

Discussion of univariate tests
The univariate tests establish that groups are somewhat more homogeneous in riskiness and risk exposure-type (under the worst_year measure) than they would be under random matching, and they enjoy higher complementarity-based and diversificationaverse payoffs (under the worst_year measure) than they would under random matching.
This evidence is consistent with key theoretical predictions; but it is not proof of riskiness or exposure-type causing matching behavior. It does show that borrowers end up in groups that are more homogeneous on these dimensions than random matching would produce, but it does not establish that these patterns are the result of the proposed theoretical mechanism. For example, it may be that friends or relatives group together, and that friends or relatives are similar along risk dimensions. Or, borrowers may match with partners in nearby occupations because they are easier to monitor, but who thereby face similar amounts and types of risk (though the observed occupational diversity within groups casts doubt on this particular story). 51 51 An ideal experiment would assign different levels and types of risk to borrowers, and test its impact on group (re)formation. Techniques used in this paper could be combined with experimentally-induced risk characteristics, enabling identification of causal impacts of risk on matching. This could be feasible in the lab, but substantial ethical and practical barriers to assigning risk experimentally in the field seem to exist. However, if the goal is to assess whether the Ghatak theory is an empirically plausible explanation of group lending's popularity and ability to revive credit markets, these simple univariate tests are in some ways preferable to alternatives. The reason is that the safe-borrower discount embedded in lending to homogeneous groups exists regardless of how groups end up homogeneous by riskiness. Whether borrowers consciously considered the risk of their partners in forming groups, or simply formed groups with friends or relatives who happened to have similar risk characteristics, what matters is that safe borrowers end up with safer partners. This fact alone implies that the joint liability stipulation is less onerous for safe borrowers, which delivers an implicit discount in their borrowing rate and allows group lending to draw more borrowers into the market. The point is that, in this framework, matching that is sufficiently homogeneous by riskiness-by whatever mechanism-is all that is needed for group lending to offer an improvement in contracting.
Thus, testing directly the degree of risk homogeneity is arguably the most informative approach to testing this main point of the Ghatak theory. Conversely, rejecting the Ghatak theory based on causally identifying, for example, kinship and not riskiness as the key matching determinant could be misguided, if the evidence pointed to riskhomogeneous groups. Such a result would cast doubt on the nature of the matching process in the Ghatak theory, but could still be fully compatible with the theory's basic explanation for group lending's success, if riskiness generally correlates among kin.
A similar argument can be made about the extended model that incorporates correlated risk. If there is unconditional evidence for antidiversification of risk, then that is enough to raise the concern that some of the contractually stipulated joint liability is being undone-whether or not the antidiversification results from conscious choices on the part of borrowers.
Thus, we believe the results of this section are directly informative about the ability and limitations of the theory to explain the rise of group lending and microcredit.
A separate shortcoming of these results is that they cannot differentiate between homogeneous matching and group conformity, in which groups gravitate toward similar risk choices because they are grouped together. Ideal to distinguish these two stories would be risk data that predates group formation, which we unfortunately lack and must leave for future work. 52

Quantifying the matching-based discount
How big are the discounts that the observed, moderately homogeneous matching in riskiness delivers? Recall that the implied interest rate faced by borrower i when successful and matched with borrower j is (from equation (2)) This is the direct interest rate r plus the liability rate c multiplied by the partner's chance of failure (1 − p j ). Allowing for ex ante uncertainty in the match, the expected implicit interest rate can be written E(r ij ) = r + c − cE(p j |p i ) and the size of the expected discount, 53 that is, the expected decline in interest rate for a unit increase in p i , is − dE(r ij ) dp i = c dE(p j |p i ) dp i The discount corresponding to a more moderate change in p i equal to the standard deviation of success probability in our data, 0 25 (Table 1), is 0 25c dE(p j |p i ) dp i In theory (see, e.g., Ahlin (2015)), c is set as high as possible subject to affordability, up to full liability; this is also consistent with BAAC official policy holding borrowers fully liable for partners' loans. Thus, ideally c = r, that is, liability equals the gross interest rate, which in the case of the (subsidized) BAAC is typically about 110%. Thus, we use c = 1 1, and the discount we aim to measure becomes 0 275 dE(p j |p i ) dp i The remaining quantity in this discount is the key derivative dE(p j |p i )/dp i . In the baseline theory, p j = p i , so E(p j |p i ) = p i and dE(p j |p i )/dp i = 1, and thus the discount is 0 275, that is, a substantial 27 5 percentage points. If instead riskiness had no predictiveness for partner riskiness, as in random matching in a continuum, then E(p j |p i ) = α for some constant α, dE(p j |p i )/dp i = 0, and the discount would be 0. In sum, two useful benchmarks for this matching gradient are that dE(p j |p i )/dp i = 1 in theory, while dE(p j |p i )/dp i = 0 under random matching in a continuum.
We estimate this key derivative from data as simply as possible. Assume a linear conditional expectation function for partner risk p j as a function of own risk p i : E(p j |p i ) = α + βp i . The parameter of interest is β = dE(p j |p i )/dp i . Given the linear conditional expectation function, β is estimated using the standard OLS formulâ β = Cov(p i p j )/ Var(p i ), that is, the covariance within matching market of borrowers' riskiness levels with that of their partners, divided by the variance within matching market of borrowers' riskiness levels. Call this the borrower-partner correlation; it equals one of the key homogeneity metrics-the borrower-partner covariance (see Section 5.1.1)normalized by the variance. 54 Thus, our estimate for the size of the discount corresponding to a standard deviation increase in probability of success, 0 25, is 0 25c dE(p j |p i ) dp i = 0 275β = 0 275 Cov(p i p j ) Var(p i ) 53 For brevity, we often omit the term "expected" when describing the discount. 54 This normalization would not change any results in the permutation-based test, since the variance does not vary across groupings of borrowers within a market.
We calculateβ for each matching market, that is, for each village v, using each village's observed grouping: call thisβ Observed v . For example, in a village with two groups of size four and riskiness types (1 2 4 5 6 7 8 9), if the observed grouping were (1 2 5 6) and (4 7 8 9), thenβ Observed v = 0 26 would be calculated, 55 implying a discount of 7 15 percentage points.
When we average thisβ Observed v across the 32 villages in our dataset with sufficient data on success probabilities, we get −0 115. This implies a negative discount on average for safe borrowers, that is, that safe borrowers pay higher rates.
Given our more positive results from the test against random matching, this is puzzling. Several factors explain this result: finiteness, measurement error, and skewness.
Consider first the effects of finiteness. The random matching benchmark in the continuum case gives rise to β = 0. But random matching in a finite population gives rise to a negative correlation. If there are N borrowers matching in a village and Σ is the sum of the N borrower types, then under random matching E(p j |p i ) = (Σ − p i )/(N − 1), that is, the expected partner riskiness is the average riskiness in the village excluding i. It follows that ∂E(p j |p i )/∂p i = −1/(N − 1). 56 This negative correlation arises because for relatively risky borrower i, the pool of potential matches is safer because it excludes i, while for relatively safe borrower j, the pool of potential matches is riskier because it excludes j. Thus, in the finite case random matching does not deliver zero but negative expected discounts to safe borrowers, because they bear liability for lower quality partners, on average. Return again to the example of a village v with two groups of size four and riskiness types (1 2 4 5 6 7 8 9). The averageβ (borrower-partner correlation) across all Thus, random matching is not neutral for risk-pricing in a finite world, but somewhat negative-a phenomenon that seems to be overlooked in the microcredit literature. Of course, this effect vanishes as the number of village borrowers N gets large. Given 22% take up of group BAAC loans among surveyed Thai households (Ahlin and Townsend (2007b)), a village with 150 households would have ∂E(p j |p i )/∂p i = 1/(0 22 * 150 − 1) ≈ −0 03. This implies random matching would give rise to a 0 8 (= 0 03 * 27 5) percentage point implied interest rate premium for borrowers with a one standard deviation higher probability of success. This is a potential cost of group lending-if matching is random in a finite market, it makes risk pricing worse, not better.
One implication of this analysis is that using a sample rather than the population of borrowers in a village negatively biases results forβ. Sinceβ Random v is inversely proportional to N − 1, where N is the number of borrowers in each grouping, the reduction in number of borrowers per grouping due to sampling makes the finite-pool average correlation appear more negative. Our data samples up to 5 borrowers per group and 10 55 This is the covariance between (1 2 4 5 6 7 8 9) and (13/3 4 19/3), divided by the variance of (1 2 4 5 6 7 8 9). 56 This holds the sum Σ fixed, so the derivative applies to comparisons across borrowers within the pool.
borrowers per village, and on average 8 3 per village. Indeed, the averageβ Random v across the 32 villages in our data is −0 142, significantly lower than the more reasonable −0 03 discussed in the preceding paragraph.
In summary, average borrower-partner correlations in our data will be lower than predicted by the continuum-based theory. Part of this is due to a built-in negative correlation between own risk and partner risk in a finite matching pool. But part of this is a downward bias due to the use of a sample of borrowers rather than the population, which magnifies the finite-pool effect. A back-of-the-envelope bias correction is to take an observed correlation,β Observed This is the approach we follow. 57 When we average thisβ Corrected v across the 32 villages in our dataset with sufficient data on success probabilities, we get −0 005, corresponding to a interest rate premium of about 1/7 of a percentage point. Thus, this finite sample correction pushes the measured discount quite close to zero, but not positive.
Measurement error must also be an issue. Our data on probability of success applies theory to a simple borrower assessment of next year's income distribution, but the application is not likely to line up perfectly. As evidence of this, mean and median probabilities of success are below 0 45 (Table 1), which is almost certainly counterfactual. Probability of success may be viewed more accurately as a proxy rather than a direct measure of borrower riskiness.
We view the resulting measurement error as most likely biasing results toward the random matching outcome. (If all probability data were pure noise, we would indeed get the random matching outcome.) In light of this, we view the ability to reject random matching in favor of homogeneous matching as the most salient empirical outcome, and believe that with better data, the mean and median matching percentile (see Figure 1) are not unlikely to be higher than the measured 0 6. The quantification exercise attempted here, which takes these risk measurements at face value and seeks to measure homogeneity not on a relative scale but an absolute scale, may suffer from even greater attenuation bias.
One step toward assessing the importance of measurement error is to check how borrower-partner types are correlated under an alternative proxy for riskiness, the coefficient of variation. While the coefficient of variation is not the precise risk measure suggested by theory, it does capture risk in a standard way and may even serve as a better proxy for it. Further, both the derivative ∂E(p j |p i )/∂p i and its empirical counterpart 57 This turns out to be slightly more conservative on average than the alternative of adding the same constant (β Random v − 0 03) to allβ Observed v 's to ensure that the average correctedβ across all groupings in each village is −0 03. Based on simulations, it appears that the true correction should not raise all groupings' β's by the same constant, but should raise lowβ's more than highβ's (some of which even decline). Our correction is ad hoc and simplistic, but embeds this idea qualitatively: it raises higherβ's less than smaller β's. Cov(p i p j )/ Var(p i ) are clearly interpretable when this measure of risk is substituted. Using this alternative measure of risk, the averageβ Observed v andβ Corrected v across the 30 villages in our dataset with sufficient data on coefficient of variation are −0 033 and 0 075, respectively. Using the corrected estimate and the slightly higher standard deviation of this risk measure, this implies a safe borrower discount of roughly 2 4 percentage points (0 075 * 0 29 * 1 1). Combining this in a rough way with the results using probability of success, this suggests an implied interest rate discount of between −0 14 and 2 39 percentage points for a borrower with one standard deviation lower risk.
Skewness in the distribution of discounts across all groupings in a village also helps explain the relatively low estimated discounts. In particular, while the averageβ across all groupings in a village is near zero (−1/(N − 1), to be exact), this average seems to come from a greater number of mildly negative borrower-partner correlations combined with a smaller number of more strongly positive borrower-partner correlations. Thus, the median can be well below the mean, and only somewhat high-percentile groupings achieve significantly positive borrower-partner correlations.
Returning to the example of a village v with two groups of size four and riskiness types (1 2 4 5 6 7 8 9), while the averageβ across the 35 groupings is −0 14, the medianβ is −0 23. Only 17% (6/35) of groupings register a positive borrower-partner correlation; only 40% (14/35) achieve a higherβ than the averageβ. This skewness seems to persist with larger sample sizes: for example, replicating this set of borrowers two and three times while increasing group size to eight and twelve, respectively, we calculate that 17% and 15% of groupings achieve a positive borrower-partner correlation, respectively, while 32% and 33% of groupings achieve a higherβ than the average, respectively. 58 An implication of this skewness is that matching that is moderately homogeneous on the relative (percentile) scale and statistically distinguishable from random matching may be insufficiently homogeneous to produce significant discounts, or even positive discounts. Matching need not be perfectly homogeneous (as in theory) to produce significant discounts; but it appears that it needs to be considerably more homogeneous than random.
In summary, several structural factors work against safe-borrower discounts: the finiteness of the borrowing pool, which induces a baseline negative correlation between borrowers and their partners; and the skewed distribution of borrower-partner correlations across feasible groupings, which implies that only a minority of groupings produces positive discounts. Our rough calculations-which attempt to correct for sampling and use two alternate risk measures, but are still provisional-suggest that average discounts corresponding to a standard deviation decline in riskiness fall somewhere between a small negative fraction of a percentage point and almost two and a half percentage points. A discount at the upper end of this range would certainly be significant, but would probably fall short of large-scale credit market transformation. However, future work is called for to quantify the safe-borrower discount more accurately using improved risk measures and village borrower populations rather than samples of village borrowers. 58 Similar percentages are calculated when we simulate similar group sizes with random draws from the uniform or normal distributions.

Multivariate methodology and results
The univariate results are consistent with both dimensions of risk-riskiness and type of risk exposure-being important for matching. Of course, a matching pattern along one dimension could be due to matching occurring on another dimension. While the univariate results are directly informative, as argued in the previous section, it is helpful to understand whether both dimensions are salient in determining matching. Here, we use a multivariate approach that allows both dimensions of risk simultaneously to affect payoffs and matching, and is able to identify key payoff features in both dimensions along with tradeoffs between the two.
Specifically, we use the matching maximum score estimator of Fox (2018) to estimate key parameters of the model's group payoff function, along both dimensions. 59 The estimator works by choosing parameters that most frequently give observed agent groupings higher payoffs than feasible, unobserved agent groupings. It has been shown consistent in an environment with many matching markets (as in our setting), assuming that groupings that give higher observable surplus are more likely to be observed.
Consider observed groups L and M in village v. If groupsL andM represent a feasible, unobserved grouping and if Π G (φ) gives the sum of payoffs of any group G as a function of parameters φ, theory predicts The matching maximum score estimator chooses parameters φ that maximize the score, that is, the number of inequalities of the form (11) that are true, where each inequality corresponds to a different feasible, unobserved groupingL,M. As in Section 5, we assume that the feasible, unobserved matches are all alternative arrangements of the borrowers from L and M into two groups of the original sizes. Thus, the inequalities (11) used for the matching maximum score estimator come from all kfor-k borrower swaps across two groups in the same village. 60 For example, if we have data on five borrowers in each of two groups in the same village, there are 5 × 5 = 25 one-for-one swaps, 10 × 10 = 100 two-for-two swaps, and so on.
Consider the model's expression for group payoffs Π L + Π M from Section 3.3, reproduced from equation (9) here: We proceed as in Section 5.1.2 to measure this payoff function in our data. First, note that terms in the group payoff function that do not involve interactions between borrower characteristics drop out of inequality (11), since they appear identically on both 59 An estimation that included more controls could also be informative. However, our dataset is very sparse in individual-level SES data and has no individual-level social network data. We do include income and next year's expected income in estimation detailed in Appendix B.
60 If the larger group in a village has sample size m and the smaller group has sample size n, k is capped at min{n m − 1}.
sides; hence, we can ignore the noninteraction terms, that is, all but the second line. Second, since groups contain more than 2 members and since our data contain a subset of each group (up to 5 members), we use a sample analog expression for the payoff function. As in Section 5.1.2, let G be defined as a set of grouped borrowers, S G as the sampled subset of group G, k as a sampled group-G borrower, p S G −k as the average success probability in the sampled subset of group G excluding borrower k, and κ S G k −k as the average correlatedness dummy of borrower k with other sampled group-G borrowers. Then the sample analog to the (relevant part of the) payoff function is 61 where β 1 = c and β 2 = c . Given data on borrower riskiness (p k 's) and correlatedness (κ i j 's), the β's are identified, but only up to scale, since multiplication by any positive scalar would preserve the inequality. That is, the signs and the relative magnitude (β 1 /β 2 ) are identified. This is precisely what matters for matching. The sign of β 1 , positive in theory, determines whether riskiness types are complements or substitutes, and this drives equilibrium matching patterns in riskiness. The sign of β 2 , also positive in theory, determines whether the group payoff is diversification-averse or loving, which determines how borrowers match along the risk exposure-type dimension. The relative magnitude of the β's quantifies tradeoffs between the two dimensions of matching.
Probabilities of success p k are measured as discussed in Section 4.2; correlatedness is proxied using similarity in worst_year or occupation, as described in Sections 4.2 and 5.1.2. If there are V villages indexed by v, and each village v has two (sampled) groups, L v and M v , the estimator comes from where the alternate groupingsL v andM v come from all k-for-k borrower swaps, as discussed above, and β 1 is normalized to +1 or −1 in estimation given identification is only up to scale. We also estimate based on a slightly different objective function, where the score is the sum of all villages' fractions of correct inequalities rather than numbers of correct inequalities. This weights each village equally in its contribution to the estimation, similar to the univariate KS results.
Maximization is carried out using the genetic algorithm routine in Matlab. Results from four estimations that alternate between the two objective functions and the two proxies for correlated risk are reported in Table 2. The point estimates are based on the Note: Each column corresponds to a different estimation; differences arise from the objective function used (noted atop each column) and the proxies for correlated risk. Pvalues are from one-sided tests for a negative (positive) true parameter if the point estimate is positive (negative). They are constructed using subsampling methods on 200 subsamples, each containing 24 distinct villages.
32 villages with sufficient data, and the corresponding 3767 total inequalities. Inference is carried out by subsampling, as suggested by Fox (2018). 62 We find that the estimated coefficient on probabilities of success is consistently positive. 63 Thus, even when controlling for correlated risk measures, including occupational similarity, riskiness has explanatory power for group formation consistent with complementarity. This supports the model, since complementarity is the basis for homogeneous matching, and hence group lending's improved risk-pricing.
The correlated risk results are also similar to the univariate results. The estimates for worst_year are consistently positive, and significant in one of two cases, suggesting a diversification-averse payoff function. The estimates for occupation are consistently negative, and mildly significant in both cases, suggesting a diversification-loving payoff function. This is the same pattern observed in the univariate results, and may be explained by lender-encouraged occupational diversification combined with antidiversification on other dimensions.
Overall, we interpret these results as supportive of the univariate results, and thus of both aspects of the theory, with the exception noted. 62 For each estimation, we create 200 subsamples containing 24 villages' data, by randomly sampling without replacement from the 32 villages. Estimation is carried out for each subsample. Operating under the assumption of 3 √ n-convergence, appropriate for multiple-market estimation (Fox (2018)), one can apply the distribution of ( 24 32 ) 1/3 (β 24 i −β 32 ) to (β 32 − β 0 ) to construct confidence intervals, where i ∈ {1 200} corresponds to the subsamples,β 24 i are the subsample estimates,β 32 is the full-sample estimate, and β 0 is the true parameter. See Politis, Romano, and Wolf (1999, 2.2). 63 These estimates are denoted super-consistent because they converge at a rate faster than the typical root-n (see also Fox (2018)). Practically speaking, we see more than 99% of subsamples produce estimates equal to +1 in three specifications, and 95% in the fourth.

Conclusion
In the context of joint liability lending and unobserved risk, theory suggests that borrowers will match homogeneously by riskiness; this embeds an implicit discount for safe borrowers and can draw them into the market, increasing intermediation, and improving efficiency. We develop tests of this hypothesis about matching behavior, and find supportive evidence from Thai microcredit groups: groups are more homogeneous in riskiness than random matching would predict. Thus, safe borrowers are likely bearing liability for safer partners and paying effectively lower interest rates. This simple feature of group lending is one plausible mechanism by which credit markets were revived among poor households around the world. However, theory also suggests that borrowers may match to antidiversify risk, in order to minimize expected liability for fellow group members. The data here suggest that some antidiversification is indeed occurring, judging by income though not by occupation.
From a policy standpoint, these results show that voluntary matching by borrowers may also have its downside. Within-group correlated risk works against the lender's interests and, in equilibrium, the borrowers'. The results suggest that lenders may want to intervene to promote risk diversification within groups, by requiring occupational diversity for example, but only if this intervention does not make matters worse by undermining homogeneous matching by riskiness. It may also be optimal to separate borrowers with high versus low correlated risk into different borrowing pools (Ahlin and Debrah (2019)), for example, by having separate contracts or even separate institutions for agricultural versus nonagricultural clientele.
The paper points out several directions for future work. First, the risk and correlation measures used here could be improved upon. Availability of income histories and/or more detailed elicitations of future income distributions could push analysis further, and produce more accurate quantitative results. Second, quantitative results would also be made more accurate with data on all members of village groups, rather than samples of village borrowers. Third, it would be ideal for matching tests to use measures of risk that predate group formation, to distinguish matching behavior from withingroup conformity that occurs after group formation. Fourth, richer datasets that include data on social networks, physical distances, etc., could potentially be used to identify whether risk-homogeneity and antidiversification are purposeful or are by-products of other matching considerations. They could also help quantify and pinpoint matching frictions in these environments. Finally, more research on how microcredit has been able to open new markets is needed to unravel this mystery, and to shed light on what elements were and are critical to its success.

Appendix A: Proofs of propositions
Proof of Proposition 1. Consider an equilibrium assignment. There are six sets into which all equilibrium borrowing groups can be partitioned: AA, BB, NN, AB, AN, BN, where the set names denote the pair of risk exposure-types of all groups within the partition.
The cross-partial of group payoff functions with respect to p i and p j is still given by equation (3). Thus, the baseline result of homogeneous matching holds in any set of groups within which correlatedness is fixed for all possible pairings of borrowers within the set-AA, BB, and NN.
It remains to show that the sets AB, AN, and BN have zero measure in equilibrium. Consider AB, for example. Riskiness complementarity implies rank-ordering within risk exposure-type. That is, if (i j) and (i j ) are equilibrium groups and borrowers i, i (j, j ) are A-risk (B-risk), then one of the following pairs of statements must hold: p i ≥ p i and p j ≥ p j , or p i ≥ p i and p j ≥ p j . Otherwise, the grouping (i j ) and (i j) would raise surplus by increasing payoffs from riskiness complementarity without altering the nature of the exposure-type matching.
Given this fact and if set AB has positive measure, then for any δ > 0, there must exist two groups (i j) and (i j ) with |p i − p i | < δ and |p j − p j | < δ. Fix δ = /4 and two such groups. We will show that with riskiness levels so close, the gains from antidiversification (matching A with A, B with B) outweigh any losses from decreased similarity in riskiness.
Without loss of generality, let (i j) be the safer group, that is, p i ≥ p i and p j ≥ p j . Using equation (6), the sum of both groups' payoffs can be written since no borrowers are exposed to the same shocks. An (i i ) and (j j ) grouping would instead pay 4R − (r + c)(p i + p j + p i + p j ) + 2c(p i p i + p j p j ) + 4c the last term capturing the gains from antidiversification. Now if p j ≥ p i or p i ≥ p j , then the new grouping is rank-ordered by riskiness, so p i p i + p j p j ≥ p i p j + p i p j and surplus has increased. If instead p j < p i and p i < p j , then all four riskiness levels (p i p j p i p j ) are within 2δ of each other, which caps the difference between p i p i + p j p j and p i p i + p j p j at 4δ 2 = . 64 In this case, too, surplus has increased. Since this alternate grouping raises surplus, the matching must not be an equilibrium; we thus contradict the hypothesis that AB has positive measure. By a similar argument, AN and BN cannot have positive measure.
Proof of Proposition 2. Let there be N possible borrower groupings in a given market (here, village), and K ≤ N unique values that arise when the given matching metric is applied to the N groupings, with values v 1 < v 2 < · · · < v K . (Ties involve K < N.) Let n i be the number of groupings that give rise to value v i and N i be the number of groupings that give rise to any value v ≤ v i , with N 0 ≡ 0; then N i = i k=1 n k and N K = N. A village whose grouping gives rise to value v i has matching percentile range of [ The village's matching percentile is then drawn uniformly from its matching percentile range.
We show next that a village's matching percentile z, constructed in this way, is distributed uniformly under random matching, that is, Then the probability that a village's matching percentile is less than z, that is, F(z), is the probability that its grouping leads to any value strictly less than v i plus the probability that its grouping leads to value v i and its percentile picked from the uniform on [ Given that if matching is random, a village's grouping will result in value v i with probability π i ≡ n i /N, this equals:

Appendix B: Other controls
Controlling for risk exposure type and riskiness levels separately (Section 6) revealed that both were independently influential in predicting matching patterns. Controlling for kinship linkages, geographical distance, and monitoring costs would also be informative. Unfortunately, our dataset lacks measures on these. In fact, only a handful of variables in the dataset are individually reported by group members from multiple groups in a village. 65 The two remaining individual-level variables in the dataset that seem potentially useful to control for are current income and next year's expected income. If matching is mainly done along income or class lines, and income is also correlated with risk, we may find that controlling for income eliminates the estimated importance of risk levels for matching.
These two income measures have their strengths and weaknesses. Income is a quite detailed measure in our dataset, based on a number of subquestions about revenues and expenses in various categories, while expected income is a single estimate (made after income is calculated). However, income also contains realized shocks, and so may capture correlated risk within a group, 66 while expected income is shock-free (assuming no serial correlation). Further, expected income is what is assumed equal across borrowers in the theory, while it varies in practice; this suggests that it may be important to control for.
We analyze both income measures, first using the univariate technique to check for salient matching patterns along the income dimension by itself, and then including each in turn with the key riskiness measure using the multivariate technique. 67 Figure 5 shows that matching is moderately homogeneous in expected income, using both variance decomposition and borrower-partner covariance. Mean and median 65 Unfortunately, merging in other datasets from the rich Townsend Thai database seems not to solve this problem; to our knowledge, individually reported data from multiple group members in a village, with group membership identified, exists only in the dataset we are using. 66 For example, if expected income is the same across all borrowers but they match with those exposed to similar shocks, then matching based on realized income will appear more homogeneous than random, since correlated shocks are pushing realized income in the same direction within groups more than across groups. 67 Due to limited sample size, we refrain from testing more than two variables at a time. matching percentiles are around 0 6, and random matching can be rejected at the 15% level and 10% level, respectively. Figure 6 shows a similar degree of homogeneous matching in income. Mean and median matching percentiles tend slightly higher, in the 0 6-0 65 range, and random matching can be rejected at the 1% level and 5% level, respectively. In short, groups are moderately closer to homogeneity in the income dimension than random matching would deliver, using either measure. The matching maximum score estimator allows us to estimate whether multiple dimensions of characteristics are important in the group payoff function that best rationalizes observed matching patterns. We follow the same approach as in Section 6, entering each income measure in turn along with riskiness, measured by borrower probability of success.
Since income does not figure directly into the (relevant part of the) theory's payoff function, we introduce it by adapting one of the homogeneity metrics used, the variance decomposition. 68 Let S L and S M be the samples of groups L and M with sample sizes l and m, respectively. Let y ≡ (y S L The sign of β 2 , which multiplies the between-group variance component, indicates whether income homogeneity or heterogeneity is valued in the group payoff function. This payoff function is used in the same matching maximum score estimation approach detailed in Section 6. We alternately use income and expected income, and alternate between an objective function that counts the number of inequalities correct, and one that counts the fraction of each village's inequalities correct (weighting each village equally). Table 3 reports results. The estimated coefficient on probability of success is positive when expected income is included, 69 and homogeneity in expected income appears not to matter for group payoffs. This result corroborates earlier results while controlling for expected income, which is held fixed in the theory; matching on level of expected income does not explain the risk-matching results we have seen. If anything, riskiness ap- Note: Each column corresponds to a different estimation; differences arise from the objective function used (noted atop each column) and the income measure. P-values are from one-sided tests for a negative true parameter. They are constructed using subsampling methods on 200 subsamples, each containing 24 distinct villages. pears to be driving the univariate matching results for expected income (Figure 5), not the reverse.
The results using income are mixed. Probability of success turns negative using the unweighted objective function, but remains positive using the village-weighted objective function. 70 Homogeneity in realized income has a strongly positive and significant coefficient in the first case, but a positive and insignificant result in the second case. We hesitate to interpret these results as significant evidence that risk homogeneity is being driven by income sorting. For one, they are not robust. Second, as discussed above, homogeneity in realized income can also proxy for antidiversified matching. This seems likely to be part of the explanation since expected income, which is arguably shock-free, showed no effect.
In sum, we find little evidence that homogeneous matching by risk is driven by income sorting.
Appendix C: Lemmas with proofs Lemma 1. Given a set of n borrowers with real-valued types, define a "grouping" as an assignment of these borrowers into two nonempty and disjoint sets, or "groups." The between-group variance is maximized, over all groupings preserving group sizes, in a rank-ordered grouping. 71 Proof. A maximum clearly exists over this finite choice set, so we prove the statement by showing that any grouping that is not rank-ordered does not maximize the betweengroup variance. Fix a set of n borrowers with real-valued types p, and grouping G that 70 That said, only 57% of subsamples produce an estimate of −1 in the first case, while 82 5% produce an estimate of +1 in the second. 71 A rank-ordered grouping is one in which all borrower types in one group are weakly larger than all borrower types in the other group.
Returning to the lemma's assumptions, fix a set of n borrowers and a set of group sizes n ·1 and n ·2 , n ·1 +n ·2 = n, with 0 < n ·1 ≤ n ·2 < n. By assumption that a perfectly homogeneous grouping exists, there are at most two types represented among these n agents. The case of only one type is trivial. Given two types, it must be that (choosing labels appropriately) n 1· = n ·1 ≡ n 1 and n 2· = n ·2 ≡ n 2 . The (relevant part) of the chi-squared statistic is then n 11 2 /n 1 2 + n 12 2 + n 21 2 /(n 1 n 2 ) + n 22 2 /n 2 2 = n 11 2 /n 1 2 + (n 1 − n 11 ) 2 + (n 2 − n 22 ) 2 /(n 1 n 2 ) + n 22 2 /n 2 2 where the equality uses n 11 +n 12 = n 1 and n 22 +n 21 = n 2 . It is straightforward to show that this statistic is strictly convex as a function of both n 11 and n 22 , and thus maximized at corners. For n 11 , the two corners are n 11 = 0 and n 11 = n 1 ; the latter implies that n 22 = n 2 and gives a statistic of 2, while the former implies n 22 = n 2 − n 1 and gives a statistic of 1 + n 1 2 /n 2 2 . If n 1 < n 2 , then n 11 = n 1 uniquely maximizes the statistic; this corresponds to the perfectly homogeneous grouping involving n 11 = n 1 and n 22 = n 2 . If n 1 = n 2 (= n/2), the two corner solutions give the same statistic and the same perfectly homogeneous grouping, with either n 11 = n 22 = n/2 or n 21 = n 12 = n/2.
Lemma 4. Given a set of n borrowers with real-valued types, define a "grouping" as an assignment of these borrowers into two disjoint sets, or "groups," each with at least two borrowers. One grouping has a higher borrower-partner covariance than another iff it generates a higher sum of payoffs.
Proof. Fix a set of n borrowers with types (p 1 p n ) and average type p = n j=1 p j /n, and grouping G = {L M} with L = (p 1 p k ) and M = (p k+1 p n ). Let p L −j be the average type in group L leaving out borrower j, and similarly for p M −j . The sum of payoffs 73 in G is, adapting equation (8) The borrower-partner covariance is C = S/n − p 2 (see equation (13)). Since n and p are invariant across groupings, it is clear that, for grouping G with sum of payoffs S and covariance C , S > S iff C > C (and S ≥ S iff C ≥ C).