Discrimination in the housing market may create large economic inefficiencies and unfair individual outcomes, but is very difficult to measure. To circumvent the problems with unobserved heterogeneity, most recent studies use the correspondence testing approach (i.e. sending fictitious inquiries to landlords). In this study, we generalize the existing methodology in order to facilitate a test of to what extent the measured degree of discrimination depends on applicant, landlord/apartment, and regional characteristics. To show how this more general methodology can be implemented, we investigate the effects of gender, ethnicity, age, and employment status in the Swedish rental market for apartments. Our results confirm the existence of widespread discrimination against some of the groups, but also show that the degree of discrimination varies substantially with landlord, apartment, and regional characteristics. This heterogeneity highlights the importance of using a broad approach when conducting correspondence studies. Our results also allow us to interpret the nature of discrimination and how it relates to segregation and geographical sorting. (C) 2013 Elsevier Inc. All rights reserved.