# Which statistics test should I use?

Group High is a year in which there was a high temperature change and group Low is a year in which there was a low temperature change. The classes represent an the percentage of coverage for a species on a plate. E.g. class 0 = 0% growth, class 4 = 50-75% growth, class 6 = >75% growth. (I will not compare an amount of temperature change to an amount of growth)

I need to know if there is a significant difference between group High and group Low. Which statistical test can I use?

Both of my variables are categorical, right?

I use R studio and Excel.  New contributor
Noor is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
• A chi-square test. May 13 at 12:23
• Even so, the assumptions of a chi-squared test are violated with such a small dataset no? May 13 at 17:36
• Perhaps an exact test would be more appropriate than a $\chi^2$ test in this case. May 14 at 2:39

Comment:

A suggestion has been made to do a chi-squared test on your $$2 \times 6$$ table of counts to see if the distributions for High and Low are different. That is one reasonable possibility among several.

H = c(6, 4,14, 3, 3, 2)
L = c(0, 3,15,10, 6, 1)
TBL = rbind(H,L);  TBL

[,1] [,2] [,3] [,4] [,5] [,6]
H    6    4   14    3    3    2
L    0    3   15   10    6    1

chisq.test(TBL)

Pearson's Chi-squared test

data:  TBL
X-squared = 11.168, df = 5, p-value = 0.04815

Warning message:
In chisq.test(TBL) :
Chi-squared approximation may be incorrect


It has also been commented that the counts in some of the cells are too sparse for a reliable P-value. Hence the 'Warning'. (Some of the expected counts are less than 5.)

chisq.test(TBL)\$exp
[,1]     [,2]     [,3]     [,4]     [,5]     [,6]
H 2.865672 3.343284 13.85075 6.208955 4.298507 1.432836
L 3.134328 3.656716 15.14925 6.791045 4.701493 1.567164
Warning message:
In chisq.test(TBL) : Chi-squared approximation may be incorrect


You could try combining Classes 0 & 1 and Classes 4 & 5 to get a $$2 \times 4$$ table of counts and then do a chi-squared test on that table.

Alternatively, as implemented in R, it is possible to obtain a more useful P-value by simulation, which is marginally significant at the 5% level.

chisq.test(TBL, sim=T)

Pearson's Chi-squared test
with simulated p-value
(based on 2000 replicates)

data:  TBL
X-squared = 11.168, df = NA, p-value = 0.04698


Moreover, as you suggest, your six 'Classes' are ordinal. So, you might want to consider looking here. Also, you might look at the links in the margin of this page noted as 'Related'. Your strategy should be to select the one test that you think best matches the nature of your data and your objectives. (You should not try all possible tests and pick the one with the smallest P-value.)