Rationale for the proposed test of association. (a) A graphical model describing population structure and its effects on a trait of interest. Population structure is captured by a common latent variable z among a set of loci xi (i =1,2, …, m), via the allele frequencies πi(z). When one locus has a causal effect on the trait, this induces spurious associations with other loci affected by population structure. At the same time, population structure may be correlated with lifestyle and environment as these are all possibly related to ancestry and geography. (b) Accounting for confounding due to latent population structure. Left panel: A test for association between the ith SNP xi and trait y without taking into account z will produce a spurious association due to the fact that both xi and y are confounded with z. Right panel: A test for association between xi|πi(z) and y will be an unbiased because conditioning on πi(z) breaks the relationship between z and xi.