[R] random normally distributed values within range
Rolf Turner
r.turner at auckland.ac.nz
Tue Oct 7 02:07:34 CEST 2008
On 7/10/2008, at 11:54 AM, Achaz von Hardenberg wrote:
> Hi all,
> I need to create 100 normally distributed random values (X) which can
> not exceed a specific range (i.e. 0<X<Y).
> With rnorm I cannot specify Max and min values among which values
> have to stay, like in runif so does some other simple way exist to do
> this with normally distributed random values?
Presumably you want a truncated normal distribution. Duncan Murdoch
posted some neat code on this list, back in the end of July this year,
to generate samples from such a distribution.
See:
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/137154.html
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
More information about the R-help
mailing list