Population structure occurs when allelic distributions are reflected in the geographic distribution of the population.
The problem of population structure
It is expected that the traits of closely related genotypes will be more similar than more distantly related genotypes. However, the polymorphipsms responsible for the variation in a trait are not necessarily restricted to a highly related subpopulation. In order to remove polymorphisms that describe the population structure more than the investigated trait, it is necessary to control for population structure. Failure to control population structure will result in a high number of false positives (ie. the polymorphisms that describe not only the investigated trait but also the population structure).
Controlling for population structure
Population structure can be controlled for by including the relatedness of each genotype to each other and carefully defined subpopulations in the model. To calculate the relatedness of each genotype to a subpopulation, a Q matrix or P matrix can be used. To calculate the relatedness of each genotype to each other, a K matrix can be used.