RE:info on a do-while-loop
From: Adrian Dunne Adrian.Dunne@ucd.ie
Subject: RE:[NMusers]info on a do-while-loop
Date: Wed, June 2, 2004 5:23 am
Jaya,
I use DOWHILE loops to simulate binomial data - for example if I want
to simulate N Bernoulli trials each with probability of 'success' given by
P and count the number of 'successes' the code would contain (DV is
the simulated value);
DOWHILE(I.LE.N)
CALL RANDOM(2,R) ; stream 2 contains uniform pseudo random
numbers
IF(R.LE.P) DV=DV+1
I=I+1
ENDDO
Adrian.-------------------------------------------
Adrian Dunne
Department of Statistics
University College Dublin
Belfield
Dublin 4
Ireland
e-mail Adrian.Dunne@ucd.ie
Phone +353-1-7167151
FAX +353-1-7161186
http://www.ucd.ie/~statdept/