# Chi-squared Test and Data Representation

I have a question with applying Chi-squared tests to a given set of data. Let's say that my data is numbers of different-colored MM's in a bag.

Suppose there are 6 red, 4 blue, 8 orange, 2 green, 10 purple, and 6 brown for a total of 36, while the expected value is 6 for each.

The chi-squared test for this data, after calculating $\sum\frac{(O-E)^2}{E}$, gives 6.67.

However, if I converted the discrete numbers into percentages/decimals such that the total is 1 (e.g. blue is 0.111 and expected is 0.167), the chi-squared value is different: 0.185.

I think this has to do with the fact that when the numbers are effectively scaled down, the numerator, which reflects the square of the differences between observed and expected, decreases more than the denominator, which is merely the single power of expected. But which way of performing the chi-squared test is correct?

• I'm sure this has been asked and answered a couple of times before, though I wasn't able to find one with a quick search. – Glen_b -Reinstate Monica Feb 21 '17 at 23:51

• Let $O = oN$ and $E = eN$, where $o$ nd $e$ are the observed and expected proportions respectively, and then substitute these into the formula in the question, and simplify. – Tim Feb 22 '17 at 3:45