# R: Same dataset, different units and then, chi-square test no longer works

I am a beginner in R and statistics.

I conducted Chi-square test to see if there is a significant difference/relationship between two distributions.

Then, I changed my units to percentage over total counts instead of absolute counts. So previously, my counts were in their thousands, but now, percentage counts are in decimal places(like 0.2%) and 30% at max.

Is it normal for chi-square to not work? (I am aware that in order to use chi-square test, frequency should be over 5)

So instead of Chi-square test, I tried to use Fisher's exact test, but now they give me p-values that are insignificant.

Do you suggest there's an error in my codes or can this happen? Do you suggest other statistical tests?

Thank you.

• Hi: You can't change to percentage over total counts or even just percentages because the test relies on the data being actual counts. By changing to percentages, your essentially changing the data itself. Mar 7 '20 at 14:21
• @molfton Thanks for your reply. If I change my data into percentages, is there any other statistical test I could do to see relationships in two distributions? Mar 7 '20 at 15:41
• I think you need to explain in detail the test that you're trying to do. there might be some different test that you can use that does involve proportions which are really percentages. Mar 8 '20 at 17:42

First, if you change your data to percentages, you can not use Chi-square or Fisher's test. Why did you change the units?

Second, what do you mean by "not work"?

Third, if your counts are in the thousands, almost any difference is going to be statistically significant, but it may be meaninglessly small in practical terms.

Most importantly, what are you trying to show? What are your variables? What are your research questions?

• Hi, thank you for your reply. My research question is to show if there's a difference in the pattern of 3' end templated modifications in isomiRs. (I am working with normalised isomiR counts and my x-axis was number of base modifications e.g +1, +2, +3) Mar 7 '20 at 15:33
• 1. I changed units to reflect how much % each miRs with specific modifications (e.g. +1) out of all miRs and also, to make my graph look neater. Mar 7 '20 at 15:36
• 2. I meant 'not work' by codes giving errors that the test results might not be accurate. Also, I tried fishers' test, but it also gave me p-values of 1. Although when I visualise results by graphs, there is a clear difference between two distributions...Also, when I tried chi-square test with actual counts, it gave me p-values with great significance. Mar 7 '20 at 15:38
• 3. Do you mean if count results are too high, its meaningless to use chi-square tests? (Sorry if all my questions are so basic. I just started using R and statistical tests:'() Mar 7 '20 at 15:39
• First: You probably have to define "differences in pattern" more precisely to figure out what to do. Second: Yes, with percentage values, chi-square i the wrong test. Third, it's not meaningless to use chi-square with large counts, but (as usual) you have to look at effect sizes, not just p values. Mar 8 '20 at 12:00