I'm trying to find out whether there is a statistical method for comparing a distribution of sample proportions to a distribution of population proportions.
For example if I have only two groups, A and B in a sample, and the proportions of people in A and B in that sample compared to the proportions of people in A and B in the population, then I could perform a one-proportion z-test for either A or B and it would not make a difference, as the z score would be the same.
However, I am trying to find out if there is any way to do the same thing if I had multiple groups: A, B, C, D, and E. Is there a specific test for this that would make my life easy? Or would the best option be to look at only the sample category where the difference from the population proportion is the greatest and run a z test on that? Help would be much appreciated.
**EDIT: I am looking for a test that I could easily write in SQL, which I could do with a one-proportion Z-test
-
$\begingroup$ Many people would start by considering the chi squared goodness of fit test. $\endgroup$– whuber ♦Aug 7, 2017 at 23:04
1 Answer
The solution is a chi-square goodness of fit test. Thank you @whuber. I have found that I can easily use the chi-square GOF test in a SQL query, given that I will know the number of degrees of freedom and at which critical value to reject the null hypothesis.