Religious Exiting and Social Networks: Computer Simulations of Religious/Secular Pluralism

Statistical models attempting to predict who will disaffiliate from religions have typically accounted for less than 15% of the variation in religious affiliations, suggesting that we have only a partial understanding of this vital social process. Using agent-based simulations in three “artificial societies” (one predominantly religious; one predominantly secular; and one in between), we demonstrate that worldview pluralism within one’s neighborhood and family social networks can be a significant predictor of religious (dis)affiliation but in pluralistic societies worldview diversity is less important and, instead, people move toward worldview neutrality. Our results suggest that there may be two phases in religious disaffiliation: (1) the early adopters initially disaffiliate regardless of social support, and subsequently (2) disaffiliation spreads as support for it within local social networks widens and it appears more acceptable. An important next step is for sociologists to confirm or correct the theoretical findings of this model using real-world social-network data, which will require overcoming the measurement difficulties involved in estimating each individual’s degree of local network pluralism.


Introduction
Statistical models have consistently found age, sex, educational attainment, income, race, political views, and geographic region (in the US) to be important correlates of religious non-affiliation and atheism (Glenn 1987;Hadaway 1980Hadaway , 1989Altemeyer and Hunsberger 1997;Strawn 2019). However, there are some problems with these variables as an explanation for why people leave religion. As Strawn (2019) illustrates, the ability of these variables to predict who will exit religion and who will stay has varied from study to study and from region to region (Norris and Inglehart 2004;Storm 2017Storm , 2009Voas 2003Voas , 2007Voas , 2014Hayes 2000). Not every study has included the same variables despite these being common demographic considerations (Uecker, Regnerus, and Vaaler 2007) and some studies have focused more on people switching religions (Sherkat 2001(Sherkat , 2014Hadaway and Roof 1979) than on people leaving religion altogether Smith 2009, 2015;Cragun 2007). While useful correlates, most of these variables are either constant to the individual (e.g., race, sex, geographic region) or vary only slightly across the life course (e.g., income, political views). As a result, it is difficult to develop a causal model of how these variables lead people to disaffiliate from religions. Of greatest interest for this paper is that the amount of variation explained in who leaves religions using these variables has never been very high. This last problem is particularly important as it suggests that even when the nonreligious are a smaller percentage of the population and, thus, it should have been easier to predict who would be the earliest to leave, our ability to do so has been limited (Kanazawa 2010;Rogers 2006;Tamney, Powell & Johnson 1989).
Given the limited amount of variation explained in why people disaffiliate from religions, we wondered whether the reason why so many models so poorly predict religious exiting is because they are missing a variable that is particularly challenging to measure: religious pluralism. Religious pluralism is challenging to capture because it is an emergent property of social life at the macro-level as well as a property of individuals' social networks. The concept of pluralism as it relates to religion and/or secular life stems from the early work of Peter Berger (1967Berger ( , 1990 and suggests the following: as the proportion of individuals in one's social network who hold different worldviews increases, the presumed plausibility of any single worldview decreases, which may lead to declining religiosity. Berger's contention extended Durkheim's ([1895Durkheim's ([ ] 2014 line of inquiry about the ways in which the division of labor (and general social fragmentation) in modernity partitioned the ' collective conscience' of society. In Berger'sand for that matter Durkheim's-conceptualization, it is more difficult for people to maintain an exclusive, strict religious worldview that marginalizes all other worldviews when they are surrounded by people who don't think like they do (Phillips 1998).
While the concept of worldview pluralism is theoretically attractive and promising for increasing the predictive power of religious exiting models, operationalizing and measuring religious/secular pluralism has proven to be challenging (Hill & Olson 2009;Perl & Olson 2000;Voas, Olson & Crockett 2002). Recent research and advances in understanding social networks have begun to address this concern (Baker & Smith 2009;Scheitle & Smith 2011) and a recently published paper has shown that these methodological challenges can be overcome with a substantial amount of work (Olson et al. 2020). Most prior research has focused on the role of social networks in propping up religiosity (Hill 2014), reinforcing ties to congregations (Stroope 2012), helping people draw on religion for support (Merino 2014;Lim & Putnam 2010), or recruiting people into religions (Stark & Bainbridge 1980). We are aware of just two prior quantitative studies that examined the role of social networks in facilitating people's exit from religion (Baker & Smith 2009;Gore et al. 2018; see Lee 2015 for a qualitative approach to this question).
Computer modeling and simulation is a relatively new approach to analyzing human behavior that can provide insights into the extent to which worldview pluralism is important for secularization. Agent-based simulation has a number of advantages over cross-sectional data analysis. Simulated societies can be generated with specific properties to test theories. Additionally, simulated societies that include social networks and social network interactions -data that are not always included in cross-sectional surveys -can reveal phenomena such as the worldview pluralism that exists within an agent's social network, allowing for a clearer analysis of whether pluralism influences people's decisions to leave religions. Additionally, similar to longitudinal studies, computer simulations can observe changes in worldviews that result from changing social networks. However, moving beyond the capacities of longitudinal studies, computer simulation experiments can also control a variety of factors in an artificial society in order to tease out the effects of specific variables. By setting the initial parametric conditions of the simulation using data drawn from sociology and psychology, researchers can test numerous social scientific theories against one another in a simulated artificial society, including the hypothesis in secularization theory that network pluralism increases secularization. Computer simulations, in effect, offer social scientists the opportunity to ' experiment' in ways that would otherwise be unethical or impractical, thereby providing them with the potential to answer questions that have so far been out of reach for social scientific research.
In this paper, we briefly review the literature on the variables that predict religious exiting -people who leave religion altogether (Cragun & Hammer 2011;Enstedt, Larsson & Mantsinen 2019) -and the literature on religious pluralism. We then illustrate how computer simulations have the potential to answer some questions that have eluded more traditional statistical analytic techniques. Such answers based on simulation experiments should inspire sociologists to confirm or correct the theoretical findings of this model using real-world social-network data, despite the measurement difficulties involved in estimating each individual's degree of network pluralism.

Literature Review
Decades of research exploring the characteristics of religious exiters has found that they are somewhat distinctive from those who retain a religious affiliation (Baker & Smith 2009;Vernon 1968;Hadaway 1989). Exiters have historically been more likely to be single, young, male, highly educated, white (in the US), and located in coastal or urban areas; they also have higher incomes and hold more progressive political views (again, in the US; see Kosmin et al. 2009; Pew Forum on Religion 2012).
However, recent research has shown that the religiously unaffiliated in the US are becoming more and more representative of the population as a whole (Strawn 2019). The most obvious explanation for this is that the nonreligious are becoming an increasingly large segment of the entire population. As the nonreligious expand in size, they must necessarily begin to look like the population in general because they are more of the population. Strawn (2019) shows that several formerly important correlates of disaffiliation are no longer strong correlates, such as age, sex, educational attainment, and income. While atheists -a subset of the nonreligious -remain distinct in a number of ways (Cragun 2014), the growth of the nonreligious in the US has reduced the distinctiveness of the nonreligious, just as it has done in other countries where the nonreligious have seen rapid growth, such as Canada (Thiessen & Wilkins-Laflamme 2017 and the UK (Voas & McAndrew 2012;Voas 2015;Voas & Crockett 2005). As those without a religious affiliation, or those without any religious beliefs whatsoever, become more common in the population, their demographic and psychological profile will, by definition, become more and more representative of the statistical norm.
Despite having ascertained that there are a number of ways in which the nonaffiliated are (or were) distinct from the religious, scholars' ability to predict who would leave religions and who would stay has never been very good. In Strawn's (2019) logistic regression models for various time periods, he is never able to account for more than about 13% of the variation in who is affiliated with a religion and who is not. Uecker et al. (2007), who include some additional behavioral variables in their models predicting who affiliates with a religion and who does not (e.g., smoking marijuana, cohabiting), were able to account for just 6% of the variation in who leaves religions. To our knowledge, the most robust models predicting religious exiting are those of Baker and Smith (2009) who included some measures of social networks (e.g., parental affiliation status; friends' affiliation status, spouse's affiliation status) and were able to account for between 21% (Cox & Snell R 2 ) and 45% (Nagelkergke R 2 ) of the variation in religious affiliation. Without the social network variables, Baker and Smith were only able to account for about 9% (Cox & Snell R 2 ) or 18% (Nagelkergke R 2 ) of the variation in religious affiliation. In sum, there is limited research that compellingly predicts who remains affiliated with a religion and who leaves, though the models with the best predictive power included measures of social networks.
The inclusion of the religious affiliation or religious worldview of members of an individual's social network into a statistical model is likely the most appropriate way to capture the religious/secular pluralism suggested by Berger (1990). As noted above, Berger proposed that higher levels of ideological and demographic pluralism would reduce religious worldview plausibility from a taken-for-granted reality to a mere private preference, and that this undermining of ideological certainty would reduce the authority of any one religious worldview in society.
In his early work, Berger was convinced that secularization was an inevitable outcome of demographic and ideological pluralism, but he would come to soften this stance later in his career. His late-career argument -that pluralism merely provided more religious worldview options, and that this would not necessarily lead to secularization -assumes that people are motivated to discern between religions in order to select faith traditions they regard as superior. This assumes that peoples' options have broadened, but their motivation to adopt religious worldviews stays the same. We find this implausible. The quest for a superior religious worldview would surely be time-intensive and emotion-intensive. Many busy people in modern societies may not have time or energy to pursue an intensive search for religious 'truth', especially if, on Berger's account, no faith is perceived to hold any legitimate claim to truth over any other in a pluralistic society (Cotter 2017). Many would not be interested in such a quest, not least because of potential social penalties. For example, searching for a religious 'truth' tradition could alienate those individuals in one's (pluralistic) network who happen to have come to different theological conclusions.
We conjecture that Berger was reluctant to construe pluralism as necessarily contributing to secularization because he underestimated the degree to which the motivational component (a strong emotional desire for meaning and order conferred by a 'sacred canopy') might be attenuated in increasingly materially secure societies. Material security changes peoples' motivational states (e.g., Inglehart 2018), such that they are relatively more open to change as well as to demographic and ideological diversity. We recognize that worldview pluralism in a society increases options for worldview adoption. This is true by definition. Yet, without a (strong) motivation to sift through all religious worldviews in order to select that which is ' optimal/superior,' researchers should parsimoniously presume that people are filling their time with more immediate matters such as finding a life partner, getting a college degree, or securing a job, as Sherkat (2014) suggests. Relatedly, researchers can parsimoniously presume that, in a pluralistic society, people will tend to avoid asserting worldview superiority in a way that alienates members of their pluralistic networks. Insofar as these latter assumptions are more plausible, we expect network pluralism to have a direct negative effect on religiosity.
Early attempts to capture the influence of religious/secular pluralism were problematic as they tended to focus on religious/secular diversity at macro-and meso-levels and not within the immediate social network of the individual where the effect of pluralism would theoretically be strongest because it is the most proximate (Stark & Bainbridge 1996;Perl & Olson 2000;Voas, Olson & Crockett 2002). Much of this research was rooted in the belief that Berger was wrong because in the US context, religious competition -a direct side effect of pluralismincreased religiosity as religions competed for adherents, leading to religious innovation and improved 'supply' of religion (Stark & Finke 2000). Counterexamples of higher levels of religiosity in religious monopolies challenged these claims (Phillips 1998). Eventually, scholars realized that pluralism at the macro-or meso-levels is less relevant than they thought to individual decision processes about religion and nonreligion. As Phillips (1998) illustrated, Mormons in the US may make up just a tiny sliver of the population (between 1% and 2%), but their minority status at the national level is not manifest at the local level where they make up the majority. In such situations, Mormons function as a majority, policing the religiosity of fellow members (Phillips 2018), which limits religious exiting. Their localized majority status allows them to assume the privileges of the religious majority by marginalizing secular people and non-Mormons (Abunuwara, Cragun & Sumerau 2018). What more recent research has shown is that people live in relatively small and limited enclaves and tend to surround themselves with others who are similar to them (McPherson, Smith-Lovin & Cook 2001;Olson & Perl 2011). Thus, to understand how worldview pluralism influences the individual, scholars should also focus their attention on the micro-or individual-level rather than only on the macro-or meso-level.
Once it became clear that macro-or meso-level pluralism alone is not a compelling explanation for either strengthening religiosity or reducing it (Voas, Olson & Crockett 2002; though see Olson et al. 2020), scholars turned toward understanding the influence of social networks, which are more localized. A number of studies have suggested that social networks are important when it comes to religiosity. Social network ties within congregations have been shown to increase religiosity (Stolzenberg, Blair-Loy & Waite 1995;Cavendish, Welch & Leege 1998;Stroope 2012), result in higher levels of happiness or subjective well-being for those who are religiously devout (Lim & Putnam 2010;Edling, Rydgren & Bohman 2014;Schafer 2013), and improve the health of religious individuals (Ellison et al. 2009;Stroope & Baker 2018). Scholars have also established the importance of social networks for recruiting individuals into religions (Stark & Bainbridge 1980;Aho 1990).
Given the role of social networks in recruiting people into religions and maintaining their religiosity, it is somewhat surprising that just two studies (of which we are aware) have examined the role of social networks in explaining why people leave religions, while virtually no research has assessed the network structure differences between religious and secular social networks (McCaffree & Saide 2017). As noted earlier, Baker and Smith (2009; see also Baker & Smith 2015) incorporated social networks in their models predicting religious disaffiliation. In their models, they incorporated four social network measures: whether parents (separately) were unaffiliated, whether friends were unaffiliated, and whether someone's spouse was unaffiliated. With spouse's and friends' affiliation status included in the models, parental religious affiliation was no longer a significant correlate of religious disaffiliation, a finding that aligns with other research about the shifting importance of parental religiosity during the life course (Arnett & Jensen 2002). Even so, the amount of variation explained in who leaves religion more than doubled by including measures of social networks, illustrating just how important social networks are for making sense of secularization processes.

Theoretical Framework
To illustrate our theoretical approach, Figure 1 displays four social networks. For much of human history, most individuals have been surrounded by other individuals who shared their worldview (Diagram A). In such an environment, rejecting the dominant worldview or adopting an alternative worldview is extremely challenging because it invites social rejection or punishment. Rejecting dominant worldviews when they are pervasive in one's social network will likely be restricted to a small subset of people and is likely driven primarily by biological and psychological factors (Kanazawa 2010;Freese 2004;Freeman forthcoming;Altemeyer & Hunsberger 1997), as well as differences in experiences. Scholars have established that, for as long as there have been records of religion there have also been dissenters who reject the gods (Whitmarsh 2016), sometimes vocally (Jacoby 2005) but other times in secret in order to avoid persecution (Hecht 2004). Such individuals will have a proclivity to reject supernatural belief, will be dispositionally inclined toward openness (Williams & Roberts 2016; though see Gurney et al. 2013;Saroglou 2002), and will be able and willing to suffer the consequences of their decisions (Rogers 2006;Edgell, Frost & Stewart 2017).
Diagram B in Figure 1 illustrates a specific social network scenario: imagine an individual (EGO) ends up in an environment in which all other people (ALTERS) have a uniform worldview, different from that of EGO. Social psychological research has established that pressure within such social networks induces most humans to conform (Asch 1955). Of course, there are always exceptions where people go against the grain, but these people typically constitute a (stigmatized) minority in very homogeneous social environments.
Diagram C in Figure 1 illustrates a social network in which the EGO has contacts with just a small number of ALTERS who have different worldviews. In such a social network, the worldview of EGO could potentially go two ways. EGO could find the challenge of ALTER to their worldview threatening and turn to their current worldview for support and comfort (Kastenmüller et al. 2011;Vail et al. 2010). Alternatively, if EGO does not find the worldview of ALTER threatening, having sustained, cooperative contact with ALTERS who do not share EGO's worldview could lead to reduced levels of prejudice against alternative worldviews and a softening of the exclusivity of EGO's worldview (Allport 1979).
Diagram D in Figure 1 describes a situation in which there is extensive worldview pluralism. In this case, EGO is connected to a number of ALTERS, all of whom have different worldviews. In such a metropolitan, pluralistic environment, we argue that the result is a move toward neutrality, toward a worldview that is maximally accommodating of diverse worldviews: secularity. To avoid needing to arbitrate between the worldviews of the ALTERs, and to reconcile the fact that EGO is surrounded by a diverse collection of ALTERs, we propose in line with other scholars (Berger 1990;Berlinerblau 2013) that EGO will move toward a secular worldview. In a globalized, modernized, pluralistic, and interconnected environment, maintenance of an exclusive, strict religious worldview is difficult as it is hard to reconcile one's awareness that ALTERs who have a different worldview than EGO are both good people and think differently about the world. Thus, worldviews containing tenets that might judge or ostracize members of one's social network are de-emphasized. Theoretically, over time and across generations, this process-a social 'selection' process for beliefs that avoid ostracizing demographically different others-can lead to the disappearance of parochial, intolerant tenets within worldviews, as well as possibly a stout resistance to parochial intolerance, particularly when it careens toward prejudice or violence.
Our theoretical model suggests that there are two stages of religious disaffiliation or secularization. In the first stage, when religious affiliation is nearly universal, it is only a small subset of individuals who are willing and able to reject the dominant worldview. Such individuals have the characteristics of early adopters: they are young males who belong to the dominant racial/ethnic group, welleducated, open-minded, and have high incomes (Rogers 2006). These individuals are able to reject the dominant worldview because they are highly privileged and can afford the blow to their social status that results from nonconformity in one aspect of their life: rejecting religion (Edgell, Frost & Stewart 2017).
In the second stage of religious disaffiliation or secularization, as the proportion of the population that is non-affiliated increases, leaving religion is driven more by social network ties than it is by risk-taking early adopters (Baker & Smith 2009). As the world globalizes and individuals develop ties to a wider array of people with diverse worldviews, the trend is toward non-parochial, inclusive secular worldviews rather than more exclusive, religious worldviews (Bruce 2013;Berlinerblau 2013). This could explain why the demographic characteristics that had distinguished the religiously unaffiliated have diminished in their strength (Strawn 2019). In a number of locations around the world, such as the coastal regions of the US, the UK, Australia, New Zealand, much of Europe, and various other countries, secularization is in its second stage. Recent research suggests that even in the Arab world, where it is extremely risky to leave religion, secularization is occurring and is likely in the first stage, where those who are leaving have the characteristics of early adopters (Dale et al. 2019). Even in this part of the world, however, emerging research on former Muslims indicates that the decision to build diverse online social networks (often using anonymous screen names) is a strong driver of leaving Islam (McCaffree forthcoming). Of course, these two stages exist within the broader secularization framework detailed by scholars such as Bruce (2012) that is driven by a variety of socio-economic factors such as rising per capita incomes and individualism.
Of particular interest in these social networks is the potential role of ' credibility-enhancing displays' (CREDs). This phrase was coined by Henrich (2009) in the context of his development of a cultural-evolutionary model that (under certain conditions) generates a high-cost equilibrium state for an entire population frequently engaged in costly signaling practices, as well as a low-cost equilibrium that is more readily explicable in evolutionary terms. In addition to solving a puzzle about the evolution of costly signaling behaviors, Henrich's work also suggested that CREDs are an important factor in the emergence and maintenance of religious beliefs and behaviors, and fueled a growing interest among scholars in the bio-cultural study of religion in the role of context biases (as well as content biases) in the origin and spread of religiosity (Gervais et al. 2011). Since then, several empirical studies have provided evidence for the claim that CREDs influence the adoption and transmission of religious beliefs (Gervais & Najle 2015;Maij et al. 2017;Willard & Cingl 2017). Enthusiasm about the implications of these findings for theories of cultural evolution might lead some scholars to downplay the role of cognitive mechanisms in these transmission processes, but most scholars studying CRED theory acknowledge or even emphasize the importance of accounting for both cognitive and contextual biases in explanations of religious belief and behavior ( Insofar as the theory predicts that CREDs will have an amplifying effect on the religiosity of a population, it also has obvious relevance for the study of nonreligion and secularization. Several of the studies cited above highlight the role of (a lack of) CREDs in predicting religious unbelief or disaffiliation. One recent study found a robust relation between (lack of) CREDs in an individual's experience and environment and the likelihood of that individual being an atheist, but also called for attending to the ways in which other variables can modify the effect of CREDs on nonreligion (Gervais et al. 2020;Langston et al. 2018). Another recent article highlighted the potential role of hypocritical or ' credibility-undermining displays' (CRUDs) as a factor in the rejection of religion. When people are confronted with immoral or inconsistent behaviors by individuals considered religious paragons (e.g., pedophilia scandals among priests), they might reconsider their religious affiliation and eventually reflectively reject identification with and participation in the group, possibly abandoning the associated supernatural beliefs (Turpin, Andersen & Lanman 2019).
All of this suggests that, while CREDs are no doubt important in the cohesion and cooperation of religious coalitions, we need empirical methods that can account for other variables and mechanisms at the same time. The first agent-based model that engaged Henrich's CRED theory extended his approach by creating an artificial society populated with agents having cognitive capacities such as skepticism, charisma, and sensitivity, and clustering in groups with diverse characteristics including the degree of costly signaling required to belong (Wildman & Sosis 2011). As explained below, the model presented in the current article is an attempt to extend the discussion even further by incorporating CRED theory into a broader, more comprehensive theoretical architecture that includes a wide variety of other variables and parameters.
In what follows, we use a computer simulation to illustrate the importance of social network pluralism and credibility-enhancing displays in understanding why people leave religions. The collective influence of the social network is an emergent property of social interaction modeled in the computer simulation. We follow Berger's early work (Berger & Luckmann 1967) in theorizing that pluralism exerts a causal force on individuals, resulting in their perception that the ideological commitments of those in their social network have shifted in intensity, leading many to follow suit.

CRED Model
The CRED model is an extension of the Simulation of Extended Time Integration (SETI) model and has been outlined in more detail elsewhere (Puga-Gonzalez et al. 2019;Shults et al. 2020). A complete ODD+D protocol of the model can be found in the supplemental materials and is available on GitHub. Here we provide a brief description of the main features and procedures of the model that are most relevant for the present study.

Agents
The artificial society represents the city of London and is inhabited by individual 'human' agents who attend school, work, marry, and reproduce. They are categorized as belonging to a majority or a minority group. They have variables related to demography (age, majority/minority group, education, employment, etc.); to personality (the HEXACO factors plus charisma, susceptibility, frustration, motivation to join a club (MTC) and club tolerance (CT)); to worldview (WV; from secular to religious on a continuum between [0, 1]); and to religious affiliation. Religious clubs are membership organizations that exist to support agents with a religious WV. Agents affiliated to a religious club tend to have WV values in the religious spectrum [0.5, 1.0]; but agents with a secular WV may also affiliate with religious clubs. Agents have memories of interpersonal encounters and the cognitive capacity to evaluate the (in)consistency of CREDs displayed by others. Due to CRED interactions, agents may change their WV and (dis)affiliate from religious clubs. Note that this CRED model assesses a single religious organization and identity that varies in intensity but not type. In other words, religious clubs in this simulation are not represented in a way that allows us to examine qualitatively distinct religious traditions. Instead, the present simulation allows for us to analyze the impact of quantitative increases in worldview religiosity.
On initialization, agents are assigned variables drawn from suitable distributions that vary according to the group they belong to (majority or minority) and are allocated to a living location (neighborhood) at random. Agents attend school for at least 16 years and then move to the work force. Once in the work force, the likelihood of (un)employment depends on agents' sex and group category. After becoming employed, agents move to the neighborhood in which their employer is located. Agents die with a certain probability or if they reach their life span. Agents may get married after reaching an age threshold; to get married, agents must satisfy age, education, and worldview compatibility conditions. After marrying, agents moved to the neighborhood of the employed partner, if neither was employed, they moved to a neighborhood at random; if both were employed, they moved to the neighborhood of the partner with the highest authority level. Once married, agents may have children; newborn children are allocated to their parents' neighborhood and inherit their parents' HEXACO personality traits.
Other personality traits such as worldview, charisma, susceptibility, frustration, etc., are derived from the inherited HEXACO personality values (Figure 2).

CRED Interactions
On a weekly basis (52 times a year), each agent holds a CRED interaction with a randomly selected agent from each of its three different social networks: family (mother, father, and spouse), worldview club (if affiliated), and neighborhood. Agents must be 12 years or older to interact. CRED displays have values ranging on a continuum between [-1, 1]. Thus, they can be positive/credibility enhancing (CRED) or negative/credibility undermining (CRUD). The intensity of the CRED display depends among other things on the type of WV (religious or secular) of the exemplar, the exemplar's charisma, the observer's susceptibility and age, as well as the age difference between exemplar and observer (see protocol for a detailed description). The consistency of a display depends on the exemplar's conscientiousness, frustration, worldview, and club affiliation. Exemplars who are not frustrated, highly conscientious, religious, and affiliated with a club will tend to display consistent CREDs. Exemplars who are very frustrated and low in conscientiousness, as well as agents with a secular WV affiliated with a religious club will tend to send inconsistent CREDs (i.e. CRUDs). Additionally, secular agents may interpret CREDs from religious agents as CRUDs. The likelihood of this happening is determined by the degree of secularity of the agent.

Modulators of CRED intensity
After the exemplar has displayed a CRED or a CRUD to an observer, two other factors further modulate the intensity of the display: pluralism and an existential security index. Given the importance of the pluralism index on the results of the present study, this calculation is explained in detail. The pluralism index represents the heterogeneity of WV values that an agent experiences in its close (family) and broader (neighborhood) environment. This index varies between [0, 1] and is calculated as follows: The first element represents the absolute (Abs) deviation of the agent WV value (Ego_WV) from the average WV value of its family (Fam_WV_Ave) and the second element represents the absolute (Abs) deviation of the agent WV value from the average WV value of its neighborhood (Neigh_WV_Ave). Q represents the weight (importance) given to the family in relation to the neighborhood. The pluralism index will be 0 (homogeneous WV) when the WV value of the agent is exactly the same as that of the average of its family and neighborhood, and it will be 1 (heterogeneous) when its completely the opposite of the average of its family and neighborhood.
The effect of pluralism on CRED intensity is then turned into a homogeneity score, or the inverse of pluralism. It is measured as: Homogeneity score = 1 -(Pluralism Index/2), and this homogeneity score then multiplies the CRED intensity value: CRED Intensity * Homogeneity score. Hence, a homogeneous pluralism index will have no effect on the intensity of the CRED; a heterogeneous index will mute the intensity of the CRED by a max of 50%. As the wording here is somewhat counter-intuitive, we want to be clear in how we are interpreting the 'homogeneity score' throughout the manuscript. A 'high' homogeneity score is a reference to the actual value of the score -closer to 1. A high homogeneity score implies a homogeneous society and will result in a smaller reduction in CRED intensity. A 'low' homogeneity score is also a reference to the actual value -closer to .5. A low homogeneity score implies a heterogeneous or pluralistic society and will result in a larger reduction in CRED intensity. In short, a 'high homogeneity score' has minimal influence on CREDs while a 'low homogeneity score' has a larger influence on CREDs, reducing their intensity.
The existential security index is the other modulator of CRED intensity. This index may not only mute but also amplify the intensity of a CRED. Importantly, this enhancement/dampening occurs only on CREDs from religious exemplars. Existential security is calculated from an equation involving two elements: the income class of the agent adjusted by the human development index (HDI) of the society, and the degree to which an agent perceives social threats (expressed by the agent's variables for shared norms (between minority and majority) and out-group suspicion). The existential security index varies between [0.5, 1.5], meaning that, at its lowest value, when existential security of the agent is at its minimum, religious CREDs will be amplified by 50%; and at its highest, when existential security of the agent is at its maximum, religious CREDs will be dampened by 50%.

Effect of CREDs/CRUDS on agents' WV and frustration
After the exemplar makes a CRED display to the observer, the observer's WV and frustration are updated according to the paths followed in two decision trees, one for religious agents and another for secular agents (Fig. 7 in ODD+D protocol). Both decision trees consider, among other things, whether the observer and exemplar are affiliated with a club, the WV value of the exemplar, and the openness personality trait of the observer. The leaves of the trees illustrate the effect that a CRED or a CRUD has on the WV and frustration variables of the observer: updates may increase, decrease or leave equal the WV and frustration values of the observer.
(dis)Affiliation with/from religious clubs Religious clubs are the only type of club included in the model. When the increase in frustration is so high that it surpasses the agent's club tolerance (Figure 2), the agent disaffiliates from their current religious club. Further, if frustration passes the agent's specific motivation to join

Openness influences initial WV value of the agent; agreeableness influences susceptibility; extraversion influences charisma; honesty and conscientiousness influence club tolerance (CT); emotionality and extraversion influence motivation to join a club (MJC); and conscientiousness and frustration influence CRED consistency. Observing others display CREDs may change/reinforce agent's WV values and may increase/decrease their frustration. High frustration may lead to club disaffiliation and/or reaffiliation via CT and MJC.
a club threshold (Figure 2), the agent then joins a new religious club. The club that the agent joins is the one from which it remembers the most intense CRED display. When the agent is secular, there is still a probability for the agent to join a religious club. This probability is inversely proportional to the agent's degree of secularism. In other words, the closer the agent's WV value to the religious spectrum (~ 0.5), the higher its likelihood of joining a religious club. Again, the club that the agent joins is the one from which it remembers the most intense CRED display.

Simulations and Data Collection
In a previous study, we sampled the parameter space (29 different parameters) and ran 1,500 simulations with different combinations of these parameter values. In that study we showed that by sampling the parameter space, the model was able to generate societies among which there was a large variation on the average WV values and percentage of agents affiliated with a religious club. The factors driving the average WV values and percentage of affiliation at the society level have been analyzed elsewhere (Puga-Gonzalez et al. 2019) and are beyond the scope of the present study. Our aim here, however, is to understand the mechanisms driving affiliation/disaffiliation at the individual level and in different types of societies. To do so, from the societies previously simu-lated, we chose three. Two were on the opposite ends of the spectra of average values of WV and affiliation and one was in the middle: 1) high WV/high affiliation, 2) low WV/ low affiliation, and 3) low WV/medium affiliation ( Table  1). In each of these societies, we used logistic regression models to examine the factors ( Table 2) that increased/ decreased the odds of affiliation of an agent with a religious club. Each simulation had a duration of 30 'years', and every year we collected data at the individual level ( Table 2).

Statistical analyses
To analyze the data we used the R statistical software package version 3.5.1 (R Team, 2015) and proceeded as follows.
From the data collected at the end of the simulation  (year 30), we first built a correlation matrix between the agents' response variable ' affiliation' with a religious club (1 = affiliated, 0 = not affiliated) and each explanatory variable ( Table 2). Given that the response variable ' affiliation' was binomial, as a correlation coefficient we used the Cramer's V association index (derived from a chi-squared test) when the explanatory variable was categorical; when the explanatory variable was numeric we used the square root of the R 2 (derived from a linear model). From these correlation matrices we identified the degree of correlation among the explanatory variables and between each explanatory variable and the response variable. Then, the explanatory variables included as predictors in the General Linear Models (GLM) models were selected according to the following criteria. First, if explanatory variables were highly correlated with each other (r > 0.5) or were more highly correlated than with the response variable, then the explanatory variable with the highest correlation with the response variable was kept and the other explanatory variables were excluded in order to avoid collinearity. This was the case for several of the demographic variables such as age, education, generation, occupation, marital status, and number of children. Second, if the correlation coefficient between the explanatory variable and the response variable was below 0.05, then the explanatory variable was excluded. A correlation coefficient of 0.05 means that the variable explains only 0.25% of the variance. Thus, our threshold was liberal since we included explanatory variables with a potentially low explanatory value. Then we ran a logistic regression model (family = binomial (link = logit)) for each society. Given that in two of the three societies, pluralism appeared to have the highest effect on the odds of affiliation (see results), we decided to further explore this variable in these societies. To do so, we ran linear mixed models where the response variable was the percentage of agents affiliated with a religious club at the neighborhood level, fixed factors were simulation year and average neighborhood homogeneity score, and the random factor was the neighborhood (Affiliation Percentage ~ Year + Homogeneity Score + (1|Neighborhood)). We entered neighborhood as a random factor because the homogeneity score is based on family and neighborhood WV values, so different neighborhoods may have different scores. Neighborhoods with an average of fewer than 10 agents per year were excluded from the analysis. Further, simulation year was included as a control because in some neighborhoods, both affiliation percentage and average homogeneity score were positively (or negatively) correlated with the simulation year. This may immediately cause a correlation between the homogeneity score and affiliation. Thus, to avoid spurious effects, simulation year was entered as a control variable in the linear mixed model. Figure 3 shows the evolution of the average WV values of the population as well as the percentage of agents affiliated with a club during the simulation run for each society type. In the society with high WV and percentage of affiliation, both values tend to increase over time. The opposite can be seen in the simulation with low WV and percentage of agents affiliated. Of greatest interest is what happens in the medium society -both the WV and the affiliation decrease over time.

Results
The logistic regression models show that for the society with a high percentage of agents affiliated, the best predictors of affiliation were being single, openness, income class, and the homogeneity score (Table 3). From these, the homogeneity score accounted for 96% of the total variance explained by the model, or 89% of the variation in affiliation (Nagelkerke R 2 = 0.89). The higher the homogeneity score (i.e., a more homogeneous social network) the higher the odds of affiliation.
The regression model for the society with a low percentage of agents affiliated showed that motivation to join, frustration, the existential security effect, and the homogeneity score were all significant predictors of the probability of agents affiliating with a club (Table 4). From these, frustration and the homogeneity score accounted for 88% of the variance explained by the model (Nagelkerke R 2 = 0.26), with the homogeneity score being the best explanatory variable accounting for 62% of the total explained variance. The lower the homogeneity score (i.e., the more heterogeneous the social network) the higher the odds of affiliation. The regression model for the society with a medium percentage of agents affiliated showed that motivation to join, frustration, the homogeneity score, and income class (lowest class) were all significant predictors of the probability of agents affiliating with a club (Table 4). From these, frustration and the homogeneity score accounted for 92% of the variance explained by the model (Nagelkerke R 2 = 0.26), with the homogeneity score being the best explanatory variable accounting for 58% of the total explained variance. The lower the homogeneity score (i.e., the more heterogeneous the social network) the higher the odds of affiliation.
In all three societies, the best explanatory variable was the homogeneity score. In the society with low values of WV and percentage of agents affiliated, frustration also accounted for 26% of the total variance explained by the model. That frustration had an effect on affiliation is not surprising since affiliation with a club directly depends on the value of frustration: if frustration of agents goes above their motivation-to-join threshold, then agents search for a club to affiliate with. More surprising is the effect of pluralism on affiliation since pluralism has no direct effect on affiliation in the model; instead, pluralism has a direct effect on the intensity of CREDs displayed by agents. When the diversity of WV values experienced by the agent (in its family and neighborhood) is high (a.k.a. a heterogeneous social network), the homogeneity score is low and the intensity of CREDs is decreased. On the other hand, when the diversity of WV values is low (a.k.a. a homogeneous social network), the homogeneity score is high, and the intensity of the CRED is less likely to be  reduced. In other words, the intensity of the CREDs experienced by the agent depend on the diversity of WV values in the agent's family and neighborhood networks. Hence, in societies where the WV of the population is homogeneous (societies with mostly religious or mostly secular WV values), the homogeneity score will keep the intensity of CREDs high and displays will thus have a higher effect on the agents. However, whether homogeneity of WV is on the religious or secular side matters and therefore we observed opposite effects of pluralism in the logistic regression models (Tables 3 and 4). In homogeneous religious societies, the homogeneity score will be high, keeping the intensity of CREDs high. Because most CREDs will come from religious agents, this will reinforce the WV values of individuals and, whenever they get a chance to affiliate, they will do so. Thus, pluralism has a positive effect on affiliation in societies that are predominantly religious ( Table 3). In societies that are homogeneous but with secular WV values, the homogeneity score again keeps the intensity of CREDs high. However, most CREDs will come from secular agents, which will move the WV of agents toward secularism. Consequently, when agents get the chance to disaffiliate from a club they will do so. In the most heterogeneous simulated society, worldview diversity appeared to result in declining affiliation, as shown in Figure 3 and Table 5.
To corroborate this, we zoomed into the societies' neighborhoods, i.e., the level at which pluralism plays a role on the intensity of CREDs displayed by agents. We ran linear mixed models to investigate whether the change in the percentage of agents affiliated at the neighborhood level could be explained by the average homogeneity score experienced by agents living in that neighborhood. In societies with high average WV and percentages of affiliation values, the homogeneity score had a positive effect on the percentage of agents affiliated at the neighborhood level, even after controlling for simulation year (Table 6A). Indeed, Figure 4 shows that there is a clear relationship between the percentage of agents affiliated and the homogeneity score at the neighborhood level.
Regarding the society with low WV values and the low percentage of religious club affiliation, the homogeneity score had a negative effect on the percentage of agents affiliated at the neighborhood level, even after controlling for simulation year ( Table 7, column B). In this case, however, we can see that when plotting the homogeneity score against the percentage of affiliation, in some neighborhoods, affiliation appears to increase when the homogeneity score increases (Figure 5A), which is the opposite of what is suggested by the linear mixed model (Table 7, column B). This strange effect may be explained by the positive correlations between the homogeneity score and the simulation year and percentage of affiliation and simulation year in most neighborhoods (Figure 5B-C; Table 7, columns A and B). Indeed, in those cases in which the correlations of both affiliation and homogeneity with simulation year are negative and significant, the correlation between affiliation and homogeneity is positive and significant (neighborhoods 1 and 5-7 in Table 7, column C). Because of this, we added simulation year as a control variable, which allowed us to hold constant the variation explained by the year of the simulation to explore the effects of homogeneity on affiliation. As a result of holding year of simulation constant, the effect of homogeneity on affiliation becomes negative in all neighborhoods except one ( Table 7, column D). Hence, after controlling for the effect of simulation year, when the secular WV values of agents become more homogeneous, the homogeneity score is high, and the percentage of agents affiliated decreases, at the society and at the neighborhood level (Table 4 and Table 7, column B).
For the society with low WV values and a medium percentage of affiliation, we found that, after controlling for the simulation year, homogeneity was either not significantly related to affiliation or had a small negative effect on affiliation (Table 8, column D, Figure 6). What this seems to indicate is that, when there is WV diversity in a society, CREDs and CRUDs both become less influential on religious affiliation. In line with our theory, worldview diversity leads to more neutral or moderated worldviews.

Discussion
In line with prior research (Baker & Smith 2009;Berger 1967Berger , 1990, we hypothesized that pluralism would be a significant and substantial predictor of religious (dis)affiliation. To test this, we used agent-based computer simulations focusing on three artificial societies: one in which Table 6: Generalized linear mixed models for A) society with high WV and affiliation, B) society with low WV and affiliation, and C) society with low WV and medium affiliation.       the majority of the agents were affiliated with a religion and had religious worldviews, one in which the majority of the agents were not affiliated with a religion and had secular worldviews, and one in which the agents were split with a medium level of affiliation but generally more secular worldviews.

