I'm posting this for an Splus user who is not part of this
discussion group:
She writes:
"I am interested in generating a set of 100 random real numbers
between 0.005 and 0.035, where the probability of drawing a specific
value is
defined by the normal distribution. rnorm() will not let me define
the limits of
my dataset, yet my model parameter values cannot physically exceed
0.035 by
definition. Is anyone aware of how to specify range limits when
generating random
numbers with a non-uniform distribution? I have explored sample(),
runif(), rnorm(), and rmvnorm(), all of
which nicely generate random numbers. However, either they are not
real (as in the case of sample()), or I cannot figure out how to
define a range of values for the random sample."
She is using Splus 2000 under NT4.
I have had a look at the discussions about random number generation
in the archives but did not find anything suitable.
Can anyone tell us how to code this or provide a reference? I will
post a summary on behalf of my colleague.
Thank you,
Alastair Dempster
Wilfrid Laurier University
Waterloo, Canada
|