In addition, the sample size varies for different SNPs due to imputation failures for different SNPs in different participating studies. Therefore, n is no longer constant across different SNPs, and we need to rescale the elements of B and D according to the different effective sample sizes of different SNPs. For any SNP j, (13)n^j=y′y∕DjSj2−β^j2∕Sj2+1 where we take the variance explained by a single SNP into account, considering that the effect sizes of some particular SNPs are large for some traits. We use the estimated effective sample size rather than the reported sample size, because the effective sample size will be smaller than the reported sample size if there is some degree of relatedness in the data. We then adjust the jkth element of B for the sample size variability of the SNPs as (14)Bjk=min(n^j,n^k)2pj(1−pj)pk(1−pk)∑imwij2∑imwik2∑imwijwik and adjust the jth diagonal element of D as Dj = 2pj(1 – pj)n̂j.