I am working on a few algorithms where I have a list of $N$ samples. Currently I have plotted these into a histogram and have a view of how uniform the values are distributed within an interval, which is quite good as a visualization, although I need a comparable value of how uniform the dataset is, in order to measure how robust it is compared to my other algorithms.
I have been looking at chi-squared test, but could not figure out how it would become helpful in my usecase?
Sample from dataset:
8725
462
1492
972
9941
8235
8220
6949
1252
Code for importing data and applying chi-squared in R
:
mydata = read.csv2("/opt/doc/stat/uniform_test_1.csv")
x <- sapply(mydata, as.numeric)
chisq.test(x)
Result: X-squared = 1664769844, df = 999998, p-value < 2.2e-16
R
. Ben Allison recommends a chi-squared test and helpfully describes how to conduct it by dividing the range of data "into equally sized non-overlapping patches." Many sources, including Wikipedia, describe this test and provide formulas. Open source software such asR
will do the calculations automatically. $\endgroup$ – whuber♦ Jan 8 '13 at 18:44chisq.test
to my dataset and get following resultX-squared = 1664769844, df = 999998, p-value < 2.2e-16
. What does thedf
represent? I will look intoKS-test
. $\endgroup$ – JavaCake Jan 8 '13 at 18:51df
is the D egrees of F reedom mentioned in all the references. $\endgroup$ – whuber♦ Jan 8 '13 at 18:52