# chi square test of randomness

#### kurumi

##### New Member
hi

say i have a spatial distribution of frequency count for 9 categories like this

3, 4, 9
4, 1, 3
2, 6, 5

How do i test whether this distribution is random using chi sq? (no other information is given)

here's what I did. I define freq count, then the observed value is how many times in this distribution the freq count occurs. For example, freq count 9 occurs 1 time, so the observe value is 1.

Freq count 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
observed value 0, 1, 1, 2, 2, 1, 1, 0, 0, 1
Expected value ?

How do i find the expected value in this case? Is this the correct way to test?
In this case, the degree of freedom is 10-1 = 9 right?

#### BGM

##### TS Contributor
The "expected value" depends on the null hypothesis you want to test. If "the distribution is random" means that it is a discrete uniform distribution among those categories, then the expected counts will be like the total frequencies divided by the total number of categories.

#### kurumi

##### New Member
The "expected value" depends on the null hypothesis you want to test. If "the distribution is random" means that it is a discrete uniform distribution among those categories, then the expected counts will be like the total frequencies divided by the total number of categories.
i will try and see if i can get the answer.
thanks very much.

#### kurumi

##### New Member
The "expected value" depends on the null hypothesis you want to test. If "the distribution is random" means that it is a discrete uniform distribution among those categories, then the expected counts will be like the total frequencies divided by the total number of categories.
hi, is this correct? because I don't have freq count 0, 7 and 8, so should i leave them out of the table? so my no. of categories is 7 instead of 10
thanks

#### BGM

##### TS Contributor
Sorry what I mean "total frequencies" is just the sum of the observed frequencies, which is 9 in your problem.