Instead, like almost all statistical tests, the G–test has an intermediate step it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. Unlike the exact test of goodness-of-fit, the G–test does not directly calculate the probability of obtaining the observed results or something more extreme. This is an intrinsic hypothesis, because you estimate p and q from the data after you collect the data, you can't predict p and q before the experiment. The best-known example of an intrinsic hypothesis is the Hardy-Weinberg proportions of population genetics: if the frequency of one allele in a population is p and the other allele is q, the null hypothesis is that expected frequencies of the three genotypes are p 2, 2 pq, and q 2. This is a null hypothesis where you calculate the expected proportions after the experiment is done, using some of the information from the data. In some situations, you have an intrinsic hypothesis. Another example would be looking at an area of shore that had 59% of the area covered in sand, 28% mud and 13% rocks if you were investigating where seagulls like to stand, your null hypothesis would be that 59% of the seagulls were standing on sand, 28% on mud and 13% on rocks. Examples include a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross. The null hypothesis is usually an extrinsic hypothesis, where you know the expected proportions before doing the experiment. The statistical null hypothesis is that the number of observations in each category is equal to that predicted by a biological theory, and the alternative hypothesis is that the observed numbers are different from the expected. Much of the information and examples on this page are the same as on the chi-square test page, so once you've decided which test is better for you, you only need to read one. G–test" near the bottom of this page, pick either chi-square or G–test, then stick with that choice for the rest of your life. You should read the section on "Chi-square vs. The G–test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar. See the web page on small sample sizes for discussion of what "small" means. If the expected number of observations in any category is too small, the G–test may give inaccurate results, and you should use an exact test instead. You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross). Use the G–test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You use the G–test of goodness-of-fit (also known as the likelihood ratio test, the log-likelihood ratio test, or the G 2 test) when you have one nominal variable, you want to see whether the number of observations in each category fits a theoretical expectation, and the sample size is large.