[Gretl-users] randgen question

Talha Yalta talhayalta at gmail.com
Tue Nov 17 14:44:13 EST 2009


Thanks ...
Talha



On Tue, Nov 17, 2009 at 6:51 PM, Allin Cottrell <cottrell at wfu.edu> wrote:
>
> 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?
>
> nulldata 250
> X = floor(randgen(u,0,11))
> series Y
> series tmp
> loop i=1..250
>  if X[i] = 0
>    Y[i] = 0
>  else
>    tmp = randgen(b,0.75,X[i])
>    Y[i] = tmp[1]
>  endif
> endloop
>
> Allin Cottrell
> _______________________________________________
> Gretl-users mailing list
> Gretl-users at lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>



-- 
“Remember not only to say the right thing in the right place, but far
more difficult still, to leave unsaid the wrong thing at the tempting
moment.” - Benjamin Franklin (1706-1790)
--



More information about the Gretl-users mailing list