[Gretl-users] randgen question
cottrell at wfu.edu
Tue Nov 17 11:51:40 EST 2009
On Tue, 17 Nov 2009, Talha Yalta wrote:
> On Tue, Nov 17, 2009 at 4:12 PM, Allin Cottrell <cottrell at wfu.edu> wrote:
> > On Tue, 17 Nov 2009, Talha Yalta wrote:
> >> I am trying to perpare a ML tutorial where there are T balls
> >> in a bag with a ratio of P=0.75 black balls and there will be
> >> 250 independent trials where 0<X<10 randomly chosen balls
> >> from the bag will show Y blacks.
> >> I create a new data set with 250 observations and create X
> >> with genr X = floor(randgen(u,0,11)
> >> After this, however, the command genr Y = randgen(b,0.75,X)
> >> does not work. Any suggestions?
> > Giving a series for the third argument is not supported.
> I see but is it possible to do what I am trying to do in gretl?
X = floor(randgen(u,0,11))
if X[i] = 0
Y[i] = 0
tmp = randgen(b,0.75,X[i])
Y[i] = tmp
More information about the Gretl-users