Dear listers:
I am generating a random number with the goal of (randomly) assigning
children who report multiple races to a single race category for
purposes of analysis. I'd like to evenly distribute children across
single race categories. However, when I use uniform() to generate a
random number, I don't get an even split:
...
I am puzzled. I would expect median = mean = 0.5 for a uniform number
defined over [0,1). This must be a simple, basic question, but neither
changing the - set seed -, changing the interval to [0,1], or changing
the observations selected seems to solve this problem. A search of
on-line help, the list archives and the Stata FAQs didn't give me much
insight either.
Actually, it is very unlikely that a random variable will produce exactly a
50/50 split. If you repeated this process several times, you would find
that sometimes the first group was bigger, sometimes the 2nd group was
bigger. By chance alone, sometimes the mean and median will be greater
than .5, sometimes they will be less.