# Background (null) distribution for higher observed frequency of an allele [closed]

I am testing the hypothesis that being heterozygote at a certain gene locus, say X, increases the chances of having the good allele of X compared to being homozygote. I have data of more than 6000 individuals with their zygosity for gene X. What could be the background distribution of allele frequency for testing the hypothesis if the observed frequency of good allele is more in heterozygotes compared to one expected by chance. Thank you so much.

• I'm voting to close this question as off-topic because it is not about biology but about statistics (see Cross Validated(stats.stackexchange.com/)). (Note: see comments under my answer for clarification about the nature of the question). Commented Jul 2, 2017 at 21:43

I don't really understand your hypothesis you want to test. Here are two things that may help you.

Test if allele frequency is the one expected from the genetic and demographic properties

The expected allele frequency is not that easy to calculate as you need much information. You need to know the mutation rate, the population size, the migration rate, assume random mating and most importantly know the selection coefficient associated with this allele. Once you've got all that, you'll find the equation in the old paper Wright 1937.

How to test?

Maximum likelihood ratio test is probably the way to go.

Test if heterozygosity is the one expected from the allele frequency

Now if you want to test if heterozygosity is not the one expected, it is much easier. The expected genotype frequencies are given by Hardy-Weinberg rule (see here for explanation on Hardy-Weinberg's rule and see here for the assumptions of this rule).

In short, for a bi-allelic loci with allele frequencies $p$ and $1-p$ the three genotype frequencies are $p^2$, $2p(1-p)$ and $(1-p)^2$, where $2p(1-p)$ is the frequency of heterozygote.

How to test?

You can simply do a chi-square test or a binomial test.

I ask if being heterozygote increases the odds of carrying a certain allele compared to being homozygote. So can I just compare the allele frequency in two populations (hetero- and homozygotes) using fisher exact t

Oh ok. If I understand you correctly, you have two loci. One for which heterozygosity is the variable of interest, while for the other locus, the variable of interest is the presence / absence of a certain allele is that right?

Sounds like your question is a pure question of statistics, not biology. Stats.SE is the place to go to but I will still try to address your question now that I started.

You can do a simple chi-square test you have the following 2 by 2 chi square table with the count of individuals in each cell

$$\begin{array}{c|c|c|} & \text{Homozygote} & \text{Heterozygote} \\ \hline \text{Allele 1} & w & x \\ \hline \text{Allele 2} & y & z \\ \hline \end{array}$$

Now, that works well if you consider only a single, randomly picked allele per individual but that would reduce your sample size. If you pick both haplotype per individual, then I am not sure of whether you might suffer from pseudo-replication. In such case, you could do a logistic regression with a nominal random effect that is the individual ID. They will be better than me at giving you such advice on stats.SE though.

• Dear Remi, thank you for the insights. I think my hypothesis is relatively simple but i could not phrase it well at first place. I ask if being heterozygote increases the odds of carrying a certain allele compared to being homozygote. So can I just compare the allele frequency in two populations (hetero- and homozygotes) using fisher exact test? Commented Jul 2, 2017 at 20:25