We model the evolution of the distribution of genotype in European populations’ recent past (within 14 thousand years before present). The evolution is driven by selection operating after a shift in the productivity of agriculture, induced by a well documented climate change, in a standard Roy model in which individuals self-select into one of two sectors (agriculture or hunter-gathering). We test the model in two data sets, one of ancient and one of modern DNA data-sets, matching the observed distributions of genetic variables of interest (allele frequencies and lineages). The model extends a standard Wright-Fisher model. We estimate the model and find support for the hypothesis that a major shift in distribution of allele frequencies (in a direction favoring higher cognitive skills) occurred after the climate warming at the end of the Younger Dryas (11,600 years BPE) made agriculture more productive than hunter-gathering. The general implication we draw is that historical transformations (in our case climate change and technological change) can affect the distribution of genotype and thus institutions, rather than the other way round.