I'm looking for a suitable statistical test for my situation. The best way I can think of describe it is a Chi-Squared test for continuous data. Please tell me otherwise.

Here is a made up scenario: Say we spend a few days observing whales and sharks in the Atlantic and Indian oceans. Here are the counts in a contingency table:

|          |Atlantic |Indian |Total |
| whales   | 8       | 2     | 10   |
| sharks   | 1       | 5     | 6    |
| Total:   | 9       | 7     | 16   |

Here I use the Chi-squared test to determine if the number of whales/sharks are independent to ocean location.

Lets say now I consider another metric: average weight of the animals. Here again is the table:

|          |Atlantic |Indian |Avg.  |
| whales   | 6.9     | 7.2   | 7.1  |
| sharks   | 2.3     | 2.9   | 2.5  |
| Avg.:    | 4.3     | 5.4   | 4.9  |

Instead of totals, I now have averages for the total of the populations along the side and last row. Here is my question: is the average weight of an animal independent to the ocean? Which test do I use now?

Just as a side note, the population sizes of each category might be very uneven such as a ratio of 1:999.

Thank you for your help in advance.


The question you are asking could be answered by performing what is very often called a 2-way ANOVA (also called two factor analysis of variance in Zar's Biostatistical Analysis).

Side comment: What I find very interesting in the way you ask your question is that indeed there are striking similarities between a 2-way ANOVA and a $\chi^2$ test.

In order to use the method, we need more information that what is available in the "mean" table: in order to calculate the statistic of the test, we also need to be able to compute the variability within each cell, and the total variability.

  • $\begingroup$ I would be very greatful if you could show how I could apply the example to the test $\endgroup$ – joshlk Feb 29 '16 at 11:02
  • $\begingroup$ If I had the averages and variability pre-calculated, do you how could I perform the test using R or Python? $\endgroup$ – joshlk Mar 1 '16 at 11:10
  • $\begingroup$ Do you have all the values, then? $\endgroup$ – Vincent Guillemot Mar 1 '16 at 13:23
  • $\begingroup$ Yes. But it may be easier if I can just input the mean and variability (thanks for you help) $\endgroup$ – joshlk Mar 1 '16 at 13:54

On the first part at least, I think it's wrong to say you can use the Chi2 test "to determine if the NUMBER of whales/sharks are independent to ocean location". One can use the Chi2 test to determine "whether observations of a big animal is whale or shark are independent to ocean location". And for this hypothesis, you use the "count of whale/shark observations" to construct a contingency table.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.