The micro-macro transition is a core problem of sociological theory building. Micro-intentions and micro-behavior do not straightforwardly translate into corresponding phenomena on the macro level, due to potentially existing rival mechanisms and the dynamics and complexity of social interactions. This chapter proposes an integrated statistical approach to studying the micro-macro transition by combining a random coefficient multilevel approach with the Stochastic Actor- Oriented Model. This is elaborated for the substantively interesting and topical question whether the growing ethnic and religious diversity in our societies, along with the well-known tendency for homophily, necessarily lead to a decline in social cohesion. The German part of the CILS4EU data is used to tackle this empirically. We investigate how religious homophily plays out differently depending on the context defined by the composition of the classroom, and explore the potential of simulation methods to explain this macro-level phenomenon from micro-level network dynamics. The empirical puzzle as stated is answered by a model representing homophily in a straightforward way, taking account of the variability between classrooms and the uncertainty about the parameter values; but a closer analysis reveals a further puzzle, which we leave for future research.