Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: text file as source for set seed # in uniform() fnc


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: text file as source for set seed # in uniform() fnc
Date   Mon, 11 Aug 2003 19:55:37 +0100

Wallace, John
> 
> I have a text file with 512 8-byte hexadecimal numbers 
> generated from
> radioactive decay (via Hotbits 
> http://www.fourmilab.ch/hotbits/) that I
> would like to use as seeds for the uniform() function.  I 
> see how to use the
> set seed argument, but I'd like to have the text file used 
> as the source of
> the set seed argument (ideally, incrementing through the 
> lines each time a
> new instance of uniform() is called for.  Is it possible to 
> load the file
> into an array of some sort then set a variable that loops 
> through the
> numbers and is used as the seed whenever uniform() is 
> invoked?  Can stata
> use hex numbers as seeds, or do I need to convert them into 
> decimal first?

I'd read them in once and store them as macros. Then 
call them up one by one within a loop. As for hexadecimal 
input, I doubt it, but you can always convert easily with 
-inten-. Possibly you'd need to read your radioactively 
decaying numbers as a string variable, and convert on 
the fly. 

Nick 
[email protected] 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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