1
$\begingroup$

I have data and I want to see if it is plausible that it comes from some uniform distribution. Is it uniformly distributed?

$\endgroup$
1
  • $\begingroup$ discrete uniform or continuous? Endpoints known or unknown? $\endgroup$
    – Glen_b
    Commented Jan 2, 2019 at 2:09

1 Answer 1

1
$\begingroup$

You can't tell that a population is uniform from a set of data, but sometimes you can see that it isn't.

I'll assume for the moment that you mean continuous uniform with known endpoints.

  1. The most common approach is to apply goodness of fit tests.

    A number of such tests exist; these include the Kolmogorov-Smirnov, Cramer-von Mises Anderson-Darling (but there are a host of other such tests).

    Which you might use depends on which alternatives are most important to you. The Anderson-Darling is often a good default choice; it's most sensitive near the ends of the interval which is usually where the alternatives most often of interest will tend to clearly show differences. However, at moderate sample sizes it can have very low power against some shorter-tailed alternatives.

    Depending on your circumstances (which you don't describe) some other test might be a better choice but absent any other information, that would be a reasonable default choice.

  2. While often used, whether a goodness of fit test suits your needs is unclear from your question. These tests are very frequently used in circumstances where they're not actually much use (such as testing distributional assumptions of some other procedure).

    It's important to consider why you're applying a test here and whether the actual problem this is supposed to solve might not be better solved in a different way. You say so little that at present it's hard to judge.

$\endgroup$
2
  • $\begingroup$ So i have generated 100 data points which fall into 104 different categories. I want to see if a discrete uniform distribution is plausible for the data. I tried a chi square goodness of fit test to see if the data followed a known discrete uniform distribution on 1 to 104 and failed to reject the null. As for the Kolomgorov-Smirnov test, is there a way to automatically calculate this for the number of categories I have (104 is a lot) $\endgroup$
    – Chris B
    Commented Jan 2, 2019 at 2:36
  • 1
    $\begingroup$ You didn't indicate your variable was categorical, an important piece of information (rendering most of my answer above wasted effort); are the categories numerical values or are they ordinal categories (e.g. high/medium/low) or nominal categories (white, red, blue, tangerine)? Also 100 data points for 104 categories is very low; you'll only be able to pick up pretty strong nonuniformity. $\endgroup$
    – Glen_b
    Commented Jan 2, 2019 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.