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

st: AW: Generating random numbers

From   "Martin Weiss" <>
To   <>
Subject   st: AW: Generating random numbers
Date   Wed, 25 Nov 2009 16:07:10 +0100


Your "seed generating process" for "sd" also uses -uniform()-, i.e. your
first line is itself dependent on a -seed-. 

Some Statalisters also use the current date, such as in -set seed
`=date("`c(current_date)'", "DMY")'- to -set seed-...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Barth Riley
Gesendet: Mittwoch, 25. November 2009 15:35
Betreff: st: Generating random numbers


I have written a program in Stata to create several datasets containing
simulated item response values, which are based on randomly generated item
response theory parameters. I am finding that the randomly generated
parameters for each dataset are following a predictable pattern (one set of
parameter values for odd-numbered datasets; another set of values for
even-numbered datasets). I have been using the set seed command to try to
avoid this repetitive pattern, for example:

local sd = `j' * int(uniform() * 1000)
set seed `sd'
local b = invnormal(uniform())

Where `j' is a forvalues counter variable. Is there a better way to do this?



*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index