Fixed effects
In the high and low affiliation societies, localized pluralism -the diversity of worldviews within family and neighborhood networks -was the best predictor of religious affiliation, though the relationship between pluralism and religious affiliation was inverted between the two societies. In the predominantly religious society, greater homogeneity in the agent's social network (i.e., more religious people in local neighborhoods) reduced the odds of the agent disaffiliating from religion. However, in the secular society, greater homogeneity in the agent's social network (i.e., more secular people in local neighborhoods) increased the odds of the agent disaffiliating from religion. In the society with moderate pre-existing religious affiliation, homogeneity of worldviews had a minimal effect, suggesting that worldview diversity moderates CREDs in diverse societies and ultimately results in more neutral, secular worldviews.
In the predominantly religious society, homogeneity in the social network resulted in CREDs with a higher intensity. Research on CREDs suggests that consistent and intense CREDs can reinforce people's religious beliefs. If an agent is enmeshed in a social network in which people consistently engage in actions and behaviors that illustrate their devotion to religious ideas, those actions will reinforce the worldview of those around them, bolstering or maintaining religiosity. It is only when individuals with different or less orthodox worldviews enter into that network that CREDs become either inconsistent (transforming into CRUDs) or individuals are exposed to CREDs from people who have different worldviews (e.g., an Orthodox Jew observing a CRED from a devout Muslim) thus diminishing the potency of any given parochial CRED. Thus, heterogeneity in social networks undermines the efficacy of CREDs, reducing religiosity and increasing the odds that people will disaffiliate from religions.
According to our models, in predominantly secular societies, the same basic process is taking place. Higher levels of homogeneity in the social networks of agents in a predominantly secular society resulted in greater odds of agents leaving religions because a secular worldview was being reinforced. Thus, our study suggests that secular CREDs are just as effective at reinforcing secular worldviews as religious CREDs are at reinforcing religious worldviews. Just as the worldview of religious individuals is reinforced when their social network is basically an isolated enclave of people who believe as they do (Phillips 1998), the worldview of secular individuals will likewise be reinforced if they live in an enclave of secular individuals.
In the mixed society with a medium level of affiliation, the homogeneity score had minimal influence on religious affiliation once controlling for simulation year. As our theoretical framework suggested, in diverse social networks, the intensity of CREDs and CRUDs will be muted as the general tendency for individuals in diverse environments will be toward moderating one's worldviews to minimize offense. As a result, CREDs and CRUDs will be less influential on others' worldviews. Even so, moderated worldviews lead to the same outcome as secular CREDsthey lead people to become more secular as secular (i.e., non-committal) worldviews hold the potential of being generally less offensive than sectarian worldviews, which condemn members of one's outgroup. The end result of worldview diversity is the same as extensive secular CREDs -religious disaffiliation.
Our findings align with our theoretical argument concerning the role of social networks on religious affiliation. Model B in Figure 1 illustrates an individual enmeshed in a social network where all the other individuals hold uniform but different (from ego) worldviews (whether religious or secular); that individual will be more likely to conform to the worldview of ego's social network. This is exactly what we found in the highly religious and highly secular societies. The agents in our simulations were likely to conform, just as real humans do (Asch 1955). While our third society, one in which the worldviews and affiliations were more mixed, is not a perfect analogue of Model D in Figure 1, the end result was the same. In more diverse societies, CREDs and CRUDs are muted and have minimal influence on religious affiliation. Other factors become more important.
An important implication of our findings is that the process of societal secularization has two phases. In phase one, it is the rare individual who bucks social pressure and rejects religion (Altemeyer & Hunsberger 1997;Kanazawa 2010). We hypothesize such individuals are biologically predisposed to skepticism and analytical thinking, leading them to find religious ideas and claims unbelievable. In phase two, becoming secular is much less difficult as there is significant pressure from one's social network to conform to prevailing secular norms. Additionally, in a highly diverse environment, worldviews are generally moderated in order to minimize the possibility of giving offense. The important implication here is that becoming secular is like other technological innovations and follows the same ' diffusion of innovation' patterns as a result (Rogers 2006): early adopters are eventually followed by masses of people who tend to conform to social trends.
More generally, but no less importantly, our study illustrates the utility of computer simulations in testing social scientific theory. Current data on changes in religious (dis) affiliation and worldview over time combined with social network data do not currently exist. Gathering such data would be extremely expensive and time-consuming. It would also require some serendipity, as researchers would have to presciently choose which societies are going to secularize over time, overcome social-network measurement difficulties, and track all this information over an extended period of time. Computer simulations allow us to examine these ideas despite the lack of data required to test them using other methods. In short, simulated agents programmed to have realistic social and psychological characteristics can be used to test the assumptions of existing theory in ways that would be too expensive or time consuming to do in the real world at scale. This is a common situation in social science: we have clear-cut measures for some variables but not for others, but simply dropping the variables where measurement is challenging is theoretically unintelligible. Computer simulations can make optimal use of existing data by employing variables for which measures exist and, for variables where clear measures are lacking, introducing parameters that can be varied to calibrate the model against real-world datasets. In this way, the model remains theoretically robust, can be tested against existing data to an optimal degree, and can make predictions about elements of theory for which existing data do not yet exist.

