Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Simple Question - Use of rndbin


From   tiago.pereira@incor.usp.br
To   statalist@hsphsun2.harvard.edu
Subject   st: Simple Question - Use of rndbin
Date   Thu, 20 Sep 2007 18:32:29 -0300 (BRT)

Dear Statalisters,

I am writing a do file that uses -rndbin- to generate a second variable,
xb. As you all know -rndbin- runs as:

rndbin obs prob numb

However, the do file repeats that task X times and, in some cases, _n is
greater than obs. Hence, for examaple, the following error shows up:

obs must be between 32 and 582539
r(198);

Indeed, in one out of X runs of the loop, the local `observations' assumes
value of 19. The problem is that _n=32 in the dataset.

Thence,

rndbin 19 0.05 1

obs must be between 32 and 582539
r(198);

So, I would like to know if there is a way to solve this problem... say...
run -rndbin- in a way that the variable xb is not created.

Thank you again for your time and help.

Tiago






*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index