Dear Statalisters,
I came across a weird behavior of the random number generator under version control. (The following I observed using Stata 17 on a Windows machine.)
Even though I specify the identical seed under the same versions, runiform() returns different values. Stata effectively ignores the seed. The same happens when I set the version statements the other way round:
The problem does not arise as long as all version statements either refer to a version before or after the introduction of the random-number generator in Stata 14:
Is there an explanation for this behavior?
I came across a weird behavior of the random number generator under version control. (The following I observed using Stata 17 on a Windows machine.)
Code:
. version 17 . version 13: set seed 27072023 . di runiform() .38472837 . version 13: set seed 27072023 . di runiform() .27057198
Code:
. version 13 . version 17: set seed 27072023 . di runiform() .39999195 . version 17: set seed 27072023 . di runiform() .08663614
Code:
. version 12 . version 13: set seed 27072023 . di runiform() .39999195 . version 13: set seed 27072023 . di runiform() .39999195
Code:
. version 16 . version 14: set seed 27072023 . di runiform() .25052039 . version 14: set seed 27072023 . di runiform() .25052039
Comment