Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: query on testing uniform distributions

From   Maarten Buis <>
Subject   Re: st: RE: query on testing uniform distributions
Date   Wed, 2 Nov 2011 08:35:20 +0100

On Tue, Nov 1, 2011 at 6:00 PM, Sergio Salis <> wrote:
> I understand that to check whether employment_start_dates follow a uniform distribution I can also use the ksmirnov test. It is not clear to me what the command -ksmirnov hazel=hazel- actually does (so I would appreciate if you could provide some further explanation on this).

To quote the helpfile of -ksmirnov-: "varname is the variable whose
distribution is being tested, and exp must evaluate to the
corresponding (theoretical) cumulative."

>However, if employment_start_dates was a continuous variable I would use
> -ksmirnov employment_start_date=14341+int((14705-14341+1)*runiform())

That sounds completely wrong to me: In this case your cumulative
density function contains a call to a random number generator.

> where 14705 is the first and 14341 the last day of the tax year of interest. Is this syntax line correct in case one deals with a continuous variable? If so, how can it be changed to deal with a discrete variable, which is my case?

You do so by deriving the cumulative density function for a discrete
uniform distribution and put that after the equal sign.

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index