Limitations
What our current simulation was unable to directly test was Model D in Figure 1. Model D suggests that being surrounded by a variety of worldviews will result in individuals developing subdued, socially accommodating worldviews. In our simulation, there were only two worldviews between which individuals could choose: secular or religious. Thus, a limitation of our simulation is that it assessed worldviews as secular or religious and left implicit -in the relationship between each individual and the local social network -the distinction between being intolerant or naively parochial and being subdued or socially accommodating. While the findings from our mixed affiliation society provide some support for Model D in that homogeneity was unrelated to affiliation, a better test of that model would include multiple worldviews interacting instead of just two. A direct test of Model D would provide additional evidence for whether individuals in heterogeneous worldview networks will exhibit reduced belief intensity, reduced dogmatism, and a greater willingness to tolerate to different points of view. This is an implication of our theoretical approach and it encourages researchers to consider that some secular worldviews might be more intense, dogmatic, and intolerant than other secular worldviews (just as the same has been said of religious worldviews). In order to determine whether a broad array of worldviews in one's social network will result in individuals adopting a non-dogmatic, socially accommodating worldview, we would need to extend our model to include worldviews that differ on these dimensions. Future research should test this idea.

Conclusion
Drawing upon simulated agents in three artificial societies -a predominantly religious one, a predominantly secular one, and one in between -allowed us to explore the variables that best predict religious affiliation. We found that localized network pluralism -in families and neighborhoods -was the best predictor of religious (dis)affiliation in the predominantly religious and secular societies. Our simulation experiments suggest that network homogeneity reduces the likelihood of people leaving religions in predominantly religious societies but increases the odds of people disaffiliating in predominantly secular societies. In the mixed affiliation society, after controlling for the year of the simulation, pluralism was generally not important. These findings indicate that understanding the role of social networks in religious (dis)affiliation is important.

Additional File
The additional file for this article can be found as follows: • Supplementary material. ODD+D protocol of the Credibility enhancing display (CRED) agent-based model. DOI: https://doi.org/10.5334/snr.129.s1