# Chi-squared on goose counts

I counted geese in two different areas - east and west. Geese were either dark-bellied or light-bellied. I want to know if the proportions of geese differ in the two different areas. So I did the chi-squared test below, which indicates the different proportions in the two areas is not due to chance.

I just want to know if I have violated any assumptions of the chi-squared test?

library(dplyr)
library(tidyr)

c("Dark-bellied", "Dark-bellied", "Light-bellied", "Light-bellied") -> race

c("west", "east", "west", "east") -> location

c(2L, 38L, 196L, 2L) -> count

data.frame(race, location, count) -> brent

brent %>%
pivot_wider(names_from = location, values_from = count) %>%
dplyr::select(-race) %>%
chisq.test ->
brent_chi


These are the results of the test:

    Pearson's Chi-squared test with Yates' continuity correction

data:  .
X-squared = 204, df = 1, p-value <0.0000000000000002

• Given that you have 2/(196+2) dark-bellied in the west, and 38/(38+2) in the east, you hardly need a test here, but of course there are multiple reasons why you might have to do it anyway. However, whether or not you have violated the assumptions is critically dependent on how the counts were conducted, not just on the numbers themselves. Commented Dec 23, 2022 at 19:44

### Assumptions of Chi Square Test

Here is a useful article that discusses the assumptions of the chi square test. They have a section explicitly outlining what these assumptions are:

1. The data in the cells should be frequencies, or counts of cases rather than percentages or some other transformation of the data.

As far as I know, you are using counts, so that's not an issue.

1. The levels (or categories) of the variables are mutually exclusive. That is, a particular subject fits into one and only one level of each of the variables.

You clearly have distinct groups. However, your geese populations in the East and West may not be so clear, so you may want to assure that these groups are totally independent.

1. Each subject may contribute data to one and only one cell in the χ2. If, for example, the same subjects are tested over time such that the comparisons are of the same subjects at Time 1, Time 2, Time 3, etc., then χ2 may not be used.

Your design doesn't seem to have repeated measures of the geese, but you may want to also ensure you did not capture the same geese and measure them multiple times.

1. The study groups must be independent. This means that a different test must be used if the two groups are related. For example, a different test must be used if the researcher’s data consists of paired samples, such as in studies in which a parent is paired with his or her child.

I don't see this as an issue unless your geese have mates, etc. that are also sampled in some way.

1. There are 2 variables, and both are measured as categories, usually at the nominal level. However, data may be ordinal data. Interval or ratio data that have been collapsed into ordinal categories may also be used. While Chi-square has no rule about limiting the number of cells (by limiting the number of categories for each variable), a very large number of cells (over 20) can make it difficult to meet assumption #6 below, and to interpret the meaning of the results.

No issue here.

1. The value of the cell expecteds should be 5 or more in at least 80% of the cells, and no cell should have an expected of less than one (3). This assumption is most likely to be met if the sample size equals at least the number of cells multiplied by 5. Essentially, this assumption specifies the number of cases (sample size) needed to use the χ2 for any number of cells in that χ2. This requirement will be fully explained in the example of the calculation of the statistic in the case study example.

The calculation of expected values follows the following formula:

$$E = \frac{M_R\times M_C}{n}$$

Your expected values are accordingly 33.28, 6.72, 164.72, 33.28, so this is no issue.

### Summary

You do not appear to have failed to meet any of the assumptions, however, I would advise at least ensuring some of the gray areas I mentioned are covered and not an issue.