What is the odd that a data set is distributed according to a Uniform 0,1? I have a data set consisting of values in between 0 and 1 and I would like to have a statistic that help me understand if the data is really uniformly (evenly) distributed.
I can't find anything so i'm actually using some custom tests - 
Given a dataset of n points, 
I'm calculating the 'expected distance' between 2 subsequent point (100/n) and I compute the square of the difference between the effective distance of two subsequent ordered point and the expected distance. it's calibrated using my own perception of what's uniformly distributed and what's not.
Anybody has something better?
 A: You can use a Pearson's chisquared test statistic to test the hypothesis:
$H_0: \text{Data is uniform }[a,b]\text{ vs } H_1: \text{Data is not uniform } [a,b]$
Under the null hypothesis, if we have $n$ data values in total, we will expect $\frac{n}{10}$ of them each to be in the intervals:
$(a,a+\frac{b-a}{10}), (a+\frac{b-a}{10},a+2\frac{b-a}{10}), ... , (a+9\frac{b-a}{10},b)$
Since the data is uniformly distributed. So for each class, the expected count of observations in that class is $\frac{n}{10}$. You can therefore calculate the Pearson's chisquared test statistic:
$\sum_{i=1}^{10} \frac{(O_i - E_i)^2}{E_i}$
Where $O_i$ is the observed number in interval $i$ and $E_i$ is the expected number (which for the above intervals would be $\frac{n}{10}$). If the null hypothesis is true, this will follow a chisquared distribution with 9 degrees of freedom. So if you get a test statistic which is greater than the critical value for such a distribution (16.9 for a 5% test) you conclude the data is not uniformly distributed.
This test assumes that the data is independent, the expected counts in each cell are not too small, and the data is from a simple random sample.
A: There are a few ways of testing data against a probability distribution:


*

*The Kolmogorov–Smirnov test

*Kuiper's test

*The Anderson–Darling test

*...and more


The idea with all of these is that, given $n$ samples, for any number $x$ you expect to see $F(x)n$ samples with value less than $x$, where $F$ is the cdf of the distribution you are testing against. (In your case, $F(x) = x$, where $0 \le x \le 1$.) So if you have a data set $(x_1, \ldots, x_n)$, let $$F_n(X) = \frac{1}{n} \#\{i : x_i \le x\}$$ be the number of samples not bigger than $x$ (divided by $n$); this is the "empirical distribution function." Each of these tests measure the difference between $F_n$ and $F$.
Each of the above tests looks at the difference $F_n(x) - F(x)$. The K-S test is the simplest to describe (but also probably the poorest choice, as it isn't as sensitive at the tails): just pick the largest one:
$$D_n = \sup_x |F_n(x) - F(x)|.$$
(It can be shown that this is just $\max\{D^+, D^-\},$
where
$$D^+ = \max_{1 \le i \le n} (\tfrac{i}{n} - F(x_i));\qquad D^- = \max_{1 \le i \le n} (F(x_i) - \tfrac{i-1}{n})$$
assuming the data is sorted in increasing order.) Kuiper's test instead looks at $D^+ + D^-$. The A-D test instead looks at a weighted average of $(F_n(x) - F(x))^2$.
You can try each of them and see how well they work for you. You don't need to pick any bin sizes for these :-)
