Dear all,
I'm using a data set with 5,000,000 observations and I'd like to generate a normally distributed random variable random which has (approximately) unique values: 2,000,000.
So far, I've managed to generate a uniformly distributed variable random with unique values: 1,835,364 by:
Unfortunately, I can't seem to figure out how to obtain a normally distributed random that has the same number of unique values. Does anyone know a way to code this?
Best
Christian
I'm using a data set with 5,000,000 observations and I'd like to generate a normally distributed random variable random which has (approximately) unique values: 2,000,000.
So far, I've managed to generate a uniformly distributed variable random with unique values: 1,835,364 by:
Code:
clear set seed 2052018 set obs 5000000 gen double u = ((1999999)*runiform() + 1) * ((2^32-1)/2^32) gen random = round(u)
Best
Christian
Comment